Automatic date update in version.in
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
5417c94d
CC
12015-07-21 Cary Coutant <ccoutant@gmail.com>
2
3 PR gold/18548
4 * symtab.cc (Symbol_table::do_define_in_output_data): Check for
5 forced local symbol even when oldsym != NULL.
6 (Symbol_table::do_define_in_output_segment): Likewise.
7 (Symbol_table::do_define_as_constant): Likewise.
8
cb5cf5e2
CC
92015-07-21 Cary Coutant <ccoutant@gmail.com>
10
b8c6c5ef 11 PR gold/18698
cb5cf5e2
CC
12 * archive.cc (Library_base::should_include_member): Don't use entry
13 point for relocatable links, or if target is not yet valid.
14 * parameters.cc (Parameters::entry): Check target_valid().
15
0ef3814f
HS
162015-07-20 Han Shen <shenhan@google.com>
17
18 Optimize erratum 843419 fix.
19
20 * aarch64.cc (AArch64_insn_utilities::is_adr): New method.
21 (AArch64_insn_utilities::aarch64_adr_encode_imm): New method.
22 (AArch64_insn_utilities::aarch64_adrp_decode_imm): New method.
23 (E843419_stub): New sub-class of Erratum_stub.
24 (AArch64_relobj::try_fix_erratum_843419_optimized): New method.
25 (AArch64_relobj::section_needs_reloc_stub_scanning): Try optimized fix.
26 (AArch64_relobj::create_erratum_stub): Add 1 argument.
27 (Target_aarch64::scan_erratum_843419_span): Pass in adrp insn offset.
28
2bca0377
HS
292015-07-20 Han Shen <shenhan@google.com>
30
31 Fix arm elf header flags wrt hardfp bit.
32
33 * arm.cc (Target_arm::do_adjust_elf_header): Set flags into view.
34
f54f5e31
L
352015-07-20 H.J. Lu <hongjiu.lu@intel.com>
36
37 PR gold/18689
38 * layout.cc (Layout::layout): Clear the SHF_COMPRESSED flag bit
39 from input group section for relocatable link.
40 * testsuite/Makefile.am (check_SCRIPTS): Add pr18689.sh.
41 (check_DATA): Add pr18689.stdout.
42 (MOSTLYCLEANFILES): Add pr18689a.o pr18689b.o.
43 (pr18689.stdout): New rule.
44 (pr18689a.o): Likewise.
45 (pr18689b.o): Likewise.
46 (pr18689.o): Likewise.
47 * testsuite/pr18689.c: New file.
48 * testsuite/pr18689.sh: Likewise.
49 * testsuite/Makefile.in: Regenerated.
50
c20ceeb2
YW
512015-07-20 Yiran Wang <yiran@google.com>
52 Cary Coutant <ccoutant@gmail.com>
53
54 PR gold/15574
55 * resolve.cc (Symbol_table): Remove warning about references
56 from shared objects to hidden symbols.
57 * testsuite/Makefile.am (hidden_test): Add hidden_test.syms.
58 * testsuite/Makefile.in: Regenerate.
59 * testsuite/hidden_test.sh: Check dynamic symbol table; update
60 expected error messages.
61
19a7fe52
L
622015-07-14 H.J. Lu <hongjiu.lu@intel.com>
63
64 * compressed_output.cc (Output_compressed_section::set_final_data_size):
65 Make --compress-debug-sections=zlib the same as
66 --compress-debug-sections=zlib-gabi.
67 * testsuite/Makefile.am (flagstest_compress_debug_sections.check):
68 Expect ".debug_.*" with the SHF_COMPRESSED bit, instead of
69 ".zdebug_".
70 * testsuite/Makefile.in: Regenerated.
71
fb8b9dbc
L
722015-07-12 H.J. Lu <hongjiu.lu@intel.com>
73
74 PR gold/18322
75 * compressed_output.cc (zlib_compress): Add argument for
76 compression header size. Set header size to compression header
77 size if it isn't 0. Don't write out the zlib header here.
78 (Output_compressed_section::set_final_data_size): Support
79 zlib-gnu and zlib-gabi compressions. Pass compression header
80 size to zlib_compress and write out compression header. Set
81 the SHF_COMPRESSED bit for zlib-gabi compression. Otherwise
82 clear the SHF_COMPRESSED bit
83 * options.h (compress_debug_sections): Add zlib-gnu and
84 zlib-gabi.
85 * output.h (Output_section::set_flags): New.
86 * testsuite/Makefile.am (check_PROGRAMS): Add
87 flagstest_compress_debug_sections_none,
88 flagstest_compress_debug_sections_gnu and
89 flagstest_compress_debug_sections_gabi.
90 (check_DATA): Add flagstest_compress_debug_sections_none.stdout.
91 flagstest_compress_debug_sections.stdout,
92 flagstest_compress_debug_sections.cmp,
93 flagstest_compress_debug_sections.check,
94 flagstest_compress_debug_sections_gnu.stdout,
95 flagstest_compress_debug_sections_gnu.cmp,
96 flagstest_compress_debug_sections_gnu.check,
97 flagstest_compress_debug_sections_gabi.stdout,
98 flagstest_compress_debug_sections_gabi.cmp and
99 flagstest_compress_debug_sections_gabi.check.
100 (flagstest_compress_debug_sections_none): New.
101 (flagstest_compress_debug_sections_none.stdout): Likewise.
102 (flagstest_compress_debug_sections.stdout): Likewise.
103 (flagstest_compress_debug_sections.check): Likewise.
104 (flagstest_compress_debug_sections.cmp): Likewise.
105 (flagstest_compress_debug_sections_gnu): Likewise.
106 (flagstest_compress_debug_sections_gnu.stdout): Likewise.
107 (flagstest_compress_debug_sections_gnu.check): Likewise.
108 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
109 (flagstest_compress_debug_sections_gabi): Likewise.
110 (flagstest_compress_debug_sections_gabi.stdout): Likewise.
111 (flagstest_compress_debug_sections_gnu.check): Likewise.
112 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
113 * testsuite/Makefile.in: Regenerated.
114
48058663
L
1152015-07-12 H.J. Lu <hongjiu.lu@intel.com>
116
117 PR gold/18321
118 * compressed_output.h (decompress_input_section): Add arguments
119 for ELF class, big endian and sh_flags.
120 * compressed_output.cc (decompress_input_section): Likewise.
121 Support the SHF_COMPRESSED section.
122 * dynobj.h (Dynobj): Add elfsize and is_big_endian member
123 functions.
124 * plugin.h (Pluginobj): Likewise.
125 * layout.cc (Layout::get_output_section_flags): Also clear the
126 SHF_COMPRESSED bit.
127 * object.h (Compressed_section_info): Add flag to store sh_flags.
128 (Object): Add pure virtual elfsize and is_big_endian member
129 functions.
130 * object.cc (need_decompressed_section): Don't skip the ".zdebug"
131 prefix here.
132 (build_compressed_section_map): Check SHF_COMPRESSED for
133 uncompressed size. Store sh_flags in Compressed_section_info.
134 Pass size, big_endian and sh_flags to decompress_input_section.
135 Skip the ".debug"/".zdebug" prefix when passing section name to
136 need_decompressed_section.
137 (Sized_relobj_file<size, big_endian>::do_find_special_section):
138 Don't check ".zdebug_*" sections.
139 (Object::decompressed_section_contents): Pass ELF class, big
140 endian and sh_flags to decompress_input_section.
141 * reloc.cc (Sized_relobj_file<size, big_endian>::write_sections):
142 Likewise.
143 * testsuite/Makefile.am (check_DATA): Add
144 debug_msg_cdebug_gabi.err and gdb_index_test_2_gabi.stdout.
145 (MOSTLYCLEANFILES): Add debug_msg_cdebug_gabi.err and
146 gdb_index_test_2_gabi.stdout.
147 (debug_msg_cdebug_gabi.o): New.
148 (odr_violation1_cdebug_gabi.o): Likewise.
149 (odr_violation2_cdebug_gabi.o): Likewise.
150 (debug_msg_cdebug_gabi.err): Likewise.
151 (check_SCRIPTS): Add gdb_index_test_2_gabi.sh.
152 (gdb_index_test_cdebug_gabi.o): Likewise.
153 (gdb_index_test_2_gabi): Likewise.
154 (gdb_index_test_2_gabi.stdout): Likewise.
155 * testsuite/gdb_index_test_2_gabi.sh: New file.
156 * testsuite/Makefile.in: Regenerated.
157
73854cdd
HS
1582015-07-09 Han Shen <shenhan@google.com>
159
160 Use "gold_info" instead of "gold_warning" for erratum fix.
161
162 * aarch64.cc (Target_aarch64::scan_erratum_843419_span): Use
163 'gold_info'.
164 (Target_aarch64::scan_erratum_835769_span): USe 'gold_info'.
165
61163dfa
HS
1662015-07-09 Han Shen <shenhan@google.com>
167
168 Drop missing symbol warning for arm/aarch64.
169
170 * aarch64.cc (AArch64_relobj::scan_errata): Drop missing symbol warning.
171 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Drop missing
172 symbol warning.
173
b91deca9
HS
1742015-07-07 Han Shen <shenhan@google.com>
175
176 Make gold aarch64 accept long form of mapping symbols.
177
178 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Make legal
179 of mapping symbols.
180
15162bef
DK
1812015-06-29 Doug Kwan <dougkwan@google.com>
182
183 * testsuite/arm_bl_out_of_range.s: Align stub table so that it appears
184 at address expected by test.
185 * testsuite/arm_cortex_a8_b.s: Ditto.
186 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
187 * testsuite/arm_cortex_a8_bl.s: Ditto.
188 * testsuite/arm_cortex_a8_blx.s: Ditto.
189 * testsuite/arm_cortex_a8_local.s: Ditto.
190 * testsuite/arm_fix_v4bx.s: Ditto.
191 * testsuite/arm_unaligned_reloc.s: Ditto.
192 * testsuite/thumb_bl_out_of_range.s: Ditto.
193 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
194 * testsuite/thumb_blx_out_of_range.s: Ditto.
b91deca9 195
56b06706
HS
1962015-06-29 Han Shen <shenhan@google.com>
197
198 Patch for erratum 843419 internal error.
199
b91deca9 200 * aarch64.cc (Erratum_stub::Insn_utilities): New typedef.
56b06706
HS
201 (Erratum_stub::update_erratum_insn): New method.
202 (Stub_table::relocate_stubs): Modified to place relocated insn.
203 (AArch64_relobj::fix_errata): Modified gold_assert.
204
2f0c79aa
HS
2052015-06-12 Han Shen <shenhan@google.com>
206
207 Fix erratum 835769.
208
209 * aarch64.cc (AArch64_insn_utilities::BYTES_PER_INSN): Move
210 defintion outside class definition.
211 (AArch64_insn_utilities::AARCH64_ZR): New static constant.
212 (AArch64_insn_utilities::aarch64_op31): New member.
213 (AArch64_insn_utilities::aarch64_ra): New member.
214 (AArch64_insn_utilities::aarch64_mac): New member.
215 (AArch64_insn_utilities::aarch64_mlxl): New member.
216 (ST_E_835769): New global enum member.
217 (Stub_table::relocate_stubs): Add 835769 handler.
218 (Stub_template_repertoire::Stub_template_repertoire): Install new
219 stub type.
220 (AArch64_relobj::scan_errata): This func is renamed from
221 scan_erratum_843419.
222 (AArch64_relobj::do_count_local_symbols): Add 835769 handler.
223 (AArch64_relobj::do_relocate_sections): Add 835769 handler.
224 (AArch64_relobj::scan_sections_for_stubs): Add 835769 handler.
225 (Target_aarch64::scan_erratum_835769_span): New method.
226 (Target_aarch64::create_erratum_stub): New method.
227 (Target_aarch64::is_erratum_835769_sequence): New method.
228 (Target_aarch64::scan_erratum_843419_sequence): Move part of the
229 code into create_erratum_stub.
230 * options.h (fix_cortex_a53_835769): New option.
231
5d7908e0
CC
2322015-06-11 Cary Coutant <ccoutant@gmail.com>
233
234 * aarch64.cc (Erratum_stub::STUB_ADDR_ALIGN): Move initialization
235 outside class body.
236 (Reloc_stub::STUB_ADDR_ALIGN): Likewise.
237
dd68f8fa
CC
2382015-06-11 Cary Coutant <ccoutant@gmail.com>
239
240 PR gold/17731
241 * layout.cc (corresponding_uncompressed_section_name): New function.
242 (Layout::choose_output_section): Call it.
243 * layout.h (corresponding_uncompressed_section_name): New function.
244 * script-sections.cc (Input_section_info::set_section_name): Check
245 for compressed debug section (.zdebug style).
246
a3a0c391
JY
2472015-06-11 Jing Yu <jingyu@google.com>
248
249 * testsuite/Makefile.am: Add -O0 for script_test_12 test.
250 * testsuite/Makefile.in: Regenerate.
251
970cdef2
DI
2522015-06-11 Davide Italiano <dccitaliano@gmail.com>
253
254 * gold.h (is_cident): Correct typo.
255
a48d0c12
HS
2562015-06-10 Han Shen <shenhan@google.com>
257 Patch for erratum-843419 (2 of 2 - fix erratum occurrences).
258
259 Now fixing for 843419 is fully functional.
260
261 The first part of the erratum fix CL is here -
262 https://sourceware.org/ml/binutils/2015-04/msg00229.html
263
264 * aarch64.cc(global enum): New constants representing stub types.
265 (Stub_template): New POD struct.
266 (Stub_template_repertoire): New class.
267 (Stub_base): New class.
268 (Erratum_stub): New class.
269 (Reloc_stub): Refactored to be a subclass of Stub_base.
270 (Reloc_stub::Stub_type): Removed.
271 (Reloc_stub::offset): Moved to Stub_base.
272 (Reloc_stub::set_offset): Moved to Stub_base.
273 (Reloc_stub::destination_address): Moved to Stub_base.
274 (Reloc_stub::set_destination_address): Moved to Stub_base.
275 (Reloc_stub::reset_destination_address): Moved to Stub_base.
276 (Reloc_stub::stub_type): Renamed and moved to Stub_base.
277 (Reloc_stub::stub_size): Renamed and moved to Stub_base.
278 (Reloc_stub::stub_insns): Renamed and moved to Stub_base.
279 (Reloc_stub::write): Moved to Stub_base.
280 (Reloc_stub::invalid_offset): Moved to Stub_base.
281 (Reloc_stub::invalid_address): Moved to Stub_base.
282 (Reloc_stub::stub_type_): Renamed and moved to Stub_base.
283 (Reloc_stub::stub_insns_): Moved to Stub_base.
284 (Reloc_stub::offset_): Moved to Stub_base.
285 (Reloc_stub::destination_address_): Moved to Stub_base.
286 (Stub_table::The_aarch64_relobj): New typedef.
287 (Stub_table::The_erratum_stub): New typedef.
288 (Stub_table::The_erratum_stub_less): New typedef.
289 (Stub_table::The_erratum_stub_set): New typedef.
290 (Stub_table::The_erratum_stub_set_iter): New typedef.
291 (Stub_table::empty): Added emptiness testing for erratum stubs.
292 (Stub_table::add_erratum_stub): New method to add an erratum stub.
293 (Stub_table::find_erratum_stub): New method.
294 (Stub_table::find_erratum_stubs_for_input_section): New method.
295 (Stub_table::erratum_stub_address): New method.
296 (Stub_table::update_date_size_changed_p): Modified to handle erratum stubs.
297 (Stub_table::do_addralign): Modified to handle erratum stubs.
298 (Stub_table::erratum_stubs_): New member.
299 (Stub_table::erratum_stub_size_): New member.
300 (Stub_table::relocate_stubs): Modified to handle erratum stubs.
301 (Stub_table::do_write): Modified to handle erratum stubs.
302 (AArch64_relobj::The_erratum_stub): New typedef.
303 (AArch64_relobj::Erratum_stub_set_iter): New typedef.
304 (AArch64_relobj::fix_errata): New method.
305 (Target_aarch64::The_reloc_stub_type): Removed.
306 (Target_aarch64::The_erratum_stub): New typede.
307 (AArch64_relocate_functions::construct_b): New method.
308
1e1b2efc
NC
3092015-06-08 Nick Clifton <nickc@redhat.com>
310
311 * po/fr.po: New French Translation.
312
b8cf5075
CC
3132015-06-07 Cary Coutant <ccoutant@gmail.com>
314
315 PR gold/18288
316 * resolve.cc (symbol_to_bits): Remove type parameter; adjust all
317 callers. Don't use STT_COMMON to check for common symbols.
318 (Symbol_table::resolve): Warn if relocatable object has STT_COMMON
319 symbol that's not in a common section.
320 * symtab.h (Symbol::is_common): Don't use STT_COMMON to check for
321 common symbols.
322
bdd2d2b7
CC
3232015-06-04 Cary Coutant <ccoutant@gmail.com>
324
325 PR gold/18200
326 * Makefile.am (diststuff): Add target.
327 * Makefile.in: Regenerate.
328
cd3c333f
CC
3292015-06-04 Cary Coutant <ccoutant@gmail.com>
330
331 PR gold/17498
332 * object.cc (Sized_relobj_file::do_count_local_symbols): Discard
333 temporary locals in merge sections.
334 * options.cc (General_options::parse_discard_all): New method.
335 (General_options::parse_discard_locals): New method.
336 (General_options::parse_discard_none): New method.
337 (General_options::General_options): Initialize discard_locals_.
338 * options.h (--discard-all): Convert to special option.
339 (--discard-locals): Likewise.
340 (--discard-none): New option.
341 (General_options::discard_all): New method.
342 (General_options::discard_locals): New method.
343 (General_options::discard_sec_merge): New method.
344 (General_options::Discard_locals): New enum.
345 (General_options::discard_locals_): New data member.
346
8086551f
CC
3472015-06-03 Cary Coutant <cary@google.com>
348
349 * script-sections.cc (Script_sections::Script_sections): Initialize
350 segments_created_.
351 (Script_sections::create_note_and_tls_segments): Set flag when
352 segments are created.
353 (Script_sections::expected_segment_count): Count PT_INTERP.
354 (Script_sections::attach_sections_using_phdrs_clause): Set flag when
355 segments are created.
356 * script-sections.h (Script_sections::segments_created_): New data
357 member.
358
374082df
CC
3592015-06-03 Cary Coutant <ccoutant@gmail.com>
360
361 PR gold/15370
362 * script-sections.cc
363 (Output_section_element_input::set_section_addresses): When there
364 are several patterns with no sort spec, put all sections in the same
365 bin.
366 * testsuite/Makefile.am (script_test_12): New testcase.
367 (script_test_12i): New testcase.
368 * testsuite/Makefile.in: Regenerate.
369 * testsuite/script_test_12.t: New test linker script.
370 * testsuite/script_test_12i.t: New test linker script.
371 * testsuite/script_test_12a.c: New test source file.
372 * testsuite/script_test_12b.c: New test source file.
373
775ed62e
CC
3742015-06-02 Cary Coutant <ccoutant@gmail.com>
375
376 * nacl.h (Sniff_file): Switch parameters to get_view to get an
377 aligned view.
378
9c7fe3c5
CC
3792015-06-03 Cary Coutant <ccoutant@gmail.com>
380
381 PR gold/17819
382 * gold.cc (queue_final_tasks): When --build-id=tree, queue a
383 separate task to schedule the build id computation.
384 * layout.cc (Hash_task::Hash_task): Remove build_id_blocker,
385 add Output_file and offset.
386 (Hash_task::run): Get and release the input views.
387 (Hash_task::is_runnable): Always return NULL (always runnable).
388 (Layout::queue_build_id_tasks): Remove.
389 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
390 parameters; use them instead of class members.
391 (Build_id_task_runner::run): New function.
392 (Close_task_runner::run): Pass array_of_hashes and size_of_hashes
393 to write_build_id.
394 * layout.h (Layout::queue_build_id_tasks): Remove.
395 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
396 parameters.
397 (Layout::array_of_hashes_): Remove.
398 (Layout::size_of_array_of_hashes_): Remove.
399 (Layout::input_view_): Remove.
400 (Build_id_task_runner): New class.
401 (Close_task_runner::Close_task_runner): Add array_of_hashes and
402 size_of_hashes parameters.
403 (Close_task_runner::array_of_hashes_): New data member.
404 (Close_task_runner::size_of_hashes_): New data member.
405 * testsuite/Makefile.am
406 (flagstest_compress_debug_sections_and_build_id_tree): New test.
407 * testsuite/Makefile.in: Regenerate.
408
400f8944
RÁE
4092015-06-01 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
410
411 * merge.cc (get_input_merge_map): Update for data structure change.
412 (get_or_make_input_merge_map): Update for data structure change.
413 * merge.h (Object_merge_map): Use a std::vector<std::pair>> instead of
414 a std::map. Remove first_shnum_, first_map_, second_shnum_, second_map_.
415
bbec1a5d
AM
4162015-05-16 Alan Modra <amodra@gmail.com>
417
418 * reloc.cc (Sized_relobj_file::find_functions): Use function_location.
419 * powerpc.cc (Target_powerpc::do_calls_non_split): New function.
420 (addi_12_1, addis_2_12, addis_12_1, cmpld_7_12_0): New constants.
421 (lis_0): Rename from lis_0_0.
422
efc6fa12
CC
4232015-04-29 Cary Coutant <cary@google.com>
424 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
425
426 * gc.h (Garbage_collection::is_section_garbage): Change Object*
427 to Relobj*.
428 (Garbage_collection::add_reference): Likewise.
429 (Garbage_collection::gc_process_relocs): Likewise. Don't push
430 object/shndx pair onto *secvec for dynamic objects. Don't follow
431 relocations pointing to dynamic objects for GC.
432 * icf.cc (Icf::find_identical_sections): Change Object* to Relobj*.
433 (Icf::unfold_section): Likewise.
434 (Icf::is_section_folded): Likewise.
435 (Icf::get_folded_section): Likewise.
436 * icf.h: (Icf::get_folded_section): Likewise.
437 (Icf::unfold_section): Likewise.
438 (Icf::is_section_folded): Likewise.
439 (Icf::section_has_function_pointers): Likewise.
440 (Icf::set_section_has_function_pointers): Likewise.
441 * object.h (Section_id): Likewise.
442 (Const_section_id): Likewise.
443 * output.cc (Output_section::update_section_layout): Likewise.
444 * output.h: (Output_section_lookup_maps::find_relaxed_input_section):
445 Likewise.
446 * plugin.cc (update_section_order): Likewise.
447 (unique_segment_for_sections): Likewise.
448 * powerpc.cc (Powerpc_relobj::add_reference): Likewise.
449 (Target_powerpc::do_gc_add_reference): Likewise.
450 (Target_powerpc::gc_process_relocs): Likewise.
451 (Target_powerpc::do_gc_add_reference): Likewise.
452 * symtab.cc (Symbol_table::is_section_folded): Likewise.
453 (Symbol_table::gc_mark_symbol): Likewise.
454 * symtab.h: (Symbol_table::is_section_folded): Likewise.
455 * target.h: (Sized_target::gc_add_reference): Likewise.
456 (Sized_target::do_gc_add_reference): Likewise.
457
f9d3ecaa
NC
4582015-04-29 Nick Clifton <nickc@redhat.com>
459
460 * po/fi.po: Updated Finnish translation.
461
faa2211d
AM
4622015-04-28 Alan Modra <amodra@gmail.com>
463
464 * powerpc.cc (Target_powerpc::do_dynsym_value): Use Address rather
465 than unsigned int for find_global_entry result temp. Compare
466 against invalid_address.
467 (Target_powerpc::do_plt_address_for_global): Likewise.
468 (Target_powerpc::Relocate::relocate): Likewise. Don't assert
469 on plt call stub existence for debug info. Do assert for plt
470 and global entry stub existence if an alloc section.
471
6ec65f28
AM
4722015-04-28 Alan Modra <amodra@gmail.com>
473
474 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't assert
475 on missing global entry stub due to bogus debug info.
476
7a2a1c79
HS
4772015-04-27 Han Shen <shenhan@google.com>
478
479 * options.h (--fix-cortex-a53-843419): Rename option.
480 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Use renamed
481 option.
482 (AArch64_relobj::scan_sections_for_stubs): Use renamed option.
483
cfbf0e3c
RÁE
4842015-04-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
485
486 PR gold/18327
487 * output.cc (Output_section::is_input_address_mapped): Assume a missing
488 entry is mapped.
489 * testsuite/Makefile.am: Add the eh_test test.
490 * testsuite/Makefile.in: Regenerate.
491 * testsuite/eh_test_a.cc: New test.
492 * testsuite/eh_test_b.cc: New test.
493
6ec65f28
AM
4942015-04-23 Sriraman Tallam <tmsriram@google.com>
495
a100d66f
ST
496 * options.h (--weak-unresolved-symbols): New option.
497 * symtab.cc (Symbol_table::sized_write_globals): Change symbol
498 binding to weak with new option.
499 * symtab.h (is_weak_undefined): Check for new option.
500 (is_strong_undefined): Check for new option.
501 * testsuite/Makefile.am (weak_unresolved_symbols_test): New test.
502 * testsuite/Makefile.in: Regenerate.
503 * testsuite/weak_unresolved_symbols_test.cc: New file.
504
4b889c30
IC
5052015-04-20 Ian Coolidge <icoolidge@google.com>
506
507 * symtab.cc (Symbol::should_add_dynsym_entry): Return true for
508 GNU_UNIQUE.
509
4277535c
RÁE
5102015-04-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
511
512 * gc.cc (Garbage_collection::do_transitive_closure): Use back and
513 push_back.
514 * gc.h (Garbage_collection): Use a std::vector instead of a std::queue.
515 * object.cc (Sized_relobj_file::do_layout): Use push_back.
516 * powerpc.cc (process_gc_mark): Use push_back.
517 (Target_powerpc::do_gc_mark_symbol): Use push_back.
518 * symtab.cc (Symbol_table::gc_mark_symbol): Use push_back.
519
7a2a1c79 5202015-04-16 Han Shen <shenhan@google.com>
5019d64a 521
6ec65f28
AM
522 * aarch64.cc (AArch64_insn_utilities): New utility class.
523 (AArch64_relobj::Mapping_symbol_position): New struct.
524 (AArch64_relobj::Mapping_symbol_info): New typedef.
525 (AArch64_relobj::do_count_local_symbols): New function overriding
526 parent's implementation.
527 (AArch64_relobj::mapping_symbol_info_): New member
528 (AArch64_relobj::scan_erratum_843419): New method.
529 (Target_aarch64::scan_erratum_843419_span): New method.
530 (Target_aarch64::is_erratum_843419_sequence): New method.
531 * options.h (fix_cortex_a53): New option.
5019d64a 532
a6a17750
CC
5332015-04-09 Cary Coutant <ccoutant@google.com>
534
535 * symtab.cc (Symbol::final_value_is_known): Check for TLS symbol
536 in a PIE link.
537 * testsuite/Makefile.am (tls_pie_test.sh): New test.
538 * testsuite/Makefile.in: Regenerate.
539 * testsuite/tls_pie_test.sh: New.
540
437ddf0c
CC
5412015-04-09 Cary Coutant <ccoutant@google.com>
542
543 * debug.h (DEBUG_LOCATION): New.
544 (DEBUG_ALL): Include DEBUG_LOCATION.
545 (debug_string_to_enum): Add DEBUG_LOCATION.
546 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Fix debug
547 output to print correct context.
548 (Sized_dwarf_line_info::do_addr2line): Add debug output. Return
549 up to 4 more locations at the beginning of the function.
550 * symtab.cc (Symbol_table::detect_odr_violations): Get canonical
551 result before sorting list of line numbers.
552 * testsuite/debug_msg.sh: Allow range of line numbers for
553 canonical results on optimized code.
554
24491327
HS
5552015-04-07 HC Yen <hc.yen@mediatek.com>
556
557 Add AArch32 support for gold linker.
558 gold/
559 * arm.cc: Add V8 arch combine table.
560
7fa5525f
RÁE
5612015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
562
563 * aarch64.cc (do_reloc_addend): Fix signature to match the parent one.
564
5368dcf2
RÁE
5652015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
566
567 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a call
568 to find by using the return value of insert.
569
9dbb4b02
RÁE
5702015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
571
572 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a copy
573 constructor call.
574
1fa29f10
IT
5752015-04-06 Ilya Tocar <ilya.tocar@intel.com>
576
577 PR gold/17641
578 * x86_64.cc (Target_x86_64::can_convert_mov_to_lea): New.
579 (Target_x86_64::Scan::local): Don't create GOT entry, when we
580 can convert mov to lea.
581 (Target_x86_64::Scan::global): Ditto.
582 (Target_x86_64::Relocate::relocate): Convert mov foo@GOTPCREL(%rip),
583 %reg to lea foo(%rip), %reg if possible.
584 * testsuite/Makefile.am (x86_64_mov_to_lea): New test.
585 * testsuite/x86_64_mov_to_lea1.s: New.
586 * testsuite/x86_64_mov_to_lea2.s: Ditto.
587 * testsuite/x86_64_mov_to_lea3.s: Ditto.
588 * testsuite/x86_64_mov_to_lea4.s: Ditto.
589 * testsuite/x86_64_mov_to_lea.sh: Ditto.
590
39f3de7c
L
5912015-04-02 H.J. Lu <hongjiu.lu@intel.com>
592
593 * configure: Regenerated.
594
c4fc4724
IT
5952015-04-01 Ilya Tocar <ilya.tocar@intel.com>
596
597 PR gold/17640
598 * i386.cc (Target_i386::can_convert_mov_to_lea): New.
599 (Target_i386::Scan::local): Don't create GOT entry, when we
600 can convert GOT to GOTOFF.
601 (Target_i386::Scan::global): Ditto.
602 (Target_i386::Relocate::relocate): Convert mov foo@GOT(%reg), %reg to
603 lea foo@GOTOFF(%reg), %reg if possible.
604 * testsuite/Makefile.am (i386_mov_to_lea): New test.
605 * testsuite/i386_mov_to_lea1.s: New.
606 * testsuite/i386_mov_to_lea2.s: Ditto.
607 * testsuite/i386_mov_to_lea3.s: Ditto.
608 * testsuite/i386_mov_to_lea4.s: Ditto.
609 * testsuite/i386_mov_to_lea5.s: Ditto.
610 * testsuite/i386_mov_to_lea.sh: Ditto.
611
918357b9
L
6122015-04-01 H.J. Lu <hongjiu.lu@intel.com>
613
614 * Makefile.am (ZLIB): New.
615 (ZLIBINC): Likewise.
616 (AM_CFLAGS): Add $(ZLIBINC).
617 (AM_CXXFLAGS): Likewise.
618 (ldadd_varldadd_var): Add $(ZLIB).
619 (incremental_dump_LDADD): Likewise.
620 (dwp_LDADD): Likewise.
621 * compressed_output.cc: Don't check HAVE_ZLIB_H to include
622 <zlib.h>.
623 (zlib_compress): Don't check HAVE_ZLIB_H.
624 (zlib_decompress): Likewise.
625 * options.h (compress_debug_sections): Likewise.
626 * configure.ac (AM_CONDITIONAL): Removed.
627 * testsuite/Makefile.am (ZLIB): New.
628 (LDADD): Add $(ZLIB).
629 Don't check HAVE_ZLIB.
630 * Makefile.in: Regenerated.
631 * config.in: Likewise.
632 * configure: Likewise.
633 * testsuite/Makefile.in: Likewise.
634
6b0ad2eb
JY
6352015-03-30 Jing Yu <jingyu@google.com>
636
637 * aarch64-reloc.def: New TLSLD_ADD_DTPREL_HI12,
638 TLSLD_ADD_DTPREL_LO12_NC.
639 * aarch64.cc (Target_aarch64::define_tls_base_symbol): Always let
640 _TLS_MODULE_BASE_ point to the start of tls segment.
641 (Target_aarch64::optimize_tls_reloc): Add cases for
642 R_AARCH64_TLSLD_ADD_DTPREL_HI12 and
643 R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
644 (Target_aarch64::Scan::local): Likewise.
645 (Target_aarch64::Scan::global): Likewise.
646 (Target_aarch64::Relocate::relocate): Likewise.
647 (Target_aarch64::Relocate::relocate_tls): Likewise. And remove
648 subtracting tls segment size from symbol value for TLSLD_*_DTPREL
649 relocations.
650
0916f9e7
RÁE
6512015-03-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
652
653 * merge.cc (Object_merge_map::add_mapping): call
654 Object_merge_map::Input_merge_map::add_mapping.
655 (Object_merge_map::Input_merge_map::add_mapping): New.
656 (Output_merge_data::do_add_input_section): Call
657 get_or_make_input_merge_map before a loop.
658 (Output_merge_string<Char_type>::finalize_merged_data): Call
659 get_or_make_input_merge_map before a loop.
660 * merge.h (Object_merge_map): Make Input_merge_map public.
661 * object.cc (Relobj::add_merge_mapping): Use get_or_create_merge_map.
662 (Relobj::get_or_create_merge_map): New.
663 * object.h (Relobj::get_or_create_merge_map): New.
664
282c9750
AM
6652015-03-24 Alan Modra <amodra@gmail.com>
666
667 PR 18147
668 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't report
669 relocation errors for branches to strong undefined symbols.
670
67f95b96
RÁE
6712015-03-23 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
672
673 * merge.cc (Object_merge_map::get_input_merge_map): Make it const.
674 (Object_merge_map::is_merge_section_for): Remove.
675 (Object_merge_map::find_merge_section): New.
676 * merge.h (Object_merge_map::is_merge_section_for): Remove.
677 (Object_merge_map::find_merge_section): New.
678 (Object_merge_map::get_input_merge_map): Add a const version.
679 * object.cc (Relobj::is_merge_section_for): Remove.
680 (Relobj::find_merge_section): New.
681 * object.h (Relobj::is_merge_section_for): Remove.
682 (Relobj::find_merge_section): New.
683 * output.cc
684 (Output_section::Input_section::is_merge_section_for): Remove.
685 (Output_section::add_merge_input_section): Don't call
686 add_merge_input_section.
687 (Output_section::find_merge_section): Return const. Use
688 object->find_merge_section.
689 (Output_section::build_lookup_maps): Don't build a map for
690 merge sections.
691 (Output_section::is_input_address_mapped): Return false if
692 section is not found.
693 (Output_section::find_starting_output_address): Use
694 find_merge_section instead of is_merge_section_for.
695 (Output_section::add_script_input_section): Don't build a map for
696 merge sections.
697 * output.h (Output_section_lookup_maps::merge_sections_by_id_): Remove.
698 (Output_section_lookup_maps::find_merge_section): Remove.
699 (Output_section_lookup_maps::add_merge_input_section) Remove.
700 (Output_section::find_merge_section): Return const.
701
152f7024
CC
7022015-03-22 Cary Coutant <cary@google.com>
703
704 PR gold/18106
705 * i386.cc (Target_i386::Relocate::tls_gd_to_ie): Fix support for
706 non-SIB form of lea, with nop after the call.
707
bccffdfd
CC
7082015-03-21 Cary Coutant <cary@google.com>
709
710 PR gold/14217
711 * output.cc (Output_segment::is_first_section_relro): Don't ignore
712 .tdata section.
713 (Output_segment::set_section_addresses): Don't align size of relro
714 segment for .tbss.
715
1c582fe7
CC
7162015-03-21 Cary Coutant <cary@google.com>
717
718 PR gold/18010
719 * stringpool.cc (Stringpool_template): Don't optimize if section
720 alignment is greater than sizeof(char).
721
410da591
CC
7222015-03-21 Cary Coutant <cary@google.com>
723
724 PR gold/18048
725 * script-c.h (script_include_directive): Add first_token parameter.
726 * script.cc (script_include_directive): Add first_token parameter, and
727 pass it to read_script_file.
728 * yyscript.y (PARSING_SECTIONS_BLOCK, PARSING_SECTION_CMDS)
729 (PARSING_MEMORY_DEF): New tokens.
730 (top): Add new productions for INCLUDE files.
731 (file_cmd): Replace file_or_sections_cmd with copy of its productions.
732 Pass PARSING_LINKER_SCRIPT to script_include_directive.
733 (section_block_cmd): Likewise; pass PARSING_SECTIONS_BLOCK.
734 (section_cmd): Pass PARSING_SECTION_CMDS.
735 (file_or_sections_cmd): Remove.
736 (memory_def): Pass PARSING_MEMORY_DEF.
737 * testsuite/Makefile.am (memory_test_2): New test.
738 * testsuite/Makefile.in: Regenerate.
739 * testsuite/memory_test_inc.t: New script file.
740 * testsuite/memory_test_inc_1.t.src: New script file.
741 * testsuite/memory_test_inc_2.t.src: New script file.
742 * testsuite/memory_test_inc_3.t.src: New script file.
743
0d5bbdb0
CC
7442015-03-21 Cary Coutant <cary@google.com>
745
746 * dwp.cc (Sized_relobj_dwo::do_section_contents): Delete.
747 (Sized_relobj_dwo::setup): Build compressed section map.
748 (Sized_relobj_dwo::do_decompressed_section_contents): Delete.
749 * dynobj.cc (Sized_dynobj::base_read_symbols): Build compressed
750 section map.
751 * object.cc (Sized_relobj_file::Sized_relobj_file): Remove
752 compressed_sections_ field.
753 (build_compressed_section_map): Take Object instead of
754 Sized_relobj_file parameter; add decompress_if_needed parameter.
755 (Sized_relobj_file::do_find_special_sections): Store compressed
756 section map in parent Object.
757 (Sized_relobj_file::do_decompressed_section_contents): Move
758 implementation to Object::decompressed_section_contents.
759 (Sized_relobj_file::do_discard_decompressed_sections): Move
760 implementation to Object::discard_decompressed_sections.
761 * object.h (build_compressed_section_map): Declare.
762 (Object::Object): Add compressed_sections_ field.
763 (Object::section_is_compressed): Move implementation here.
764 (Object::decompressed_section_contents): De-virtualize.
765 (Object::discard_decompressed_sections): De-virtualize.
766 (Object::do_section_is_compressed): Delete.
767 (Object::do_decompressed_section_contents): Delete.
768 (Object::set_compressed_sections): New method.
769 (Object::compressed_sections): New method.
770 (Object::compressed_sections_): New data member.
771 (Compressed_section_info, Compressed_section_map): Move to top of file.
772 (Sized_relobj_file::do_section_is_compressed): Delete.
773 (Sized_relobj_file::do_decompressed_section_contents): Delete.
774 (Sized_relobj_file::do_discard_decompressed_sections): Delete.
775 (Sized_relobj_file::compressed_sections_): Move to Object class.
776
bd9e0d46
CC
7772015-03-21 Cary Coutant <ccoutant@google.com>
778
779 PR gold/18152
780 * gold.cc (queue_middle_tasks): Finalize .eh_frame after laying out
781 deferred objects.
782
943c8b43
CC
7832015-03-11 Cary Coutant <ccoutant@google.com>
784
785 * options.cc (General_options::finalize): Don't allow -z relro
786 with incremental linking.
787 * testsuite/Makefile.am (incremental_test): Add -z norelro.
788 (incremental_test_2): Likewise.
789 (incremental_test_3): Likewise.
790 (incremental_test_4): Likewise.
791 (incremental_test_5): Likewise.
792 (incremental_test_6): Likewise.
793 (incremental_copy_test): Likewise.
794 (incremental_common_test_1): Likewise.
795 (incremental_comdat_test_1): Likewise.
796 * testsuite/Makefile.in: Regenerate.
797
e1663197
CC
7982015-03-09 Cary Coutant <ccoutant@google.com>
799
800 PR gold/14675
801 * ehframe.cc (Eh_frame::add_ehframe_input_section): Change return type;
802 return enum indicating whether .eh_frame section is empty, optimizable,
803 unrecognized, or an end marker. Adjust explicit instantiations.
804 * ehframe.h (Eh_frame::Eh_frame_section_disposition): New enum type.
805 (Eh_frame::add_ehframe_input_section): Change return type.
806 * gold.cc (queue_middle_tasks): Call Layout::finalize_eh_frame_section.
807 * layout.cc (Layout::layout_eh_frame): Don't add optimized sections
808 to the .eh_frame output section until we see the end marker.
809 (Layout::finalize_eh_frame_section): New.
810 * layout.h: (Layout::finalize_eh_frame_section): New.
811
beb8418f
L
8122015-03-05 H.J. Lu <hongjiu.lu@intel.com>
813
814 * output.cc (Relobj::initialize_input_to_output_map<size>):
815 Remove typename on elfcpp::Elf_types<size>::Elf_Addr.
816
48c73428
CC
8172015-03-04 Cary Coutant <ccoutant@google.com>
818
819 * parameters.cc (Parameters::set_target_once): Call
820 Target::select_as_default_target just once from here...
821 (set_parameters_target): ...instead of from here.
822
8232015-03-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
dbe40a88
RÁE
824
825 * ehframe.cc (Cie::set_output_offset): Pass in and use a
826 Output_section_data instead of a Merge_map.
827 (Eh_frame::Eh_frame): Don't initialize merge_map_.
828 (Eh_frame::read_cie): Use add_merge_mapping instead of
829 Merge_map::add_mapping.
830 (Eh_frame::read_fde): Ditto.
831 (Eh_frame::set_final_data_size): Use this instead of this->merge_map_.
832 (Eh_frame::do_output_offset): Use merge_output_offset istead of
833 merge_map_->get_output_offset.
834 (Eh_frame::do_is_merge_section_for): Delete.
835 * ehframe.h (Fde::add_mapping): Pass in and use a Output_section_data
836 instead of a Merge_map.
837 (Cie::set_output_offset): Pass in a Output_section_data instead of a
838 Merge_map.
839 (Eh_frame::do_is_merge_section_for): Delete.
840 (Eh_frame::merge_map_): Delete.
841 * merge.cc (Object_merge_map::get_or_make_input_merge_map): Pass in
842 and use a Output_section_data instead of a Merge_map.
843 (Object_merge_map::add_mapping): Ditto.
844 (Object_merge_map::get_output_offset): Remove the merge_map argument.
845 (Object_merge_map::is_merge_section_for): Pass in and use a
846 Output_section_data instead of a Merge_map.
847 (Merge_map): Delete.
848 (Output_merge_base::do_output_offset): Use merge_output_offset instead
849 of merge_map_.get_output_offset.
850 (Output_merge_base::do_is_merge_section_for): Delete.
851 (Output_merge_data::do_add_input_section): Use
852 object->add_merge_mapping instead of add_mapping.
853 (Output_merge_string<Char_type>::finalize_merged_data): Ditto.
854 * merge.h (Merge_map): Delete forward declaration.
855 (Object_merge_map::add_mapping): Pass in and use a Output_section_data
856 instead of a Merge_map.
857 (Object_merge_map::get_output_offset): Remove the merge_map argument.
858 (Object_merge_map::is_merge_section_for): Pass in and use a
859 Output_section_data instead of a Merge_map.
860 (Input_merge_map::Object_merge_map::merge_map): Replace with
861 output_data.
862 (Object_merge_map::get_or_make_input_merge_map): Pass in and use a
863 Output_section_data instead of a Merge_map.
864 (Merge_map): Delete.
865 (Output_merge_base::Output_merge_base): Don't initialize merge_map_.
866 (Output_merge_base::do_is_merge_section_for): Delete.
867 (Output_merge_base::add_mapping): Delete.
868 (Output_merge_base::merge_map_): Delete.
869 * object.cc (Relobj::initialize_input_to_output_map): New.
870 (Relobj::initialize_input_to_output_map): New.
871 (Relobj::merge_output_offset): New.
872 (Relobj::is_merge_section_for): New.
873 (Relobj::initialize_input_to_output_map): Instantiate for 32 and 64
874 bits.
875 * object.h (Relobj::merge_map): Delete.
876 (initialize_input_to_output_map): New.
877 (set_merge_map): Delete.
878 (add_merge_mapping): New.
879 (merge_output_offset): New.
880 (is_merge_section_for): New.
881 * output.cc (Output_section::Input_section::is_merge_section_for):
882 Use object->is_merge_section_for.
883 * output.h (Output_section_data::is_merge_section_for): Delete.
884 (Output_section_data::do_is_merge_section_for): Delete.
885 * reloc.cc (Merged_symbol_value<size>::initialize_input_to_output_map):
886 Use object->initialize_input_to_output_map.
887 (Merged_symbol_value<size>::value_from_output_section): Use
888 object->merge_output_offset.
889
48c73428 8902015-03-02 Peter Collingbourne <pcc@google.com>
2c7b626c
CC
891 Cary Coutant <ccoutant@google.com>
892
893 * output.cc (Output_section::add_merge_input_section): Do not
894 attempt to merge sections with an entsize of 0.
895
48c73428 8962015-03-02 Khem Raj <raj.khem@gmail.com>
5b07cd84
CC
897
898 * attributes.h (class Output_attributes_section_data ): Add
899 do_print_to_mapfile function.
900
ec86f434
AM
9012015-02-24 Alan Modra <amodra@gmail.com>
902
903 PR 18010
904 * powerpc.cc (Powerpc_relocate_functions::addr16_ds): Always
905 complain if value is not a multiple of four.
906 (Target_powerpc::Relocate::relocate): Correct handling of
907 R_POWERPC_GOT_TPREL16 and R_POWERPC_GOT_TPREL16_LO for ppc64.
908
be66981e
L
9092015-02-21 H.J. Lu <hongjiu.lu@intel.com>
910
911 * configure.ac (default_size): Set to 32 for x32.
912 * configure: Regenerated.
913
e3ee8ed4
AM
9142015-02-18 Alan Modra <amodra@gmail.com>
915
916 PR 17954
917 * powerpc.cc (Global_symbol_visitor_opd::operator()): Set default
918 visibility.
919
3a935c6c
RÁE
9202015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
921
922 * gc.h (Garbage_collection::add_reference): Don't use find.
923
e0a1e121
RÁE
9242015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
925
926 * object.cc (write_local_symbols): avoid std::vector copy.
927
45a4fb1a
RÁE
9282015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
929
930 * merge.cc (get_output_offset): Use upper_bound instead of lower_bound.
931
2d9afefe
MW
9322015-02-09 Mark Wielaard <mjw@redhat.com>
933
934 * gdb-index.cc (Gdb_index_info_reader::visit_top_die): Recognize
935 DW_LANG_Fortran03 and DW_LANG_Fortran08.
936
e9c1bdad
CC
9372015-02-16 Cary Coutant <ccoutant@google.com>
938
939 PR gold/13577
940 PR gold/16992
941 * layout.cc (Layout::finish_dynamic_section): Don't set DT_SYMBOLIC or
942 DF_SYMBOLIC if --dynamic-list option is used.
943 * options.cc (General_options::finalize): --dynamic-list is not
944 mutually exclusive with -Bsymbolic.
945 * symtab.h (Symbol::is_preemptible): Don't exclude dynamic symbols not
946 listed in --dynamic-list.
947 * testsuite/Makefile.am (dynamic_list_lib2.so): Add
948 -Bsymbolic-functions.
949 * testsuite/Makefile.in: Regenerate.
950
0ed4b0bf
CC
9512015-02-16 Cary Coutant <ccoutant@google.com>
952
953 PR gold/17971
954 * incremental.cc: Remove redundant include of "output.h".
955
1a920511
JY
9562015-02-12 Jing Yu <jingyu@google.com>
957
958 * aarch64-reloc.def (TLSLE_MOVW_TPREL_G2, TLSLE_MOVW_TPREL_G1,
959 TLSLE_MOVW_TPREL_G1_NC, TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC,):
960 New relocation.
961 * aarch64.cc (Target_aarch64::Scan::local): Add cases for new
962 TLSLE_MOVW_* relocations.
963 (Target_aarch64::Scan::global): Likewise.
964 (Target_aarch64::Relocate::relocate): Likewise.
965 (Target_aarch64::Relocate::relocate_tls): Add cases and handlings
966 for new TLSLE_MOVW_* relocations.
967
07f107f3
WN
9682015-02-11 Will Newton <will.newton@linaro.org>
969
970 PR gold/13321
971 * arm.cc (Target_arm::make_plt_section): Create an ARM
972 state mapping symbol at the start of the PLT.
973
e051a5b5
L
9742015-02-09 H.J. Lu <hongjiu.lu@intel.com>
975
976 * testsuite/Makefile.am (two_file_shared_2_pic_1_test_DEPENDENCIES):
977 Replace two_file_shared_2.so with two_file_shared_1.so.
978 * testsuite/Makefile.in: Regenerated.
979
dddcc5b9
AM
9802015-02-09 Alan Modra <amodra@gmail.com>
981
982 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add libweak_undef_2.a,
983 plugin_test_thin.a and defsym_test.
984 * testsuite/Makefile.in: Regenerate.
985
b39b8b9d
RÁE
9862015-02-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
987
988 * merge.cc (do_add_input_section): Combine loop epilogue into main loop
989 body.
990
b66d1c52
CC
9912015-02-04 Peter Collingbourne <pcc@google.com>
992
993 * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve
994 forwarding symbols when computing symbol resolution info for plugins.
995 * plugin.h (Plugin_manager::symtab): New method.
996 (Pluginobj::get_symbol_resolution_info): Add symtab parameter.
997
23081de0
CC
9982015-02-03 Cary Coutant <ccoutant@google.com>
999 Peter Collingbourne <pcc@google.com>
1000
1001 PR gold/15660
1002 * archive.cc (Thin_archive_object_unlocker): New class.
1003 (Archive::include_member): Unlock external members of thin archives.
1004 * testsuite/Makefile.am (plugin_test_1): Rename .syms files.
1005 (plugin_test_2): Likewise.
1006 (plugin_test_3): Likewise.
1007 (plugin_test_4): Likewise.
1008 (plugin_test_5): Likewise.
1009 (plugin_test_6): Likewise.
1010 (plugin_test_7): Likewise.
1011 (plugin_test_8): Likewise.
1012 (plugin_test_9): Likewise.
1013 (plugin_test_10): Likewise.
1014 (plugin_test_11): New test case.
1015 * testsuite/Makefile.in: Regenerate.
1016 * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms
1017 file to decide whether to claim file.
1018 (all_symbols_read_hook): Likewise.
1019 * testsuite/plugin_test_1.sh: Adjust expected output.
1020 * testsuite/plugin_test_2.sh: Likewise.
1021 * testsuite/plugin_test_3.sh: Likewise.
1022 * testsuite/plugin_test_6.sh: Likewise.
1023 * testsuite/plugin_test_tls.sh: Likewise.
1024 * testsuite/plugin_test_11.sh: New testcase.
1025
10262015-02-03 Cary Coutant <ccoutant@google.com>
1027
1028 * descriptors.cc (Descriptors::open): Set artificially-low limit for
1029 file descriptors when debugging enabled. Add debug output.
1030 (Descriptors::release): Add debug output.
1031 (Descriptors::close_some_descriptor): Likewise.
1032 (Descriptors::close_all): Likewise.
1033 * fileread.cc (File_read::lock): Likewise.
1034 (File_read::unlock): Likewise.
1035
24dd5808
CC
10362015-02-02 Cary Coutant <ccoutant@google.com>
1037
1038 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
1039 executable output file.
1040
fa89cc82
HS
10412015-01-22 Han Shen <shenhan@google.com>
1042
1043 * arm.cc (Target_arm::Target_arm): Add initialization for new members.
1044 (Target_arm::do_plt_address_for_global): New method.
1045 (Target_arm::do_plt_address_for_local): New method.
1046 (Target_arm::rel_irelative_section): New method.
1047 (Target_arm::make_data_plt): Add more parameters for plt ctor.
1048 (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
1049 (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
1050 (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
1051 (Target_arm::Scan::check_non_pic): Add ifunc support.
1052 (Target_arm::Scan::local): Add ifunc support.
1053 (Target_arm::Scan::global): Add ifunc support.
1054 (Target_arm::make_plt_section): New method.
1055 (Target_arm::make_plt_entry): Change to call to make_plt_section.
1056 (Target_arm::make_local_ifunc_plt_entry): New method.
1057 (Target_arm::got_irelative_): New member.
1058 (Target_arm::rel_irelative_): New member.
1059 (Target_arm::got_section): Add creation for got_irelative_.
1060 (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
1061 (Target_arm::Relocate::relocate): Properly set local ifunc address.
1062 (Target_arm::do_dynsym_value): Properly set global ifunc address.
1063 (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
1064 (Output_data_plt_arm::IRelative_data): New type.
1065 (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
1066 (Output_data_plt_arm::add_entry): Add more parameters.
1067 (Output_data_plt_arm::add_relocation): New method.
1068 (Output_data_plt_arm::add_local_ifunc_entry): New method.
1069 (Output_data_plt_arm::rel_irelative): New method.
1070 (Output_data_plt_arm::entry_count): Modified.
1071 (Output_data_plt_arm::address_for_global): New method.
1072 (Output_data_plt_arm::address_for_local): New method.
23081de0 1073gold/
fa89cc82
HS
1074 (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
1075 (Output_data_plt_arm::insert_irelative_data): New method.
1076 (Output_data_plt_arm::irelative_rel_): New member.
1077 (Output_data_plt_arm::got_): New member.
1078 (Output_data_plt_arm::got_irelative_): New member.
1079 (Output_data_plt_arm::irelative_count_): New member.
1080 (Output_data_plt_arm::IRelative_data_vec): New typedef.
1081 (Output_data_plt_arm::irelative_data_vec_): New member.
1082 (Output_data_plt_arm::do_write): Write out irelative entries.
1083 (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
1084 more parameters to ctor.
1085 (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
1086 more parameters to ctor.
1087 * output.h (Output_data_reloc::add_local_relative): New method.
1088 * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
1089
0f81d3f0
AM
10902015-01-29 Alan Modra <amodra@gmail.com>
1091
1092 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
1093 and GOT_TLSGD to LE optimization.
1094
65d92137
CC
10952015-01-28 Cary Coutant <ccoutant@google.com>
1096
1097 * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
1098 for undef TLS symbols.
1099 (Target_x86_64::Relocate::relocate_tls): Likewise.
1100 (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
1101
5485698a
CC
11022015-01-25 Cary Coutant <ccoutant@google.com>
1103
1104 * output.cc (Output_segment::set_section_addresses): Fix calculation
1105 of size of relro segment.
1106
b01a4b04
AM
11072015-01-22 Alan Modra <amodra@gmail.com>
1108
1109 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
1110 condition for need of ifunc plt entry.
1111 (Target_powerpc::Scan::global <got relocs>): Likewise.
1112
3d0064a9
CC
11132015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1114
1115 * mips.cc (reloc_high): Add r_sym.
1116 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
1117 reloc_high constructor.
1118 (Mips_relocate_functions::relgot16_local): Likewise.
1119 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
1120 r_type to decide whether LO16 matches HI16.
1121 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
1122 rello16 and relgot16_local.
1123
a5cd8f05
CC
11242015-01-09 Cary Coutant <ccoutant@google.com>
1125
1126 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
1127 unless alignment is larger than page size.
1128
4fc1b9d4
L
11292015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1130 Cary Coutant <ccoutant@google.com>
1131
1132 PR gold/17729
1133 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
1134 (DEFAULT_TARGET_X32): Set for x32.
1135 * x86_64.cc (cmp_insn_32): New.
1136 (lea_r10_insn_32): Likewise.
1137 (lea_r11_insn_32): Likewise.
1138 (cmp_insn_64): Likewise.
1139 (lea_r10_insn_64): Likewise.
1140 (lea_r11_insn_64): Likewise.
1141 (Target_x86_64<size>::do_calls_non_split): Handle x32.
1142 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
1143 (check_DATA): Add split_x32 files.
1144 (split_x32_[1234n].o): New targets.
1145 (split_x32_[124]): New targets.
1146 (split_x32_[1234r].stdout): New targets.
1147 * testsuite/split_x32.sh: New file.
1148 * testsuite/split_x32_1.s: Likewise.
1149 * testsuite/split_x32_2.s: Likewise.
1150 * testsuite/split_x32_3.s: Likewise.
1151 * testsuite/split_x32_4.s: Likewise.
1152 * testsuite/split_x32_n.s: Likewise.
1153 * configure: Regenerated.
1154 * testsuite/Makefile.in: Likewise.
1155
e749cab8
L
11562015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1157
1158 PR gold/17809
1159 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
1160 x32.
1161
af759df0
AM
11622015-01-02 Alan Modra <amodra@gmail.com>
1163
1164 * version.cc (print_version): Just print current year.
1165 * dwp.cc (print_version): Likewise.
1166
b90efa5b
AM
11672015-01-01 Alan Modra <amodra@gmail.com>
1168
1169 Update year range in copyright notice of all files.
1170
f12d1e8a
AM
11712014-12-25 Alan Modra <amodra@gmail.com>
1172
1173 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
1174 new enums.
1175 (Target_arm::merge_object_attributes, ): Likewise.
1176
5c294fee
TG
11772014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
1178
1179 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
1180 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
1181 AEABI_VFP_args_vfp to check that.
1182 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
1183 value and replace hardcoded values by enum values.
1184
e30880c2
CC
11852014-12-22 Cary Coutant <ccoutant@google.com>
1186
1187 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
1188
bd040da1
L
11892014-12-20 H.J. Lu <hongjiu.lu@intel.com>
1190
1191 PR gold/14608
1192 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
1193 to "return i * i * 3;".
1194
e02a4046
CC
11952014-12-16 Cary Coutant <ccoutant@google.com>
1196
1197 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
1198 (Mapfile::print_output_data): Use current_data_size() to avoid
1199 assert for sections requiring postprocessing; if address is not valid,
1200 print 0.
1201 (Mapfile::print_output_section): Use current_data_size(); print note
1202 that addresses and sizes are before compression.
1203
add6016b
L
12042014-12-14 H.J. Lu <hongjiu.lu@intel.com>
1205
1206 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1207 Cast current_group_size to unsigned long when reporting error.
1208
0bf32ea9
JY
12092014-12-10 Jing Yu <jingyu@google.com>
1210
1211 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
1212 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
1213 Update error message.
1214 (Target_aarch64::do_relax): Use absolute value of option
1215 stub_group_size. Replace local variable with class member
1216 stub_group_size_.
1217
cbcb23fa
AM
12182014-12-04 Alan Modra <amodra@gmail.com>
1219
1220 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
1221 addend of PLTREL24 reloc when not generating a plt stub. Make
1222 max_branch_offset an "Address".
fbad6518 1223 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
cbcb23fa
AM
1224 (Target_powerpc::Relocate::relocate): Likewise.
1225
1611bc4a
AM
12262014-12-04 Alan Modra <amodra@gmail.com>
1227
1228 PR 17670
1229 * symtab.cc (Symbol::set_undefined): Remove assertion.
1230 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1231 on symbols defined in discarded sections, instead return false.
1232 Rearrange params, update all callers.
1233 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
1234 branches to syms in discarded sections.
1235 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
1236 undefined and flag as discarded.
1237 (Target_powerpc::Relocate::relocate): Localize variable.
1238
4759c34e
L
12392014-12-03 H.J. Lu <hongjiu.lu@intel.com>
1240
1241 PR gold/17675
1242 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
1243 * testsuite/Makefile.in: Regenerated.
1244
1f98a074
AM
12452014-12-03 Alan Modra <amodra@gmail.com>
1246
1247 PR 17566
1248 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
1249 when adding dynamic relocations against section symbols.
1250
fb257835
DI
12512014-12-01 Dimitry Ivanov <dimitry@google.com>
1252
1253 * layout.cc (Layout::finish_dynamic_section): When '-z global'
1254 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
1255 * options.h (General_options): New -z option (global).
1256
d8e60314
CC
12572014-12-01 Cary Coutant <ccoutant@google.com>
1258
1259 PR gold/17578
1260 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
1261 is given.
1262 (Layout::create_executable_stack_info): Warn when -z noexecstack is
1263 given but some inputs require executable stack.
1264
982bbd97
CC
12652014-11-26 Cary Coutant <ccoutant@google.com>
1266
1267 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
1268 .debug_str_offsets; strip .debug_gnu_pubnames and
1269 .debug_gnu_pubtypes.
1270 (lines_only_debug_sections): Strip all four new sections.
1271
bb779192
HS
12722014-11-26 Jing Yu <jingyu@google.com>
1273
1274 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
1275 register to be x0 when to relax TLSDESC_LD64_LO12.
1276
a3e60ddb
AM
12772014-11-26 Alan Modra <amodra@gmail.com>
1278
1279 * powerpc.cc (struct Stub_table_owner): New.
1280 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
1281 unsigned int vector. Update all references.
1282 (powerpc_relobj::set_stub_table): Take an unsigned int param
1283 rather than a Stub_table. Update callers.
1284 (Powerpc_relobj::clear_stub_table): New function.
1285 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
1286 stub_group_size_ vars.
1287 (Target_powerpc::new_stub_table): Delete.
1288 (max_branch_delta): New function, extracted from..
1289 (Target_powerpc::Relocate::relocate): ..here..
1290 (Target_powerpc::Branch_info::make_stub): ..and here. Return
1291 status on whether stub created successfully.
1292 (Stub_control::Stub_control): Add "no_size_errors" param. Move
1293 default sizing to..
1294 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
1295 reduce on relax failure.
1296 (Target_powerpc::group_sections): Add "no_size_errors" param.
1297 Use stub_group_size_. Set up group info in a temp vector,
1298 before building Stub_table vector. Account for input sections
1299 possibly already converted to relaxed sections.
1300 (Stub_table::init): Delete. Merge into..
1301 (Stub_table::Stub_table): ..here.
1302 (Stub_table::can_reach_stub): New function.
1303 (Stub_table::add_plt_call_entry): Add "from" parameter and
1304 return true iff stub could be reached.
1305 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
1306 param too.
1307 (Stub_table::clear_stubs): Add "all" param.
1308
a20605cf
AM
13092014-11-26 Alan Modra <amodra@gmail.com>
1310
1311 * powerpc.cc (Stub_control::set_output_and_owner): New function.
1312 (Target_powerpc::group_sections): Use it.
1313
43b64deb
CC
13142014-11-25 Cary Coutant <ccoutant@google.com>
1315
1316 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
1317 (Binary_to_elf::write_symbol): Add st_size parameter.
1318 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
1319
c924eb67
CC
13202014-11-25 Cary Coutant <ccoutant@google.com>
1321
1322 PR gold/17639
1323 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
1324 (Sized_relobj_file::do_layout): Handle deferred sections properly
1325 during GC pass 1. Don't add reloc sections to deferred list twice.
1326 * object.h (Sized_relobj_file::is_deferred_layout): New function.
1327 (Sized_relobj_file::is_deferred_layout_): New data member.
1328
9d585188
L
13292014-11-21 H.J. Lu <hongjiu.lu@intel.com>
1330
1331 PR gold/17619
1332 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
1333 Check PC-relative offset overflow in PLT entry.
1334
3ffaac20
AM
13352014-11-21 Alan Modra <amodra@gmail.com>
1336
1337 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
1338 for undefined weaks.
1339
0cfb0717
AM
13402014-11-20 Alan Modra <amodra@gmail.com>
1341
1342 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
1343 from --stub-group-size parameter divided by 1024.
1344 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
1345 template parameter. Update all uses.
1346 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
1347 has_stub_value. Set for long branches. Don't report overflow for
1348 branch to undefined weak symbols. Print info message on
1349 overflowing branch to stub.
1350
f9dffbf0
AM
13512014-11-20 Alan Modra <amodra@gmail.com>
1352
1353 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
1354
e88ba8d5
L
13552014-11-13 H.J. Lu <hongjiu.lu@intel.com>
1356
1357 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
1358 entry for R_X86_64_GOTPLT64.
1359 (Target_x86_64<size>::Relocate::relocate): Update comments for
1360 R_X86_64_GOTPLT64.
1361
d37ffe25
ED
13622014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
1363
1364 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
1365 * plugin.h: add lock definition
1366
9726c3c1
HS
13672014-10-29 Han Shen <shenhan@google.com>
1368 Jing Yu <jingyu@google.com>
1369
1370 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
1371 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1372 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
1373 Symbol::TLS_REF.
1374 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
1375 method.
1376 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
1377 (Target_aarch64::tls_ld_to_le): New method.
1378 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
1379 for 64bit targets.
1380 (Output_data_plt_aarch64::irelative_rel_): New data member.
1381 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
1382 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
1383 (Output_data_plt_aarch64::add_relocation): New method.
1384 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
1385 offset. Add got_irelative size to got size.
1386 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
1387 type string with the new typename.
1388 (AArch64_relocate_functions::update_adr): Replace parameter x with
1389 immed.
1390 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
1391 (AArch64_relocate_functions::reloc_common): New method.
1392 (AArch64_relocate_funcsions::rela_general): Extract common part out
1393 into reloc_common method.
1394 (AArch64_relocate_functions::rela_general): Likewise.
1395 (AArch64_relocate_functions::pcrela_general): Likewise.
1396 (AArch64_relocate_functions::adr): New method.
1397 (AArch64_relocate_functions::adrp): Calculate immed before calling
1398 update_adr.
1399 (AArch64_relocate_functions::adrp): Likewise.
1400 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
1401 comparing x to 0. Calculate immed from ~x when x < 0.
1402 (Target_aarch64::optimize_tls_reloc): Add new cases for
1403 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1404 TLSLD_MOVW_DTPREL_G0_NC.
1405 (Target_aarch64::possible_function_pointer_reloc): Implement this
1406 method.
1407 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
1408 comment.
1409 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
1410 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1411 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1412 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
1413 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1414 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1415 (Target_aarch64::make_plt_entry): Call add_entry with two more
1416 parameters.
1417 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1418 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
1419 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1420 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1421 (Target_aarch64::Relocate::relocate_tls): Add cases for
1422 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1423 TLSLD_MOVW_DTPREL_G0_NC.
1424 * testsuite/icf_safe_so_test.cc: Correct test comment.
1425 * testsuite/icf_safe_test.sh: Add AArch64 arch.
1426
80272b8c
AM
14272014-10-22 Alan Modra <amodra@gmail.com>
1428
1429 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
1430 thread_starter.
1431
998a69f4
AS
14322014-10-18 Andreas Schwab <schwab@linux-m68k.org>
1433
1434 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
1435
aed56ec5
CC
14362014-10-17 Cary Coutant <ccoutant@google.com>
1437
1438 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1439 Add "typename" keyword.
1440
bb779192 14412014-10-15 Han Shen <shenhan@google.com>
83a01957
HS
1442 Jing Yu <jingyu@google.com>
1443
1444 Patch for gold aarch64 backend to support relaxation.
1445 * aarch64-reloc.def: Change format.
1446 * aarch64.cc (class Reloc_stub): New class.
1447 (class Stub_table): New class.
1448 (class AArch64_relobj): New class.
1449 (class AArch64_input_section): New class.
1450 (class AArch64_output_section): New class.
1451 (Target_aarch64::new_stub_table): New method.
1452 (Target_aarch64::new_aarch64_input_section): New method.
1453 (Target_aarch64::find_aarch64_input_section): New method.
1454 (Target_aarch64::scan_section_for_stubs): New method.
1455 (Target_aarch64::scan_reloc_section_for_stubs): New method.
1456 (Target_aarch64::relocate_stub): New method.
1457 (Target_aarch64::current_target): New method.
1458 (Target_aarch64::do_make_elf_object): New method.
1459 (Target_aarch64::do_may_relax): New method.
1460 (Target_aarch64::do_relax): New method.
1461 (Target_aarch64::group_sections): New method.
1462 (Target_aarch64::scan_reloc_for_stub): New method.
1463 (Target_aarch64::do_make_output_section): New method.
1464 (Target_aarch64::stub_tables_): New data member.
1465 (Target_aarch64::aarch64_input_section_map_): New data member.
1466 (AArch64_relocate_functions::maybe_apply_stub): New method.
1467
db4c9594
CC
14682014-09-30 Cary Coutant <ccoutant@google.com>
1469
1470 PR gold/17432
1471 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
1472
cd6da036
KC
14732014-09-30 Kito Cheng <kito@0xlab.org>
1474
1475 PR gold/13597
1476 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
1477 hash table before sysv-style hash table.
1478
5f772412
ST
14792014-09-29 Sriraman Tallam <tmsriram@google.com>
1480
1481 * options.h (--pic-executable): Add negative to alias to -no-pie.
1482
5efeedf6
CC
14832014-09-26 Cary Coutant <ccoutant@google.com>
1484
1485 PR gold/16773
1486 * object.cc (Sized_relobj_file): Compute value of section symbols
1487 for TLS sections the same as TLS symbols.
1488
1707f183
CC
14892014-09-25 Cary Coutant <ccoutant@google.com>
1490
1491 PR gold/17432
1492 * resolve.cc (Symbol_table::resolve): Override common placeholder
1493 symbols, but adjust sizes.
1494 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
1495 symbols to common lists.
1496
00cac886
AM
14972014-09-24 Alan Modra <amodra@gmail.com>
1498
1499 * po/POTFILES.in: Regenerate.
1500
635aa30e
CC
15012014-09-23 Taiju Tsuiki <tzik@google.com>
1502 Cary Coutant <ccoutant@google.com>
1503
71b9b91b 1504 PR gold/14860
635aa30e
CC
1505 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
1506 on input_sections_blocker.
1507 * layout.cc (Write_sections_task::locks): Unblock
1508 input_sections_blocker_.
1509 * layout.h (Write_sections_task::Write_sections_task): Add
1510 input_sections_blocker.
1511 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
1512 to DEPENDENCIES.
1513 * testsuite/Makefile.in: Regenerate.
1514
c0c71592
RÁE
15152014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1516
1517 * testsuite/Makefile.am (plugin_test_10): New test.
1518 * testsuite/Makefile.in: Regenerate
1519 * testsuite/plugin_common_test_2.c (c1): Align to 8.
1520 * testsuite/plugin_test_10.sh: New file.
1521
6168c2a1
RÁE
15222014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1523
1524 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
1525 * resolve.cc (Symbol_table::resolve): Don't override common symbols
1526 during the replacement phase.
1527
3a531937
JY
15282014-09-17 Han Shen <shenhan@google.com>
1529 Jing Yu <jingyu@google.com>
1530
1531 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
1532 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
1533 * aarch64.cc (Target_aarch64): Add data members
1534 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
1535 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
1536 constructor.
1537 (Target_aarch64::do_reloc_symbol_index): New method.
1538 (Target_aarch64::do_reloc_addend): New method.
1539 (Target_aarch64::add_tlsdesc_info): New method.
1540 (Target_aarch64::do_dynsym_value): New method.
1541 (Target_aarch64::do_make_data_plt): Add new parameters: got,
1542 got_irelative. Pass them to Output_data_plt_aarch64_standard.
1543 (Target_aarch64::make_data_plt): Add new parameters: got,
1544 got_irelative. Pass them to do_make_data_plt.
1545 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
1546 (Target_aarch64::Relocate:tls_gd_to_le): New method.
1547 (Target_aarch64::Relocate:tls_ie_to_le): New method.
1548 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
1549 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
1550 (Target_aarch64::got_tlsdesc_section): New method.
1551 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1552 (Target_aarch64::define_tls_base_symbol): New method.
1553 (Target_aarch64::reserve_tlsdesc_entries): New method.
1554 (Target_aarch64::got_mod_index_entry): New method.
1555 (Target_aarch64::rela_tlsdesc_section): New method.
1556 (Target_aarch64::rela_irelative_section): New method.
1557 (Target_aarch64::Tlsdesc_info): New struct.
1558 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
1559 relocations and tlsdesc relocations.
1560 (Target_aarch64::optimize_tls_reloc): Implement method.
1561 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
1562 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
1563 in constructor.
1564 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
1565 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
1566 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
1567 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
1568 (Output_data_plt_aarch64::rela_tlsdesc): New method.
1569 (Output_data_plt_aarch64::rela_irelative): New method.
1570 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
1571 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
1572 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
1573 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
1574 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
1575 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
1576 (Output_data_plt_aarch64_standard): New member variables:
1577 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
1578 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
1579 New parameter: got, got_irelative.
1580 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
1581 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
1582 (Output_data_plt_aarch64::do_write): Replace got_address with
1583 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
1584 (AArch64_relocate_functions::update_movnz): New method.
1585 (AArch64_relocate_functions): Correct format.
1586 (AArch64_relocate_functions::movnz): New method.
1587 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
1588 before the switch. Add new cases to switch.
00cac886 1589 Check ie_to_le relaxation on tlsie relocations. Add code handling
3a531937
JY
1590 tlsgd tlsdesc cases.
1591 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
1592 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
1593 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
1594 Call reloc_name_in_error_message to print unsupported reloc.
1595 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
1596 make_data_plt.
1597 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
1598 relocs. Fill in some more dynamic tags.
1599 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
1600 Skip call tls_get_addr when tlsgd is relaxed.
1601 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
1602 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
1603 tlsdesc->ie relaxation.
1604
62661c93
SS
16052014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1606
1607 * mips.cc (Target_mips_nacl): New class.
1608 (Target_selector_mips_nacl): New class.
1609 (target_selector_mips32): Rename from target_selector_mips32be and use
1610 Target_selector_mips_nacl instead of Target_selector_mips.
1611 (target_selector_mips32el): Rename from target_selector_mips32 and use
1612 Target_selector_mips_nacl instead of Target_selector_mips.
1613 (target_selector_mips64): Rename from target_selector_mips64be and use
1614 Target_selector_mips_nacl instead of Target_selector_mips.
1615 (target_selector_mips64el): Rename from target_selector_mips64 and use
1616 Target_selector_mips_nacl instead of Target_selector_mips.
1617 (Target_mips::mips_info): Add const attribute.
1618
54674d38
CC
16192014-09-02 Cary Coutant <ccoutant@google.com>
1620
1621 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
1622 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
1623 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
1624 (Sized_incr_dynobj::do_section_name): Likewise.
1625 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
1626 (Sized_incr_dynobj::do_section_name): Likewise.
1627 * object.h (Object::section_name): Likewise.
1628 (Object::do_section_name): Likewise.
1629 (Sized_relobj_file::do_section_name): Likewise.
1630 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
1631 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
1632
9860cbcf
CC
16332014-09-02 Cary Coutant <ccoutant@google.com>
1634
1635 PR gold/17005
1636 * ehframe.cc (Fde::write): Add output_offset parameter.
1637 (Cie::write): Likewise.
1638 (Eh_frame::set_final_data_size): Account for offset within output
1639 section.
1640 (Eh_frame::do_sized_write): Likewise.
1641 * ehframe.h (Fde::write): Add output_offset parameter.
1642 (Cie::write): Likewise.
1643 * output.cc (Output_section::Input_section_sort_entry): Remove
1644 section_has_name_; add output_section_name parameter. Use
1645 output section name for non-input sections.
1646 (Output_section::Input_section_sort_entry::section_has_name): Remove.
1647 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
1648 (Output_section::Input_section_sort_compare): Remove logic for
1649 sections without names.
1650 (Output_section::Input_section_sort_init_fini_compare): Likewise.
1651 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
1652 Likewise.
1653 (Output_section::Input_section_sort_section_name_compare): Likewise.
1654
8e33481e
HS
16552014-08-29 Han Shen <shenhan@google.com>
1656 Jing Yu <jingyu@google.com>
1657
1658 * aarch64-reloc-property.cc
1659 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
1660 reference reloc property in the table.
1661 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
1662 3 other entries.
1663 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
1664 2 new overloaded methods.
1665 (Output_data_got_aarch64::do_write): Add code to write out
1666 static relocs.
1667 (class Output_data_got_aarch64::Static_reloc): New class to wrap
1668 static relocs.
1669 (Output_data_got_aarch64::static_relocs): New vector to
1670 hold static relocs.
1671 (Target_aarch64::TCB_SIZE): New const static memeber.
1672 (Target_aarch64::tcb_size): New method.
1673 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
1674 (Target_aarch64::Relocate::relocate_tls): New method.
1675 (Target_aarch64::Scan::local): Add code handling new reloc types.
1676 (Target_aarch64::Scan::global): Add code handling new reloc types.
1677
81233653
ST
16782014-08-13 Sriraman Tallam <tmsriram@google.com>
1679
1680 * options.h (-no-pie): Add option.
1681
9363c7c3
JY
16822014-08-08 Jing Yu <jingyu@google.com>
1683 Han Shen <shenhan@google.com>
1684
1685 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
1686 (DEFFILES): add aarch64-reloc.def.
1687 (TARGETSOURCES): Add aarch64-reloc-property.cc.
1688 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
1689 * Makefile.in: Regenerate.
1690 * aarch64-reloc-property.cc: New file.
1691 * aarch64-reloc-property.h: New file.
1692 * aarch64-reloc.def: New file.
1693 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
1694 with tab to make the format consistent.
1695 (Output_data_got_aarch64::symbol_table_): New method.
1696 (Target_aarch64::do_plt_address_for_global): New method.
1697 (Target_aarch64::do_plt_address_for_local): New method.
1698 (Target_aarch64::do_select_as_default_target): New method.
1699 (Target_aarch64::do_make_data_plt): New method.
1700 (Target_aarch64::make_data_plt): New method.
1701 (Output_data_plt_aarch64::has_irelative_section): New method.
1702 (Output_data_plt_aarch64::address_for_global): New method.
1703 (Output_data_plt_aarch64::address_for_local): New method.
1704 (Output_data_plt_aarch64::irelative_rel_): New parameter.
1705 (Output_data_plt_aarch64::add_entry): Implement contents.
1706 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
1707 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
1708 the got_pov entry to plt0.
1709 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
1710 Implement contents.
1711 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
1712 (AArch64_howto): New struct.
1713 (aarch64_howto[]): New static const array.
1714 (AArch64_relocate_functions): New class.
1715 (Target_aarch64::Scan::get_reference_flags): Remove method.
1716 (Target_aarch64::Scan::local): Implement to support a few relocations.
1717 (Target_aarch64::Scan::global): Implement to support a few relocations.
1718 (Target_aarch64::make_plt_section): Implement contents.
1719 (Target_aarch64::make_plt_entry): Implement contents.
1720 (Target_aarch64::do_finalize_sections): Implement contents.
1721 (Target_aarch64::Relocate::relocate): Implement a few relocations.
1722 (Target_aarch64::relocate_section): Implement contents.
1723
ad9fe6c1
AM
17242014-08-06 Alan Modra <amodra@gmail.com>
1725
1726 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
1727
7cd4e5b7
AM
17282014-08-06 Alan Modra <amodra@gmail.com>
1729
1730 PR 13227
1731 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
1732
5ad9b0a7
ST
17332014-07-21 Sriraman Tallam <tmsriram@google.com>
1734
1735 * object.cc (Relobj::is_section_name_included): Add
7c16d96e 1736 ".rodata.nptl_version" to not garbage collect this section.
5ad9b0a7 1737
e051745c
CC
17382014-07-08 Cary Coutant <ccoutant@google.com>
1739
1740 * expression.cc (struct Expression::Expression_eval_info): Add
1741 new fields type_pointer, vis_pointer, and nonvis_pointer.
1742 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
1743 nonvis_pointer parameters. Adjust all calls.
1744 (Symbol_expression::value): Update type, visibility, and nonvis bits
1745 in caller.
1746 * script.cc (Symbol_assignment::sized_finalize): Update type,
1747 visibility, and remaining st_other bits for new symbol.
1748 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
1749 vis_pointer, and nonvis_pointer parameters.
1750 * symtab.h (Symbol::set_type): New method.
1751
1752 * testsuite/Makefile.am (defsym_test): New test.
1753 * testsuite/Makefile.in: Regenerate.
1754 * testsuite/defsym_test.c: New file.
1755 * testsuite/defsym_test.sh: New file.
1756
f35c4853
CC
17572014-07-08 Cary Coutant <ccoutant@google.com>
1758
1759 PR gold/15639
1760 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
1761 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
1762 (Sized_dynobj::base_read_symbols): ...new method.
1763 * object.h (Sized_relobj_file::base_read_symbols): New method.
1764 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
1765 (Sized_relobj_file::base_read_symbols): ...new method.
1766 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
1767 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
1768 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
1769
2900af2d
AM
17702014-07-04 Alan Modra <amodra@gmail.com>
1771
1772 * po/POTFILES.in: Regenerate.
1773
053a4d68
JY
17742014-07-02 Jing Yu <jingyu@google.com>
1775
1776 * aarch64.cc: New file
1777 * Makefile.am (TARGETSOURCES): Add aarch64.cc
1778 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
1779 * Makefile.in: Regenerate.
1780 * configure.tgt: Add entries for aarch64*.
1781 * configure.ac: Likewise.
1782 * configure: Likewise.
1783
7b549045
AM
17842014-06-27 Alan Modra <amodra@gmail.com>
1785
1786 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
1787
cb818dbf
CC
17882014-06-24 Cary Coutant <ccoutant@google.com>
1789
1790 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
1791 sections.
1792 (Dwo_file::sized_read_unit_index): Likewise.
1793
9810d34d
SS
17942014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1795
1796 * mips.cc: New file.
1797 * Makefile.am (TARGETSOURCES): Add mips.cc
1798 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
1799 * configure.tgt: Add entries for mips*.
1800 * configure.ac: Likewise.
1801 * Makefile.in: Regenerate.
1802 * configure: Likewise.
1803
9baa787b
CC
18042014-06-09 Cary Coutant <ccoutant@google.com>
1805
1806 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
1807 unit_length is within section bounds.
1808
8f89af0a
CC
18092014-06-09 Cary Coutant <ccoutant@google.com>
1810
1811 PR gold/16980
1812 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
1813 map.
1814
a47622ac
AM
18152014-06-07 Alan Modra <amodra@gmail.com>
1816
1817 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
1818
4320c691
CC
18192014-06-06 Cary Coutant <ccoutant@google.com>
1820
1821 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
1822 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
1823 (Dwarf_pubnames_table::read_header): Likewise.
1824 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
1825 .debug_gnu_pubtypes.
1826
270c9937
JB
18272014-06-05 Joel Brobecker <brobecker@adacore.com>
1828
1829 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
1830 * Makefile.in, configure: Regenerate.
1831
397998fc
AM
18322014-06-03 Alan Modra <amodra@gmail.com>
1833
1834 * powerpc.cc (addis_12_2): Define.
1835 (Stub_table::do_write): Support fusion on ELFv2 stubs.
1836
61f5c66f
AM
18372014-06-03 Alan Modra <amodra@gmail.com>
1838
1839 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
1840 st_other output.
1841
f6971787
AM
18422014-06-02 Alan Modra <amodra@gmail.com>
1843
1844 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
1845 Only ignore relocs on ELFv1.
1846 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
1847
f6fb8322
CC
18482014-05-30 Cary Coutant <ccoutant@google.com>
1849
1850 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
1851 * testsuite/Makefile.in: Regenerate.
1852 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
1853
c23dd342
L
18542014-05-27 H.J. Lu <hongjiu.lu@intel.com>
1855
1856 PR gold/16945
1857 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
1858 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
1859
5fe7ffdc
AM
18602014-05-15 Alan Modra <amodra@gmail.com>
1861
1862 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
1863 Compare FDE contents with DW_CFA_nop rather than 0.
1864
a82bef93
ST
18652014-05-13 Sriraman Tallam <tmsriram@google.com>
1866
1867 * symtab.h (may_need_copy_reloc): Remove check for position independent
1868 code.
1869 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
1870 position independence before pc absolute may_need_copy_reloc call.
1871 Add check for executable output befor pc relative may_need_copy_reloc
1872 call.
1873 * i386.cc: Ditto.
1874 * arm.cc: Ditto.
1875 * sparc.cc: Ditto.
1876 * tilegx.cc: Ditto.
1877 * powerpc.cc: Add check for no position independence before
1878 may_need_copy_reloc calls.
1879 * testsuite/pie_copyrelocs_test.cc: New file.
1880 * testsuite/pie_copyrelocs_shared_test.cc: New file.
1881 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 1882 * Makefile.in: Regenerate.
a82bef93 1883
53c66605
ML
18842014-05-08 Martin Liška <mliska@suse.cz>
1885
1886 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
1887
57b2284c
CC
18882014-05-06 Cary Coutant <ccoutant@google.com>
1889
1890 PR gold/16900
1891 * i386.cc (Output_data_got_plt_i386): New class.
1892 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
1893 parameter. Change all callers.
1894 (Output_data_plt_i386::layout_): Remove.
1895 (Output_data_plt_i386::got_plt_): Change type.
1896 (Target_i386::got_plt_): Change type. Change all references.
1897 (Target_i386::got_section): Create instance of new class.
1898 (Output_data_got_plt_i386::do_write): New function.
1899 * x86_64.cc (Output_data_got_plt_x86_64): New class.
1900 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
1901 parameter. Change all callers.
1902 (Output_data_plt_x86_64::layout_): Remove.
1903 (Output_data_plt_x86_64::got_plt_): Change type.
1904 (Target_x86_64::got_plt_): Change type. Change all references.
1905 (Target_x86_64::got_section): Create instance of new class.
1906 (Output_data_got_plt_x86_64::do_write): New function.
1907 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
1908 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
1909 class.
1910
6b97515d 19112014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 1912
6b97515d
CC
1913 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
1914 if we have pubnames/pubtypes.
1915
d1bddd3c
CC
19162014-05-02 Cary Coutant <ccoutant@google.com>
1917
5fe7ffdc
AM
1918 * defstd.cc (in_segment): Define __ehdr_start here...
1919 * layout.cc (Layout::finalize): ...Instead of here. Set the
1920 output segment when known.
1921 * resolve.cc (Symbol::override_base_with_special): Remember
1922 the original binding.
1923 * symtab.cc (Symbol::set_output_segment): New function.
1924 (Symbol::set_undefined): New function.
1925 * symtab.h (Symbol::is_weak_undefined): Check original undef
1926 binding.
1927 (Symbol::is_strong_undefined): New function.
1928 (Symbol::set_output_segment): New function.
1929 (Symbol::set_undefined): New function.
1930 * target-reloc.h (is_strong_undefined): Remove.
1931 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
1932 Check for hidden undefs.
1933 (relocate_section): Call Symbol::is_strong_undefined.
1934
1935 * testsuite/Makefile.am (ehdr_start_test_1)
1936 (ehdr_start_test_2, ehdr_start_test_3)
1937 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
1938 * testsuite/Makefile.in: Regenerate.
1939 * testsuite/ehdr_start_def.cc: New source file.
1940 * testsuite/ehdr_start_test.cc: New source file.
1941 * testsuite/ehdr_start_test.t: New linker script.
1942 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 1943
7849f6d8
CC
19442014-04-23 Cary Coutant <ccoutant@google.com>
1945
bf2cc635 1946 PR gold/16870
7849f6d8
CC
1947 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
1948
99fd8cff
CC
19492014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1950
1951 * layout.cc (Layout::include_section): Allow a target to decide
1952 whether to include a section.
1953 * target.h (Target::should_include_section): New function.
1954 (Target::do_should_include_section): New function.
1955
91f43acd
CC
19562014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1957
1958 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
1959 inline into ...
1960 (Copy_relocs::emit): ... here.
1961 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
1962 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
1963 (Copy_reloc_entry::entries_): Change from private to protected.
1964
c4eb27e1
ST
19652014-04-02 Sriraman Tallam <tmsriram@google.com>
1966
1967 * icf.cc (get_section_contents): Replace copies of reloc
1968 vectors with const references.
1969
ae447ddd
CC
19702014-04-02 Cary Coutant <ccoutant@google.com>
1971
1972 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
1973 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
1974 * configure: Regenerate.
1975 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
1976 -fno-use-linker-plugin.
1977 (LINK1, CXXLINK1): Add it to the link command.
1978 * testsuite/Makefile.in: Regenerate.
1979
fa47fa92
AM
19802014-03-12 Alan Modra <amodra@gmail.com>
1981
1982 * Makefile.in: Regenerate.
1983
9b12c500
CC
19842014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1985
1986 * symtab.h (Symbol::set_nonvis): New function.
1987
beacaa96
CC
19882014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1989
1990 * symtab.cc (Sized_symbol<32>::init_output_data):
1991 Instantiate the template.
1992 (Sized_symbol<64>::init_output_data): Likewise.
1993
800d9823
CC
19942014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1995
1996 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
1997 adjust dynamic symbol value.
1998 * target.h (Target::adjust_dyn_symbol): New function.
1999 (Target::do_adjust_dyn_symbol): New function.
2000
918fc1f8 20012014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 2002
918fc1f8
CC
2003 * output.cc (Output_data_dynamic::Dynamic_entry::write):
2004 Get the value of DYNAMIC_CUSTOM dynamic entry.
2005 * output.h (Output_data_dynamic::add_custom): New function.
2006 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
2007 dynamic entry.
2008 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
2009 * target.h (Target::dynamic_tag_custom_value): New function.
2010 (Target::do_dynamic_tag_custom_value): New function.
2011
98ff9231
CC
20122014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2013
2014 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
2015 dynsym indexes.
2016 * target.h (Target::has_custom_set_dynsym_indexes): New function.
2017 (Target::do_has_custom_set_dynsym_indexes): New function.
2018 (Target::set_dynsym_indexes): New function.
2019 (Target::do_set_dynsym_indexes): New function.
2020
b80eed39
AM
20212014-03-07 Alan Modra <amodra@gmail.com>
2022
2023 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
2024 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
2025 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
2026 (Powerpc_relocate_functions::has_overflow_bitfield,
2027 overflowed): Use the above.
2028 (Target_powerpc::Relocate::relocate): Correct overflow checking
2029 for a number of relocations. Modify overflow test for 16-bit
2030 fields in instructions to signed/unsigned according to whether
2031 the field takes a signed or unsigned value.
2032
4b95cf5c
AM
20332014-03-05 Alan Modra <amodra@gmail.com>
2034
2035 Update copyright years.
2036
45965137
AM
20372014-03-05 Alan Modra <amodra@gmail.com>
2038
2039 * powerpc.cc (Target_powerpc::Scan::local, global): Support
2040 R_PPC64_ADDR64_LOCAL.
2041 (Target_powerpc::Relocate::relocate): Likewise.
2042
2c80b753
AM
20432014-03-03 Alan Modra <amodra@gmail.com>
2044
2045 * dwp.cc (print_version): Update copyright year to current.
2046
c1c69e83
AM
20472014-02-10 Alan Modra <amodra@gmail.com>
2048
2049 * po/gold.pot: Regenerate.
2050
dd0c4e70
CC
20512014-02-06 Cary Coutant <ccoutant@google.com>
2052
2053 Fix problem where -u is ignored when a weak undef is seen.
2054
2055 * archive.cc (Library_base::should_include_member): Reorder
2056 code to check for -u option if a weak undef has already been seen.
2057 * testsuite/Makefile.am (weak_undef_test_2): New test case.
2058 * testsuite/Makefile.in: Regenerate.
2059 * testsuite/weak_undef_file3.cc: New file.
2060 * testsuite/weak_undef_file4.cc: New file.
2061 * testsuite/weak_undef_test_2.cc: New file.
2062
1a221d3d
CC
20632014-02-05 Cary Coutant <ccoutant@google.com>
2064
2065 Fix issues with gold undefined symbol diagnostics.
2066
2067 PR binutils/15435
2068 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
2069 check to here.
2070 * target-reloc.h (is_strong_undefined): New function.
2071 (relocate_section): Move undef vtable symbol check from here.
2072 Check for is_strong_undefined.
2073
e889f0a4 20742014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 2075
e889f0a4
CC
2076 Fix problems with the --dynamic-list option.
2077
2078 PR gold/13577
2079 * options.cc (General_options::parse_dynamic_list):
2080 Set have_dynamic_list_.
2081 (General_options::General_options): Initialize have_dynamic_list_.
2082 (General_options::finalize): Turn off -Bsymbolic and
2083 -Bsymbolic-functions if --dynamic-list provided.
2084 * options.h (General_options::have_dynamic_list): New function.
2085 (General_options::have_dynamic_list_): New data member.
2086 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
2087 correctly.
5fe7ffdc 2088
e889f0a4
CC
2089 PR gold/16530
2090 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
2091 in --dynamic-list, mark it.
5fe7ffdc 2092
e889f0a4
CC
2093 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
2094 (dynamic_list_2): New test case.
2095 * testsuite/Makefile.in: Regenerate.
2096 * testsuite/dynamic_list_2.cc: New file.
2097 * testsuite/dynamic_list_2.t: New file.
2098 * testsuite/dynamic_list_lib1.cc: New file.
2099 * testsuite/dynamic_list_lib2.cc: New file.
2100 * testsuite/gc_dynamic_list_test.c: New file.
2101 * testsuite/gc_dynamic_list_test.sh: New file.
2102 * testsuite/gc_dynamic_list_test.t: New file.
2103
ec673e64
CC
21042014-01-28 Cary Coutant <ccoutant@google.com>
2105
2106 Add .gdb_index version 7 support.
2107
2108 * gold/dwarf_reader.cc: include <utility> (for make_pair).
2109 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
2110 debug sections.
2111 (Dwarf_ranges_table::read_ranges_table): Likewise.
2112 (Dwarf_pubnames_table::read_section): Check for GNU-style
2113 sections, and for compressed debug sections.
2114 (Dwarf_pubnames_table::read_header): Compute end address of table.
2115 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
2116 for end of list by offset, not by offset == 0.
2117 (Dwarf_info_reader::do_read_string_table): Check for compressed
2118 debug sections.
2119 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2120 Initialize new data members.
2121 (Dwarf_pubnames_table::next_name): return flag_byte.
2122 (Dwarf_pubnames_table::end_of_table_): New data member.
2123 (Dwarf_pubnames_table::is_gnu_style_): New data member.
2124 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
2125 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
2126 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
2127 read skeleton type unit DIEs.
2128 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
2129 (Gdb_index::do_write): Write flag_byte.
2130 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
2131 (Gdb_index::Cu_vector): Store flags along with cu indexes.
2132 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
2133 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
2134
221fd5d5
L
21352014-01-08 H.J. Lu <hongjiu.lu@intel.com>
2136
2137 * version.cc (print_version): Update copyright year to 2014.
2138
6c09fb0b
ILT
21392013-12-19 Dimitry Andric <dimitry@andric.com>
2140
2141 * stringpool.cc (Stringpool_template::reserve): Add
2142 HAVE_UNORDERED_MAP case.
2143 * stringpool.cc (Stringpool_template::print_stats): Likewise.
2144
8356f2d0
CC
21452013-12-18 Cary Coutant <ccoutant@google.com>
2146
2147 * configure.ac: Check for <unordered_set> and <unordered_map>.
2148 * config.in: Regenerate.
2149 * configure: Regenerate.
2150 * system.h: Use <unordered_set> and <unordered_map> if available.
2151
f2c7d7ee
RM
21522013-12-10 Roland McGrath <mcgrathr@google.com>
2153
2154 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
2155 with $(INSTALL_PROGRAM_ENV).
2156 * Makefile.in: Regenerate.
2157
6632e8cc
CC
21582013-11-22 Cary Coutant <ccoutant@google.com>
2159
2160 * configure.ac: Add check for which library is needed for
2161 dlopen.
2162 * configure: Regenerate.
2163
0c075858
CC
21642013-11-22 Cary Coutant <ccoutant@google.com>
2165
2166 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
2167 assembler.
2168 * testsuite/Makefile.in: Regenerate.
2169
f49fe902
L
21702013-11-17 H.J. Lu <hongjiu.lu@intel.com>
2171
2172 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
2173 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
2174 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
2175 (Target_x86_64<size>::Scan::local): Likewise.
2176 (Target_x86_64<size>::Scan::global): Likewise.
2177 (Target_x86_64<size>::Relocate::relocate): Likewise.
2178 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
2179 Likewise.
2180 (Target_x86_64<size>::Scan::check_non_pic(): Handle
2181 R_X86_64_PC32_BND.
2182
2183 * testsuite/Makefile.am (check_PROGRAMS): Add
2184 exception_x86_64_bnd_test.
2185 (exception_x86_64_bnd_test_SOURCES): New macro.
2186 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
2187 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
2188 (exception_x86_64_bnd_test_LDADD): Likewise.
2189 (exception_x86_64_bnd_1.o): New rule.
2190 (exception_x86_64_bnd_2.o): Likewise.
2191 * testsuite/Makefile.in: Regenerated.
2192
9055360d
AM
21932013-11-15 Alan Modra <amodra@gmail.com>
2194
2195 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
2196 accessor.
2197 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
2198 Only call ppc64_local_entry_offset for 64-bit. Restrict
2199 symval_for_branch lookup to ELFv1.
2200 (Stub_table::add_plt_call_entry): Use unsigned int off.
2201 (Output_data_glink::Address, invalid_address): New.
2202 (Output_data_glink::add_eh_frame): Move out of line. Add
2203 support for ELFv2.
2204 (Output_data_glink::add_global_entry, find_global_entry,
2205 global_entry_address): New functions.
2206 (Output_data_glink::global_entry_stubs_, end_branch_table_,
2207 ge_size): New variables.
2208 (Output_data_glink::set_final_data_size): Add global entry
2209 stub sizing.
2210 (Output_data_glink::do_write): Write global entry stubs.
2211 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
2212 parameter. Return true for ELFv2. Adjust callers.
2213 (Target_powerpc::Scan::local, global): Restrict opd lookup to
2214 ELFv1. Similarly for ifunc and dynamic relocation processing
2215 specific to ELFv1. Recognize that symbols are defined on
2216 their plt entries for ELFv2.
2217 (Target_powerpc::symval_for_branch): Assert if called for
2218 ELFv2 or ppc32.
2219 (Target_powerpc::Relocate::relocate): Use global entry plt
2220 stub for symbol value if such exists on ELFv2.
2221 (Target_powerpc::Relocate::relocate): Don't call
2222 symval_for_branch when ELFv2. Do adjust for local entry
2223 offset when ELFv2.
2224 (Target_powerpc::do_dynsym_value): Set symbols to global entry
2225 plt stub for ELFv2.
2226 (Target_powerpc::do_plt_address_for_global): Similarly.
2227
cafdd569
CC
22282013-11-14 Cary Coutant <ccoutant@google.com>
2229
2230 Revert patch -- this did not fix the problem, and there is
2231 no race there.
2232
2233 2013-11-14 Cary Coutant <ccoutant@google.com>
2234
2235 PR gold/14860
2236 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2237 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2238 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2239 updating fde_offsets_.
2240 (Eh_frame_hdr::lock_): New data member.
2241
94e49e16
CC
22422013-11-14 Cary Coutant <ccoutant@google.com>
2243
2244 * dwp.cc (Dwo_file_entry): New type.
2245 (File_list): Use Dwo_file_entry.
2246 (Dwo_file::verify): New function.
2247 (Dwo_file::verify_dwo_list): New function.
2248 (Dwo_file::sized_verify_dwo_list): New function.
2249 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
2250 list.
2251 (Dwp_options): New enum type.
2252 (dwp_options): Add --verify-only.
2253 (usage): Likewise.
2254 (main): Likewise.
2255 * dwp.h (gold_info): Add declaration.
2256
7cdd7d57
CC
22572013-11-14 Cary Coutant <ccoutant@google.com>
2258
2259 PR gold/14860
2260 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2261 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2262 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2263 updating fde_offsets_.
2264 (Eh_frame_hdr::lock_): New data member.
2265
1d946cb3
CC
22662013-11-06 Cary Coutant <ccoutant@google.com>
2267
2268 PR gold/15758
2269 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
2270 before reloc sections.
2271
4f65b40e
AM
22722013-11-04 Alan Modra <amodra@gmail.com>
2273
2274 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
2275 (Symbol::needs_dynamic_reloc): Test new flag.
2276 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
2277 (Target_powerpc::Scan::get_reference_flags): Add target param.
2278 Return FUNC_DESC_ABI for 64-bit ELFv1.
2279 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
2280 call.
2281 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
2282 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
2283
908794a9
CC
22842013-10-31 Cary Coutant <ccoutant@google.com>
2285
2286 Restore support for dwp v2 DWARF package file format.
2287
2288 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2289 tu_length parameter. Adjust all callers.
2290 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2291 * dwp.cc: Include dwarf.h.
2292 (Section_bounds): New struct type.
2293 (Unit_set): New struct type.
2294 (Dwo_file::Dwo_file): Initialize new data member.
2295 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2296 Combine and rename to...
2297 (Dwo_file::read_unit_index): ...this.
2298 (Dwo_file::sized_read_compunit_index)
2299 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2300 (Dwo_file::sized_read_unit_index): ...this.
2301 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2302 parameters; add section_id parameter.
2303 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2304 (Dwo_file::add_unit_set): ...this.
2305 (Dwo_file::shndx_map_): Remove.
2306 (Dwo_file::sect_offsets_): New data member.
2307 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2308 (Dwp_output_file::add_section): Rename to...
2309 (Dwp_output_file::add_contribution): ...this.
2310 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2311 (Dwp_output_file::add_tu_set): Likewise.
2312 (Dwp_output_file::Contribution): New type.
2313 (Dwp_output_file::Section::contributions): New data member.
2314 (Dwp_output_file::Cu_or_tu_set): Remove.
2315 (Dwp_output_file::Section::Section): New ctor.
2316 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2317 (Dwp_output_file::Dwp_index::Section_table): New type.
2318 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2319 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2320 parameter.
2321 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2322 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2323 (Dwp_output_file::Dwp_index::section_table): New member function.
2324 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2325 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2326 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2327 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2328 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2329 (Dwp_output_file::Dwp_index::section_table_): New data member.
2330 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2331 (Dwp_output_file::add_output_section): New member function.
2332 (Dwp_output_file::write_new_section): New member function.
2333 (Dwp_output_file::write_contributions): New member function.
2334 (Dwp_output_file::section_id_map_): New data member.
2335 (class Dwo_id_info_reader): Remove.
2336 (class Unit_reader): New class.
2337 (get_dwarf_section_name): New function.
2338 (Dwo_file::read_executable): Adjust initializations of class data.
2339 (Dwo_file::read): Add support for v2 package file format.
2340 (Dwo_file::read_unit_index): Likewise.
2341 (Dwo_file::sized_read_unit_index): Likewise.
2342 (Dwo_file::copy_section): Likewise.
2343 (Dwo_file::add_unit_set): Likewise.
2344 (Dwp_output_file::add_output_section): Likewise.
2345 (Dwp_output_file::add_contribution): Likewise.
2346 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2347 for empty slot.
2348 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2349 file format.
2350 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2351 slot.
2352 (Dwp_output_file::initialize): Remove unused function.
2353 (Dwp_output_file::finalize): Add support for v2 package file format.
2354 (Dwp_output_file::write_index): Likewise.
2355 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2356 function prototype.
2357
2500c017
CC
23582013-10-31 Cary Coutant <ccoutant@google.com>
2359
2360 * configure.ac: Fix check for -fmerge-constants.
2361 * configure.ac: Regenerate.
2362
dd0845d7
RM
23632013-10-30 Roland McGrath <mcgrathr@google.com>
2364
2365 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
2366 Correct 9-byte nop sequence to match what the assembler generates.
2367
b4f7960d
AM
23682013-10-30 Alan Modra <amodra@gmail.com>
2369
2370 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
2371 ppc64_local_entry_offset, ppc64_local_entry_offset,
2372 do_read_symbols): New functions.
2373 (Powerpc_relobj::e_flags_, st_other_): New vars.
2374 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
2375 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
2376 (Powerpc_relobj::e_flags_): New var.
2377 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
2378 and adjust for ELFv2.
2379 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
2380 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
2381 (Powerpc_dynobj::do_find_special_sections): Likewise.
2382 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
2383 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
2384 to ELFv2 local entry.
2385 (Target_powerpc::do_relax): No thread safe barriers needed for
2386 ELFv2.
2387 (Output_data_plt_powerpc::initial_plt_entry_size_,
2388 plt_entry_size): Delete. Replace all uses with
2389 first_plt_entry_offset() and plt_entry_size().
2390 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
2391 reserved_size parm. Update callers.
2392 (Output_data_plt_powerpc::entry_count): Update.
2393 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
2394 and use Target_powerpc::first_plt_entry_offset().
2395 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
2396 rename to plt_entry_size.
2397 (Output_data_plt_powerpc::add_ifunc_entry,
2398 add_local_ifunc_entry): Adjust reloc for ELFv2.
2399 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
2400 (glink_eh_frame_fde_64v2): New.
2401 (Stub_table::plt_call_size): Support ELFv2 sizing.
2402 (Output_data_glink::add_eh_frame): Use the new FDE.
2403 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
2404 (Stub_table::do_write): Write ELFv2 stubs and glink.
2405 (Target_powerpc::Relocate::relocate): Replaces nop after call
2406 with ld 2,24(1) and adjust local offset destination for ELFv2.
2407
f9c6b907
AM
24082013-10-30 Alan Modra <amodra@gmail.com>
2409
2410 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
2411 (Target_powerpc::Scan::global, local): Likewise.
2412 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
2413 on all ppc64 @h and @ha relocs.
2414
e84fe78f
AM
24152013-10-14 Alan Modra <amodra@gmail.com>
2416
2417 * output.h (Output_data_got::add_constant): Tidy.
2418 (Output_data_got::add_constant_pair): New function.
2419 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
2420 methods used so as to first call reserve_ent().
2421
679e4abf
RM
24222013-10-11 Roland McGrath <mcgrathr@google.com>
2423
44dcb735
RM
2424 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
2425 add_got_entry and add_got_entry_pair.
2426
13323c49
RM
2427 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
2428 (HAVE_PUBNAMES): Likewise.
2429 * configure: Regenerate.
2430
1496b446
RM
2431 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
2432 * testsuite/Makefile.in: Regenerate.
2433
cc84c10b
RM
2434 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
2435 Remove const from declaration.
2436 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
2437 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
2438 * output.h (Output_file_header): Remove const from member target_
2439 and corresponding constructor argument.
2440 * output.cc (Output_file_header::Output_file_header): Update prototype.
2441 (Output_file_header::do_sized_write): Use this->target_ in place
2442 of parameters()->target().
2443
52f66a2c
RM
2444 * testsuite/undef_symbol.cc (Foo::get_a): New method.
2445
2b64b551
RM
2446 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
2447 * configure: Regenerate.
2448 * Makefile.in: Regenerate.
2449 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
2450 * testsuite/merge_string_literals_2.c: Likewise.
2451 * testsuite/Makefile.am
2452 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
2453 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
2454 literal -fmerge-constants.
2455 * testsuite/Makefile.in: Regenerate.
2456
43819297
RM
2457 * i386.cc (Target_i386): Remove unused member dynbss_.
2458 * arm.cc (Target_arm): Likewise.
2459 * powerpc.cc (Target_powerpc): Likewise.
2460 * sparc.cc (Target_sparc): Likewise.
2461 * tilegx.cc (Target_tilegx): Likewise.
2462 * x86_64.cc (Target_x86_64): Likewise.
2463 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
2464 type_signature_, type_offset_.
2465 * plugin.h (Plugin_hook): Remove unused member layout_.
2466 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
2467 mapfile_.
2468 (Read_member): Remove unused members input_objects_, symtab_,
2469 mapfile_, layout_.
2470 (Check_library): Remove unused member symtab_.
2471 * archive.h (Lib_group): Remove unused member lib_.
2472 * archive.cc (Lib_group::Lib_group): Update initializer.
2473 * incremental.h (Incremental_binary): Remove unused member target_.
2474 (Incremental_script_entry): Removed unused member script_.
2475 * layout.h (Write_symbols_task): Remove unused member input_objects_.
2476 * icf.h (Icf): Remove unused member num_tracked_relocs.
2477
39d9ead7
RM
2478 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
2479 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
2480 its only use.
2481 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
2482
679e4abf
RM
2483 * archive.h: Use struct rather than class for forward declaration
2484 of Read_symbols_data.
2485
54de2ea6
CC
24862013-10-07 Cary Coutant <ccoutant@google.com>
2487
2488 PR gold/16010
2489 * testsuite/Makefile.am (icf_test): Fix dependencies.
2490 (icf_safe_test): Likewise.
2491 (icf_safe_so_test): Likewise.
2492 (large_symbol_alignment): Add empty _LDADD rule.
2493 * testsuite/Makefile.in: Regenerate.
2494
b14016f0
L
24952013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
2496
2497 PR gold/15927
2498 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
2499 relocation for R_X86_64_32 on x32.
2500
eb426534
RM
25012013-08-27 Roland McGrath <mcgrathr@google.com>
2502
2503 * output.cc (Output_segment::set_section_addresses): Take new
2504 Target* argument. If target->isolate_execinstr() and the segment
2505 is executable and starts at a target->abi_pagesize() boundary,
2506 pad its end out to a target->abi_pagesize() boundary with code fill.
2507 * output.h (Output_segment::set_section_addresses): Update decl.
2508 * layout.h (Layout::check_output_data_for_reset_values): Take new
2509 argument RELAX_OUTPUTS.
2510 (Layout): New member relax_output_list_.
2511 (Layout::add_relax_output): New method.
2512 * layout.cc (Layout::Layout): Update constructor.
2513 (Layout::reset_relax_output): New method.
2514 (Layout::clean_up_after_relaxation): Call it.
2515 (Layout::prepare_for_relaxation): Update caller.
2516 (Layout::set_segment_offsets): Update callers of set_section_addresses.
2517 Call reset_relax_output before re-processing segments for
2518 isolate_execinstr case.
2519 (Layout::write_data): Handle relax_output_list_.
2520 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
2521 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
2522
9aff4b7a
NC
25232013-08-23 Yuri Chornoivan <yurchor@ukr.net>
2524
2525 PR binutils/15834
2526 * object.h: Fix typos.
2527
93f8221c
RM
25282013-08-16 Roland McGrath <mcgrathr@google.com>
2529
2530 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
2531 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
2532
e44c3715
CC
25332013-08-07 Cary Coutant <ccoutant@google.com>
2534
2535 Revert support for v2 DWP files:
2536
2537 2013-03-01 Cary Coutant <ccoutant@google.com>
2538
2539 Add dwp support for v2 DWARF package file format.
2540 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2541 tu_length parameter. Adjust all callers.
2542 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2543 * dwp.cc: Include dwarf.h.
2544 (Section_bounds): New struct type.
2545 (Unit_set): New struct type.
2546 (Dwo_file::Dwo_file): Initialize new data member.
2547 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2548 Combine and rename to...
2549 (Dwo_file::read_unit_index): ...this.
2550 (Dwo_file::sized_read_compunit_index)
2551 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2552 (Dwo_file::sized_read_unit_index): ...this.
2553 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2554 parameters; add section_id parameter.
2555 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2556 (Dwo_file::add_unit_set): ...this.
2557 (Dwo_file::shndx_map_): Remove.
2558 (Dwo_file::sect_offsets_): New data member.
2559 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2560 (Dwp_output_file::add_section): Rename to...
2561 (Dwp_output_file::add_contribution): ...this.
2562 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2563 (Dwp_output_file::add_tu_set): Likewise.
2564 (Dwp_output_file::Contribution): New type.
2565 (Dwp_output_file::Section::contributions): New data member.
2566 (Dwp_output_file::Cu_or_tu_set): Remove.
2567 (Dwp_output_file::Section::Section): New ctor.
2568 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2569 (Dwp_output_file::Dwp_index::Section_table): New type.
2570 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2571 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2572 parameter.
2573 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2574 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2575 (Dwp_output_file::Dwp_index::section_table): New member function.
2576 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2577 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2578 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2579 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2580 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2581 (Dwp_output_file::Dwp_index::section_table_): New data member.
2582 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2583 (Dwp_output_file::add_output_section): New member function.
2584 (Dwp_output_file::write_new_section): New member function.
2585 (Dwp_output_file::write_contributions): New member function.
2586 (Dwp_output_file::section_id_map_): New data member.
2587 (class Dwo_id_info_reader): Remove.
2588 (class Unit_reader): New class.
2589 (get_dwarf_section_name): New function.
2590 (Dwo_file::read_executable): Adjust initializations of class data.
2591 (Dwo_file::read): Add support for v2 package file format.
2592 (Dwo_file::read_unit_index): Likewise.
2593 (Dwo_file::sized_read_unit_index): Likewise.
2594 (Dwo_file::copy_section): Likewise.
2595 (Dwo_file::add_unit_set): Likewise.
2596 (Dwp_output_file::add_output_section): Likewise.
2597 (Dwp_output_file::add_contribution): Likewise.
2598 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2599 for empty slot.
2600 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2601 file format.
2602 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2603 slot.
2604 (Dwp_output_file::initialize): Remove unused function.
2605 (Dwp_output_file::finalize): Add support for v2 package file format.
2606 (Dwp_output_file::write_index): Likewise.
2607 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2608 function prototype.
2609
c6905c28
CC
26102013-07-31 Cary Coutant <ccoutant@google.com>
2611
2612 * object.cc (Sized_relobj::do_output_section_address): New function.
2613 (Sized_relobj): Instantiate explicitly.
2614 * object.h (Object::output_section_address): New function.
2615 (Object::do_output_section_address): New function.
2616 (Sized_relobj::do_output_section_address): New function.
2617 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
2618
26192013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 2620 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
2621
2622 * parameters.cc (Parameters::entry): Return target-specific entry
2623 symbol name.
2624 * target.h (Target::entry_symbol_name): New function.
2625 (Target_info::entry_symbol_name): New data member.
2626
2627 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
2628 * i386.cc (Target_i386::i386_info): Likewise.
2629 (Target_i386_nacl::i386_nacl_info): Likewise.
2630 * sparc.cc (Target_sparc::sparc_info): Likewise.
2631 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
2632 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
2633 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
2634 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
2635
234d4ab8
SA
26362013-07-22 Sterling Augustine <saugustine@google.com>
2637
2638 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
2639 Convert parameter shndx to local variable. Add parameters symtab
2640 and symtab_size. Scan over section names. Find relocation
2641 section corresponding to current section. Create and initialize
2642 reloc_mapper_ and reloc_type_.
2643 (Dwarf_pubnames_table::read_header): Add assertion. Change
2644 unit_length to off_t. Initialize member unit_length_. Fill in field
2645 cu_offset_.
2646 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2647 Initialize new fields unit_length_ and cu_offset_.
2648 (Dwarf_pubnames_table::read_section): Update prototype.
2649 (Dwarf_pubnames_table::cu_offset): New member function.
2650 (Dwarf_pubnames_table::subsection_size): Likewise.
2651 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
2652 New fields.
2653 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
2654 member functions public.
2655 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
2656 Update comment. Rework logic. Move repeated parts to...
2657 (Gdb_index_info_reader::read_pubtable): ...here. New function.
2658 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
2659 pubtypes_table_, and stmt_list_offset.
2660 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2661 Gdb_index::find_pubtype_offset,
2662 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
2663 (Gdb_index::pubnames_read): Update prototype and rework logic.
2664 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
2665 Forward declare.
2666 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2667 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
2668 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
2669 Gdb_index::map_pubtable_to_dies):
2670 Declare functions.
2671 (Gdb_index::pubnames_read): Update declaration.
2672 (Gdb_index::Pubname_offset_map): New type.
2673 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
2674 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
2675 Gdb_index::stmt_list_offset): Declare.
2676 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
2677 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
2678 Gdb_index::pubtypes_offset_): Remove.
2679
a3ed37d8
RM
26802013-07-19 Roland McGrath <mcgrathr@google.com>
2681
2682 * options.h (General_options): Add -Trodata-segment option.
2683 * parameters.cc (Parameters::check_rodata_segment): New function.
2684 (Parameters::set_target_once): Call it.
2685 * parameters.h (Parameters): Declare it (private member function).
2686 * layout.cc (load_seg_unusable_for_headers): New function, broken
2687 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
2688 then validate rodata segment rather than text segment.
2689 (relaxation_loop_body): Call that.
2690 (is_text_segment): New function. Don't admit a non-executable
2691 segment if TARGET->isolate_execinstr().
2692 (set_segment_offsets): Call it. Honor -Trodata-segment option.
2693
eb5b4ded
CC
26942013-07-15 Shawn Landden <shawnlandden@gmail.com>
2695
2696 PR gold/15070
2697 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
2698 * nacl.h (Sniff_file::View::View): Request aligned view.
2699
4d5effb9
CC
27002013-07-11 Cary Coutant <ccoutant@google.com>
2701
2702 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
2703 correct BRLT entry size.
2704
ba8ca3e7
AM
27052013-07-03 Alan Modra <amodra@gmail.com>
2706
2707 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
2708 comment.
2709
267257d2
CC
27102013-07-01 Cary Coutant <ccoutant@google.com>
2711
2712 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
2713 reloc_type_.
2714 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
2715 (Dwarf_ranges_table::lookup_reloc): New function.
2716 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
2717 reloc_type_.
2718 (Dwarf_ranges_table::lookup_reloc): New function.
2719 (Dwarf_ranges_table::reloc_type_): New data member.
2720
06f30c9d
CC
27212013-06-27 Jing Yu <jingyu@google.com>
2722
2723 PR gold/15662
2724 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
2725 function.
2726 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
2727 (Target_powerpc::do_relax): Call the above.
2728
a2d7bf59
AM
27292013-06-27 Cary Coutant <ccoutant@google.com>
2730
2731 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
2732 on garbage collected .opd section.
2733
27342013-06-27 Alan Modra <amodra@gmail.com>
2735
2736 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
2737 is non-zero.
2738 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
2739 (Target_powerpc::do_function_location): Likewise for loc->shndx.
2740
32364e50
CC
27412013-06-14 Cary Coutant <ccoutant@google.com>
2742
2743 * resolve.cc (Symbol::override_base): Don't override st_type
2744 from plugin placeholder symbols.
2745 (Symbol_table::resolve): Likewise.
2746 (Symbol_table::should_override): Don't complain about TLS mismatch
2747 if the TO symbol is a plugin placeholder.
2748 * testsuite/Makefile.am (plugin_test_tls): New test.
2749 * testsuite/Makefile.in: Regenerate.
2750 * testsuite/plugin_test_tls.sh: New test script.
2751 * testsuite/two_file_test_2_tls.cc: New test source.
2752 * testsuite/two_file_test_tls.cc: New test source.
2753
7fb47cc9
CC
27542013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
2755
2756 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
2757 the maximum segment alignment is larger than the page size.
2758 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
2759 correctly aligns the symbols with large alignemnt.
2760 * testsuite/Makefile.in: Regenerate.
2761 * testsuite/large_symbol_alignment.cc: New file.
2762
6934001a
CC
27632013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
2764 Sriraman Tallam <tmsriram@google.com>
2765
2766 * options.h (sort_section): New option.
2767 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
2768 Rename from Input_section_sort_section_name_special_ordering_compare.
2769 (Input_section_sort_section_name_compare): New struct.
2770 * output.cc (Output_section::Input_section_sort_section_name_compare::
2771 operator()): New function.
2772 (Output_section::sort_attached_input_sections): Use new sort function
2773 for .text if --sort-section=name is specified.
2774 * layout.cc (Layout::make_output_section):
2775 Add sorting by name when --sort-section=name is specified.
2776 * testsuite/Makefile.am (text_section_grouping): Test option
2777 --sort-section=name.
2778 * testsuite/Makefile.in: Regenerate.
2779 * testsuite/section_sorting_name.cc: New file.
2780 * testsuite/section_sorting_name.sh: New file.
2781
93acabad
CC
27822013-05-21 Cary Coutant <ccoutant@google.com>
2783
2784 * symtab.h (Symbol::is_cxx_vtable): New function.
2785 * target-reloc.h (relocate_section): Check for vtable symbol.
2786 * testsuite/Makefile.am (missing_key_func.sh): New test case.
2787 * testsuite/Makefile.in: Regenerate.
2788 * testsuite/missing_key_func.cc: New test source.
2789 * testsuite/missing_key_func.sh: New test script.
2790
60e8b3fc
CC
27912013-05-21 Cary Coutant <ccoutant@google.com>
2792
2b64b551
RM
2793 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
2794 type of enclosing symbol.
2795 (Relocate_info::location): Check symbol type when describing symbol.
2796 * object.h (Symbol_location_info): Remove unused line_number;
2797 add enclosing_symbol_type.
2798 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 2799
9df9de2c
CC
28002013-05-13 Cary Coutant <ccoutant@google.com>
2801
2b64b551
RM
2802 * configure.ac: Export DEFAULT_TARGET.
2803 * configure: Regenerate.
2804 * Makefile.in: Regenerate.
2805 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
2806 * testsuite/Makefile.in: Regenerate.
2807 * testsuite/debug_msg.sh: Delete duplicate tests.
2808 Don't check undef_int error message match for powerpc where the
2809 source file and line number aren't available.
9df9de2c 2810
bbc5ae17
RM
28112013-05-10 Roland McGrath <mcgrathr@google.com>
2812
2813 * options.h (General_options): Add --rosegment-gap option.
2814 * options.cc (finalize): --rosegment-gap implies --rosegment.
2815 * layout.cc (set_segment_offsets): Let user option override
2816 target->rosegment_gap().
2817
0c6e6c39
RM
28182013-05-10 Roland McGrath <mcgrathr@google.com>
2819
2820 * options.h (General_options): Remove leading space from help
2821 messages for -nostdlib and --rosegment.
2822
cde7cb01
MR
28232013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
2824
2825 PR ld/15365
2826 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
2827
f31ae5b8
AM
28282013-05-03 Alan Modra <amodra@gmail.com>
2829
2830 * merge.cc (Output_merge_string::do_add_input_section): Correct
2831 scan for number of strings. Rename vars to avoid shadowing.
2832 Include missing terminator in input_size_.
2833
d3a7cd45
L
28342013-05-01 H.J. Lu <hongjiu.lu@intel.com>
2835
2836 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
2837 Restore empty string handling.
2838
6ad3daba
CC
28392013-05-01 Cary Coutant <ccoutant@google.com>
2840
2841 * stringpool.cc (Stringpool_template::new_key_offset): Fix
2842 uninitialized warning.
2843
e31908b6
CC
28442013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
2845
2846 * output.cc (Output_section::add_merge_input_section): Allow
2847 to merge sections if the alignment is more than character size.
2848 * merge.h (Output_merge_string::Output_merge_string): Remove
2849 assert.
2850 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
2851 only not-null strings. Check the alignment of strings.
2852 * stringpool.h
2853 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
2854 alignment as the argument.
2855 (Stringpool_template<Stringpool_char>::addralign_): New class member.
2856 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
2857 Align non-zero length strings according to the addralign_.
2858 (Stringpool_template<Stringpool_char>::set_string_offsets):
2859 Updating offsets according to the given alignment.
2860 * testsuite/Makefile.am (text_section_grouping): Test if string
2861 literals are getting merged.
2862 * testsuite/Makefile.in: Regenerate.
2863 * testsuite/merge_string_literals_1.c: New file.
2864 * testsuite/merge_string_literals_2.c: Ditto.
2865 * testsuite/merge_string_literals.sh: Ditto.
2866
0e804863
ILT
28672013-04-26 Ian Lance Taylor <iant@google.com>
2868
2869 * target-reloc.h (relocate_section): If the reloc offset is out of
2870 range, pass VIEW as NULL to relocate.relocate.
2871 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
2872 * i386.cc (Target_i386::Relocate::relocate): Likewise.
2873 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
2874 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
2875 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
2876 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
2877
e7c5ea40
CC
28782013-04-26 Geoff Pike <gpike@chromium.org>
2879
2880 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
2881 * layout.cc (Hash_task): New class.
2882 (Layout::queue_build_id_tasks): New function.
2883 (Layout::write_build_id): Handle single-thread portion of build ID
2884 computation. (In some cases, all of it is single-threaded.) Replace
2885 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
2886 functionality in fewer lines of code.
2887 * layout.h (Layout::queue_build_id_tasks): New function declaration.
2888 * options.h (General_options): make "--build-id" default to tree
2889 rather than sha1. Add two new options related to --build-id=tree:
2890 --build-id-chunk-size-for-treehash and
2891 --build-id-min-file-size-for-treehash.
2892 * Makefile.am: add testing of --build-id=tree and related new options
2893 (these tests will be invoked by "make check").
2894 * Makefile.in: Regenerate.
2895
49926cd0
AM
28962013-04-25 Alan Modra <amodra@gmail.com>
2897
2898 * configure.tgt: Add powerpcle and powerpc64le.
2899
a4034750
AM
29002013-04-22 Alan Modra <amodra@gmail.com>
2901
2902 PR gold/15355
2903 * layout.cc (Layout::segment_precedes): Allow more than one
2904 segment with the same type and flags.
2905
e79c84aa
CC
29062013-04-15 Cary Coutant <ccoutant@google.com>
2907
2908 * layout.cc (Layout::set_relocatable_section_offsets): Don't
2909 allocate space in file for BSS sections.
2910
2199fbe7
CC
29112013-04-15 Cary Coutant <ccoutant@google.com>
2912
2913 * script-sections.cc (Orphan_output_section): Reset address
2914 to zero after each orphaned section for relocatable links.
2915
502e8a84
CC
29162013-04-15 Cary Coutant <ccoutant@google.com>
2917
a4034750
AM
2918 * symtab.cc (Symbol_table::sized_write_globals): Subtract
2919 section starting address for relocatable link.
2920 * testsuite/Makefile.am (script_test_11): New test.
2921 * testsuite/Makefile.in: Regenerate.
2922 * testsuite/script_test_11.c: New source file.
2923 * testsuite/script_test_11.t: New linker script.
502e8a84 2924
0cfdc767
AM
29252013-04-13 Alan Modra <amodra@gmail.com>
2926
2927 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
2928 owner when sections are not adjacent and exceed group size.
2929 (Target_powerpc::group_sections): Handle corner case.
2930 (Target_powerpc::Branch_info::make_stub): Handle case where
2931 stub table doesn't exist due to branches in non-exec sections.
2932 (Target_powerpc::Relocate::relocate): Likewise.
2933
6830ee24
AM
29342013-04-11 Alan Modra <amodra@gmail.com>
2935
2936 PR gold/15354
2937 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
2938 .branch_lt to match bfd ld. Adjust comments throughout file.
2939
54a3d865
ILT
29402013-04-04 Ian Lance Taylor <iant@google.com>
2941
2942 GCC PR c++/56840
2943 * object.cc (do_layout_deferred_sections): Handle .eh_frame
2944 sections before checking whether they are included in the link.
2945
9993ba11
ST
29462013-03-29 Sriraman Tallam <tmsriram@google.com>
2947
2948 * archive.cc (Archive::get_elf_object_for_member): Create the elf
2949 object before calling the plugin claim_file handler. Pass the elf
2950 object of the archive to the plugin. Delete the elf object if the
2951 plugin claims the file.
2952
ebacd51e
AM
29532013-03-21 Alan Modra <amodra@gmail.com>
2954
2955 * layout.cc (Layout::set_segment_offsets): Accept writable .text
2956 segment when omagic.
2957
117be58f
AM
29582013-03-21 Alan Modra <amodra@gmail.com>
2959
2960 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
2961 comparison warning.
2962 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
2963 uninitialized" warning.
2964
32e2b61d
AM
29652013-03-20 Alan Modra <amodra@gmail.com>
2966
2967 * symtab.h (Symbol::clear_version): New function.
2968 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
2969 is_needed by weak references. Clear version for symbols defined
2970 in as-needed objects that are not needed.
2971
b3ccdeb5
AM
29722013-03-15 Alan Modra <amodra@gmail.com>
2973
2974 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
2975 static and public. Add report_err param. Return false for data refs.
2976 (Target_powerpc::rela_dyn_section): New overloaded function.
2977 (Target_powerpc::plt_, iplt_): Elucidate.
2978 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
2979 (Output_data_plt_powerpc::do_write): Don't write .iplt.
2980 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
2981 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
2982 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
2983 push_branch and make_plt_entry for ifunc syms when
2984 reloc_needs_plt_for_ifunc.
2985 (Target_powerpc::Relocate::relocate): Don't use plt entry value
2986 for ifunc unless reloc_needs_plt_for_ifunc.
2987
ad3d8a2f
AM
29882013-03-15 Alan Modra <amodra@gmail.com>
2989
2990 * gc.h (gc_process_relocs): Don't look through function descriptors.
2991 * icf.cc (get_section_contents): Do so here instead.
2992
4d9aa155
AM
29932013-03-13 Alan Modra <amodra@gmail.com>
2994
2995 * powerpc.cc (is_branch_reloc): Forward declare.
2996 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
2997 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
2998 false for 64-bit, true for 32-bit non-branch relocs.
2999 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
3000 * testsuite/Makefile.am (icf_test): Use linker map file instead of
3001 nm output.
3002 (icf_safe_test): Generate linker map file as well as nm output.
3003 (icf_safe_so_test): Likewise.
3004 * testsuite/Makefile.in: Regenerate.
3005 * testsuite/icf_test.sh: Parse linker map file to determine
3006 section folding.
3007 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
3008 * testsuite/icf_safe_so_test.sh: Likewise.
3009 (X86_32_or_ARM_specific_safe_fold): Merge into..
3010 (arch_specific_safe_fold): ..this.
3011 (X86_64_specific_safe_fold): Delete unused function.
3012
57420c20
AM
30132013-03-12 Alan Modra <amodra@gmail.com>
3014
3015 * gc.h (gc_process_relocs): Look through function descriptors
3016 to determine shndx, symvalue and addend used by ICF. Tidy
3017 variable duplication.
3018
dc3714f3
AM
30192013-03-11 Alan Modra <amodra@gmail.com>
3020
3021 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
3022 * layout.cc (Layout_task_runner::run): ..to here.
3023 * symtab.h (struct Symbol_location): Extract from..
3024 (class Symbol_table): ..here.
3025 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
3026 * target.h (class Target): Add function_location and
3027 do_function_location functions.
3028 (class Sized_target): Add do_function_location.
3029 * object.h (class Sized_relobj_file): Move find_shdr..
3030 (class Object): ..to here.
3031 * object.cc: Likewise. Update to suit. Instantiate.
3032 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
3033 * powerpc.cc (class Powerpc_dynobj): New.
3034 (Target_powerpc::do_function_location): New function.
3035 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
3036 (Powerpc_dynobj::do_read_symbols): New function.
3037 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
3038
956b03bb
ILT
30392013-03-08 Ian Lance Taylor <iant@google.com>
3040
3041 * options.cc (General_options::string_to_object_format): Accept
3042 "default".
3043
4bead2d5
AM
30442013-03-08 Alan Modra <amodra@gmail.com>
3045
3046 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
3047 pointer to Post_fde.
3048 (struct Post_fde): Move definition to here..
3049 * ehframe.cc (struct Post_fde): ..from here.
3050 (Cie::write): Don't alloc Post_fde.
3051 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
3052
02e60bf7
AM
30532013-03-07 Alan Modra <amodra@gmail.com>
3054
3055 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
3056 relocation referencing .LC0.
3057 * testsuite/discard_locals_test.sh: Remove FIXMEs.
3058
8343f03a
AM
30592013-03-07 Alan Modra <amodra@gmail.com>
3060
3061 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
3062 always_inline. Add assembly for powerpc to avoid GOT.
3063
3366d57c
AM
30642013-03-07 Alan Modra <amodra@gmail.com>
3065
3066 * testsuite/script_test_10.sh: Don't test .bss section
3067 header number.
3068
6c77229c
AM
30692013-03-06 Alan Modra <amodra@gmail.com>
3070
3071 * powerpc.cc (class Powerpc_relobj): Move some member functions.
3072 (Target_powerpc::symval_for_branch): Add symtab param. Update
3073 all callers. Handle folded sections.
3074 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
3075 to Powerpc_relobj.
3076 (Global_symbol_visitor_opd::operator()): Likewise.
3077
a39e4af6
AM
30782013-03-04 Alan Modra <amodra@gmail.com>
3079
3080 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
3081 * testsuite/Makefile.in: Regenerate.
3082
d5834edb
CC
30832013-03-01 Cary Coutant <ccoutant@google.com>
3084
3085 Add dwp support for v2 DWARF package file format.
3086 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
3087 tu_length parameter. Adjust all callers.
3088 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
3089 * dwp.cc: Include dwarf.h.
3090 (Section_bounds): New struct type.
3091 (Unit_set): New struct type.
3092 (Dwo_file::Dwo_file): Initialize new data member.
3093 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
3094 Combine and rename to...
3095 (Dwo_file::read_unit_index): ...this.
3096 (Dwo_file::sized_read_compunit_index)
3097 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
3098 (Dwo_file::sized_read_unit_index): ...this.
3099 (Dwo_file::copy_section): Remove section_name, is_str_offsets
3100 parameters; add section_id parameter.
3101 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
3102 (Dwo_file::add_unit_set): ...this.
3103 (Dwo_file::shndx_map_): Remove.
3104 (Dwo_file::sect_offsets_): New data member.
3105 (Dwp_output_file::Dwp_output_file): Initialize new data members.
3106 (Dwp_output_file::add_section): Rename to...
3107 (Dwp_output_file::add_contribution): ...this.
3108 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
3109 (Dwp_output_file::add_tu_set): Likewise.
3110 (Dwp_output_file::Contribution): New type.
3111 (Dwp_output_file::Section::contributions): New data member.
3112 (Dwp_output_file::Cu_or_tu_set): Remove.
3113 (Dwp_output_file::Section::Section): New ctor.
3114 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
3115 (Dwp_output_file::Dwp_index::Section_table): New type.
3116 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
3117 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
3118 parameter.
3119 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
3120 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
3121 (Dwp_output_file::Dwp_index::section_table): New member function.
3122 (Dwp_output_file::Dwp_index::section_table_end): New member function.
3123 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
3124 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
3125 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
3126 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
3127 (Dwp_output_file::Dwp_index::section_table_): New data member.
3128 (Dwp_output_file::Dwp_index::section_mask_): New data member.
3129 (Dwp_output_file::add_output_section): New member function.
3130 (Dwp_output_file::write_new_section): New member function.
3131 (Dwp_output_file::write_contributions): New member function.
3132 (Dwp_output_file::section_id_map_): New data member.
3133 (class Dwo_id_info_reader): Remove.
3134 (class Unit_reader): New class.
3135 (get_dwarf_section_name): New function.
3136 (Dwo_file::read_executable): Adjust initializations of class data.
3137 (Dwo_file::read): Add support for v2 package file format.
3138 (Dwo_file::read_unit_index): Likewise.
3139 (Dwo_file::sized_read_unit_index): Likewise.
3140 (Dwo_file::copy_section): Likewise.
3141 (Dwo_file::add_unit_set): Likewise.
3142 (Dwp_output_file::add_output_section): Likewise.
3143 (Dwp_output_file::add_contribution): Likewise.
3144 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
3145 for empty slot.
3146 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
3147 file format.
3148 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
3149 slot.
3150 (Dwp_output_file::initialize): Remove unused function.
3151 (Dwp_output_file::finalize): Add support for v2 package file format.
3152 (Dwp_output_file::write_index): Likewise.
3153 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
3154 function prototype.
3155
a68a081d
CC
31562013-03-01 Cary Coutant <ccoutant@google.com>
3157
3158 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
3159 function into class definition in header file.
3160 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
3161 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
3162 New function.
3163 (Dwarf_info_reader::check_buffer): Move here from .cc file.
3164
9d5781f8
AM
31652013-02-28 Alan Modra <amodra@gmail.com>
3166
3167 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
3168 * target.cc (Target::do_plt_fde_location): New function.
3169 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
3170 accessor function, and constructor param.
3171 (struct Post_fde, Post_fdes): Declare.
3172 (Cie::write): Add post_fdes param.
3173 * ehframe.cc (Fde::write): Use plt_fde_location.
3174 (struct Post_fde): Define.
3175 (Cie::write): Stash FDEs added post merge mapping.
3176 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
3177 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
3178 (Eh_frame::do_sized_write): Arrange to write post map FDES after
3179 other FDEs.
3180 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
3181 (Target_powerpc::has_glink): New function.
3182 (Target_powerpc::do_relax): Add eh_frame info for stubs.
3183 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
3184 glink_eh_frame_fde_32, default_fde): New data.
3185 (Stub_table::eh_frame_added_): New var.
3186 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
3187 Make const.
3188 (Stub_table::add_eh_frame): New function.
3189 (Output_data_glink::add_eh_frame): New function.
3190 (Target_powerpc::make_glink_section): Call add_eh_frame.
3191
214383dd
ILT
31922013-02-15 Ian Lance Taylor <iant@google.com>
3193
3194 * options.h (DEFINE_uint64_alias): Define.
3195 (class General_options): Add -Ttext-segment as an alias for
3196 -Ttext.
3197
91c2b899
AM
31982013-02-15 Alan Modra <amodra@gmail.com>
3199
3200 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
3201 (Stub_table::do_write): ..here, two places.
3202 (Stub_table::plt_call_size): Use it here too.
3203
20e2a8aa
ILT
32042013-02-11 Ian Lance Taylor <iant@google.com>
3205
3206 * descriptors.cc (Descriptors::close_all): New function.
3207 * descriptors.h (class Descriptors): Declare close_all.
3208 (close_all_descriptors): New inline function.
3209 * plugin.cc: Include "descriptors.h".
3210 (Plugin_manager::cleanup): Call close_all_descriptors.
3211
8952bc69
AM
32122013-02-06 Alan Modra <amodra@gmail.com>
3213
3214 * README: Update coding style link.
3215
29bd8b6b
CC
32162013-01-28 Cary Coutant <ccoutant@google.com>
3217
a4034750
AM
3218 * dwp.cc (File_list): New typedef.
3219 (Dwo_name_info_reader): New class.
3220 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
3221 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
3222 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
3223 (Dwo_file::read_executable): New function.
3224 (Dwo_file::read): Move common setup code to ...
3225 (Dwo_file::make_object): ... here.
3226 (dwp_options): Add --exec/-e.
3227 (usage): Likewise.
3228 (main): Likewise.
29bd8b6b 3229
c6ac678d
ST
32302013-01-24 Sriraman Tallam <tmsriram@google.com>
3231
3232 * layout.cc (Layout::layout): Check for option text_reorder.
3233 (Layout::make_output_section): Ditto.
3234 * options.h (text_reorder): New option.
3235 * output.cc (Input_section_sort_compare): Remove special ordering
3236 of section names.
3237 (Output_section::
3238 Input_section_sort_section_name_special_ordering_compare::
3239 operator()): New function.
3240 (Output_section::sort_attached_input_sections): Use new sort function
3241 for .text.
3242 * output.h (Input_section_sort_section_name_special_ordering_compare):
3243 New struct.
3244 * testsuite/Makefile.am (text_section_grouping): Test option
3245 --no-text-reorder
3246 * testsuite/Makefile.in: Regenerate.
3247 * testsuite/text_section_grouping.sh: Check order of functions without
3248 default text reordering.
3249
50701cc1
MF
32502013-01-18 Mike Frysinger <vapier@gentoo.org>
3251
3252 * options.h (General_options): Change default to true for new_dtags.
3253
b1b00fcc
MF
32542013-01-18 Mike Frysinger <vapier@gentoo.org>
3255
3256 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
3257 when enable_new_dtags is false. Only add DT_RUNPATH when
3258 enable_new_dtags is true.
3259
ec5b8187
AM
32602013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
3261
3262 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
3263 used in declaration and definition consistent.
3264 (Target_powerpc::symval_for_branch): Ditto.
3265
a880d4c4
ST
32662013-01-16 Sriraman Tallam <tmsriram@google.com>
3267
3268 * testsuite/plugin_final_layout.cc: Fix comment.
3269
7c381248
ST
32702013-01-16 Sriraman Tallam <tmsriram@google.com>
3271
3272 * layout.cc (Layout::layout): Do not do default sorting for
3273 text sections when section ordering is specified.
3274 (make_output_section): Ditto.
3275 * testsuite/plugin_final_layout.cc: Name the function sections
3276 to catch reordering issues.
3277
e2458743
AM
32782013-01-15 Alan Modra <amodra@gmail.com>
3279
3280 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
3281 plt-thread-safe.
3282
431ed302
AM
32832013-01-15 Alan Modra <amodra@gmail.com>
3284
3285 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
3286 * testsuite/Makefile.in: Regenerate.
3287
0ec6429b
AM
32882013-01-14 Alan Modra <amodra@gmail.com>
3289
3290 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
3291 * testsuite/Makefile.in: Regenerate.
3292
0bf402d5
ILT
32932013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
3294
36af3926 3295 PR bfd/14430
0bf402d5
ILT
3296 Fix mingw gold build with plugins enabled
3297 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
3298 * configure.ac: Export DLOPEN_LIBS and add headers check.
3299 * plugin.cc: Handle non-dlfcn case.
3300 * Makefile.in: Regenerate.
3301 * config.in: Regenerate.
3302 * configure: Regenerate.
3303 * testsuite/Makefile.in: Regenerate.
3304
9e9143bc
ST
33052013-01-09 Sriraman Tallam <tmsriram@google.com>
3306
3307 * output.h (sort_attached_input_sections): Change to be public.
3308 * script-sections.cc
3309 (Output_section_definition::set_section_addresses): Sort
3310 attached input sections according to section order before linker
3311 script assigns section addresses.
3312 (Orphan_output_section::set_section_addresses): Sort
3313 attached input sections according to section order before linker
3314 script assigns section addresses.
3315 * Makefile.am (final_layout.sh): Use a simple linker script to
3316 check if section ordering still works.
3317 * Makefile.in: Regenerate.
3318
679af368
ILT
33192013-01-09 Ben Cheng <bccheng@google.com>
3320
3321 * arm.cc (Target_arm::attributes_accept_div): New function.
3322 (Target_arm::attributes_forbid_div): New function.
3323 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
3324 attribute using the same new functions as what bfd/elf32_arm.c
3325 does.
3326
3136a00e
CC
33272013-01-07 Cary Coutant <ccoutant@google.com>
3328
3329 PR gold/14993
3330 * output.cc (Output_section::add_input_section): For incremental
3331 updates, don't track input sections that are allocated from patch
3332 space.
3333
f2a6224b
L
33342013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3335 Ian Lance Taylor <iant@google.com>
3336
3337 PR gold/14897
3338 * configure.ac (--enable-ld): Removed.
3339 (install_as_default): Set to yes only for --enable-gold=default
3340 or --disable-ld.
3341 * configure: Regenerated.
3342
4f46f626
L
33432013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3344
3345 * options.h (General_options): Add -fuse-ld= for GCC linker
3346 option compatibility.
3347
26e4ef59
CC
33482013-01-04 Cary Coutant <ccoutant@google.com>
3349
3350 * configure.ac: Fix typo restoring CXXFLAGS.
3351 * configure: Regenerate.
3352
3d587466
CC
33532013-01-04 Cary Coutant <ccoutant@google.com>
3354
4f46f626
L
3355 * testsuite/Makefile.am (CXXLINK_S): New macro.
3356 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
3357 * testsuite/Makefile.in: Regenerate.
3d587466 3358
44db6695
L
33592013-01-02 H.J. Lu <hongjiu.lu@intel.com>
3360
3361 * version.cc (print_version): Update copyright year to 2013.
3362
edcac0c1
ILT
33632012-12-20 Ian Lance Taylor <iant@google.com>
3364
3365 * layout.cc (Layout::special_ordering_of_input_section): New
3366 function.
3367 (Layout::layout): If input section requires special ordering, must
3368 sort input sections.
3369 (Layout::make_output_section): May sort .text input sections.
3370 (Layout::is_section_name_prefix_grouped): Remove.
3371 * layout.h (class Layout): Declare
3372 special_ordering_of_input_section. Don't declare
3373 is_section_name_prefix_grouped.
3374 * output.cc (Output_section::add_input_section): Revert last
3375 change.
3376 (Output_section::Input_section_sort::match_file_name): Don't crash
3377 if called on output section data.
3378 (Output_section::Input_section_sort_compare): Sort based on
3379 special ordering.
3380 (Output_section::Input_section_sort_section_order_index_compare):
3381 Revert last patch.
3382 (Output_section::sort_attached_input_sections): Likewise.
3383
28f2a4ac
ST
33842012-12-18 Sriraman Tallam <tmsriram@google.com>
3385
edcac0c1 3386 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
3387 * layout.h (Layout::is_section_name_prefix_grouped): New function.
3388 * output.cc (Output_section::add_input_section): Check if section
3389 name contains special prefix. Keep input sections to sort such
3390 sections.
3391 (Output_section::Input_section_sort_section_order_index_compare
3392 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
3393 (Output_section::sort_attached_input_sections): Add condition to
3394 Input_section_entry constructor call.
28f2a4ac
ST
3395 * testsuite/Makefile.am (text_section_grouping): New test.
3396 * testsuite/Makefile.in: Regenerate.
3397 * testsuite/text_section_grouping.cc: New file.
3398 * testsuite/text_section_grouping.sh: New file.
3399
5bf135a7
NC
34002012-12-17 Nick Clifton <nickc@redhat.com>
3401
3402 * Makefile.am: Add copyright notice.
3403 * NEWS: Likewise.
3404 * README: Likewise.
3405 * configure.ac: Likewise.
3406 * ftruncate.c: Likewise.
3407 * Makefile.in: Regenerate.
3408
59965708
CC
34092012-12-14 Cary Coutant <ccoutant@google.com>
3410
a4034750
AM
3411 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
3412 --no-as-needed flag.
3413 (exception_separate_shared_12_test): Likewise.
3414 (incremental_copy_test): Likewise.
3415 * testsuite/Makefile.in: Regenerate.
59965708 3416
2a77e2ab
CC
34172012-12-14 Cary Coutant <ccoutant@google.com>
3418
3419 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
3420 (Dwp_output_file::Dwp_index::enter_set): Add assert.
3421
e3deeb9c
AM
34222012-12-12 Alan Modra <amodra@gmail.com>
3423
3424 * powerpc.cc (class Track_tls): New.
3425 (class Relocate, class Scan): Inherit Track_tls.
3426 (Target_powerpc::Scan::local, global): Track tls optimization
3427 and avoid creating plt entry for __tls_get_addr if all uses
3428 are optimized away.
3429 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
3430
d8f5a274
AM
34312012-12-12 Alan Modra <amodra@gmail.com>
3432
3433 * options.h (General_options): Add --toc-sort/--no-toc-sort.
3434 Replace no_toc_optimize with toc_optimize.
3435 * output.h (Output_section::input_sections): Provide non-const variant.
3436 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
3437 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
3438 accessors.
3439 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
3440 (class Sort_toc_sections): New.
3441 (Target_powerpc::do_finalize_sections): Sort toc sections.
3442 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
3443
4c8a1de1
RM
34442012-12-10 Roland McGrath <mcgrathr@google.com>
3445
3446 * testsuite/binary_unittest.cc (read_all): New function.
3447 (Sized_binary_test): Use it instead of ::read.
3448 * fileread.cc (do_read): Don't assume pread always reads the whole
3449 amount in a single call.
3450
edc27beb
AM
34512012-12-10 Alan Modra <amodra@gmail.com>
3452
3453 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
3454 Set EM_PPC64 or EM_PPC here.
3455 (Target_selector_powerpc::do_recognize): Delete.
3456
906b9150
AM
34572012-12-10 Alan Modra <amodra@gmail.com>
3458
3459 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
3460 stub_table_.
3461 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
3462
418c15ae
RM
34632012-12-07 Roland McGrath <mcgrathr@google.com>
3464
3465 * testsuite/binary_unittest.cc (Sized_binary_test):
3466 Use open_descriptor rather than ::open.
3467
decdd3bc
AM
34682012-12-07 Alan Modra <amodra@gmail.com>
3469
3470 * powerpc.cc (Stub_table::do_write): Delete redundant Address
3471 typedef and invalid_address constant.
3472 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
3473 instantiate constants.
3474
db399005
ILT
34752012-12-06 Roland McGrath <mcgrathr@google.com>
3476
3477 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
3478 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
3479 * aclocal.m4: Regenerate.
3480 * configure: Regenerate.
3481 * Makefile.in: Regenerate.
3482 * testsuite/Makefile.in: Regenerate.
3483
aba6bc71
AM
34842012-12-07 Alan Modra <amodra@gmail.com>
3485
3486 * options.h (General_options): Add no_toc_optimize.
3487 * powerpc.cc (ok_lo_toc_insn): New function.
3488 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
3489
9e69ed50
AM
34902012-12-06 Alan Modra <amodra@gmail.com>
3491
3492 * options.h (General_options): Add plt_align, plt_static_chain,
3493 plt_thread_safe. Update stub_group_size help text.
3494 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
3495 for new plt_thread_safe_ var.
3496 (use_plt_offset): Correct comments.
3497 (Target_powerpc::do_relax): Look for thread creation symbols to
3498 determine default plt_thread_safe value. Clear plt call stubs
3499 as well as branch stubs each iteration.
3500 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
3501 insn constants.
3502 (l, hi, ha, write_insn): Move earlier.
3503 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
3504 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
3505 plt stubs too.
3506 (Stub_table::update_size): Adjust.
3507 (Stub_table::prev_size, set_prev_size): Delete.
3508 (Stub_table::stub_align): Let --plt-align affect result.
3509 (Stub_table::plt_call_size): Calculate sizes for various stubs.
3510 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
3511 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
3512 (Stub_table::do_write): Support more stub variants.
3513
f43ba157
AM
35142012-12-04 Alan Modra <amodra@gmail.com>
3515
3516 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
3517 (Target_powerpc::do_define_standard_symbols): New function.
3518
34171bc5
AM
35192012-12-03 Alan Modra <amodra@gmail.com>
3520
3521 * output.h: Formatting, whitespace.
3522
dc9589e9 35232012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
3524
3525 * layout.h (Layout::get_executable_sections): Declare.
3526 * layout.cc (Layout::get_executable_sections): New function.
3527 * arm.cc (Target_arm::group_sections): Use it.
3528 (Arm_output_section::group_sections): Delete now redundant test.
3529 * output.cc (Output_reloc::Output_reloc): Add is_relative.
3530 param to handle relative relocs.
3531 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
3532 (Output_data_reloc::add_absolute): Adjust.
3533 (Output_data_reloc::add_relative): New function.
3534 (Output_data::reset_data_size): New function.
3535 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
3536 (Output_section::set_addralign): New function.
3537 (Output_section::checkpoint_set_addralign): New function.
3538 (Output_section::clear_section_offsets_need_adjustment): New function.
3539 (Output_section::input_sections): Make public.
3540 * powerpc.cc (class Output_data_brlt_powerpc): New.
3541 (class Stub_table, class Stub_control): New.
3542 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
3543 stub_table_, set_stub_table, stub_table): New vectors and accessor
3544 functions.
3545 (Target_powerpc::do_may_relax, do_relax, push_branch,
3546 new_stub_table, stub_tables, brlt_section, group_sections,
3547 add_branch_lookup_table, find_branch_lookup_table,
3548 write_branch_lookup_table, make_brlt_section): New functions.
3549 (Target_powerpc::struct Sort_sections, class Branch_info): New.
3550 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
3551 branch_info_): New vars.
3552 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
3553 make call stubs here.
3554 (Output_data_glink): Remove all call stub handling from this class.
3555 (Target_powerpc::Scan::local, global): Save interesting branch
3556 relocs and relocs for ifunc. Adjust calls to plt entry functions.
3557 (Target_powerpc::do_finalize_sections): Only make reg save/restore
3558 functions on final link.
3559 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
3560 Handle long branch destinations too.
3561 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
3562 do_plt_address_for_local): Adjust lookup of plt call stubs.
3563
627b30b7
AM
35642012-11-30 Alan Modra <amodra@gmail.com>
3565
3566 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
3567 relocs against protected symbols when building 32-bit shared libs.
3568
40b469d7
AM
35692012-11-30 Alan Modra <amodra@gmail.com>
3570
3571 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
3572 param. Call got_section() to make .got. Update all callers
3573 and their callers and so on.
3574
bb66a627
AM
35752012-11-30 Alan Modra <amodra@gmail.com>
3576
3577 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
3578 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
3579 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
3580 value if it already exists.
3581
d2cf1c6c
L
35822012-11-19 H.J. Lu <hongjiu.lu@intel.com>
3583
3584 PR gold/14858
3585 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
3586
edccdf7c
RM
35872012-11-14 Roland McGrath <mcgrathr@google.com>
3588
3589 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
3590 than bfc instruction for data sandboxing.
3591
6febeb74
AM
35922012-11-08 Alan Modra <amodra@gmail.com>
3593
3594 * po/POTFILES.in: Regenerate.
3595
0a6f1bf2
AM
35962012-11-05 Alan Modra <amodra@gmail.com>
3597
3598 * configure.ac: Apply 2012-09-10 change to config.in here.
3599 * configure: Regenerate.
3600
26a4e9cb
AM
36012012-11-05 Alan Modra <amodra@gmail.com>
3602
3603 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
3604 (struct Opd_ent): Use "Address" rather than "Offset".
3605 (Output_data_got_powerpc::got_base_offset): Return Valtype.
3606 (Target_powerpc::got_section): Make public.
3607 (Target_powerpc::scan_relocs): Move code setting symbols..
3608 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
3609 Create _SDA_BASE_ only when referenced.
3610
cc928013
RM
36112012-11-02 Roland McGrath <mcgrathr@google.com>
3612
3613 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
3614 from last change.
3615
50ed5eb1
RM
36162012-11-01 Roland McGrath <mcgrathr@google.com>
3617
62fe925a
RM
3618 * target.h (Sized_target::relocate_relocs): Use Elf_Off
3619 for offset_in_output_section parameter.
3620 (Sized_target::relocate_special_relocatable): Likewise.
3621 * arm.cc (Target_arm::relocate_relocs): Likewise.
3622 (Target_arm::relocate_special_relocatable): Likewise.
3623 * i386.cc (Target_i386::relocate_relocs): Likewise.
3624 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
3625 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
3626 * target-reloc.h (relocate_relocs): Likewise.
3627 * testsuite/testfile.cc (Target_test): Likewise.
3628 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
3629 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
3630
3631 * system.h: Move inclusion of <clocale> to after <libintl.h> in
3632 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
3633
3634 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
3635 parameter, which is unused in the [!F_SETFD] case.
3636
50ed5eb1
RM
3637 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
3638 SYMNDX to off_t before comparing it to this->data_size().
3639 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
3640 * incremental.cc (Output_section_incremental_inputs::do_write):
3641 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
3642
2cadc0bf
RM
3643 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
3644
3bfcb652
NC
36452012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
3646
3647 * gold.cc (Target_arm::do_adjust_elf_header): Add the
3648 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
3649 in EABI_VER5.
3650
c1a8d56e
CC
36512012-10-29 Cary Coutant <ccoutant@google.com>
3652
3653 * dwp.cc (usage): Add file and exit status parameters;
3654 add --help and --version options.
3655 (print_version): New function.
3656 (main): Add --help and --version options.
3657
b2490a7b
L
36582012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3659
3660 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
3661 final_layout_sequence.txt.
3662 * testsuite/Makefile.in: Regenerated.
3663
aa543512
L
36642012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3665
3666 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
3667 COMPILE generated by automake.
3668 (LINK1): Likewise.
3669 (CXXCOMPILE1): Likewise.
3670 (CXXLINK1): Likewise.
3671 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
3672 (LINK): Likewise.
3673 (CXXCOMPILE): Likewise.
3674 (CXXLINK): Likewise.
3675 * testsuite/Makefile.in: Regenerated.
3676
d361fafb
L
36772012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3678
3679 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
3680 on bad fwrite return.
3681
598c7410
L
36822012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3683
3684 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
3685 on val.
3686
35c813e2
CC
36872012-10-23 Cary Coutant <ccoutant@google.com>
3688
3689 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
3690 * testsuite/Makefile.in: Regenerate.
3691 * testsuite/dwp_test.h: New source file.
3692 * testsuite/dwp_test_1.cc: New source file.
3693 * testsuite/dwp_test_1.s: New source file.
3694 * testsuite/dwp_test_1.sh: New source file.
3695 * testsuite/dwp_test_1b.cc: New source file.
3696 * testsuite/dwp_test_1b.s: New source file.
3697 * testsuite/dwp_test_2.cc: New source file.
3698 * testsuite/dwp_test_2.s: New source file.
3699 * testsuite/dwp_test_2.sh: New source file.
3700 * testsuite/dwp_test_main.cc: New source file.
3701 * testsuite/dwp_test_main.s: New source file.
3702
77429909
CC
37032012-10-23 Cary Coutant <ccoutant@google.com>
3704
3705 * dwp.h: New header file.
3706 * dwp.cc: New source file.
3707 * gold.h: Move shared declarations to system.h.
3708 * system.h: New header file.
3709 * Makefile.am: Add dwp.
3710 * Makefile.in: Regenerate.
3711
ed5d6712
CC
37122012-10-23 Cary Coutant <ccoutant@google.com>
3713
3714 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
3715 Dwarf_info_reader::read_from_pointer.
3716 (Dwarf_pubnames_table::read_header): Likewise.
3717 (Dwarf_pubnames_table::next_name): Likewise.
3718 (Dwarf_die::read_attributes): Likewise.
3719 (Dwarf_die::skip_attributes): Likewise.
3720 (Dwarf_info_reader::read_from_pointer): New function template.
3721 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
3722 (Dwarf_pubnames_table): Likewise.
3723 (Dwarf_info_reader::read_from_pointer): New function template.
3724 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
3725 Dwarf_pubnames_table ctor.
3726
8787852d
CC
37272012-10-23 Cary Coutant <ccoutant@google.com>
3728
3729 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
3730 abbrev_shndx.
3731 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
3732 abbrev_shndx_.
3733 (Dwarf_info_reader::set_abbrev_shndx): New method.
3734 (Dwarf_info_reader::abbrev_shndx_): New data member.
3735
9fc236f3
CC
37362012-10-23 Cary Coutant <ccoutant@google.com>
3737
3738 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
3739 from object, not parameters.
3740 (Dwarf_info_reader::parse): Likewise.
3741 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
3742 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
3743 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
3744 methods.
3745
effe8365
CC
37462012-10-23 Cary Coutant <ccoutant@google.com>
3747
3748 * fileread.cc (Input_file::Input_file): New constructor.
3749 * fileread.h (class Input_file): Add new constructor.
3750
1698990d
AM
37512012-10-18 Alan Modra <amodra@gmail.com>
3752
3753 PR gold/14727
3754 * object.cc (Relobj::is_section_name_included): Also match
3755 .sdata personality section.
3756
168a4726
AM
37572012-10-18 Alan Modra <amodra@gmail.com>
3758
3759 * target-reloc.h (class Default_comdat_behavior): New, package up..
3760 (get_comdat_behaviour): ..this.
3761 (relocate_section): Add Relocate_comdat_behavior template arg,
3762 adjust code to suit.
3763 * arm.cc (Target_arm::relocate_section): Adjust to suit.
3764 (Target_arm::scan_reloc_section): Likewise.
3765 * i386.cc (Target_i386::relocate_section): Likewise.
3766 * sparc.cc (Target_sparc::relocate_section): Likewise.
3767 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
3768 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
3769 * powerpc.cc (class Relocate_comdat_behavior): New.
3770 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
3771 gold::relocate_section with new template arg.
3772
acc276d8
AM
37732012-10-18 Alan Modra <amodra@gmail.com>
3774
3775 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
3776 dynamic relocs for GOT_TPREL got entries, without symbol if
3777 resolving locally.
3778 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
3779 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
3780 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
3781
e10f9870
AM
37822012-10-17 Alan Modra <amodra@gmail.com>
3783
3784 PR gold/14726
3785 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
3786
ae034989
ST
37872012-10-16 Sriraman Tallam <tmsriram@google.com>
3788
3789 * layout.cc (Layout::include_section): Keep sections marked
3790 SHF_EXCLUDE when doing relocatable links.
3791
f3a0ed29
AM
37922012-10-16 Alan Modra <amodra@gmail.com>
3793
3794 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
3795 (Target_powerpc::do_finalize_sections): Call it.
3796 (Output_data_save_res): New class and supporting functions.
3797 (Target_powerpc::symval_for_branch): Only look up .opd entry for
3798 normal symbols defined in object files.
3799
c6de8ed4
AM
38002012-10-12 Alan Modra <amodra@gmail.com>
3801
3802 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
3803 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
3804 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
3805 section if scan_opd_relocs not yet called.
3806 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
3807
03e25981
AM
38082012-10-12 Alan Modra <amodra@gmail.com>
3809
3810 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
3811 add_local_ifunc_entry): Revert last change.
3812 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
3813
c9824451
AM
38142012-10-05 Alan Modra <amodra@gmail.com>
3815
3816 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
3817 do_plt_address_for_global): New functions.
3818 (Output_data_got_powerpc::do_write): Don't segfault when linking
3819 statically.
3820 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
3821 add_local_ifunc_entry): Return true on adding entry..
3822 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
3823 glink->add_entry call. Remove unused symtab param. Adjust calls.
3824 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
3825 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
3826 set up symbols here.
3827 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
3828 syms here. Do so even when no .iplt. Don't segfault when linking
3829 statically.
3830 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
3831 new variants without reloc param.
3832 (Glink_sym_ent::Glink_sym_ent): Likewise.
3833 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
3834 reloc when refs will resolve to plt call stub.
3835 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
3836 R_PPC_PLTREL24 to resolve locally.
3837 (Target_powerpc::Scan::global): Correct ifunc handling.
3838 (Target_powerpc::Relocate::relocate): Correct local sym glink
3839 lookup. Don't destroy "value" when we have a plt call stub,
3840 and when checking plt call validity.
3841 (Target_powerpc::do_dynsym_value): Simplify.
3842
19fec8c1
AM
38432012-10-05 Alan Modra <amodra@gmail.com>
3844
3845 * i386.cc (Output_data_plt_i386::address_for_global,
3846 address_for_local): Add plt offset to returned value. Adjust uses.
3847 * sparc.cc (Output_data_plt_sparc::address_for_global,
3848 address_for_local): Likewise.
3849 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
3850 address_for_local): Likewise.
3851 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
3852 address_for_local): Likewise.
3853 * target.h (Target::plt_address_for_global, plt_address_for_local):
3854 Update comment.
3855 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
3856 (Output_data_got::Got_entry::write): Nor here.
3857 * output.h: Comment fix.
3858
e867b647
WL
38592012-10-02 Jiong Wang <jiwang@tilera.com>
3860
3861 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
3862 global_offset_table_ value for larget got.
3863 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
3864
e5d5f5ed
AM
38652012-09-29 Alan Modra <amodra@gmail.com>
3866
3867 * powerpc.cc (Target_powerpc::iplt_): New output section.
3868 (Target_powerpc::iplt_section, make_iplt_section,
3869 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
3870 (Target_powerpc::make_plt_entry): Handle ifunc syms.
3871 Target_powerpc::plt_entry_count): Count iplt entries too.
3872 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
3873 reloc section in constructor. New params.
3874 (Target_powerpc::make_plt_section): Create reloc section here instead.
3875 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
3876 functions.
3877 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
3878 (Output_data_glink::add_entry, find_entry): New functions to
3879 deal with local syms.
3880 (Glink_sym_ent): Add support for local syms.
3881 (Output_data_glink::do_write): Handle ifunc plt entries.
3882 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3883 (Target_powerpc::Scan::local, global): Handle ifunc syms.
3884 (Target_powerpc::Relocate::relocate): Likewise.
3885 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
3886
ec4dbad3
AM
38872012-09-25 Alan Modra <amodra@gmail.com>
3888
3889 * object.h (Sized_relobj_file::adjust_local_symbol,
3890 do_adjust_local_symbol): New functions.
3891 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
3892 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
3893 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
3894 and irregular opd entry spacing.
3895 (Powerpc_relobj::do_read_relocs): Add opd size checks.
3896 (Global_symbol_visitor_opd): New functor.
3897 (Target_powerpc::do_finalize_sections): Omit global symbols defined
3898 on deleted opd entries.
3899
5c0b3823
WL
39002012-09-15 Jiong Wang <jiwang@tilera.com>
3901
3902 * tilegx.cc: New file.
3903 * Makefile.am (TARGETSOURCES): Add tilegx.cc
3904 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
3905 * configure.tgt: Add entries for tilegx*.
3906 * configure.ac: Likewise.
3907 * Makefile.in: Rebuild.
3908 * configure: Likewise.
3909 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
3910 tilegx.
3911
bfdfa4cd
AM
39122012-09-13 Alan Modra <amodra@gmail.com>
3913
3914 * target-reloc.h (scan_relocs): Call scan.local for relocs
3915 against symbols in discarded sections. Pass is_discarded
3916 param.
3917 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
3918 Add is_discarded param.
3919 * powerpc (Target_powerpc::Scan::local): Likewise. Use
3920 is_discarded to flag opd entry as discarded. Don't emit dyn
3921 relocs on such entries.
3922 (Target_powerpc::Scan::global): Similarly detect and handle
3923 such opd entries.
3924 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
3925 opd_ent_. Update all uses.
3926 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
3927 (Target_powerpc::relocate_section): Zero out discarded opd
3928 entry relocs.
3929
d77a0555
ILT
39302012-09-12 Ian Lance Taylor <iant@google.com>
3931
3932 PR gold/14570
3933 * output.cc: Rename Output_data_got template parameter from size
3934 to got_size for all functions. Compile all variants of
3935 Output_data_got.
3936 (Output_data_got::Got_entry::write): Correct use of size for
3937 symbol value. Use local_is_tls rather than casting to
3938 Sized_relobj_file.
3939 * object.h (class Object): Add local_is_tls and do_local_is_tls.
3940 (class Sized_relobj_file): Add do_local_is_tls.
3941 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
3942
815a1205
AM
39432012-09-11 Alan Modra <amodra@gmail.com>
3944
3945 PR gold/14566
3946 * layout.cc (Layout::set_segment_offsets): When using
3947 common-page-size alignment, ensure we are on a new max-page-size
3948 page.
3949 * output.cc (Output_segment::set_section_addresses): Use
3950 abi_pagesize, not common_pagesize for relro boundary.
3951 (Output_segment::set_offset): Likewise.
3952
bd73a62d
AM
39532012-09-11 Alan Modra <amodra@gmail.com>
3954
3955 * output.h (Output_data_got::add_global_tls, add_local_tls,
3956 add_local_tls_pair): New functions.
3957 (Output_data_got::add_local_pair_with_rel): Remove second
3958 reloc param. Expand comment.
3959 (Output_data_got::Got_entry): Rename use_plt_offset_ to
3960 use_plt_or_tls_offset_, similarly for constructor param.
3961 (Output_data_got::Got_entry::write): Add got_index param.
3962 * output.cc (Output_data_got::add_global_tls, add_local_tls,
3963 add_local_tls_pair): New functions.
3964 (Output_data_got::Got_entry::write): Handle tls symbols
3965 with use_plt_or_tls_offset_ set specially.
3966 (Output_data_got::add_local_pair_with_rel): Only one reloc.
3967 (Output_data_got::do_write): Replace iterator with index, pass
3968 index to entry write function.
3969 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
3970 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
3971 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
3972 call.
3973 * i386.cc (Target_i386::Scan::local): Likewise.
3974 * sparc.cc (Target_sparc::Scan::local): Likewise.
3975 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
3976 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
3977 do_tls_offset_for_global): New functions.
3978 (Target_powerpc::Scan::local): Correct TLS relocations and got
3979 entry values.
3980 (Target_powerpc::Scan::global): Don't emit unnecessary
3981 dynamic relocations on TLS GOT entries.
3982
00716ab1
AM
39832012-09-10 Matthias Klose <doko@ubuntu.com>
3984
3985 * config.in: Disable sanity check for kfreebsd.
3986
c891b3f9
SA
39872012-09-10 Sterling Augustine <saugustine@google.com>
3988
3989 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
3990 (Gdb_index::pubtypes_read): New parameter.
3991 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
3992 to calls.
3993 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
3994 pubtypes_object_.
3995
e81fea4d
AM
39962012-09-09 Alan Modra <amodra@gmail.com>
3997
3998 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
3999 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
4000 * gc.h (gc_process_relocs): Call target gc_add_reference.
4001 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
4002 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
4003 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
4004 unnecessary cast.
4005 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
4006 to cater for when we don't need code offset. Update use.
4007 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
4008 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
4009 set_opd_valid): New functions.
4010 (Target_powerpc::do_gc_add_reference): New function.
4011 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
4012 stashed refs.
4013 (Target_powerpc::do_gc_mark_symbol): New function.
4014
d2d60eef
CC
40152012-09-06 Cary Coutant <ccoutant@google.com>
4016
4017 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
4018 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
4019 (Dwarf_die::skip_attributes): Likewise.
4020 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
4021 * testsuite/gdb_index_test.cc (inline_func_1): New function.
4022 (main): Call it.
4023 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
4024
32ed4573
L
40252012-09-05 H.J. Lu <hongjiu.lu@intel.com>
4026
4027 * testsuite/script_test_3.t: Add .got.plt output section
4028 statement.
4029 * testsuite/script_test_4.t: Likewise.
4030
f4baf0d4
AM
40312012-09-05 Alan Modra <amodra@gmail.com>
4032
4033 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
4034 update all uses and lose "enum" when using type.
4035
864a1b56
AM
40362012-09-05 Alan Modra <amodra@gmail.com>
4037
4038 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
4039 * configure: Regenerate.
4040 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
4041 (plugin_final_layout.stdout): Likewise.
4042 (memory_test): Set page sizes to 0x1000.
4043 * testsuite/Makefile.in: Regenerate.
4044 * testsuite/discard_locals_test.sh: Add FIXME comment.
4045 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
4046 * testsuite/pr14265.t: Add .got output section statement.
4047 * testsuite/script_test_2.t: Likewise.
4048 * testsuite/script_test_3.t: Likewise.
4049 * testsuite/script_test_4.t: Likewise.
4050 * testsuite/script_test_5.t: Likewise.
4051 * testsuite/script_test_6.t: Likewise.
4052 * testsuite/script_test_7.t: Likewise.
4053 * testsuite/script_test_9.t: Likewise.
4054
3ea0a085
AM
40552012-09-05 Alan Modra <amodra@gmail.com>
4056
4057 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
4058 (Powerpc_relocate_functions::Status): New typedef.
4059 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4060 (Target_powerpc::Scan::local): Handle REL64.
4061 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
4062 for REL32 and REL64.
4063 (Target_powerpc::symval_for_branch): New function, extracted from..
4064 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
4065 checks. Report overflow errors.
4066
7404fe1b
AM
40672012-09-05 Alan Modra <amodra@gmail.com>
4068
4069 * object.h (Sized_relobj_file::emit_relocs): Delete.
4070 (Sized_relobj_file::emit_relocs_reltype): Delete.
4071 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
4072 relocate_relocs for --emit-relocs.
4073 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
4074 * output.h: Update comment.
4075 (Output_segment::first_section): New function.
4076 (Output_segment::first_section_load_address): Use first_section.
4077 * output.cc (Output_segment::first_section): New function extracted..
4078 (Output_segment::first_section_load_address): ..from here. Delete.
4079 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
4080 * target.h (Sized_target::relocate_for_relocatable): Likewise.
4081 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
4082 adjust call to target.h function.
4083 * i386.cc (Target_i386): Likewise.
4084 * sparc.cc (Target_sparc): Likewise.
4085 * x86_64.cc (Target_x86_64): Likewise.
4086 * powerpc.cc (Target_powerpc): Likewise.
4087 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
4088 first tls section has section symbol for optimised local dynamic
4089 output relocs.
4090 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
4091 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
4092 optimised tls code.
4093 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
4094 Rename to relocate_relocs. Update error message.
4095
957564c9
AS
40962012-09-04 Andreas Schwab <schwab@linux-m68k.org>
4097
4098 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
4099 --just-symbols.
4100
dd93cd0a
AM
41012012-08-31 Alan Modra <amodra@gmail.com>
4102
4103 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
4104 (Powerpc_relobj::toc_base_offset): New stub function.
4105 (Target_powerpc): Add tp_offset, dtp_offset. Rename
4106 got_mod_index_offset to tlsld_got_offset. Update all refs.
4107 (Target_powerpc::Relocate::enum skip_tls): New.
4108 (Target_powerpc::call_tls_get_addr_): New var.
4109 (Target_powerpc::is_branch_reloc): Move to file scope.
4110 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
4111 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
4112 New functions.
4113 (Target_powerpc::enum Got_type): Delete old values, add new ones.
4114 (powerpc_info): Correct common_pagesize for ppc64.
4115 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
4116 (Powerpc_relocate_functions): Add overflow check enums and functions.
4117 Add non-shift version of rela, rela_ua. Delete all rel public
4118 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
4119 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
4120 addr16_ha3, addr14 functions.
4121 (Output_data_got_powerpc::add_constant_pair): New function.
4122 (Output_data_got_powerpc::got_base_offset): Likewise.
4123 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
4124 (instruction constants): Sort, add some more.
4125 (Output_data_glink::do_write): Add and use Address typedef. Use
4126 object->toc_base_offset() stub for 64-bit.
4127 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
4128 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4129 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
4130 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
4131 Always treat .opd relocs as against locally defined symbol.
4132 Correct condition for RELATIVE relocs.
4133 (Target_powerpc::do_finalize_sections): Test for NULL sections.
4134 (Target_powerpc::Relocate::relocate): Use plt call stub as value
4135 for 32-bit syms with a plt entry. Correct ppc64 toc base
4136 calculations. Handle TLS relocs, and more. Add overflow
4137 checking and adjust for Powerpc_relocate_functions changes.
4138 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
4139 Reinstate --emit-relocs code with FIXME.
4140
a1373b60
AM
41412012-08-30 Alan Modra <amodra@gmail.com>
4142
4143 * layout.cc (Layout::set_segment_offsets): Set p_align to
4144 abi_pagesize, not common_pagesize.
4145 (Layout::relaxation_loop_body): Similarly use abi_pagesize
4146 to determine whether file header can go in segment.
4147
703d02da
AM
41482012-08-30 Alan Modra <amodra@gmail.com>
4149
4150 * output.h (Output_reloc::Output_reloc <output section>): Add
4151 is_relative param. Adjust calls.
4152 (Output_reloc::add_output_section_relative): New functions.
4153 * output.cc (Output_reloc::Output_reloc <output section>): Handle
4154 is_relative.
4155 (Output_reloc::symbol_value): Handle SECTION_CODE.
4156
16164a6b
ST
41572012-08-24 Sriraman Tallam <tmsriram@google.com>
4158
4159 * gold.cc (queue_middle_tasks): Call layout again when unique
4160 segments for sections is desired.
4161 * layout.cc (Layout::Layout): Initialize new members.
4162 (Layout::get_output_section_flags): New function.
4163 (Layout::choose_output_section): Call get_output_section_flags.
4164 (Layout::layout): Make output section for mapping to a unique segment.
4165 (Layout::insert_section_segment_map): New function.
4166 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 4167 output sections marked so.
16164a6b
ST
4168 (Layout::segment_precedes): Check for unique segments when sorting.
4169 * layout.h (Layout::Unique_segment_info): New struct.
4170 (Layout::Section_segment_map): New typedef.
4171 (Layout::insert_section_segment_map): New function.
4172 (Layout::get_output_section_flags): New function.
4173 (Layout::is_unique_segment_for_sections_specified): New function.
4174 (Layout::set_unique_segment_for_sections_specified): New function.
4175 (Layout::unique_segment_for_sections_specified_): New member.
4176 (Layout::section_segment_map_): New member.
4177 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
4178 Rename is_gc_pass_one to is_pass_one.
4179 Rename is_gc_pass_two to is_pass_two.
4180 Rename is_gc_or_icf to is_two_pass.
4181 Check for which pass based on whether symbols data is present.
4182 Make it two pass when unique segments for sections is desired.
4183 * output.cc (Output_section::Output_section): Initialize new
4184 members.
4185 * output.h (Output_section::is_unique_segment): New function.
4186 (Output_section::set_is_unique_segment): New function.
4187 (Output_section::is_unique_segment_): New member.
4188 (Output_section::extra_segment_flags): New function.
4189 (Output_section::set_extra_segment_flags): New function.
4190 (Output_section::extra_segment_flags_): New member.
4191 (Output_section::segment_alignment): New function.
4192 (Output_section::set_segment_alignment): New function.
4193 (Output_section::segment_alignment_): New member.
4194 (Output_segment::Output_segment): Initialize is_unique_segment_.
4195 (Output_segment::is_unique_segment): New function.
4196 (Output_segment::set_is_unique_segment): New function.
4197 (Output_segment::is_unique_segment_): New member.
4198 * plugin.cc (allow_unique_segment_for_sections): New function.
4199 (unique_segment_for_sections): New function.
4200 (Plugin::load): Add new functions to transfer vector.
4201 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
4202 * Makefile.in: Regenerate.
4203 * testsuite/plugin_final_layout.sh: Check if unique segment
4204 functionality works.
4205 * testsuite/plugin_section_order.c (onload): Check if new interfaces
4206 are available.
4207 (allow_unique_segment_for_sections): New global.
4208 (unique_segment_for_sections): New global.
4209 (claim_file_hook): Call allow_unique_segment_for_sections.
4210 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 4211
1e2bee4f
CC
42122012-08-22 Cary Coutant <ccoutant@google.com>
4213
4214 * layout.cc (Layout::include_section): Don't assert on GROUP
4215 sections with --emit-relocs.
4216
1d5dfe78
CC
42172012-08-21 Cary Coutant <ccoutant@google.com>
4218
4219 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
4220 if --export-dynamic-symbol names an undef symbol.
4221
c9269dff
AM
42222012-08-18 Alan Modra <amodra@gmail.com>
4223
4224 * powerpc.cc: Formatting and white space.
4225 (Powerpc_relobj): Rename got2_section_ to special_.
4226 Add opd_ent_shndx_ and opd_ent_off_ vectors.
4227 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
4228 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
4229 (Target_powerpc): Add Address typedef and invalid_address. Use
4230 throughout.
4231 (Target_powerpc::is_branch_reloc): New function.
4232 (Powerpc_relocate_functions): Add Address typedef, use throughout.
4233 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
4234 for dst_mask, value and addend.
4235 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
4236 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
4237 (Output_data_glink::do_write): Correct toc base. Don't try to use
4238 uint16_t for 24-bit offset. Use get_output_section_offset and
4239 check return.
4240 (Target_powerpc::Scan::local): Handle more relocs.
4241 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
4242 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
4243 Plug in toc restoring insn after plt calls. Translate branches
4244 to function descriptor symbols to corresponding entry point.
4245 (Target_powerpc::relocate_for_relocatable): Check return from
4246 get_output_section_offset.
4247 * symtab.h: Comment typo.
4248
b1759dce
ILT
42492012-08-14 Ian Lance Taylor <iant@google.com>
4250
4251 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
4252 unsupported_relocal_local to call unsupported_reloc_global.
4253
b9b2ae8b
NC
42542012-08-14 Nick Clifton <nickc@redhat.com>
4255
4256 PR ld/14265
4257 * script-sections.cc (Sections_element::output_section_name): Add
4258 keep return parameter.
4259 (Output_section_element::match_name): Add keep return parameter.
4260 Return the value of the keep_ member.
4261 * script-sections.h (class Output_section): Update
4262 output_section_name prototype.
4263 * layout.cc (Layout::keep_input_section): New public member
4264 function.
4265 (Layout::choose_output_section): Pass keep parameter to
4266 output_section_name.
4267 * layout.h (class Layout): Add keep_input_section.
4268 * object.cc (Sized_relobj_file::do_layout): Check for kept input
4269 sections.
4270 * testsuite/Makefile.am: Add a test.
4271 * testsuite/Makefile.in: Regenerate.
4272 * testsuite/pr14265.c: Source file for the test.
4273 * testsuite/pr14265.t: Linker script for the test.
4274 * testsuite/pr14265.sh: Shell script for the test.
4275
921b5322
AM
42762012-08-14 Alan Modra <amodra@gmail.com>
4277
4278 * target.h (Target::output_section_name): New function.
4279 (Target::do_output_section_name): New function.
4280 * layout.cc (Layout::choose_output_section): Call the above.
4281 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
4282
6ce78956
AM
42832012-08-14 Alan Modra <amodra@gmail.com>
4284
4285 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
4286 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
4287 for replace_constant call.
4288 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
4289 (Output_data_glink::do_print_to_mapfile): New function.
4290 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
4291 (Target_powerpc::Relocate::relocate): Likewise.
4292
d1a8cabd
AM
42932012-08-14 Alan Modra <amodra@gmail.com>
4294
4295 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
4296 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
4297 (Output_data_glink::add_entry,find_entry): Remove shndx param.
4298 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
4299 all references to shndx_. Handle special case for R_PPC_PLTREL24
4300 here.
4301 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
4302 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
4303 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
4304 here.
4305 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
4306 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
4307
d83ce4e3
AM
43082012-08-12 Alan Modra <amodra@gmail.com>
4309
4310 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
4311 (glink insn constants): Use uint32_t.
4312 (Output_data_glink::add_entry): Use insert, not [] operator.
4313
cf43a2fe
AM
43142012-08-11 Alan Modra <amodra@gmail.com>
4315
4316 * object.h (Sized_relobj_file::find_shdr): New function.
4317 (Sized_relobj_file::find_special_sections): New function.
4318 * object.cc (Sized_relobj_file::find_shdr): New function.
4319 (Sized_relobj_file::find_eh_frame): Use find_shdr.
4320 (Sized_relobj_file::find_special_sections): New function, split out..
4321 (Sized_relobj_file::do_read_symbols): ..from here.
4322 * output.h (Output_data_got::replace_constant): New function.
4323 (Output_data_got::num_entries): New function.
4324 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
4325 (Output_data_got::got_offset): Protected rather than private.
4326 (Output_data_got::replace_got_entry): New function.
4327 * output.cc (Output_data_got::replace_got_entry): New function.
4328 * powerpc.cc (class Powerpc_relobj): New.
4329 (class Powerpc_relocate_functions): Delete all psymval variants or
4330 convert to value,addend type. Delete pcrela, pcrela_unaligned.
4331 Implement _ha functions using corresponding _hi function.
4332 (Powerpc_relobj::find_special_sections): New function.
4333 (Target_powerpc::do_make_elf_object): New function.
4334 (class Output_data_got_powerpc): New.
4335 (class Output_data_glink): New.
4336 (class Powerpc_scan_relocatable_reloc): New.
4337 Many more changes througout file.
4338
3c892704
NC
43392012-08-09 Nick Clifton <nickc@redhat.com>
4340
4341 * po/vi.po: Updated Vietnamese translation.
4342
82435b3b
ILT
43432012-08-07 Ian Lance Taylor <iant@google.com>
4344
4345 * layout.cc (Layout::add_target_dynamic_tags): If
4346 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
4347 plt_rel.
4348
a6dc81d2
NC
43492012-07-30 Nick Clifton <nickc@redhat.com>
4350
4351 * po/gold.pot: Updated template.
4352 * po/es.po: Updated Spanish translation.
4353
f1415016
CC
43542012-07-18 Cary Coutant <ccoutant@google.com>
4355
4356 PR gold/14344
4357 * configure.ac: Add check for -gpubnames support.
4358 * configure: Regenerate.
4359 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
4360 support; force -gno-pubnames.
4361 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
4362 support.
4363 (gdb_index_test_4): New test.
4364 * testsuite/Makefile.in: Regenerate.
4365 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
4366 * testsuite/gdb_index_test_2.sh: Likewise.
4367 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
4368 * testsuite/gdb_index_test_4.sh: New script.
4369 * testsuite/gdb_index_test_comm.sh: New script with common code;
4370 don't look for space after colon.
4371
b7fd7c37
ST
43722012-07-16 Sriraman Tallam <tmsriram@google.com>
4373
4374 * gold.cc (queue_middle_tasks): Update function order only after
4375 deferred objects due to plugins are processed.
4376
1f3212db
ILT
43772012-07-11 Ian Lance Taylor <iant@google.com>
4378
4379 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
4380 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
4381 (Target_arm::scan_reloc_for_stub): Likewise.
4382 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
4383 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
4384 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
4385 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
4386 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
4387
81c82a68
ILT
43882012-07-10 Dodji Seketeli <dodji@redhat.com>
4389 Ian Lance Taylor <iant@google.com>
4390
4391 PR gold/14309
4392 * configure.ac: Test whether std::tr1::hash<off_t> works.
4393 * gold.h: Add a specialization for std::tr1::hash<off_t> if
4394 needed.
4395 * output.h (class Output_fill): Add virtual destructor.
4396 * configure, config.in: Rebuild.
4397
eabc84f4
RM
43982012-06-22 Roland McGrath <mcgrathr@google.com>
4399
4400 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
4401
370e30b6
RÁE
44022012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
4403
4404 * plugin.cc (Plugin::load): Handle position independent executables.
4405
fb1b895d
CC
44062012-06-06 Cary Coutant <ccoutant@google.com>
4407
4408 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
4409 add .debug_macro.
4410 (lines_only_debug_sections): Likewise.
4411 (gdb_fast_lookup_sections): New static array.
4412 (is_gdb_debug_section): Rename formal parameter.
4413 (is_lines_only_debug_section): Likewise.
4414 (is_gdb_fast_lookup_section): New function.
4415 (Layout::include_section): Check for ".zdebug_" prefix; pass
4416 section name suffix to is_gdb_debug_section, et al.; check for
4417 fast-lookup sections when building .gdb_index.
4418 * options.h (--strip-debug-gdb): Update GDB version number.
4419
7c0640fa
CC
44202012-06-06 Cary Coutant <ccoutant@google.com>
4421
4422 * configure.ac: Add check for fallocate.
4423 * configure: Regenerate.
4424 * config.in: Regenerate.
4425
4426 * options.h (class General_options): Add --mmap-output-file and
4427 --posix-fallocate options.
4428 * output.cc: (posix_fallocate): Remove; replace with...
4429 (gold_fallocate): New function.
4430 (Output_file::map_no_anonymous): Call gold_fallocate.
4431 (Output_file::map): Check --mmap-output-file option.
4432
2a49eb69
DK
44332012-06-05 Jing Yu <jingyu@google.com>
4434
4435 * gold.h (textdomain): Add do {} to empty while(0).
4436 (bindtextdomain): Likewise.
4437
fad072ac
CC
44382012-06-04 Cary Coutant <ccoutant@google.com>
4439
4440 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
4441 has_dynsym_index.
4442
8cc69fb6
ST
44432012-05-25 Sriraman Tallam <tmsriram@google.com>
4444
4445 * symtab.cc (Symbol_table::define_special_symbol):
4446 Initialize *poldsym to prevent uninitialized variable errors.
4447
1be75daa
CC
44482012-05-23 Cary Coutant <ccoutant@google.com>
4449
4450 * layout.cc (Layout::section_name_mapping): Add rules to handle
4451 exact match on .data.rel.ro.local or .data.rel.ro.
4452 (Layout::output_section_name): Check for exact matches.
4453
9b689de0
CC
44542012-05-23 Cary Coutant <ccoutant@google.com>
4455
4456 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
4457 more carefully.
4458
b24fdbf5
CC
44592012-05-22 Cary Coutant <ccoutant@google.com>
4460
4461 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
4462 object before exporting symbol.
4463
e550e1a2
L
44642012-05-21 H.J. Lu <hongjiu.lu@intel.com>
4465
4466 * testsuite/tls_test.cc: Include "config.h" first.
4467 * testsuite/tls_test_c.c: Likewise.
4468
df7b86aa
NC
44692012-05-17 Daniel Richard G. <skunk@iskunk.org>
4470 Nick Clifton <nickc@redhat.com>
4471
4472 PR 14072
4473 * configure.in: Add check that sysdep.h has been included before
4474 any system header files.
4475 * configure: Regenerate.
4476 * config.in: Regenerate.
4477
1007b503
CC
44782012-05-14 Cary Coutant <ccoutant@google.com>
4479
4480 * layout.cc (Layout::make_output_section): Mark .tdata section
4481 as RELRO.
4482 * testsuite/relro_test.cc: Add a TLS variable.
4483
fd885f3a
L
44842012-05-10 H.J. Lu <hongjiu.lu@intel.com>
4485
4486 PR gold/14091
4487 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
4488 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
4489 R_X86_64_64.
4490
80f5885c
CC
44912012-05-08 Cary Coutant <ccoutant@google.com>
4492
4493 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
4494 (lines_only_debug_sections): Likewise.
4495
2e702c99
RM
44962012-05-02 Roland McGrath <mcgrathr@google.com>
4497
4498 * nacl.cc: New file.
4499 * nacl.h: New file.
4500 * Makefile.am (CCFILES, HFILES): Add them.
4501 * Makefile.in: Regenerate.
4502 * i386.cc (Output_data_plt_i386_nacl): New class.
4503 (Output_data_plt_i386_nacl_exec): New class.
4504 (Output_data_plt_i386_nacl_dyn): New class.
4505 (Target_i386_nacl): New class.
4506 (Target_selector_i386_nacl): New class.
4507 (target_selector_i386): Use it instead of Target_selector_i386.
4508 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
4509 (Target_x86_64_nacl): New class.
4510 (Target_selector_x86_64_nacl): New class.
4511 (target_selector_x86_64, target_selector_x32): Use it instead of
4512 Target_selector_x86_64.
4513 * arm.cc (Output_data_plt_arm_nacl): New class.
4514 (Target_arm_nacl): New class.
4515 (Target_selector_arm_nacl): New class.
4516 (target_selector_arm, target_selector_armbe): Use it instead of
4517 Target_selector_arm.
4518
4519 * target-select.cc (select_target): Take new Input_file* and off_t
4520 arguments, pass them on to recognize method of selector.
4521 * object.cc (make_elf_sized_object): Update caller.
4522 * parameters.cc (parameters_force_valid_target): Likewise.
4523 * incremental.cc (make_sized_incremental_binary): Likewise.
4524 * target-select.h: Update decl.
4525 (Target_selector::recognize): Take new Input_file* argument,
4526 pass it on to do_recognize.
4527 (Target_selector::do_recognize): Take new Input_file* argument.
4528 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
4529 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
4530 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
4531 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
4532
4533 * target.h (Target::Target_info): New members isolate_execinstr
4534 and rosegment_gap.
4535 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
4536 * arm.cc (Target_arm::arm_info): Update initializer.
4537 * i386.cc (Target_i386::i386_info): Likewise.
4538 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
4539 * sparc.cc (Target_sparc::sparc_info): Likewise.
4540 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
4541 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
4542 * layout.cc (Layout::attach_allocated_section_to_segment):
4543 Take new const Target* argument. If target->isolate_execinstr(), act
4544 like --rosegment.
4545 (Layout::find_first_load_seg): Take new const Target* argument;
4546 if target->isolate_execinstr(), reject PF_X segments.
4547 (Layout::relaxation_loop_body): Update caller.
4548 (Layout::set_segment_offsets): If target->isolate_execinstr(),
4549 reset file offset to zero when we hit LOAD_SEG, and then do a second
4550 loop over the segments before LOAD_SEG to reassign offsets after
4551 addresses have been determined. Handle target->rosegment_gap().
4552 (Layout::attach_section_to_segment): Take new const Target* argument;
4553 pass it to attach_allocated_section_to_segment.
4554 (Layout::make_output_section): Update caller.
4555 (Layout::attach_sections_to_segments): Take new const Target* argument;
4556 pass it to attach_section_to_segment.
4557 * gold.cc (queue_middle_tasks): Update caller.
4558 * layout.h (Layout): Update method decls with new arguments.
4559
4560 * arm.cc (Target_arm::Target_arm): Take optional argument for the
4561 Target_info pointer to use.
4562 (Target_arm::do_make_data_plt): New virtual method.
4563 (Target_arm::make_data_plt): New method that calls it.
4564 (Target_arm::make_plt_entry): Use it.
4565 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
4566 for the section alignment.
4567 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
4568 method.
4569 (Output_data_plt_arm::first_plt_entry_offset): Call it.
4570 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
4571 method.
4572 (Output_data_plt_arm::get_plt_entry_size): Call it.
4573 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
4574 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
4575 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
4576 method.
4577 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
4578 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
4579 method instead of sizeof(plt_entry).
4580 (Output_data_plt_arm::add_entry): Likewise.
4581 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
4582 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
4583 than static method.
4584 (Target_arm::plt_entry_size): Likewise.
4585 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
4586 Move to ...
4587 (Output_data_plt_arm_standard): ... here, new class.
4588 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
4589 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
4590 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
4591
4592 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
4593 Take additional argument for the PLT entry size.
4594 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
4595 Use get_plt_entry_size method rather than plt_entry_size variable.
4596 (Output_data_plt_x86_64::reserve_slot): Likewise.
4597 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
4598 (Output_data_plt_x86_64::add_entry): Likewise.
4599 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
4600 (Output_data_plt_x86_64::address_for_global): Likewise.
4601 (Output_data_plt_x86_64::address_for_local): Likewise.
4602 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4603 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
4604 Make method non-static.
4605 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
4606 method.
4607 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
4608 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
4609 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
4610 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
4611 virtual method.
4612 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
4613 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
4614 virtual method.
4615 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
4616 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
4617 virtual method.
4618 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
4619 (Output_data_plt_x86_64::plt_entry_size)
4620 (Output_data_plt_x86_64::first_plt_entry)
4621 (Output_data_plt_x86_64::plt_entry)
4622 (Output_data_plt_x86_64::tlsdesc_plt_entry)
4623 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
4624 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
4625 (Output_data_plt_x86_64_standard): ... here, new class.
4626 (Target_x86_64::Target_x86_64): Take optional argument for the
4627 Target_info pointer to use.
4628 (Target_x86_64::do_make_data_plt): New virtual method.
4629 (Target_x86_64::make_data_plt): New method to call it.
4630 (Target_x86_64::init_got_plt_for_update): Use that.
4631 Call this->plt_->add_eh_frame method here.
4632 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
4633 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
4634 rather than static method.
4635 (Target_x86_64::plt_entry_size): Likewise.
4636 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
4637 rather than plt_entry_size variable. Move guts of PLT filling to...
4638 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
4639 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
4640 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
4641
4642 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
4643 additional argument for the section alignment.
4644 Don't do add_eh_frame_for_plt here.
4645 (Output_data_plt_i386::first_plt_entry_offset): Make the method
4646 non-static. Use get_plt_entry_size method rather than plt_entry_size
4647 variable.
4648 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
4649 method.
4650 (Output_data_plt_i386::get_plt_entry_size): Call it.
4651 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
4652 (Output_data_plt_i386::add_eh_frame): New method to call it.
4653 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
4654 method.
4655 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
4656 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
4657 method.
4658 (Output_data_plt_i386::fill_plt_entry): New method to call it.
4659 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
4660 method instead of plt_entry_size.
4661 (Output_data_plt_i386::plt_entry_size)
4662 (Output_data_plt_i386::plt_eh_frame_fde_size)
4663 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
4664 (Output_data_plt_i386_standard): ... here, new class.
4665 (Output_data_plt_i386_exec): New class.
4666 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
4667 (Output_data_plt_i386_exec::first_plt_entry): ... here.
4668 (Output_data_plt_i386::exec_plt_entry): Move to ...
4669 (Output_data_plt_i386_exec::plt_entry): ... here.
4670 (Output_data_plt_i386_dyn): New class.
4671 (Output_data_plt_i386::first_plt_entry): Move to ...
4672 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
4673 (Output_data_plt_i386::dyn_plt_entry): Move to ...
4674 (Output_data_plt_i386_dyn::plt_entry): ... here.
4675 (Target_i386::Target_i386): Take optional argument for the Target_info
4676 pointer to use.
4677 (Target_i386::do_make_data_plt): New virtual method.
4678 (Target_i386::make_data_plt): New method to call it.
4679 (Target_i386::make_plt_section): Use that.
4680 Call this->plt_->add_eh_frame method here.
4681 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
4682 rather than plt_entry_size variable.
4683 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
4684 (Output_data_plt_i386::address_for_local): Likewise.
4685 (Output_data_plt_i386::do_write): Likewise.
4686 Move guts of PLT filling to...
4687 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
4688 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
4689 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
4690 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
4691
b9b9f2ee
CC
46922012-05-01 Cary Coutant <ccoutant@google.com>
4693
4694 * dwarf_reader.cc (Dwarf_die::read_attributes)
4695 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
4696 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
4697 * reduced_debug_output.cc
4698 (Output_reduced_debug_info_section::get_die_end): Remove
4699 DW_FORM_GNU_ref_index. Add default case.
4700
57923f48
MW
47012012-04-26 Mark Wielaard <mjw@redhat.com>
4702
4703 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
4704 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
4705 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
4706 DW_AT_high_pc as offset from DW_AT_low_pc.
4707
4708 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
4709 * testsuite/Makefile.in: Regenerate.
4710 * testsuite/gdb_index_test_3.c: New test source file.
4711 * testsuite/gdb_index_test_3.sh: New test source file.
4712
2c54b4f4
ILT
47132012-04-25 Ian Lance Taylor <iant@google.com>
4714
4715 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
4716 pointer.
4717 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
4718 as a class, not a struct.
4719 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
4720 (Target_arm::apply_cortex_a8_workaround): Likewise.
4721 * gc.h: Declare Reloc_types as a struct, not a class.
4722 * object.h: Declare Symbols_data as a struct.
4723 * reloc.h: Declare Read_relocs_data as a struct.
4724 * target.h: Declare Relocate_info as a struct.
4725
a5a5f7a3
DM
47262012-04-24 David S. Miller <davem@davemloft.net>
4727
4728 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
4729 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
4730 and R_SPARC_WPLT30.
4731
f038d496
CC
47322012-04-24 Cary Coutant <ccoutant@google.com>
4733
4734 * incremental-dump.cc (find_input_containing_global): Replace
4735 magic number with symbolic constant.
4736 (dump_incremental_inputs): Update version number.
4737 * incremental.cc (Output_section_incremental_inputs): Update version
4738 number; import symbolic constants from Incremental_inputs_reader.
4739 (Incremental_inputs::create_data_sections): Align relocations
4740 section correctly for 64-bit targets.
4741 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
4742 constants; add padding.
4743 (Output_section_incremental_inputs::write_header): Add assert for
4744 header_size.
4745 (Output_section_incremental_inputs::write_input_files): Add assert
4746 for input_entry_size.
4747 (Output_section_incremental_inputs::write_info_blocks): Add padding;
4748 add assert for object_info_size, input_section_entry_size,
4749 global_sym_entry_size.
4750 * incremental.h (Incremental_inputs_reader): Add symbolic constants
4751 for data structure sizes; use them.
4752 (Incremental_input_entry_reader): Import symbolic constants from
4753 Incremental_inputs_reader; use them.
4754
a4d85145
DM
47552012-04-23 David S. Miller <davem@davemloft.net>
4756
4757 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
4758 and elf_flags_set_.
4759 (Target_sparc::Target_sparc): Initialize new fields.
4760 (Target_sparc::do_make_elf_object): New function.
4761 (Target_sparc::do_adjust_elf_header): New function.
4762
1d509098
CC
47632012-04-23 Cary Coutant <ccoutant@google.com>
4764
4765 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
4766 CU range table of gdb index.
4767
7ebeff7f
DM
47682012-04-20 David S. Miller <davem@davemloft.net>
4769
4770 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
4771 instead of false.
4772
13cf9988
DM
47732012-04-16 David S. Miller <davem@davemloft.net>
4774
2a1079e8
DM
4775 * sparc.cc (Target_sparc::got_address): New function.
4776 (Sparc_relocate_functions::gdop_hix22): New function.
4777 (Sparc_relocate_functions::gdop_lox10): New function.
4778 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
4779 relocs.
4780 (Target_sparc::Scan::local): Likewise if the global symbol is not
4781 preemptible and is not IFUNC.
4782 (Target_sparc::Relocate::relocate): Perform GOTDATA code
4783 transformations for local and non-preemptible non-IFUNC global
4784 symbols.
4785
0bc964fc
DM
4786 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
4787 writing out 64-bit part of ranges.
4788
661d7a80
DM
4789 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
4790 -fpic and -fpie respectively.
4791 * Makefile.in: Regenerate.
4792
8c2bf391
DM
4793 * sparc.cc (class Target_sparc): Add rela_ifunc_.
4794 (Target_sparc::Target_sparc): Initialize new field.
4795 (Target_sparc::do_plt_section_for_global): New function.
4796 (Target_sparc::do_plt_section_for_local): New function.
4797 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
4798 (Target_sparc::make_plt_section): New function, broken out of
4799 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
4800 (Target_sparc::make_plt_entry): Call make_plt_section.
4801 (Target_sparc::make_local_ifunc_plt_entry): New function.
4802 (Target_sparc::rela_ifunc_section): New function.
4803 (Target_sparc::plt_section): Remove const.
4804 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
4805 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
4806 and ifunc_count_ fields.
4807 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
4808 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
4809 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
4810 (Output_data_plt_sparc::rela_ifunc): New function.
4811 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
4812 (Output_data_plt_sparc::has_ifunc_section): New function.
4813 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
4814 (Output_data_plt_sparc::address_for_global): New function.
4815 (Output_data_plt_sparc::address_for_local): New function.
4816 (Output_data_plt_sparc::plt_index_to_offset): New function.
4817 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
4818 and entry_count.
4819 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
4820 entry_count.
4821 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
4822 R_SPARC_JMP_IREL to switch.
4823 (Target_sparc::Scan::check_non_pic): Likewise.
4824 (Target_sparc::Scan::local): Handle IFUNC symbols.
4825 (Target_sparc::Scan::local): Likewise.
4826 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
4827 and plt_address_for_local.
4828 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
4829 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
4830
13cf9988
DM
4831 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
4832 (class Output_data_reloc): Adjust calls to Output_reloc_type.
4833 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
4834 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
4835 global relocs too.
4836 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
4837 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
4838 calls.
4839 * sparc.cc (Target_sparc::Scan::global): Likewise.
4840 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4841
31821be0
CC
48422012-04-16 Cary Coutant <ccoutant@google.com>
4843
4844 * archive.cc (Library_base::should_include_member): Check for
4845 --export-dynamic-symbol.
4846 * options.h (class General_options): Add --export-dynamic-symbol.
4847 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
4848 --export-dynamic-symbol.
4849 (Symbol_table::gc_mark_undef_symbols): Likewise.
4850 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
4851
2615994e
DM
48522012-04-12 David S. Miller <davem@davemloft.net>
4853
4854 * sparc.cc (Reloc::wdisp10): New relocation method.
4855 (Reloc::h34): Likewise.
4856 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
4857 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
4858 R_SPARC_WDISP10.
4859 (Target_sparc::Scan::local): Likewise.
4860 (Target_sparc::Scan::global): Likewise.
4861 (Target_sparc::Relocate::relocate): Likewise.
4862
6782735d
CC
48632012-04-09 Cary Coutant <ccoutant@google.com>
4864
4865 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
4866 low_pc == 0.
4867
8c7a0b00
ILT
48682012-04-06 Ian Lance Taylor <iant@google.com>
4869
4870 * timer.cc: #include <unistd.h>.
4871
58797674
RM
48722012-04-06 Roland McGrath <mcgrathr@google.com>
4873
4874 * configure.in (AC_CHECK_HEADERS): Add locale.h.
4875 * config.in: Regenerate.
4876 * configure: Regenerate.
4877
44350750
NC
48782012-04-05 Nick Clifton <nickc@redhat.com>
4879
4880 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
4881 (AM_LC_MESSAGES): Add.
4882 * aclocal.m4: Regenerate.
4883 * config.in: Regenerate.
4884 * configure: Regenerate.
4885
c1027032
CC
48862012-03-21 Cary Coutant <ccoutant@google.com>
4887
4888 * Makefile.am: Add gdb-index.cc, gdb-index.h.
4889 * Makefile.in: Regenerate.
4890 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
4891 (Sized_elf_reloc_mapper::symbol_section): New function.
4892 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
4893 (make_elf_reloc_mapper): New function.
4894 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
4895 (Dwarf_abbrev_table::do_read_abbrevs): New function.
4896 (Dwarf_abbrev_table::do_get_abbrev): New function.
4897 (Dwarf_ranges_table::read_ranges_table): New function.
4898 (Dwarf_ranges_table::read_range_list): New function.
4899 (Dwarf_pubnames_table::read_section): New function.
4900 (Dwarf_pubnames_table::read_header): New function.
4901 (Dwarf_pubnames_table::next_name): New function.
4902 (Dwarf_die::Dwarf_die): New function.
4903 (Dwarf_die::read_attributes): New function.
4904 (Dwarf_die::skip_attributes): New function.
4905 (Dwarf_die::set_name): New function.
4906 (Dwarf_die::set_linkage_name): New function.
4907 (Dwarf_die::attribute): New function.
4908 (Dwarf_die::string_attribute): New function.
4909 (Dwarf_die::int_attribute): New function.
4910 (Dwarf_die::uint_attribute): New function.
4911 (Dwarf_die::ref_attribute): New function.
4912 (Dwarf_die::child_offset): New function.
4913 (Dwarf_die::sibling_offset): New function.
4914 (Dwarf_info_reader::check_buffer): New function.
4915 (Dwarf_info_reader::parse): New function.
4916 (Dwarf_info_reader::do_parse): New function.
4917 (Dwarf_info_reader::do_read_string_table): New function.
4918 (Dwarf_info_reader::lookup_reloc): New function.
4919 (Dwarf_info_reader::get_string): New function.
4920 (Dwarf_info_reader::visit_compilation_unit): New function.
4921 (Dwarf_info_reader::visit_type_unit): New function.
4922 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
4923 Sized_elf_reloc_mapper.
4924 (Sized_dwarf_line_info::symbol_section): Remove function.
4925 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
4926 (Sized_dwarf_line_info::read_line_mappings): Remove object
4927 parameter, adjust callers.
4928 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
4929 * dwarf_reader.h: Include <sys/types.h>.
4930 (class Track_relocs): Remove forward declaration.
4931 (class Elf_reloc_mapper): New class.
4932 (class Sized_elf_reloc_mapper): New class.
4933 (class Dwarf_abbrev_table): New class.
4934 (class Dwarf_range_list): New class.
4935 (class Dwarf_ranges_table): New class.
4936 (class Dwarf_pubnames_table): New class.
4937 (class Dwarf_die): New class.
4938 (class Dwarf_info_reader): New class.
4939 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
4940 (Sized_dwarf_line_info::symbol_section): Remove member function.
4941 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
4942 base class.
4943 * gdb-index.cc: New source file.
4944 * gdb-index.h: New source file.
4945 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
4946 and .debug_types sections, call Layout::add_to_gdb_index.
4947 (Sized_relobj_incr::do_section_name): Implement.
4948 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
4949 return type; Implement.
4950 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
4951 return type.
4952 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
4953 parameter list and return type.
4954 (Sized_incr_dynobj::do_section_contents): Likewise.
4955 * layout.cc: Include gdb-index.h.
4956 (Layout::Layout): Initialize gdb_index_data_.
4957 (Layout::init_fixed_output_section): Check for .gdb_index section.
4958 (Layout::add_to_gdb_index): New function. Instantiate.
4959 * layout.h: Add forward declaration for class Gdb_index.
4960 (Layout::add_to_gdb_index): New member function.
4961 (Layout::gdb_index_data_): New data member.
4962 * main.cc: Include gdb-index.h.
4963 (main): Print statistics for gdb index.
4964 * object.cc (Object::section_contents): Move code into
4965 do_section_contents.
4966 (need_decompressed_section): Check for sections needed when building
4967 gdb index.
4968 (build_compressed_section_map): Likewise.
4969 (Sized_relobj_file::do_read_symbols): Need local symbols when building
4970 gdb index.
4971 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
4972 sections; call Layout::add_to_gdb_index.
4973 (Sized_relobj_file::do_decompressed_section_contents): Call
4974 do_section_contents directly.
4975 * object.h (Object::do_section_contents): Adjust parameter list and
4976 return type.
4977 (Object::do_decompressed_section_contents): Call do_section_contents
4978 directly.
4979 (Sized_relobj_file::do_section_contents): Adjust parameter list and
4980 return type.
4981 * options.h (class General_options): Add --gdb-index option.
4982 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
4983 list and return type.
4984 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
4985 * reloc.h (Track_relocs::checkpoint): New function.
4986 (Track_relocs::reset): New function.
4987
4988 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
4989 New test cases.
4990 * testsuite/Makefile.in: Regenerate.
4991 * testsuite/gdb_index_test.cc: New test source file.
4992 * testsuite/gdb_index_test_1.sh: New test source file.
4993 * testsuite/gdb_index_test_2.sh: New test source file.
4994
647f1574
DK
49952012-03-19 Doug Kwan <dougkwan@google.com>
4996
4997 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 4998 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
4999 __exidx_start and __exidx_end. Make symbol table parameter
5000 anonymous as it is not used.
5001 * gold.cc (queue_middle_tasks): Call target hook to define any
5002 target-specific symbols.
5003 * target.h (Target::define_standard_symbols): New method.
5004 (Target::do_define_standard_symbols): Same.
5005 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
5006 * testsuite/Makefile.in: Regenerate.
5007 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
5008 and __exidx_end.
5009 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
5010 relocations are generated for __exidx_start and __exidx_end.
5011
7c6109da
DK
50122012-03-16 Doug Kwan <dougkwan@google.com>
5013
5014 * testsuite/Makefile.am: Disable test initpri3b.
5015 * testsuite/Makefile.in: Regenerate.
5016
7b8957f8
DK
50172012-03-15 Doug Kwan <dougkwan@google.com>
5018
5019 * arm.cc (Target_arm::got_section): Make .got section read-only
5020 if -z now is given.
5021
14dc9ef7
ILT
50222012-03-15 Ian Lance Taylor <iant@google.com>
5023
5024 PR gold/13850
5025 * layout.cc (Layout::make_output_section): Correctly mark
5026 SHT_INIT_ARRAY, et. al., as relro.
5027
fa40b62a
DK
50282012-03-14 Doug Kwan <dougkwan@google.com>
5029
5030 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
5031 dynamic relocations for protected symbols in shared objects.
5032
fd325007
ILT
50332012-03-13 Ian Lance Taylor <iant@google.com>
5034
5035 * resolve.cc (Symbol_table::resolve): When merging common symbols,
5036 keep the larger alignment.
5037
e8dd54e1
CC
50382012-03-12 Cary Coutant <ccoutant@google.com>
5039
5040 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
5041 handling of DW_LNE_define_file.
5042
feb5f3b0
CC
50432012-03-12 Cary Coutant <ccoutant@google.com>
5044
5045 * reduced_debug_output.cc
5046 (Output_reduced_debug_info_section::get_die_end): Add new FORM
5047 codes to switch.
5048
a1fb4256
CC
50492012-02-29 Cary Coutant <ccoutant@google.com>
5050
5051 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
5052
5dd8762a
CC
50532012-02-29 Cary Coutant <ccoutant@google.com>
5054
5055 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
5056 Call Object::decompressed_section_contents.
5057 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
5058 New dtor.
5059 (Sized_dwarf_line_info::buffer_start_): New data member.
5060 * merge.cc (Output_merge_data::do_add_input_section): Call
5061 Object::decompressed_section_contents.
5062 (Output_merge_string::do_add_input_section): Likewise.
5063 * object.cc (need_decompressed_section): New function.
5064 (build_compressed_section_map): Decompress sections needed later.
5065 (Sized_relobj_file::do_decompressed_section_contents): New function.
5066 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5067 * object.h (Object::decompressed_section_contents): New function.
5068 (Object::discard_decompressed_sections): New function.
5069 (Object::do_decompressed_section_contents): New function.
5070 (Object::do_discard_decompressed_sections): New function.
5071 (Compressed_section_info): New type.
5072 (Compressed_section_map): Include decompressed section contents.
5073 (Sized_relobj_file::do_decompressed_section_contents): New function.
5074 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5075
7b5de7ee
CC
50762012-02-16 Cary Coutant <ccoutant@google.com>
5077
5078 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
5079 * testsuite/Makefile.in: Regenerate.
5080
f9fa4a63
CC
50812012-02-14 Cary Coutant <ccoutant@google.com>
5082
5083 * options.cc (General_options::finalize): Disallow -pie and -static.
5084
2c175ebc
DK
50852012-02-03 Doug Kwan <dougkwan@google.com>
5086
5087 * arm.cc (Arm_relocate_functions::abs8,
5088 Arm_relocate_functions::abs16): Use
5089 Bits::has_signed_unsigned_overflow32.
5090 (Arm_relocate_functions::thm_abs8): Correct range of
5091 overflow check.
5092 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
5093 in assertions.
5094
90cff06f
DK
50952012-02-02 Doug Kwan <dougkwan@google.com>
5096
5097 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
5098 position independent outputs, not just shared objects.
5099
63887f3d
L
51002012-01-30 H.J. Lu <hongjiu.lu@intel.com>
5101
5102 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
5103 * configure: Regenerated.
5104
bef2b434
ILT
51052012-01-27 Ian Lance Taylor <iant@google.com>
5106
5107 * reloc.h (Bits): New class with static functions, copied from
5108 namespace utils in arm.cc.
5109 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
5110 instead.
5111
c335b55d
L
51122012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5113
5114 * incremental.cc (write_info_blocks): Correct relocation offset.
5115
41194d9f
L
51162012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5117
5118 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
5119 (Relocate::tls_gd_to_le): Likewise.
5120
1bae613c
L
51212012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5122
5123 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
5124
24482ca0
L
51252012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5126
5127 * configure.ac: Check if -mcmodel=medium works.
5128 * configure: Regenerated.
5129
c2c7840a
CC
51302012-01-24 Cary Coutant <ccoutant@google.com>
5131
5132 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
5133 definition and ...
5134 (read_unsigned_LEB_128_x): ... this new function.
5135 (read_signed_LEB_128): Replaced with inline definition and ...
5136 (read_signed_LEB_128_x): ... this new function.
5137 * int_encoding.h (read_unsigned_LEB_128_x): New function.
5138 (read_unsigned_LEB_128): Add inline definition.
5139 (read_signed_LEB_128_x): New function.
5140 (read_signed_LEB_128): Add inline definition.
5141 * testsuite/Makefile.am (leb128_unittest): New unit test.
5142 * testsuite/Makefile.in: Regenerate.
5143 * testsuite/leb128_unittest.cc: New unit test.
5144
833de760 51452012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
5146
5147 PR gold/13617
5148 * i386.cc (Target_i386::do_code_fill): When using a jmp
5149 instruction, pad with nop instructions.
5150 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5151
618d6666
L
51522012-01-22 H.J. Lu <hongjiu.lu@intel.com>
5153
5154 * x86_64.cc (gc_process_relocs): Add typename on types used in
5155 template.
5156 (scan_relocs): Likewise.
5157 (relocate_section): Likewise.
5158 (apply_relocation): Likewise.
5159
3660ff06
L
51602012-01-10 H.J. Lu <hongjiu.lu@intel.com>
5161
5162 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
5163 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
5164 under x32.
5165
fc51264f
L
51662012-01-09 H.J. Lu <hongjiu.lu@intel.com>
5167
5168 * x86_64.cc: Initial support for x32.
5169
dd74ae06
CC
51702012-01-03 Cary Coutant <ccoutant@google.com>
5171
5172 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
5173 Use abstract base class for GOT.
5174 * gold/output.h (class Output_data_got_base): New abstract base class.
5175 (class Output_data_got): Derive from new base class, adjust ctors.
5176 (Output_data_got::reserve_slot): Make virtual; rename to
5177 do_reserve_slot; Adjust callers.
5178 * gold/target.h (Sized_target::init_got_plt_for_update): Return
5179 pointer to abstract base class.
5180 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
5181
83896202
ILT
51822011-12-18 Ian Lance Taylor <iant@google.com>
5183
5184 * object.h (Relobj::local_symbol_value): New function.
5185 (Relobj::local_plt_offset): New function.
5186 (Relobj::local_has_got_offset): New function.
5187 (Relobj::local_got_offset): New function.
5188 (Relobj::set_local_got_offset): New function.
5189 (Relobj::do_local_symbol_value): New pure virtual function.
5190 (Relobj::do_local_plt_offset): Likewise.
5191 (Relobj::do_local_has_got_offset): Likewise.
5192 (Relobj::do_local_got_offset): Likewise.
5193 (Relobj::do_set_local_got_offset): Likewise.
5194 (Sized_relobj::do_local_has_got_offset): Rename from
5195 local_has_got_offset.
5196 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
5197 (Sized_relobj::do_set_local_got_offset): Rename from
5198 set_local_got_offset.
5199 (Sized_relobj_file::do_local_plt_offset): Rename from
5200 local_plt_offset.
5201 (Sized_relobj_file::do_local_symbol_value): New function.
5202 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
5203 local_plt_offset.
5204 * output.cc (Output_data_got::Got_entry::write): Change object to
5205 Relobj. Use local_symbol_value.
5206 (Output_data_got::add_global_with_rel): Change rel_dyn to
5207 Output_data_reloc_generic*. Use add_global_generic.
5208 (Output_data_got::add_global_with_rela): Remove. Change all
5209 callers to use add_global_with_rel.
5210 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
5211 Output_data_reloc_generic*. Use add_global_generic.
5212 (Output_data_got::add_global_pair_with_rela): Remove. Change all
5213 callers to use add_global_pair_with_rel.
5214 (Output_data_got::add_local): Change object to Relobj*.
5215 (Output_data_got::add_local_plt): Likewise.
5216 (Output_data_got::add_local_with_rel): Change object to Relobj*,
5217 change rel_dyn to Output_data_reloc_generic*. Use
5218 add_local_generic.
5219 (Output_data_got::add_local_with_rela): Remove. Change all
5220 callers to use all_local_with_rel.
5221 (Output_data_got::add_local_pair_with_rel): Change object to
5222 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
5223 add_output_section_generic.
5224 (Output_data_got::add_local_pair_with_rela): Remove. Change all
5225 callers to use add_local_pair_with_rel.
5226 (Output_data_got::reserve_local): Change object to Relobj*.
5227 * output.h: (class Output_data_reloc_generic): Add pure virtual
5228 declarations for add_global_generic, add_local_generic,
5229 add_output_section_generic.
5230 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
5231 functions for Output_data_reloc_generic. Update declarations for
5232 changes listed in output.cc.
5233 (class Output_data_got): Change template parameter to got_size.
5234 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
5235 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
5236 function.
5237 (Sized_relobj_incr::do_local_plt_offset): New function.
5238 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
5239 add_global_generic.
5240
76677ad0
CC
52412011-12-17 Cary Coutant <ccoutant@google.com>
5242
5243 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
5244 * resolve.cc (Symbol_table::resolve): Likewise.
5245 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
5246 arrays.
5247 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5248
8b8dd8d5
ILT
52492011-12-16 Ian Lance Taylor <iant@google.com>
5250
5251 * output.h (Output_data_reloc_generic::add): Only call
5252 add_dynamic_reloc if this is a dynamic reloc section.
5253
d55525b9
L
52542011-12-15 H.J. Lu <hongjiu.lu@intel.com>
5255
5256 PR gold/13505
5257 * target-reloc.h (apply_relocation): Replace <64, false> with
5258 <size, big_endian>.
5259
ff81c7c1
NC
52602011-11-25 Nick Clifton <nickc@redhat.com>
5261
5262 * po/it.po: New Italian translation.
5263
628f39be
SA
52642011-11-17 Sterling Augustine <saugustine@google.com>
5265
5266 * script.cc (script_include_directive): Implement.
5267 (read_script_file): New local variables name and search_path. Update
5268 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
5269 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
5270 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
5271
98ef3ea4
SA
52722011-11-11 Sterling Augustine <saugustine@google.com>
5273
5274 * yyscript.y (section_cmd): Add support for INCLUDE directive.
5275 (file_or_sections_cmd): Likewise.
5276
f4a8b6d7
DK
52772011-11-11 Doug Kwan <dougkwan@google.com>
5278
5279 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
5280 if --just-symbols is given.
5281
29ab395d
DK
52822011-11-10 Doug Kwan <dougkwan@google.com>
5283
5284 PR gold/13362
5285 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
5286 when processing data relocs.
5287 * reloc.h (Relocate_functions::rel_unaligned): New method.
5288 (Relocate_functions::pcrel_unaligned): Ditto.
5289 (Relocate_functions::rel32_unaligned): Ditto.
5290 (Relocate_functions::pcrel32_unaligned): Ditto.
5291
2c339f71
DK
52922011-11-09 Doug Kwan <dougkwan@google.com>
5293
5294 PR gold/13362
5295 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
5296 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
5297 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
5298 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5299 (Relocate_functions::rel_unaligned): New.
5300 (Relocate_functions::rel32_unaligned): New.
5301 * target-reloc.h (relocate_for_relocatable): Add code to handle
5302 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5303 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
5304 arm_unaligned_reloc_r): New targets.
5305 * testsuite/Makefile.in: Regenerate.
5306 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
5307 linking.
5308
3f3cddf1
ILT
53092011-11-02 Ian Lance Taylor <iant@google.com>
5310
5311 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
5312 NATIVE_LINKER.
5313 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
5314 * options.cc (General_options::finalize): Use library search path
5315 from configure script if specified. If not native and no sysroot,
5316 only search TOOLLIBDIR.
5317 * options.h (Search_directory::Search_directory): Change name to
5318 const std::string&.
5319 (General_options::add_to_library_path_with_sysroot): Change arg to
5320 const std::string&.
5321 * configure, Makefile.in, config.in: Rebuild.
5322
a8e2273b
ILT
53232011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5324
5325 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
5326 we are working around the ARM1176 Erratum.
5327 * options.h (General_options::fix_arm1176): Add option.
5328 * testsuite/Makefile.am: Add testcases, and keep current ones
5329 working.
5330 * testsuite/Makefile.in: Regenerate.
5331 * testsuite/arm_fix_1176.s: New file.
5332 * testsuite/arm_fix_1176.sh: Likewise.
5333
cd6eab1c
ILT
53342011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5335
5336 * arm.cc (Target_arm::Target_arm): Remove initialisation of
5337 may_use_blx_.
5338 (Target_arm::may_use_blx): Remove method.
5339 (Target_arm::set_may_use_blx): Likewise.
5340 (Target_arm::may_use_v4t_interworking): New method.
5341 (Target_arm::may_use_v5t_interworking): Likewise.
5342 (Target_arm::may_use_blx_): Remove member variable.
5343 (Arm_relocate_functions::arm_branch_common): Check for v5T
5344 interworking.
5345 (Arm_relocate_functions::thumb_branch_common): Likewise.
5346 (Reloc_stub::stub_type_for_reloc): Likewise.
5347 (Target_arm::do_finalize_sections): Correct interworking checks.
5348 * testsuite/Makefile.am: Add new tests.
5349 * testsuite/Makefile.in: Regenerate.
5350 * testsuite/arm_farcall_arm_arm.s: New test.
5351 * testsuite/arm_farcall_arm_arm.sh: Likewise.
5352 * testsuite/arm_farcall_arm_thumb.s: Likewise.
5353 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
5354 * testsuite/arm_farcall_thumb_arm.s: Likewise.
5355 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
5356 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
5357 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
5358
286adcf4
CC
53592011-10-31 Cary Coutant <ccoutant@google.com>
5360
5361 PR gold/13023
5362 * expression.cc (Expression::eval_with_dot): Add
5363 is_section_dot_assignment parameter.
5364 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
5365 absolute and assigning to dot within a section.
5366 * script-sections.cc
5367 (Output_section_element_assignment::set_section_addresses): Pass
5368 dot_section to set_if_absolute.
5369 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
5370 as is_section_dot_assignment flag to eval_with_dot.
5371 (Output_section_element_dot_assignment::set_section_addresses):
5372 Likewise.
5373 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
5374 parameter. Also set value if relative to dot_section; set the
5375 symbol's output_section.
5376 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
5377 parameter. Adjust all callers.
5378 (Expression::eval_maybe_dot): Likewise.
5379 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
5380 Adjust all callers.
5381 * testsuite/script_test_2.t: Test assignment of an absolute value
5382 to dot within an output section element.
5383
9634ed06
CC
53842011-10-31 Cary Coutant <ccoutant@google.com>
5385
5386 * options.h (class General_options): Add --[no-]gnu-unique options.
5387 * symtab.cc (Symbol_table::sized_write_globals): Convert
5388 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
5389
de4101c7
CC
53902011-10-31 Cary Coutant <ccoutant@google.com>
5391
5392 PR gold/13359
5393 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
5394 unnecessary assertion.
5395 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
5396
7257cc92
ST
53972011-10-31 Sriraman Tallam <tmsriram@google.com>
5398
5399 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5400 gc_mark_symbol.
5401 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5402 gc_mark_symbol.
5403 Change to just keep the section associated with symbol.
5404 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
5405 they are externally visible and --export-dynamic is turned on.
5406 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
5407
bfc34b3f
ILT
54082011-10-19 Ian Lance Taylor <iant@google.com>
5409
5410 PR gold/13163
5411 * script-sections.cc
5412 (Output_section_element_dot_assignment::needs_output_section): New
5413 function.
5414
ea0d8c47
ILT
54152011-10-19 Ian Lance Taylor <iant@google.com>
5416
5417 PR gold/13204
5418 * layout.cc (Layout::segment_precedes): Don't assert failure if a
5419 --section-start option was seen.
5420 * options.h (General_options::any_section_start): New function.
5421
abd242a9
DM
54222011-10-18 David S. Miller <davem@davemloft.net>
5423
5424 PR binutils/13301
5425 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
5426 member to track relocation locations that have moved during TLS
5427 reloc optimizations.
5428 (Target_sparc::Relocate::Relocate): Initialize to NULL.
5429 (Target_sparc::Relocate::relocate): Adjust view down by 4
5430 bytes if it matches reloc_adjust_addr_.
5431 (Target_sparc::Relocate::relocate_tls): Always move the
5432 __tls_get_addr call delay slot instruction forward 4 bytes when
5433 performing relaxation.
5434
bab9090f
CC
54352011-10-18 Cary Coutant <ccoutant@google.com>
5436
5437 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
5438 (Output_file::map_no_anonymous): Check for non-zero
5439 return code from posix_fallocate.
5440
f7c5b166
CC
54412011-10-17 Cary Coutant <ccoutant@google.com>
5442
5443 PR gold/13245
5444 * plugin.cc (is_visible_from_outside): Check for symbols
5445 referenced from dynamic objects.
5446 * resolve.cc (Symbol_table::resolve): Don't count references
5447 from dynamic objects as references from real ELF files.
5448 * testsuite/plugin_test_2.sh: Adjust expected result.
5449
b490c0bb
CC
54502011-10-17 Cary Coutant <ccoutant@google.com>
5451
5452 * gold.cc: Include timer.h.
5453 (queue_middle_tasks): Stamp time.
5454 (queue_final_tasks): Likewise.
5455 * main.cc (main): Store timer in parameters. Print timers
5456 for each pass.
5457 * parameters.cc (Parameters::Parameters): Initialize timer_.
5458 (Parameters::set_timer): New function.
5459 (set_parameters_timer): New function.
5460 * parameters.h (Parameters::set_timer): New function.
5461 (Parameters::timer): New function.
5462 (Parameters::timer_): New data member.
5463 (set_parameters_timer): New function.
5464 * timer.cc (Timer::stamp): New function.
5465 (Timer::get_pass_time): New function.
5466 * timer.h (Timer::stamp): New function.
5467 (Timer::get_pass_time): New function.
5468 (Timer::pass_times_): New data member.
5469
f475cf7b
CC
54702011-10-17 Cary Coutant <ccoutant@google.com>
5471
5472 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
5473 task for members of lib groups.
5474
cdd7e244
CC
54752011-10-17 Cary Coutant <ccoutant@google.com>
5476
5477 PR gold/13288
4f95c8b4 5478 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
5479 (File_read::make_view): Move bounds check (replace with assert)...
5480 (File_read::find_or_make_view): ... to here.
5481
dfb45471
CC
54822011-10-12 Cary Coutant <ccoutant@google.com>
5483
4f95c8b4 5484 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
5485 ::read returns less than requested size.
5486
53bbcc1b
CC
54872011-10-10 Cary Coutant <ccoutant@google.com>
5488
4f95c8b4 5489 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
5490 Initialize defined_count_.
5491 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
5492 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
5493 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
5494 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
5495 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 5496 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
5497 member.
5498 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 5499 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
5500 Return zeroes instead of internal error.
5501
397b129b
CC
55022011-10-10 Cary Coutant <ccoutant@google.com>
5503
5504 PR gold/13249
4f95c8b4 5505 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 5506 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 5507 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
5508 (Output_reloc::type_): Adjust size of bit field.
5509 (Output_reloc::use_plt_offset_): New bit field.
5510 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
5511 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
5512 flag. Adjust all callers.
4f95c8b4 5513 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
5514 creating RELATIVE relocations.
5515
d5698657
NC
55162011-10-10 Nick Clifton <nickc@redhat.com>
5517
5518 * po/es.po: Updated Spanish translation.
5519 * po/fi.po: Updated Finnish translation.
5520
6a59a5c2
DN
55212011-10-03 Diego Novillo <dnovillo@google.com>
5522
5523 * options.cc (parse_uint): Fix dereference of RETVAL.
5524
f0558624
ST
55252011-09-29 Sriraman Tallam <tmsriram@google.com>
5526
5527 * layout.h (section_order_map_): New member.
5528 (get_section_order_map): New member function.
5529 * output.cc (Output_section::add_input_section): Check for patterns
5530 only when --section-ordering-file is specified.
5531 * gold.cc (queue_middle_tasks): Delay updating order of sections till
5532 output_sections have been formed.
5533 * layout.cc (Layout_Layout): Initialize section_order_map_.
5534 * plugin.cc (update_section_order): Store order in order_map. Do not
5535 update the order.
5536 * testsuite/Makefile.am: Add test case for plugin_final_layout.
5537 * testsuite/Makefile.in: Regenerate.
5538 * testsuite/plugin_section_order.c: New file.
5539 * testsuite/plugin_final_layout.cc: New file.
5540 * testsuite/plugin_final_layout.sh: New file.
5541
a7dac153
CC
55422011-09-29 Cary Coutant <ccoutant@google.com>
5543
4f95c8b4 5544 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 5545 Check for NULL.
4f95c8b4 5546 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
5547 symbols during incremental update.
5548 (Symbol_table::add_from_dynobj): Likewise.
5549
eebd87a5
ILT
55502011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5551 Ian Lance Taylor <iant@google.com>
5552
5553 * symtab.cc (Symbol_table::define_special_symbol): Always
5554 canonicalize version string.
5555
403a3331
CC
55562011-09-26 Cary Coutant <ccoutant@google.com>
5557
4f95c8b4
CC
5558 * gold.cc (queue_initial_tasks): Move option checks ...
5559 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
5560 some options; make others fatal.
5561
235061c2
CC
55622011-09-26 Cary Coutant <ccoutant@google.com>
5563
5564 gcc PR lto/47247
5565 * plugin.cc (get_symbols_v2): New function.
5566 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
5567 (is_referenced_from_outside): New function.
5568 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
5569 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
5570 (get_symbols): Pass version parameter.
5571 (get_symbols_v2): New function.
5572 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
5573 parameter.
5574 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
5575 (onload): Add LDPT_GET_SYMBOLS_V2.
5576 (all_symbols_read_hook): Use get_symbols_v2; check for
5577 LDPR_PREVAILING_DEF_IRONLY_EXP.
5578 * testsuite/plugin_test_3.sh: Update expected results.
5579
dc87f620
ILT
55802011-09-23 Simon Baldwin <simonb@google.com>
5581
5582 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
5583 configuration options.
5584 * configure: Regenerate.
5585 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
5586 * Makefile.in: Regenerate.
5587 * testsuite/Makefile.in: Regenerate.
5588
a8279f82
ST
55892011-09-19 Sriraman Tallam <tmsriram@google.com>
5590
5591 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
5592
0c9350c8
CC
55932011-09-19 Cary Coutant <ccoutant@google.com>
5594
5595 * incremental.cc (can_incremental_update): Fix typo in comment.
5596 * incremental.h (can_incremental_update): Likewise.
5597
aa06ae28
CC
55982011-09-18 Cary Coutant <ccoutant@google.com>
5599
5600 * incremental.cc (can_incremental_update): New function.
5601 * incremental.h (can_incremental_update): New function.
5602 * layout.cc (Layout::init_fixed_output_section): Call it.
5603 (Layout::make_output_section): Don't allow patch space in .eh_frame.
5604 * object.cc (Sized_relobj_file::do_layout): Call
5605 can_incremental_update.
5606
ebb300b2
CC
56072011-09-13 Cary Coutant <ccoutant@google.com>
5608
5609 * configure.ac: Check for glibc support for gnu_indirect_function
5610 support with static linking, setting automake conditional
5611 IFUNC_STATIC.
5612 * Makefile.in: Regenerate.
5613 * configure: Regenerate.
5614
5615 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
5616 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
5617 for IFUNC_STATIC.
5618 * testsuite/Makefile.in: Regenerate.
5619
1206d0d5
CC
56202011-09-13 Cary Coutant <ccoutant@google.com>
5621
5622 * incremental.cc (Sized_relobj_incr::do_layout): Call
5623 report_comdat_group for kept comdat sections.
5624 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
5625 * testsuite/Makefile.in: Regenerate.
5626 * testsuite/incr_comdat_test_1.cc: New source file.
5627 * testsuite/incr_comdat_test_2_v1.cc: New source file.
5628 * testsuite/incr_comdat_test_2_v2.cc: New source file.
5629 * testsuite/incr_comdat_test_2_v3.cc: New source file.
5630
40b29874
ILT
56312011-09-13 Ian Lance Taylor <iant@google.com>
5632
5633 * object.cc (Sized_relobj_file::do_layout): Remove unused local
5634 variable external_symbols_offset.
5635
1b045aac
ILT
56362011-09-12 Ian Lance Taylor <iant@google.com>
5637
5638 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
5639 triggered if object has no symbols.
5640
24c6c55a
DM
56412011-09-09 David S. Miller <davem@davemloft.net>
5642
5643 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
5644 (Output_fill_debug_line::do_write): Likewise.
5645
66570254
CC
56462011-08-29 Cary Coutant <ccoutant@google.com>
5647
5648 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
5649 casts to match formatting specs.
5650 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
5651
8ea8cd50
CC
56522011-08-26 Cary Coutant <ccoutant@google.com>
5653
5654 * layout.cc (Free_list::allocate): Provide guarantee of minimum
5655 remaining hole size when allocating.
5656 (Layout::make_output_section): Set fill methods for debug sections.
5657 * layout.h (Free_list::Free_list_node): Move from private to
5658 public.
5659 (Free_list::set_min_hole_size): New function.
5660 (Free_list::begin, Free_list::end): New functions.
5661 (Free_list::min_hole_): New data member.
5662 * output.cc: Include dwarf.h.
5663 (Output_fill_debug_info::do_minimum_hole_size): New function.
5664 (Output_fill_debug_info::do_write): New function.
5665 (Output_fill_debug_line::do_minimum_hole_size): New function.
5666 (Output_fill_debug_line::do_write): New function.
5667 (Output_section::Output_section): Initialize new data member.
5668 (Output_section::set_final_data_size): Ensure patch space is larger
5669 than minimum hole size.
5670 (Output_section::do_write): Fill holes in debug sections.
5671 * output.h (Output_fill): New class.
5672 (Output_fill_debug_info): New class.
5673 (Output_fill_debug_line): New class.
5674 (Output_section::set_free_space_fill): New function.
5675 (Output_section::free_space_fill_): New data member.
5676 * testsuite/Makefile.am (incremental_test_3): Add
5677 --incremental-patch option.
5678 (incremental_test_4): Likewise.
5679 (incremental_test_5): Likewise.
5680 (incremental_test_6): Likewise.
5681 (incremental_copy_test): Likewise.
5682 (incremental_common_test_1): Likewise.
5683 * testsuite/Makefile.in: Regenerate.
5684
7cf80422
NC
56852011-08-26 Nick Clifton <nickc@redhat.com>
5686
5687 * po/es.po: Updated Spanish translation.
5688
c3f7b0e5
CC
56892011-08-01 Cary Coutant <ccoutant@google.com>
5690
5691 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
5692 * gold/testsuite/Makefile.in: Regenerate.
5693 * gold/testsuite/justsyms_exec.c: New source file.
5694 * gold/testsuite/justsyms_lib.c: New source file.
5695
9590bf25
CC
56962011-08-01 Cary Coutant <ccoutant@google.com>
5697
5698 * layout.cc (Layout::set_segment_offsets): Don't realign text
5699 segment if -Ttext was specified.
5700 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
5701 file type.
5702 * object.h (Sized_relobj_file::e_type): New function.
5703 (Sized_relobj_file::e_type_): New data member.
5704 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
5705 base address for ET_EXEC files.
5706 * target.cc (Target::do_make_elf_object_implementation): Allow
5707 ET_EXEC files with --just-symbols option.
5708
dcd8d12e
CC
57092011-07-28 Cary Coutant <ccoutant@google.com>
5710
5711 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
5712 Add thread_number parameter.
5713 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
5714 * workqueue-threads.cc
5715 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
5716 current thread if its thread number is greater than desired thread
5717 count.
5718 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
5719 Add thread_number parameter.
5720 (Workqueue::should_cancel_thread): Likewise.
5721 (Workqueue::find_runnable_or_wait): Pass thread_number to
5722 should_cancel_thread.
5723 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
5724 parameter.
5725
804eb480
ST
57262011-07-22 Sriraman Tallam <tmsriram@google.com>
5727
5728 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
5729 only after checking if it cannot be forced local.
5730 * symtab.h (is_externally_visible): Check if the symbol is not forced
5731 local.
5732
f1ddb600
ILT
57332011-07-15 Ian Lance Taylor <iant@google.com>
5734
5735 * options.h (class General_options): Add --print-output-format.
5736 Move -EL next to -EB, for better --help output.
5737 * target-select.cc: Include <cstdio>, "options.h", and
5738 "parameters.h".
5739 (Target_selector::do_target_bfd_name): New function.
5740 (print_output_format): New function.
5741 * target-select.h (class Target_selector): Update declarations.
5742 (Target_selector::target_bfd_name): New function.
5743 (print_output_format): Declare.
5744 * main.cc: Include "target-select.h".
5745 (main): Handle --print-output-format.
5746 * gold.cc: Include "target-select.h".
5747 (queue_initial_tasks): Handle --print-output-format when there are
5748 no input files.
5749 * parameters.cc (parameters_force_valid_target): Give a better
5750 error message if -EB/-EL does not match target.
5751 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
5752 function.
5753
7d172687
ILT
57542011-07-15 Ian Lance Taylor <iant@google.com>
5755
5756 * i386.cc (class Output_data_plt_i386): Add layout_ field.
5757 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
5758 (Output_data_plt_i386::do_write): Write address of .dynamic
5759 section to first entry in .got.plt section.
5760 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
5761 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
5762 Initialize layout_.
5763 (Output_data_plt_x86_64::do_write): Write address of .dynamic
5764 section to first entry in .got.plt section.
5765 * layout.h (Layout::dynamic_section): New function.
5766
e9552f7e
ST
57672011-07-13 Sriraman Tallam <tmsriram@google.com>
5768
5769 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
5770 to claim_file call.
5771 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
5772 input_section_position_, and input_section_glob_.
5773 (read_layout_from_file): Call function section_ordering_specified.
5774 * layout.h (is_section_ordering_specified): New function.
5775 (section_ordering_specified): New function.
5776 (section_ordering_specified_): New boolean member.
5777 * main.cc(main): Call load_plugins after layout object is defined.
5778 * output.cc (Output_section::add_input_section): Use
5779 function section_ordering_specified to check if section ordering is
5780 needed.
5781 * output.cc (Output_section::add_relaxed_input_section): Use
5782 function section_ordering_specified to check if section ordering is
5783 needed.
5784 (Output_section::update_section_layout): New function.
5785 (Output_section::sort_attached_input_sections): Check if input section
5786 must be reordered.
5787 * output.h (Output_section::update_section_layout): New function.
5788 * plugin.cc (get_section_count): New function.
5789 (get_section_type): New function.
5790 (get_section_name): New function.
5791 (get_section_contents): New function.
5792 (update_section_order): New function.
58797674 5793 (allow_section_ordering): New function.
e9552f7e
ST
5794 (Plugin::load): Add the new interfaces to the transfer vector.
5795 (Plugin_manager::load_plugins): New parameter.
5796 (Plugin_manager::all_symbols_read): New parameter.
5797 (Plugin_manager::claim_file): New parameter. Save the elf object for
5798 unclaimed objects.
5799 (Plugin_manager::get_elf_object): New function.
5800 (Plugin_manager::get_view): Change to directly use the bool to check
5801 if get_view is called from claim_file_hook.
5802 * plugin.h (input_objects): New function
5803 (Plugin__manager::load_plugins): New parameter.
5804 (Plugin_manager::claim_file): New parameter.
5805 (Plugin_manager::get_elf_object): New function.
5806 (Plugin_manager::in_claim_file_handler): New function.
5807 (Plugin_manager::in_claim_file_handler_): New member.
5808 (layout): New function.
5809 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
5810 handler with an extra parameter. Make the elf object before calling
5811 claim_file handler.
5812 * testsuite/plugin_test.c (get_section_count): New function pointer.
5813 (get_section_type): New function pointer.
5814 (get_section_name): New function pointer.
5815 (get_section_contents): New function pointer.
5816 (update_section_order): New function pointer.
5817 (allow_section_ordering): New function pointer.
5818 (onload): Check if the new interfaces exist.
5819
9446efde
ILT
58202011-07-13 Ian Lance Taylor <iant@google.com>
5821
5822 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
5823 relro section.
5824 * x86_64.cc (Target_x86_64::got_section): Likewise.
5825 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
5826 (relro_now_test_SOURCES): New variable.
5827 (relro_now_test_DEPENDENCIES): New variable.
5828 (relro_now_test_LDFLAGS): New variable.
5829 (relro_now_test_LDADD): New variable.
5830 (relro_now_test.so): New target.
5831 * testsuite/Makefile.in: Rebuild.
5832
07aa62f2
ILT
58332011-07-12 Ian Lance Taylor <iant@google.com>
5834
5835 PR gold/12980
5836 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
5837 GLOB_DAT relocation rather than a RELATIVE relocation for a
5838 protected symbol when creating a shared library.
5839 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
5840 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
5841 * testsuite/protected_main_1.cc (main): Test that protected
5842 function has same address.
5843
e2153196
ILT
58442011-07-11 Ian Lance Taylor <iant@google.com>
5845
5846 PR gold/12979
5847 * options.h (class General_options): Add -Bgroup.
5848 * options.cc (General_options::finalize): If -Bgroup is set,
5849 default to --unresolved-symbols=report-all.
5850 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
5851 * target-reloc.h (issue_undefined_symbol_error): Handle
5852 --unresolved-symbols=report-all.
5853
6daf5215
ILT
58542011-07-08 Ian Lance Taylor <iant@google.com>
5855
5856 PR gold/11985
5857 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
5858 if linker script discards key sections.
5859 (Layout::create_dynamic_symtab): Likewise.
5860 (Layout::assign_local_dynsym_offsets): Likewise.
5861 (Layout::sized_create_version_sections): Likewise.
5862 (Layout::create_interp): Likewise.
5863 (Layout::finish_dynamic_section): Likewise.
5864 (Layout::set_dynamic_symbol_size): Likewise.
5865
beabb2c6
ILT
58662011-07-08 Ian Lance Taylor <iant@google.com>
5867
5868 PR gold/12386
5869 * options.h (class General_options): Add --unresolved-symbols.
5870 * target-reloc.h (issue_undefined_symbol_error): Check
5871 --unresolved-symbols. Add comments.
5872
9c16daf1
ILT
58732011-07-08 Ian Lance Taylor <iant@google.com>
5874
5875 * testsuite/odr_violation2.cc (Ordering::operator()): Make
5876 expression more complex.
5877
191f1a2d
ILT
58782011-07-08 Ian Lance Taylor <iant@google.com>
5879
5880 PR gold/11317
5881 * target-reloc.h (issue_undefined_symbol_error): New inline
5882 function, broken out of relocate_section.
5883 (relocate_section): Call issue_undefined_symbol_error.
5884 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
5885 there is no TLS segment if we are about to issue an undefined
5886 symbol error.
5887 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
5888
62855347
ILT
58892011-07-08 Ian Lance Taylor <iant@google.com>
5890
5891 PR gold/12279
5892 * resolve.cc (Symbol_table::should_override): Add fromtype
5893 parameter. Change all callers. Give error when linking together
5894 TLS and non-TLS symbol.
5895 (Symbol_table::should_override_with_special): Add fromtype
5896 parameter. Change all callers.
5897 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
5898 there is no TLS segment if we have reported some errors.
5899 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
5900
67181c72
ILT
59012011-07-08 Ian Lance Taylor <iant@google.com>
5902
5903 PR gold/12372
5904 * target.h (Target::plt_address_for_global): New function.
5905 (Target::plt_address_for_local): New function.
5906 (Target::plt_section_for_global): Remove.
5907 (Target::plt_section_for_local): Remove.
5908 (Target::do_plt_address_for_global): New virtual function.
5909 (Target::do_plt_address_for_local): New virtual function.
5910 (Target::do_plt_section_for_global): Remove.
5911 (Target::do_plt_section_for_local): Remove.
5912 (Target::register_global_plt_entry): Add Symbol_table and Layout
5913 parameters.
5914 * output.cc (Output_data_got::Got_entry::write): Use
5915 plt_address_for_global and plt_address_for_local.
5916 * layout.cc (Layout::add_target_dynamic_tags): Use size and
5917 address of output section.
5918 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
5919 got_irelative_, and irelative_count_ fields. Update
5920 declarations.
5921 (Output_data_plt_i386::has_irelative_section): New function.
5922 (Output_data_plt_i386::entry_count): Add irelative_count_.
5923 (Output_data_plt_i386::set_final_data_size): Likewise.
5924 (class Target_i386): Add got_irelative_ and rel_irelative_
5925 fields. Update declarations.
5926 (Target_i386::Target_i386): Initialize new fields.
5927 (Target_i386::do_plt_address_for_global): New function replacing
5928 do_plt_section_for_global.
5929 (Target_i386::do_plt_address_for_local): New function replacing
5930 do_plt_section_for_local.
5931 (Target_i386::got_section): Create got_irelative_.
5932 (Target_i386::rel_irelative_section): New function.
5933 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
5934 fields. Don't define __rel_iplt_{start,end}.
5935 (Output_data_plt_i386::add_entry): Add symtab and layout
5936 parameters. Change all callers. Use different PLT and GOT for
5937 IFUNC symbols.
5938 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
5939 layout parameters. Change all callers. Use different PLT and
5940 GOT.
5941 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
5942 (Output_data_plt_i386::rel_irelative): New function.
5943 (Output_data_plt_i386::address_for_global): New function.
5944 (Output_data_plt_i386::address_for_local): New function.
5945 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
5946 IRELATIVE GOT when changing IFUNC GOT entries.
5947 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
5948 reloc.
5949 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
5950 if we didn't create an IRELATIVE GOT.
5951 (Target_i386::Relocate::relocate): Use plt_address_for_global and
5952 plt_address_for_local.
5953 (Target_i386::do_dynsym_value): Use plt_address_for_global.
5954 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
5955 got_irelative_, and irelative_count_ fields. Update
5956 declarations.
5957 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
5958 Initialize new fields. Remove symtab parameter. Change all
5959 callers.
5960 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
5961 irelative_count_.
5962 (Output_data_plt_x86_64::has_irelative_section): New function.
5963 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
5964 (class Target_x86_64): Add got_irelative_ and rel_irelative_
5965 fields. Update declarations.
5966 (Target_x86_64::Target_x86_64): Initialize new fields.
5967 (Target_x86_64::do_plt_address_for_global): New function replacing
5968 do_plt_section_for_global.
5969 (Target_x86_64::do_plt_address_for_local): New function replacing
5970 do_plt_section_for_local.
5971 (Target_x86_64::got_section): Create got_irelative_.
5972 (Target_x86_64::rela_irelative_section): New function.
5973 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
5974 all callers. Don't create __rel_iplt_{start,end}.
5975 (Output_data_plt_x86_64::add_entry): Add symtab and layout
5976 parameters. Change all callers. Use different PLT and GOT for
5977 IFUNC symbols.
5978 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
5979 layout parameters. Change all callers. Use different PLT and
5980 GOT.
5981 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
5982 parameters. Change all callers. Use different PLT and GOT for
5983 IFUNC symbols.
5984 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
5985 (Output_data_plt_x86_64::rela_irelative): New function.
5986 (Output_data_plt_x86_64::address_for_global): New function.
5987 (Output_data_plt_x86_64::address_for_local): New function.
5988 (Output_data_plt_x86_64::set_final_data_size): Likewise.
5989 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
5990 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
5991 (Target_x86_64::register_global_plt_entry): Add symtab and layout
5992 parameters.
5993 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
5994 reloc.
5995 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
5996 symbols if we didn't create an IRELATIVE GOT.
5997 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
5998 plt_address_for_local.
5999 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
6000 * testsuite/ifuncvar1.c: New test file.
6001 * testsuite/ifuncvar2.c: New test file.
6002 * testsuite/ifuncvar3.c: New test file.
6003 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
6004 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
6005 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
6006 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
6007 * testsuite/Makefile.in: Rebuild.
6008
33c15b45
CC
60092011-07-07 Cary Coutant <ccoutant@google.com>
6010
6011 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
6012 (two_file_test_1_ndebug.o): Likewise.
6013 (two_file_test_1b_ndebug.o): Likewise.
6014 (two_file_test_2_ndebug.o): Likewise.
6015 (two_file_test_main_ndebug.o): Likewise.
6016 (incremental_test_2): Link with no-debug versions.
6017
f48b5fb7
CC
60182011-07-06 Cary Coutant <ccoutant@google.com>
6019
6020 * gold/incremental.cc
6021 (Output_section_incremental_inputs::write_info_blocks): Check for
6022 hidden and internal symbols.
6023
221597a5
CC
60242011-07-06 Cary Coutant <ccoutant@google.com>
6025
6026 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
6027 Check disposition for startup file.
6028 (Incremental_inputs::report_command_line): Ignore
6029 --incremental-startup-unchanged option.
6030 * options.cc (General_options::parse_incremental_startup_unchanged):
6031 New function.
6032 (General_options::General_options): Initialize new data member.
6033 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
6034 (General_options): Add --incremental-startup-unchanged option.
6035 (General_options::incremental_startup_disposition): New function.
6036 (General_options::incremental_startup_disposition_): New data member.
6037
e24719f6
CC
60382011-07-06 Cary Coutant <ccoutant@google.com>
6039
6040 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
6041 input file index to Script_info ctor.
6042 (Sized_incremental_binary::do_file_has_changed): Find the
6043 command-line argument for files named in scripts.
6044 * incremental.h (Script_info::Script_info): New ctor
6045 with input file index.
6046 (Script_info::input_file_index): New function.
6047 (Script_info::input_file_index_): New data member.
6048 (Incremental_binary::get_library): Add const.
6049 (Incremental_binary::get_script_info): Add const.
6050 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
6051 * testsuite/Makefile.am (incremental_test_5): New test case.
6052 (incremental_test_6): New test case.
6053 * testsuite/Makefile.in: Regenerate.
6054
8f7c81e8
CC
60552011-07-06 Cary Coutant <ccoutant@google.com>
6056
6057 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
6058 debug output when command lines differ.
6059
9fbd3822
CC
60602011-07-06 Cary Coutant <ccoutant@google.com>
6061
6062 * incremental.cc (Incremental_inputs::report_command_line): Ignore
6063 --incremental-patch option.
6064 * layout.cc (Free_list::allocate): Extend allocation beyond original
6065 end if enabled.
6066 (Layout::make_output_section): Mark sections that should get
6067 patch space.
6068 * options.cc (parse_percent): New function.
6069 * options.h (parse_percent): New function.
6070 (DEFINE_percent): New macro.
6071 (General_options): Add --incremental-patch option.
6072 * output.cc (Output_section::Output_section): Initialize new data
6073 members.
6074 (Output_section::add_input_section): Print section name when out
6075 of patch space.
6076 (Output_section::add_output_section_data): Likewise.
6077 (Output_section::set_final_data_size): Add patch space when
6078 doing --incremental-full.
6079 (Output_section::do_reset_address_and_file_offset): Remove patch
6080 space.
6081 (Output_segment::set_section_list_addresses): Print debug output
6082 only if --incremental-update.
6083 * output.h (Output_section::set_is_patch_space_allowed): New function.
6084 (Output_section::is_patch_space_allowed_): New data member.
6085 (Output_section::patch_space_): New data member.
6086 * parameters.cc (Parameters::incremental_full): New function.
6087 * parameters.h (Parameters::incremental_full): New function
6088 * testsuite/Makefile.am (incremental_test_2): Add test for
6089 --incremental-patch option.
6090 * testsuite/Makefile.in: Regenerate.
6091 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
6092 (t18): Remove function body.
6093
f6cccc2c
DK
60942011-07-05 Doug Kwan <dougkwan@google.com>
6095
6096 PR gold/12771
6097 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
6098 Arm_Address type for relocation result.
6099 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
6100 overflow check.
6101 (Arm_relocate_functions::abs32): Use unaligned access.
6102 (Arm_relocate_functions::rel32): Ditto.
6103 (Arm_relocate_functions::prel31): Ditto.
6104 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
6105 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
6106 static data relocations.
6107 * testsuite/Makefile.in: Regnerate.
6108 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
6109
28a13fec
ILT
61102011-07-05 Ian Lance Taylor <iant@google.com>
6111
6112 PR gold/12392
6113 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
6114 symbols if necessary.
6115 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6116
24d47b34
ILT
61172011-07-05 Ian Lance Taylor <iant@google.com>
6118
6119 PR gold/12952
6120 * resolve.cc (Symbol::override_base_with_special): Simply override
6121 version with special symbol version, ignoring previous version.
6122
41f9cbbe
ILT
61232011-07-05 Ian Lance Taylor <iant@google.com>
6124
6125 * object.cc (Sized_relobj_file::include_section_group): Add
6126 information to comment about signature location.
6127
886288f1
ILT
61282011-07-02 Ian Lance Taylor <iant@google.com>
6129
6130 PR gold/12957
6131 * options.h (class General_options): Add -f and -F.
6132 * options.cc (General_options::finalize): Fatal error if -f/-F
6133 are used without -shared.
6134 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
6135
ae3a6d4f
ILT
61362011-07-02 Ian Lance Taylor <iant@google.com>
6137
6138 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
6139
21131061
ILT
61402011-07-01 Ian Lance Taylor <iant@google.com>
6141
6142 PR gold/12525
6143 PR gold/12952
6144 * resolve.cc (Symbol::override_base_with_special): Don't override
6145 the version if the overriding symbol has a different name.
6146 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
6147 all callers. If we give an error about an undefined version,
6148 define the base version if necessary.
6149 * dynobj.h (class Versions): Update declaration.
6150 * testsuite/weak_alias_test_5.cc: New file.
6151 * testsuite/weak_alias_test.script: New file.
6152 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
6153 and versioned_alias have the right value, and call t2.
6154 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
6155 weak_alias_test_5.so.
6156 (weak_alias_test_LDADD): Likewise.
6157 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
6158 * testsuite/Makefile.in: Rebuild.
6159
611062c0
ILT
61602011-07-01 Ian Lance Taylor <iant@google.com>
6161
6162 PR gold/12525
6163 * options.h (class General_options): Support -z notext.
6164 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
6165 -Wl,-z,notext.
6166 (two_file_shared_nonpic.so): Likewise.
6167 (two_file_shared_mixed.so): Likewise.
6168 (two_file_shared_mixed_1.so): Likewise.
6169 (weak_undef_lib_nonpic.so): Likewise.
6170 (alt/weak_undef_lib_nonpic.so): Likewise.
6171 (tls_test_shared_nonpic.so): Likewise.
6172 * testsuite/Makefile.in: Rebuild.
6173
328c7c2f
ILT
61742011-07-01 Ian Lance Taylor <iant@google.com>
6175
6176 PR gold/12525
6177 * configure.ac: Test whether static linking works, setting
6178 the automake conditional HAVE_STATIC.
6179 * testsuite/Makefile.am: Disable tests using -static if
6180 HAVE_STATIC is not true.
6181 * configure, testsuite/Makefile.in: Rebuild.
6182
02d7cd44
ILT
61832011-07-01 Ian Lance Taylor <iant@google.com>
6184
6185 PR gold/12525
6186 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
6187 Assert if we see DW_EH_PE_indirect.
6188 * target.h (Target::ehframe_datarel_base): New function.
6189 (Target::do_ehframe_datarel_base): New target function.
6190 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
6191 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
6192 function.
6193
07a60597
ILT
61942011-07-01 Ian Lance Taylor <iant@google.com>
6195
6196 PR gold/12571
6197 * options.h (class General_options): Add
6198 --ld-generated-unwind-info.
6199 * ehframe.cc (Fde::write): Add address parameter. Change all
6200 callers. If associated with PLT, fill in address and size.
6201 (Cie::set_output_offset): Only add merge mapping if there is an
6202 object.
6203 (Cie::write): Add address parameter. Change all callers.
6204 (Eh_frame::add_ehframe_for_plt): New function.
6205 * ehframe.h (class Fde): Update declarations. Move shndx_ and
6206 input_offset_ fields into union u_, with new plt field.
6207 (Fde::Fde): Adjust for new union field.
6208 (Fde::Fde) [Output_data version]: New constructor.
6209 (Fde::add_mapping): Only add merge mapping if there is an object.
6210 (class Cie): Update declarations.
6211 (class Eh_frame): Declare add_ehframe_for_plt.
6212 * layout.cc (Layout::layout_eh_frame): Break out code into
6213 make_eh_frame_section, and call it.
6214 (Layout::make_eh_frame_section): New function.
6215 (Layout::add_eh_frame_for_plt): New function.
6216 * layout.h (class Layout): Update declarations.
6217 * merge.cc (Merge_map::add_mapping): Add assertion.
6218 * i386.cc: Include "dwarf.h".
6219 (class Output_data_plt_i386): Make first_plt_entry,
6220 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
6221 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6222 and plt_eh_frame_fde.
6223 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
6224 boundary. Call add_eh_frame_for_plt if appropriate.
6225 * x86_64.cc: Include "dwarf.h".
6226 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
6227 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
6228 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6229 and plt_eh_frame_fde.
6230 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
6231 appropriate.
6232
14788a3f
ILT
62332011-06-29 Ian Lance Taylor <iant@google.com>
6234
6235 PR gold/12629
6236 * object.cc (Sized_relobj_file::layout_section): Change shdr
6237 parameter to be const.
6238 (Sized_relobj_file::layout_eh_frame_section): New function, broken
6239 out of do_layout.
6240 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
6241 appropriate. Call layout_eh_frame_section.
6242 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
6243 sections.
6244 * object.h (class Sized_relobj_file): Update declarations.
6245
6c21fce1
ILT
62462011-06-29 Ian Lance Taylor <iant@google.com>
6247
37e41b03 6248 PR gold/12652
6c21fce1
ILT
6249 * script.cc (Token::integer_value): Accept trailing M/m/K/k
6250 modifier.
6251 (Lex::gather_token): Accept trailing M/m/K/k for integers.
6252
4d5e4e62
ILT
62532011-06-29 Ian Lance Taylor <iant@google.com>
6254
6255 PR gold/12675
6256 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
6257 SHT_X86_64_UNWIND.
6258 * layout.cc (Layout::layout_eh_frame): Likewise.
6259
886f533a
ILT
62602011-06-29 Ian Lance Taylor <iant@google.com>
6261
6262 PR gold/12695
6263 * layout.cc (Layout::symtab_section_shndx): New function.
6264 * layout.h (class Layout): Declare symtab_section_shndx.
6265 * output.cc (Output_section::write_header): Call it.
6266
f3ae1b28
ILT
62672011-06-29 Ian Lance Taylor <iant@google.com>
6268
6269 PR gold/12818
6270 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
6271 symbols which are not used in a relocation.
6272
aecf301f
ILT
62732011-06-28 Ian Lance Taylor <iant@google.com>
6274
6275 PR gold/12898
6276 * layout.cc (Layout::segment_precedes): Don't crash if a linker
6277 script create indistinguishable segments.
6278 (Layout::set_segment_offsets): Use stable_sort when sorting
6279 segments. Pass this to Compare_segments constructor.
6280 * layout.h (class Layout): Make segment_precedes non-static.
6281 (class Compare_segments): Change from struct to class. Add
6282 layout_ field. Add constructor.
6283 * script-sections.cc
6284 (Script_sections::attach_sections_using_phdrs_clause): Rename
6285 local orphan to is_orphan. Don't report failure to put empty
6286 section in segment. On attachment failure, report name of
6287 section, and attach to first PT_LOAD segment.
6288
03ef7571
ILT
62892011-06-28 Ian Lance Taylor <iant@google.com>
6290
6291 PR gold/12934
6292 * target-select.cc (Target_selector::Target_selector): Add
6293 emulation parameter. Change all callers.
6294 (select_target_by_bfd_name): Rename from select_target_by_name.
6295 Change all callers.
6296 (select_target_by_emulation): New function.
6297 (supported_emulation_names): New function.
6298 * target-select.h (class Target_selector): Add emulation_ field.
6299 Update declarations.
6300 (Target_selector::recognize_by_bfd_name): Rename from
6301 recognize_by_name. Change all callers.
6302 (Target_selector::supported_bfd_names): Rename from
6303 supported_names. Change all callers.
6304 (Target_selector::recognize_by_emulation): New function.
6305 (Target_selector::supported_emulations): New function.
6306 (Target_selector::emulation): New function.
6307 (Target_selector::do_recognize_by_bfd_name): Rename from
6308 do_recognize_by_name. Change all callers.
6309 (Target_selector::do_supported_bfd_names): Rename from
6310 do_supported_names. Change all callers.
6311 (Target_selector::do_recognize_by_emulation): New function.
6312 (Target_selector::do_supported_emulations): New function.
6313 (select_target_by_bfd_name): Change name in declaration.
6314 (select_target_by_emulation): Declare.
6315 (supported_emulation_names): Declare.
6316 * parameters.cc (parameters_force_valid_target): Try to find
6317 target based on emulation from -m option.
6318 * options.h (class General_options): Change doc string for -m.
6319 * options.cc (help): Print emulations.
6320 (General_options::parse_V): Likewise.
6321 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
6322 Add emulation parameter. Change all callers.
6323
200b2bb9
ILT
63242011-06-28 Ian Lance Taylor <iant@google.com>
6325
6326 * target.h (class Target): Add osabi_ field.
6327 (Target::osabi): New function.
6328 (Target::set_osabi): New function.
6329 (Target::Target): Initialize osabi_.
6330 (Target::do_adjust_elf_header): Make pure virtual.
6331 (Sized_target::do_adjust_elf_header): Declare.
6332 * target.cc (Sized_target::do_adjust_elf_header): New function.
6333 (class Sized_target): Instantiate all versions.
6334 * freebsd.h (class Target_freebsd): Remove.
6335 (Target_selector_freebsd::do_recognize): Call set_osabi on
6336 Target.
6337 (Target_selector_freebsd::do_recognize_by_name): Likewise.
6338 (Target_selector_freebsd::set_osabi): Remove.
6339 * i386.cc (class Target_i386): Inherit from Sized_target rather
6340 than Target_freebsd.
6341 * x86_64.cc (class Target_x86_64): Likewise.
6342
b3ce541e
ILT
63432011-06-28 Ian Lance Taylor <iant@google.com>
6344
6345 * target.h (Target::can_check_for_function_pointers): Rewrite.
6346 Make non-virtual.
6347 (Target::can_icf_inline_merge_sections): Likewise.
6348 (Target::section_may_have_icf_unsafe_poineters): Likewise.
6349 (Target::Target_info): Add can_icf_inline_merge_sections field.
6350 (Target::do_can_check_for_function_pointers): New virtual
6351 function.
6352 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
6353 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
6354 from can_check_for_function_pointers, move in file.
6355 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
6356 section_may_have_icf_unsafe_poineters, move in file.
6357 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
6358 * i386.cc (Target_i386::do_can_check_for_function_pointers):
6359 Rename from can_check_for_function_pointers, move in file.
6360 (Target_i386::can_icf_inline_merge_sections): Remove.
6361 (Target_i386::i386_info): Initialize
6362 can_icf_inline_merge_sections.
6363 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
6364 Initialize can_icf_inline_merge_sections.
6365 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
6366 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
6367 Rename from can_check_for_function_pointers, move in file.
6368 (Target_x86_64::can_icf_inline_merge_sections): Remove.
6369 (Target_x86_64::x86_64_info): Initialize
6370 can_icf_inline_merge_sections.
6371 * testsuite/testfile.cc (Target_test::test_target_info):
6372 Likewise.
6373 * icf.cc (get_section_contents): Correct formatting.
6374
6d1c4efb
ILT
63752011-06-27 Ian Lance Taylor <iant@google.com>
6376
6377 * symtab.cc (Symbol::versioned_name): New function.
6378 (Symbol_table::add_to_final_symtab): Use versioned_name when
6379 appropriate.
6380 (Symbol_table::sized_write_symbol): Likewise.
6381 * symtab.h (class Symbol): Declare versioned_name.
6382 * stringpool.h (class Stringpool_template): Add variant of add
6383 which takes a std::basic_string.
6384 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
6385 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
6386 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
6387 (ver_test_12.o): New target.
6388 * testsuite/Makefile.in: Rebuild.
6389
57eb9b50
DK
63902011-06-27 Doug Kwan <dougkwan@google.com>
6391
6392 * arm.cc (Arm_relocate_functions::thm_jump8,
6393 Arm_relocate_functions::thm_jump11): Use a wider signed
6394 type to compute offset.
6395 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
6396 arm_thm_jump8.
6397 * testsuite/Makefile.in: Regenerate.
6398 * testsuite/arm_branch_in_range.sh: Check test results of
6399 arm_thm_jump11 and arm_thm_jump8.
6400 * testsuite/arm_thm_jump11.s: New test source file.
6401 * testsuite/arm_thm_jump11.t: New linker script.
6402 * testsuite/arm_thm_jump8.s: New test source file.
6403 * testsuite/arm_thm_jump8.t: New linker script.
6404
487b39df
ILT
64052011-06-24 Ian Lance Taylor <iant@google.com>
6406
6407 * layout.cc: Include "object.h".
6408 (ctors_sections_in_init_array): New static variable.
6409 (Layout::is_ctors_in_init_array): New function.
6410 (Layout::layout): Add entry to ctors_sections_in_init_array if
6411 appropriate.
6412 * layout.h (class Layout): Declare is_ctors_in_init_array.
6413 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
6414 is_ctors_reverse_view is set.
6415 (Sized_relobj_file::write_sections): Add layout parameter. Change
6416 all callers. Set is_ctors_reverse_view field of View_size.
6417 (Sized_relobj_file::reverse_words): New function.
6418 * object.h (Sized_relobj_file::View_size): Add
6419 is_ctors_reverse_view field.
6420 (class Sized_relobj_file): Update declarations.
6421 * testsuite/initpri3.c: New test.
6422 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
6423 initpri3b.
6424 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
6425 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
6426 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
6427 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
6428 * testsuite/Makefile.in: Rebuild.
6429
472076e4
CC
64302011-06-24 Cary Coutant <ccoutant@google.com>
6431
6432 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
6433 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
6434 (debug_msg_cdebug.err): New targets.
6435 * testsuite/Makefile.in: Regenerate.
6436 * testsuite/debug_msg.sh: Check output of link with compressed debug.
6437 Fix checks for link with shared library.
6438
a60af0db
DK
64392011-06-24 Doug Kwan <dougkwan@google.com>
6440
6441 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
6442 skip empty text sections.
6443 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
6444
5393d741
ILT
64452011-06-22 Ian Lance Taylor <iant@google.com>
6446
6447 PR gold/12910
6448 * options.h (class General_options): Add --ctors-in-init-array.
6449 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
6450 friends as SHT_PROGBITS for merging sections.
6451 (Layout::layout): Remove special handling of .init_array and
6452 friends. Don't sort if doing relocatable link. Sort for .ctors
6453 and .dtors if ctors_in_init_array.
6454 (Layout::make_output_section): Force correct section types for
6455 .init_array and friends. Don't sort if doing relocatable link,
6456 Don't sort .ctors and .dtors if ctors_in_init_array.
6457 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
6458 (Layout::output_section_name): Add relobj parameter. Change all
6459 callers. Handle .ctors. and .dtors. in code rather than table.
6460 Handle .ctors and .dtors if ctors_in_init_array.
6461 (Layout::match_file_name): New function, moved from output.cc.
6462 * layout.h (class Layout): Update declarations.
6463 * output.cc: Include "layout.h".
6464 (Input_section_sort_entry::get_priority): New function.
6465 (Input_section_sort_entry::match_file_name): Just call
6466 Layout::match_file_name.
6467 (Output_section::Input_section_sort_init_fini_compare::operator()):
6468 Handle .ctors and .dtors. Sort by explicit priority rather than
6469 by name.
6470 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
6471 * testsuite/initpri2.c: New test.
6472 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
6473 (check_PROGRAMS): Add initpri2.
6474 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
6475 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
6476 * configure, testsuite/Makefile.in: Rebuild.
6477
e1f74f98
ILT
64782011-06-19 Ian Lance Taylor <iant@google.com>
6479
6480 PR gold/12880
6481 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
6482 .interp section to a PT_INTERP segment even if we have seen a
6483 --dynamic-linker option. Don't do it if we have seen a PHDRS
6484 clause in a linker script.
6485 (Layout::finalize): Don't create a .interp section if we've
6486 already create a PT_INTERP segment.
6487 (Layout::create_interp): Always call choose_output_section (revert
6488 patch of 2011-06-17). Don't create PT_INTERP segment.
6489 * script-sections.cc
6490 (Script_sections::create_note_and_tls_segments): Add a .interp
6491 section to a PT_INTERP segment even if we have seen a
6492 --dynamic-linker option.
6493
766f91bb
ILT
64942011-06-18 Ian Lance Taylor <iant@google.com>
6495
6496 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
6497 merely because a non-PT_LOAD segment has a dynamic reloc.
6498
0d212c3a
ILT
64992011-06-18 Ian Lance Taylor <iant@google.com>
6500
6501 * layout.cc (Layout::finish_dynamic_section): Don't create
6502 DT_FLAGS entry if not needed.
6503
911a5072
ILT
65042011-06-18 Ian Lance Taylor <iant@google.com>
6505
6506 PR gold/12745
6507 * layout.cc (Layout::layout_eh_frame): Correct handling of
6508 writable .eh_frame section.
6509
534b4e5f
ILT
65102011-06-17 Ian Lance Taylor <iant@google.com>
6511
6512 PR gold/12893
6513 * resolve.cc (Symbol_table::resolve): Don't give an error if a
6514 symbol is redefined with the exact same object and value.
6515
10b4f102
ILT
65162011-06-17 Ian Lance Taylor <iant@google.com>
6517
6518 PR gold/12880
6519 * layout.h (class Layout): Add interp_segment_ field.
6520 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
6521 (Layout::attach_allocated_section_to_segment): If making shared
6522 library, put .interp section in PT_INTERP segment.
6523 (Layout::finalize): Also call create_interp if -dynamic-linker
6524 option was used.
6525 (Layout::create_interp): Assert that there is no PT_INTERP
6526 segment. If not using a SECTIONS clause, use make_output_section.
6527 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
6528 * script-sections.cc
6529 (Script_sections::create_note_and_tls_segments): If making shared
6530 library, put .interp section in PT_INTERP segment.
6531
a29b0dad
ILT
65322011-06-17 Ian Lance Taylor <iant@google.com>
6533
e588ea8d
ILT
6534 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
6535 when making a shared library.
6536
65372011-06-17 Ian Lance Taylor <iant@google.com>
6538
6539 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
6540 parameter. Change all callers. Don't issue warning about PC32
6541 against locally defined symbol.
a29b0dad 6542
9d3b0698
ILT
65432011-06-16 Ian Lance Taylor <iant@google.com>
6544
6545 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
6546 occurs in same object.
6547
85b0f90c
AM
65482011-06-14 Alan Modra <amodra@gmail.com>
6549
6550 * po/POTFILES.in: Regenerate.
6551
a94907d9
ILT
65522011-06-09 Ian Lance Taylor <iant@google.com>
6553
6554 * script-sections.cc
6555 (Orphan_output_section::set_section_addresses): For a relocatable
6556 link set address to 0.
6557
4fb3a1c3
CC
65582011-06-09 Cary Coutant <ccoutant@google.com>
6559
6560 PR gold/12804
6561 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
6562 used with --compress-debug-sections.
6563 * gold/object.cc (Sized_relobj_file::do_layout): Report
6564 uncompressed size of compressed input sections.
6565
61220854
CC
65662011-06-08 Cary Coutant <ccoutant@google.com>
6567
6568 PR gold/12804
6569 * testsuite/two_file_test_2_v1.cc: Change initialization of
6570 v2 to keep it in .data.
6571
e6455dfb
CC
65722011-06-07 Cary Coutant <ccoutant@google.com>
6573
6574 * common.cc (Symbol_table::do_allocate_commons_list): Call
6575 gold_fallback.
6576 * errors.cc (Errors::fatal): Adjust call to gold_exit.
6577 (Errors::fallback): New function.
6578 (gold_fallback): New function.
6579 * errors.h (Errors::fallback): New function.
6580 * gold.cc (gold_exit): Change status parameter to enum; adjust
6581 all callers.
6582 (queue_initial_tasks): Call gold_fallback.
6583 * gold.h: Include cstdlib.
6584 (Exit_status): New enum type.
6585 (gold_exit): Change status parameter to enum.
6586 (gold_fallback): New function.
6587 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
6588 (Layout::create_symtab_sections): Likewise.
6589 (Layout::create_shdrs): Likewise.
6590 * main.cc (main): Adjust call to gold_exit.
6591 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
6592 (Output_data_got::add_got_entry_pair): Likewise.
6593 (Output_section::add_input_section): Likewise.
6594 (Output_section::add_output_section_data): Likewise.
6595 (Output_segment::set_section_list_addresses): Likewise.
6596 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
6597
fb0e076f
CC
65982011-06-07 Cary Coutant <ccoutant@google.com>
6599
6600 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
6601 for incremental links.
6602 * output.cc (Output_segment::set_section_list_addresses): Remove
6603 FIXME and test for TLS or BSS.
6604
a5ee4d5d
CC
66052011-06-07 Cary Coutant <ccoutant@google.com>
6606
6607 * testsuite/Makefile.am: Add incremental_copy_test,
6608 incremental_common_test_1.
6609 * testsuite/Makefile.in: Regenerate.
6610 * testsuite/common_test_1_v1.c: New source file.
6611 * testsuite/common_test_1_v2.c: New source file.
6612 * testsuite/copy_test_v1.cc: New source file.
6613
5146f448
CC
66142011-06-07 Cary Coutant <ccoutant@google.com>
6615
6616 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
6617 update, allocate common from bss section's free list.
6618 * incremental-dump.cc (dump_incremental_inputs): Print flag for
6619 linker-defined symbols.
6620 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
6621 Skip GOT and PLT entries that are no longer referenced.
6622 (Output_section_incremental_inputs::write_info_blocks): Mark
6623 linker-defined symbols.
6624 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
6625 * output.cc (Output_section::allocate): New function.
6626 * output.h (Output_section::allocate): New function.
6627 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
6628 linker-defined symbols.
6629 (Symbol::override_base_with_special): Copy is_predefined_ flag.
6630 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
6631 (Symbol::init_base_output_data): Likewise.
6632 (Symbol::init_base_output_segment): Likewise.
6633 (Symbol::init_base_constant): Likewise.
6634 (Sized_symbol::init_output_data): Likewise.
6635 (Sized_symbol::init_output_segment): Likewise.
6636 (Sized_symbol::init_constant): Likewise.
6637 (Symbol_table::do_define_in_output_data): Likewise.
6638 (Symbol_table::do_define_in_output_segment): Likewise.
6639 (Symbol_table::do_define_as_constant): Likewise.
6640 * symtab.h (Symbol::is_predefined): New function.
6641 (Symbol::init_base_output_data): Add is_predefined parameter.
6642 (Symbol::init_base_output_segment): Likewise.
6643 (Symbol::init_base_constant): Likewise.
6644 (Symbol::is_predefined_): New data member.
6645 (Sized_symbol::init_output_data): Add is_predefined parameter.
6646 (Sized_symbol::init_output_segment): Likewise.
6647 (Sized_symbol::init_constant): Likewise.
6648 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
6649
26d3c67d
CC
66502011-06-07 Cary Coutant <ccoutant@google.com>
6651
6652 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
6653 instead of emit_copy_reloc.
6654 (Copy_relocs::emit_copy_reloc): Refactor.
6655 (Copy_relocs::make_copy_reloc): New function.
6656 (Copy_relocs::add_copy_reloc): Remove.
6657 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
6658 section.
6659 (Copy_relocs::make_copy_reloc): New function.
6660 (Copy_relocs::add_copy_reloc): Remove.
6661 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
6662 unchanged input files.
6663 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
6664 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
6665 Reserve BSS space for COPY relocations.
6666 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6667 (Output_section_incremental_inputs::write_info_blocks): Record
6668 whether a symbol is copied from a shared object.
6669 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
6670 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
6671 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
6672 (Incremental_input_entry_reader::get_output_symbol_index): Add
6673 is_copy parameter.
6674 (Incremental_binary::emit_copy_relocs): New function.
6675 (Incremental_binary::do_emit_copy_relocs): New function.
6676 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6677 new data member.
6678 (Sized_incremental_binary::add_copy_reloc): New function.
6679 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6680 (Sized_incremental_binary::Copy_reloc): New struct.
6681 (Sized_incremental_binary::Copy_relocs): New typedef.
6682 (Sized_incremental_binary::copy_relocs_): New data member.
6683 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
6684 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
6685 * target.h (Sized_target::emit_copy_reloc): New function.
6686 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
6687
7cdb37d9
CC
66882011-06-02 Cary Coutant <ccoutant@google.com>
6689
6690 PR gold/12163
6691 * gold/archive.cc (Archive::Archive): Initialize new data member.
6692 (Archive::include_all_members): Return if archive has already been
6693 included.
6694 * gold/archive.h (Archive::include_all_members_): New data member.
6695
cc643b88
NC
66962011-06-02 Nick Clifton <nickc@redhat.com>
6697
6698 * dynobj.h: Fix spelling mistake in comment.
6699 * output.cc: Likewise.
6700
f62a3ca7 67012011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 6702 Asier Llano
f62a3ca7
DK
6703
6704 PR gold/12826
cc643b88 6705 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
6706 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
6707 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
6708 redundant arm_exidx_test.so.
6709 * testsuite/Makefile.in: Regenerate.
6710 (check_SCRIPTS): Add pr12826.sh
6711 (check_DATA): Add pr12826.stdout
6712 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
6713 * testsuite/pr12826.sh: New file.
6714 * testsuite/pr12826_1.s: Ditto.
6715 * testsuite/pr12826_1.s: Ditto.
6716
8dbe1edc
ILT
67172011-05-30 Ian Lance Taylor <iant@google.com>
6718
6719 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
6720 sections.
6721
c49875be
ILT
67222011-05-29 Ian Lance Taylor <iant@google.com>
6723
6724 PR gold/12804
6725 * testsuite/Makefile.am: Use different file name for two_file_test
6726 temporary file for each incremental test.
6727 * testsuite/Makefile.in: Rebuild.
6728
69d53f7a
ILT
67292011-05-29 Ian Lance Taylor <iant@google.com>
6730
6731 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
6732 binary input file is empty.
6733
41d0ab5f
ILT
67342011-05-27 Ian Lance Taylor <iant@google.com>
6735
6736 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
6737 (ver_test_9.so): Likewise.
6738 * testsuite/Makefile.in: Rebuild.
6739
89d8a36b
CC
67402011-05-26 Cary Coutant <ccoutant@google.com>
6741
6742 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
6743 * incremental.cc (Incremental_inputs::report_input_section): Fix
6744 comment, indentation.
6745 (Incremental_inputs::report_comdat_group): New function.
6746 (Output_section_incremental_inputs::set_final_data_size): Adjust size
6747 of data for incremental input file entry.
6748 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
6749 group count, COMDAT group signatures.
6750 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
6751 an unchanged input file.
6752 * incremental.h (Incremental_object_entry::Incremental_object_entry):
6753 Initialize new data member.
6754 (Incremental_object_entry::add_comdat_group): New function.
6755 (Incremental_object_entry::get_comdat_group_count): New function.
6756 (Incremental_object_entry::get_comdat_signature_key): New function.
6757 (Incremental_object_entry::groups_): New data member.
6758 (Incremental_inputs::report_comdat_group): New function.
6759 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
6760 data for incremental input file entry.
6761 (Incremental_input_entry_reader::get_comdat_group_count): New function.
6762 (Incremental_input_entry_reader::get_input_section): Adjust size of
6763 data for incremental input file entry.
6764 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
6765 (Incremental_input_entry_reader::get_comdat_group_signature): New
6766 function.
6767 * object.cc (Sized_relobj::include_section_group): Report kept
6768 COMDAT groups for incremental links.
6769
1706a06f
ILT
67702011-05-24 David Meyer <pdox@google.com>
6771
6772 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
6773 with name parameter. Add found_name parameter.
6774 * fileread.cc (Input_file::find_file): Adjust code accordingly.
6775 * dirsearch.h (class Dirsearch): Update declaration.
6776
a10ae760
ILT
67772011-05-24 Ian Lance Taylor <iant@google.com>
6778
6779 * archive.cc (Library_base::should_include_member): Pull in object
6780 from archive if it defines the entry symbol.
6781 * parameters.cc (Parameters::entry): New function.
6782 * parameters.h (class Parameters): Declare entry.
6783 * output.h (class Output_file_header): Remove entry_ field.
6784 * output.cc (Output_file_header::Output_file_header): Remove entry
6785 parameter. Change all callers.
6786 (Output_file_header::entry): Use parameters->entry.
6787 * gold.cc (queue_middle_tasks): Likewise.
6788 * plugin.cc (Plugin_hook::run): Likewise.
6789
aa92d6ed
CC
67902011-05-24 Cary Coutant <ccoutant@google.com>
6791
6792 * gold.cc (queue_initial_tasks): Pass incremental base filename
6793 to Output_file::open_base_file; don't print error message.
6794 * incremental-dump.cc (main): Adjust call to
6795 Output_file::open_for_modification.
6796 * incremental-dump.cc (main): Likewise.
6797 * incremental.cc (Incremental_inputs::report_command_line):
6798 Ignore --incremental-base option when comparing command lines.
6799 Ignore parameter when given as separate argument.
6800 * options.h (class General_options): Add --incremental-base.
6801 * output.cc (Output_file::Output_file):
6802 (Output_file::open_base_file): Add base_name and writable parameters;
6803 read base file into new file; print error message here.
6804 (Output_file::map_no_anonymous): Add writable parameter; adjust all
6805 callers.
6806 * output.h (Output_file::open_for_modification): Rename to...
6807 (Output_file::open_base_file): ...this; add base_name and
6808 writable parameters; adjust all callers.
6809 (Output_file::map_no_anonymous): Add writable parameter; adjust all
6810 callers.
6811 * testsuite/Makefile.am (incremental_test_4): Test
6812 --incremental-base.
6813 * testsuite/Makefile.in: Regenerate.
6814
2eedd706
CC
68152011-05-24 Cary Coutant <ccoutant@google.com>
6816
6817 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
6818 incremental_test_4.
6819 * testsuite/Makefile.in: Regenerate.
6820 * testsuite/two_file_test_1_v1.cc: New test source file.
6821 * testsuite/two_file_test_1b_v1.cc: New test source file.
6822 * testsuite/two_file_test_2_v1.cc: New test source file.
6823
0f1c85a6
CC
68242011-05-24 Cary Coutant <ccoutant@google.com>
6825
6826 * dynobj.h (Dynobj::do_dynobj): New function.
6827 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
6828 flag and soname for shared objects.
6829 * incremental.cc (Incremental_inputs::report_object): Make
6830 either Incremental_object_entry or Incremental_dynobj_entry; add
6831 soname to string table.
6832 (Incremental_inputs::report_input_section): Add assertion.
6833 (Output_section_incremental_inputs::set_final_data_size): Adjust
6834 type of input file entry for shared libraries; adjust size of
6835 shared library info entry.
6836 (Output_section_incremental_inputs::write_input_files): Write
6837 as_needed flag for shared libraries.
6838 (Output_section_incremental_inputs::write_info_blocks): Adjust type
6839 of input file entry for shared libraries; write soname.
6840 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
6841 soname from incremental info.
6842 * incremental.h (enum Incremental_input_flags): Add
6843 INCREMENTAL_INPUT_AS_NEEDED.
6844 (Incremental_input_entry::Incremental_input_entry): Initialize new
6845 data member.
6846 (Incremental_input_entry::set_as_needed): New function.
6847 (Incremental_input_entry::as_needed): New function.
6848 (Incremental_input_entry::do_dynobj_entry): New function.
6849 (Incremental_input_entry::as_needed_): New data member.
6850 (Incremental_object_entry::Incremental_object_entry): Don't check
6851 for shared library.
6852 (Incremental_object_entry::do_type): Likewise.
6853 (class Incremental_dynobj_entry): New class.
6854 (Incremental_input_entry_reader::as_needed): New function.
6855 (Incremental_input_entry_reader::get_soname): New function.
6856 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
6857 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
6858 size of shared library info entry.
58797674 6859 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
6860 incremental link when adding DT_NEEDED entries.
6861 * object.h (Object::Object): Initialize new data member.
6862 (Object::dynobj): New function.
6863 (Object::set_as_needed): New function.
6864 (Object::as_needed): New function.
6865 (Object::do_dynobj): New function.
6866 (Object::as_needed_): New data member.
6867
6fa2a40b
CC
68682011-05-24 Cary Coutant <ccoutant@google.com>
6869
6870 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
6871 info; adjust display of GOT entries.
6872 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
6873 vector of input objects; remove file_status_.
6874 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
6875 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
6876 got_plt reader; call target hooks to reserve GOT entries.
6877 (Output_section_incremental_inputs::set_final_data_size): Adjust size
6878 of input file info header and GOT info entry.
6879 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
6880 relocation info.
6881 (Got_plt_view_info::got_descriptor): Remove.
6882 (Got_plt_view_info::sym_index): New data member.
6883 (Got_plt_view_info::input_index): New data member.
6884 (Local_got_offset_visitor::visit): Write input file index.
6885 (Global_got_offset_visitor::visit): Write 0 for input file index.
6886 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
6887 with sym_index and input_index.
6888 (Output_section_incremental_inputs::write_got_plt): Adjust size of
6889 incremental info GOT entry; replace got_descriptor with input_index.
6890 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
6891 map from input file index to object.
6892 (Sized_relobj_incr::do_layout): Replace direct data member reference
6893 with accessor function.
6894 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
6895 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
6896 Adjust size of input file info header.
6897 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
6898 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
6899 (Incremental_input_entry_reader::get_input_section): Adjust size of
6900 input file info header.
6901 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
6902 of incremental info GOT entry.
6903 (Incremental_got_plt_reader::get_got_desc): Remove.
6904 (Incremental_got_plt_reader::get_got_symndx): New function.
6905 (Incremental_got_plt_reader::get_got_input_index): New function.
6906 (Sized_incremental_binary::Sized_incremental_binary): Remove
6907 file_status_; add input_objects_.
6908 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
6909 (Sized_incremental_binary::set_file_is_unchanged): Remove.
6910 (Sized_incremental_binary::file_is_unchanged): Remove.
6911 (Sized_incremental_binary::set_input_object): New function.
6912 (Sized_incremental_binary::input_object): New function.
6913 (Sized_incremental_binary::file_status_): Remove.
6914 (Sized_incremental_binary::input_objects_): New data member.
6915 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
6916 references.
6917 (Sized_relobj_incr::invalid_address): Move to base class.
6918 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
6919 class.
6920 (Sized_relobj_incr::do_output_section_offset): Likewise.
6921 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
6922 (Sized_relobj_incr::section_offsets_): Likewise.
6923 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
6924 function.
6925 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
6926 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
6927 with accessor function.
6928 (Sized_relobj_file::do_layout): Likewise.
6929 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
6930 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
6931 (Sized_relobj_file::compute_final_local_value): Replace refs to
6932 section_offsets_ with accessor function.
6933 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
6934 * object.h (Relobj::Relobj): Initialize new data members.
6935 (Relobj::add_dyn_reloc): New function.
6936 (Relobj::first_dyn_reloc): New function.
6937 (Relobj::dyn_reloc_count): New function.
6938 (Relobj::first_dyn_reloc_): New data member.
6939 (Relobj::dyn_reloc_count_): New data member.
6940 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
6941 references.
6942 (Sized_relobj::Address): New typedef.
6943 (Sized_relobj::invalid_address): Move here from child class.
6944 (Sized_relobj::Sized_relobj): Initialize new data members.
6945 (Sized_relobj::sized_relobj): New function.
6946 (Sized_relobj::is_output_section_offset_invalid): Move here from
6947 child class.
6948 (Sized_relobj::get_output_section_offset): Likewise.
6949 (Sized_relobj::local_has_got_offset): Likewise.
6950 (Sized_relobj::local_got_offset): Likewise.
6951 (Sized_relobj::set_local_got_offset): Likewise.
6952 (Sized_relobj::do_for_all_local_got_entries): Likewise.
6953 (Sized_relobj::clear_got_offsets): New function.
6954 (Sized_relobj::section_offsets): Move here from child class.
6955 (Sized_relobj::do_output_section_offset): Likewise.
6956 (Sized_relobj::do_set_section_offset): Likewise.
6957 (Sized_relobj::Local_got_offsets): Likewise.
6958 (Sized_relobj::local_got_offsets_): Likewise.
6959 (Sized_relobj::section_offsets_): Likewise.
6960 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
6961 references.
6962 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
6963 class.
6964 (Sized_relobj_file::sized_relobj): New function
6965 (Sized_relobj_file::local_has_got_offset): Move to base class.
6966 (Sized_relobj_file::local_got_offset): Likewise.
6967 (Sized_relobj_file::set_local_got_offset): Likewise.
6968 (Sized_relobj_file::get_output_section_offset): Likewise.
6969 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
6970 (Sized_relobj_file::do_output_section_offset): Likewise.
6971 (Sized_relobj_file::do_set_section_offset): Likewise.
6972 (Sized_relobj_file::Local_got_offsets): Likewise.
6973 (Sized_relobj_file::local_got_offsets_): Likewise.
6974 (Sized_relobj_file::section_offsets_): Likewise.
6975 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
6976 (all constructors).
6977 (set_needs_dynsym_index): Convert relobj to derived class pointer.
6978 (Output_reloc::get_symbol_index): Likewise.
6979 (Output_reloc::local_section_offset): Likewise.
6980 (Output_reloc::get_address): Likewise.
6981 (Output_reloc::symbol_value): Likewise.
6982 (Output_data_got::reserve_slot): Move to class definition.
6983 (Output_data_got::reserve_local): New function.
6984 (Output_data_got::reserve_slot_for_global): Remove.
6985 (Output_data_got::reserve_global): New function.
6986 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
6987 (all constructors, two instantiations).
6988 (Output_reloc::get_relobj): New function (two instantiations).
6989 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
6990 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
6991 (Output_data_reloc::add_global): Adjust type of relobj.
6992 (Output_data_reloc::add_global_relative): Likewise.
6993 (Output_data_reloc::add_symbolless_global_addend): Likewise.
6994 (Output_data_reloc::add_local): Likewise.
6995 (Output_data_reloc::add_local_relative): Likewise.
6996 (Output_data_reloc::add_symbolless_local_addend): Likewise.
6997 (Output_data_reloc::add_local_section): Likewise.
6998 (Output_data_reloc::add_output_section): Likewise.
6999 (Output_data_reloc::add_absolute): Likewise.
7000 (Output_data_reloc::add_target_specific): Likewise.
7001 (Output_data_got::reserve_slot): Move definition here.
7002 (Output_data_got::reserve_local): New function.
7003 (Output_data_got::reserve_global): New function.
7004 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
7005 section_offsets_ with accessor function.
7006 (Sized_relobj_file::write_sections): Likewise.
7007 (Sized_relobj_file::do_relocate_sections): Likewise.
7008 * target.h (Sized_target::reserve_local_got_entry): New function.
7009 (Sized_target::reserve_global_got_entry): New function.
7010 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
7011 (Target_x86_64::reserve_global_got_entry): New function.
7012 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
7013
4829d394
CC
70142011-05-23 Cary Coutant <ccoutant@google.com>
7015
7016 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
7017 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
7018 bit when checking got_type.
7019 * incremental.cc (Sized_incremental_binary::setup_readers):
7020 Store symbol table and string table locations; initialize bit vector
7021 of file status flags.
7022 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
7023 unchanged files.
7024 (Sized_incremental_binary::do_process_got_plt): New function.
7025 (Sized_incremental_binary::get_symtab_view): Use stored locations.
7026 (Output_section_incremental_inputs::set_final_data_size): Record
7027 file index for each input file.
7028 (Output_section_incremental_inputs::write_got_plt): Store file index
7029 instead of input entry offset for each GOT entry.
7030 * incremental.h
7031 (Incremental_input_entry::Incremental_input_entry): Initialize new
7032 data member.
7033 (Incremental_input_entry::set_offset): Store file index.
7034 (Incremental_input_entry::get_file_index): New function.
7035 (Incremental_input_entry::file_index_): New data member.
7036 (Incremental_binary::process_got_plt): New function.
7037 (Incremental_binary::do_process_got_plt): New function.
7038 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7039 data members.
7040 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
7041 (Sized_incremental_binary::set_file_is_unchanged): New function.
7042 (Sized_incremental_binary::file_is_unchanged): New function.
7043 (Sized_incremental_binary::do_process_got_plt): New function.
7044 (Sized_incremental_binary::file_status_): New data member.
7045 (Sized_incremental_binary::main_symtab_loc_): New data member.
7046 (Sized_incremental_binary::main_strtab_loc_): New data member.
7047 * output.cc (Output_data_got::Got_entry::write): Add case
7048 RESERVED_CODE.
7049 (Output_data_got::add_global): Call add_got_entry.
7050 (Output_data_got::add_global_plt): Likewise.
7051 (Output_data_got::add_global_with_rel): Likewise.
7052 (Output_data_got::add_global_with_rela): Likewise.
7053 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
7054 (Output_data_got::add_global_pair_with_rela): Likewise.
7055 (Output_data_got::add_local): Call add_got_entry.
7056 (Output_data_got::add_local_plt): Likewise.
7057 (Output_data_got::add_local_with_rel): Likewise.
7058 (Output_data_got::add_local_with_rela): Likewise.
7059 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
7060 (Output_data_got::add_local_pair_with_rela): Likewise.
7061 (Output_data_got::reserve_slot): New function.
7062 (Output_data_got::reserve_slot_for_global): New function.
7063 (Output_data_got::add_got_entry): New function.
7064 (Output_data_got::add_got_entry_pair): New function.
7065 (Output_section::add_output_section_data): Edit FIXME.
7066 * output.h
7067 (Output_section_data_build::Output_section_data_build): New
7068 constructor with size parameter.
7069 (Output_data_space::Output_data_space): Likewise.
7070 (Output_data_got::Output_data_got): Initialize new data member; new
7071 constructor with size parameter.
7072 (Output_data_got::add_constant): Call add_got_entry.
7073 (Output_data_got::reserve_slot): New function.
7074 (Output_data_got::reserve_slot_for_global): New function.
7075 (class Output_data_got::Got_entry): Add RESERVED_CODE.
7076 (Output_data_got::add_got_entry): New function.
7077 (Output_data_got::add_got_entry_pair): New function.
7078 (Output_data_got::free_list_): New data member.
7079 * target.h (Sized_target::init_got_plt_for_update): New function.
7080 (Sized_target::register_global_plt_entry): New function.
7081 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
7082 Initialize new data member; call init; add constructor with PLT count.
7083 (Output_data_plt_x86_64::init): New function.
7084 (Output_data_plt_x86_64::add_relocation): New function.
7085 (Output_data_plt_x86_64::reserve_slot): New function.
7086 (Output_data_plt_x86_64::free_list_): New data member.
7087 (Target_x86_64::init_got_plt_for_update): New function.
7088 (Target_x86_64::register_global_plt_entry): New function.
7089 (Output_data_plt_x86_64::add_entry): Allocate from free list for
7090 incremental updates.
7091 (Output_data_plt_x86_64::add_relocation): New function.
7092 * testsuite/object_unittest.cc (Object_test): Set default options.
7093
ec69d6da
ILT
70942011-05-16 Ian Lance Taylor <iant@google.com>
7095
7096 * options.h (class General_options): Make -i a synonym for -r.
7097
732e31de
ILT
70982011-05-16 Ian Lance Taylor <iant@google.com>
7099
7100 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
7101
403676b5
CC
71022011-05-10 Cary Coutant <ccoutant@google.com>
7103
7104 * object.cc (Sized_relobj::do_count_local_symbols): Check for
7105 strip_all (-s).
7106
5b7b7d6e
ILT
71072011-05-06 Ian Lance Taylor <iant@google.com>
7108
7109 * layout.cc (Layout::layout): If the output section flags change,
7110 update the ordering.
7111
f0f9babf
CC
71122011-04-25 Cary Coutant <ccoutant@google.com>
7113
7114 * incremental-dump.cc (dump_incremental_inputs): Print local
7115 symbol info for each input file.
7116 * incremental.cc
7117 (Output_section_incremental_inputs::set_final_data_size): Add local
7118 symbol info to input file entries in incremental info.
7119 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7120 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
7121 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
7122 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
7123 implementation.
7124 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
7125 (Sized_incr_relobj::do_relocate): Write the local symbols.
7126 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
7127 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
7128 Adjust size of input file header.
7129 (Incremental_inputs_reader::get_local_symbol_offset): New function.
7130 (Incremental_inputs_reader::get_local_symbol_count): New function.
7131 (Incremental_inputs_reader::get_input_section): Adjust size of input
7132 file header.
7133 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
7134 (Sized_incr_relobj::This): New typedef.
7135 (Sized_incr_relobj::sym_size): New const data member.
7136 (Sized_incr_relobj::Local_symbol): New struct.
7137 (Sized_incr_relobj::do_output_local_symbol_count): New function.
7138 (Sized_incr_relobj::do_local_symbol_offset): New function.
7139 (Sized_incr_relobj::local_symbol_count_): New data member.
7140 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
7141 (Sized_incr_relobj::local_symbol_index_): New data member.
7142 (Sized_incr_relobj::local_symbol_offset_): New data member.
7143 (Sized_incr_relobj::local_dynsym_offset_): New data member.
7144 (Sized_incr_relobj::local_symbols_): New data member.
7145 * object.h (Relobj::output_local_symbol_count): New function.
7146 (Relobj::local_symbol_offset): New function.
7147 (Relobj::do_output_local_symbol_count): New function.
7148 (Relobj::do_local_symbol_offset): New function.
7149 (Sized_relobj::do_output_local_symbol_count): New function.
7150 (Sized_relobj::do_local_symbol_offset): New function.
7151
d0a9ace3
ILT
71522011-04-22 Vladimir Simonov <sv@sw.ru>
7153
7154 * descriptors.cc (set_close_on_exec): New function.
7155 (Descriptors::open): Use set_close_on_exec.
7156 * output.cc (S_ISLNK): Define if not defined.
7157
94a3fc8b
CC
71582011-04-22 Cary Coutant <ccoutant@google.com>
7159
7160 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
7161 global symbol map.
7162 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7163 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
7164 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
7165 relocations.
7166 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
7167 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
7168 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
7169 * incremental.h
7170 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
7171 function.
7172 (Incremental_binary::apply_incremental_relocs): New function.
7173 (Incremental_binary::do_apply_incremental_relocs): New function.
7174 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7175 data member.
7176 (Sized_incremental_binary::add_global_symbol): New function.
7177 (Sized_incremental_binary::global_symbol): New function.
7178 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7179 (Sized_incremental_binary::symbol_map_): New data member.
7180 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
7181 * target.h (Sized_target::apply_relocation): New function.
7182 * target-reloc.h (apply_relocation): New function.
7183 * x86_64.cc (Target_x86_64::apply_relocation): New function.
7184
c87e4302
DK
71852011-04-22 Doug Kwan <dougkwan@google.com>
7186
7187 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
7188 flag of a SHT_ARM_EXIDX section.
2e702c99 7189 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
7190 * testsuite/Makefile.in: Regenerate.
7191 * testsuite/arm_exidx_test.s: New file.
7192 * testsuite/arm_exidx_test.sh: Same.
7193
e7782cf6
CC
71942011-04-20 Cary Coutant <ccoutant@google.com>
7195
7196 PR gold/12689
7197 * archive.h (Incremental_archive_entry::Archive_member):
7198 Initialize arg_serial_ (second constructor).
7199
308ecdc7
ILT
72002011-04-17 Ian Lance Taylor <iant@google.com>
7201
7202 * object.cc (Relocate_info::location): Simplify location string.
7203 * errors.cc (Errors::error_at_location): Don't print program
7204 name.
7205 (Errors::warning_at_location): Likewise.
7206 (Errors::undefined_symbol): Likewise.
7207 * testsuite/debug_msg.sh: Update accordingly.
7208
bec5b579
CC
72092011-04-14 Cary Coutant <ccoutant@google.com>
7210
7211 * gold/layout.cc (Layout::symtab_section_offset): New function.
7212 * gold/layout.h (Layout::symtab_section_offset): New function.
7213 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
7214
88597d34
ILT
72152011-04-12 Ian Lance Taylor <iant@google.com>
7216
7217 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
7218 with MREMAP_MAYMOVE.
7219 * output.h (class Output_file): Add map_is_allocated_ field.
7220 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
7221 not available, provide stubs. If mremap is not available, #define
7222 it to gold_mremap.
7223 (MREMAP_MAYMOVE): Define if not defined.
7224 (Output_file::Output_file): Initialize map_is_allocated_.
7225 (Output_file::resize): Check map_is_allocated_.
7226 (Output_file::map_anonymous): If mmap fails, use malloc.
7227 (Output_file::unmap): Don't do anything for an anonymous map.
7228 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
7229 is not available, provide stubs.
7230 (File_read::View::~View): Use free rather than delete[].
7231 (File_read::make_view): Use malloc rather than new[]. If mmap
7232 fails, use malloc.
7233 (File_read::find_or_make_view): Use malloc rather than new[].
7234 * gold.h: Remove HAVE_REMAP code.
7235 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
7236 exists. Rename mremap to gold_mremap. If mmap is not available
7237 don't do anything.
7238 * configure, config.in: Rebuild.
7239
11e361bc
ILT
72402011-04-11 Ian Lance Taylor <iant@google.com>
7241
7242 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
7243 initialize local variable v.
7244
cdc29364
CC
72452011-04-11 Cary Coutant <ccoutant@google.com>
7246
7247 * archive.cc (Archive::include_member): Adjust call to
7248 report_object.
7249 (Add_archive_symbols::run): Track argument serial numbers.
7250 (Lib_group::include_member): Likewise.
7251 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
7252 * archive.h (Incremental_archive_entry::Archive_member):
7253 Initialize arg_serial_.
7254 (Archive_member::arg_serial_): New data member.
7255 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
7256 (Sized_dynobj::do_add_symbols): Track symbols when doing an
7257 incremental link.
7258 (Sized_dynobj::do_for_all_local_got_entries): New function.
7259 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
7260 function.
7261 * fileread.cc (get_mtime): New function.
7262 * fileread.h (get_mtime): New function.
7263 * gold.cc (queue_initial_tasks): Check for incremental update.
7264 (process_incremental_input): New function.
7265 (queue_middle_tasks): Don't force valid target for incremental
7266 update.
7267 * incremental-dump.cc (find_input_containing_global): Adjust
7268 size of symbol info entry.
7269 (dump_incremental_inputs): Dump argument serial number and
7270 in_system_directory flag; bias shndx by 1; print symbol names
7271 when dumping per-file symbol lists; use new symbol info readers.
7272 * incremental.cc
7273 (Output_section_incremental_inputs:update_data_size): New function.
7274 (Sized_incremental_binary::setup_readers): Setup input readers
7275 for each input file; build maps for files added from libraries
7276 and scripts.
7277 (Sized_incremental_binary::check_input_args): New function.
7278 (Sized_incremental_binary::do_check_inputs): Build map of argument
7279 serial numbers to input arguments.
7280 (Sized_incremental_binary::do_file_has_changed): Rename
7281 do_file_is_unchanged to this; compare file modification times.
7282 (Sized_incremental_binary::do_init_layout): New function.
7283 (Sized_incremental_binary::do_reserve_layout): New function.
7284 (Sized_incremental_binary::do_get_input_reader): Remove.
7285 (Sized_incremental_binary::get_symtab_view): New function.
7286 (Incremental_checker::can_incrementally_link_output_file): Remove.
7287 (Incremental_inputs::report_command_line): Exclude --debug options.
7288 (Incremental_inputs::report_archive_begin): Add parameter; track
7289 argument serial numbers; don't put input file entry for archive
7290 before archive members.
7291 (Incremental_inputs::report_archive_end): Put input file entry
7292 for archive after archive members.
7293 (Incremental_inputs::report_object): Add parameter; track argument
7294 serial numbers and in_system_directory flag.
7295 (Incremental_inputs::report_script): Add parameter; track argument
7296 serial numbers.
7297 (Output_section_incremental_inputs::set_final_data_size): Adjust
7298 size of symbol info entry; check for forwarding symbols.
7299 (Output_section_incremental_inputs::write_input_files): Write
7300 in_system_directory flag and argument serial number.
7301 (Output_section_incremental_inputs::write_info_blocks): Map section
7302 indices between incremental info and original input file; store
7303 input section index for each symbol.
7304 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
7305 change operator() to visit().
7306 (class Global_got_offset_visitor): Likewise.
7307 (class Global_symbol_visitor_got_plt):
7308 (Output_section_incremental_inputs::write_got_plt): Use new visitor
7309 classes.
7310 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
7311 (Sized_incr_relobj::do_read_symbols): New function.
7312 (Sized_incr_relobj::do_layout): New function.
7313 (Sized_incr_relobj::do_layout_deferred_sections): New function.
7314 (Sized_incr_relobj::do_add_symbols): New function.
7315 (Sized_incr_relobj::do_should_include_member): New function.
7316 (Sized_incr_relobj::do_for_all_global_symbols): New function.
7317 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
7318 (Sized_incr_relobj::do_section_size): New function.
7319 (Sized_incr_relobj::do_section_name): New function.
7320 (Sized_incr_relobj::do_section_contents): New function.
7321 (Sized_incr_relobj::do_section_flags): New function.
7322 (Sized_incr_relobj::do_section_entsize): New function.
7323 (Sized_incr_relobj::do_section_address): New function.
7324 (Sized_incr_relobj::do_section_type): New function.
7325 (Sized_incr_relobj::do_section_link): New function.
7326 (Sized_incr_relobj::do_section_info): New function.
7327 (Sized_incr_relobj::do_section_addralign): New function.
7328 (Sized_incr_relobj::do_initialize_xindex): New function.
7329 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
7330 (Sized_incr_relobj::do_read_relocs): New function.
7331 (Sized_incr_relobj::do_gc_process_relocs): New function.
7332 (Sized_incr_relobj::do_scan_relocs): New function.
7333 (Sized_incr_relobj::do_count_local_symbols): New function.
7334 (Sized_incr_relobj::do_finalize_local_symbols): New function.
7335 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
7336 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
7337 (Sized_incr_relobj::do_relocate): New function.
7338 (Sized_incr_relobj::do_set_section_offset): New function.
7339 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
7340 (Sized_incr_dynobj::do_read_symbols): New function.
7341 (Sized_incr_dynobj::do_layout): New function.
7342 (Sized_incr_dynobj::do_add_symbols): New function.
7343 (Sized_incr_dynobj::do_should_include_member): New function.
7344 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
7345 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
7346 (Sized_incr_dynobj::do_section_size): New function.
7347 (Sized_incr_dynobj::do_section_name): New function.
7348 (Sized_incr_dynobj::do_section_contents): New function.
7349 (Sized_incr_dynobj::do_section_flags): New function.
7350 (Sized_incr_dynobj::do_section_entsize): New function.
7351 (Sized_incr_dynobj::do_section_address): New function.
7352 (Sized_incr_dynobj::do_section_type): New function.
7353 (Sized_incr_dynobj::do_section_link): New function.
7354 (Sized_incr_dynobj::do_section_info): New function.
7355 (Sized_incr_dynobj::do_section_addralign): New function.
7356 (Sized_incr_dynobj::do_initialize_xindex): New function.
7357 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
7358 (make_sized_incremental_object): New function.
7359 (Incremental_library::copy_unused_symbols): New function.
7360 (Incremental_library::do_for_all_unused_symbols): New function.
7361 * incremental.h (enum Incremental_input_flags): New type.
7362 (class Incremental_checker): Remove.
7363 (Incremental_input_entry::Incremental_input_entry): Add argument
7364 serial number.
7365 (Incremental_input_entry::arg_serial): New function.
7366 (Incremental_input_entry::set_is_in_system_directory): New function.
7367 (Incremental_input_entry::is_in_system_directory): New function.
7368 (Incremental_input_entry::arg_serial_): New data member.
7369 (Incremental_input_entry::is_in_system_directory_): New data member.
7370 (class Script_info): Move here from script.h.
7371 (Script_info::Script_info): Add filename parameter.
7372 (Script_info::filename): New function.
7373 (Script_info::filename_): New data member.
7374 (Incremental_script_entry::Incremental_script_entry): Add argument
7375 serial number.
7376 (Incremental_object_entry::Incremental_object_entry): Likewise.
7377 (Incremental_object_entry::add_input_section): Build list of input
7378 sections with map to original shndx.
7379 (Incremental_object_entry::get_input_section_index): New function.
7380 (Incremental_object_entry::shndx_): New data member.
7381 (Incremental_object_entry::name_key_): Rename; adjust all refs.
7382 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
7383 (Incremental_archive_entry::Incremental_archive_entry): Add argument
7384 serial number.
7385 (Incremental_inputs::report_archive_begin): Likewise.
7386 (Incremental_inputs::report_object): Likewise.
7387 (Incremental_inputs::report_script): Likewise.
7388 (class Incremental_global_symbol_reader): New class.
7389 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
7390 and store flags and input file type.
7391 (Incremental_input_entry_reader::arg_serial): New function.
7392 (Incremental_input_entry_reader::type): Extract type from flags.
7393 (Incremental_input_entry_reader::is_in_system_directory): New function.
7394 (Incremental_input_entry_reader::get_input_section_count): Call
7395 accessor function for type.
7396 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
7397 function for type; adjust size of global symbol entry.
7398 (Incremental_input_entry_reader::get_global_symbol_count): Call
7399 accessor function for type.
7400 (Incremental_input_entry_reader::get_object_count): Likewise.
7401 (Incremental_input_entry_reader::get_object_offset): Likewise.
7402 (Incremental_input_entry_reader::get_member_count): Likewise.
7403 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
7404 (Incremental_input_entry_reader::get_member_offset): Likewise.
7405 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
7406 (Incremental_input_entry_reader::Global_symbol_info): Remove.
7407 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
7408 (Incremental_input_entry_reader::get_global_symbol_reader): New
7409 function.
7410 (Incremental_input_entry_reader::get_output_symbol_index): New
7411 function.
7412 (Incremental_input_entry_reader::type_): Remove.
7413 (Incremental_input_entry_reader::flags_): New data member.
7414 (Incremental_inputs_reader::input_file_offset): New function.
7415 (Incremental_inputs_reader::input_file_index): New function.
7416 (Incremental_inputs_reader::input_file): Call input_file_offset.
7417 (Incremental_inputs_reader::input_file_at_offset): New function.
7418 (Incremental_relocs_reader::get_r_type): Reformat.
7419 (Incremental_relocs_reader::get_r_shndx): Reformat.
7420 (Incremental_relocs_reader::get_r_offset): Reformat.
7421 (Incremental_relocs_reader::data): New function.
7422 (Incremental_binary::Incremental_binary): Initialize new data members.
7423 (Incremental_binary::check_inputs): Add cmdline parameter.
7424 (Incremental_binary::file_is_unchanged): Remove.
7425 (Input_reader::arg_serial): New function.
7426 (Input_reader::get_unused_symbol_count): New function.
7427 (Input_reader::get_unused_symbol): New function.
7428 (Input_reader::do_arg_serial): New function.
7429 (Input_reader::do_get_unused_symbol_count): New function.
7430 (Input_reader::do_get_unused_symbol): New function.
7431 (Incremental_binary::input_file_count): New function.
7432 (Incremental_binary::get_input_reader): Change signature to use
7433 index instead of filename.
7434 (Incremental_binary::file_has_changed): New function.
7435 (Incremental_binary::get_input_argument): New function.
7436 (Incremental_binary::get_library): New function.
7437 (Incremental_binary::get_script_info): New function.
7438 (Incremental_binary::init_layout): New function.
7439 (Incremental_binary::reserve_layout): New function.
7440 (Incremental_binary::output_file): New function.
7441 (Incremental_binary::do_check_inputs): New function.
7442 (Incremental_binary::do_file_is_unchanged): Remove.
7443 (Incremental_binary::do_file_has_changed): New function.
7444 (Incremental_binary::do_init_layout): New function.
7445 (Incremental_binary::do_reserve_layout): New function.
7446 (Incremental_binary::do_input_file_count): New function.
7447 (Incremental_binary::do_get_input_reader): Change signature.
7448 (Incremental_binary::input_args_map_): New data member.
7449 (Incremental_binary::library_map_): New data member.
7450 (Incremental_binary::script_map_): New data member.
7451 (Sized_incremental_binary::Sized_incremental_binary): Initialize
7452 new data members.
7453 (Sized_incremental_binary::output_section): New function.
7454 (Sized_incremental_binary::inputs_reader): Add const.
7455 (Sized_incremental_binary::symtab_reader): Add const.
7456 (Sized_incremental_binary::relocs_reader): Add const.
7457 (Sized_incremental_binary::got_plt_reader): Add const.
7458 (Sized_incremental_binary::get_symtab_view): New function.
7459 (Sized_incremental_binary::Inputs_reader): New typedef.
7460 (Sized_incremental_binary::Input_entry_reader): New typedef.
7461 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
7462 (Sized_incremental_binary::do_file_is_unchanged): Remove.
7463 (Sized_incremental_binary::do_file_has_changed): New function.
7464 (Sized_incremental_binary::do_init_layout): New function.
7465 (Sized_incremental_binary::do_reserve_layout): New function.
7466 (Sized_input_reader::Inputs_reader): Remove.
7467 (Sized_input_reader::Input_entry_reader): Remove.
7468 (Sized_input_reader::do_arg_serial): New function.
7469 (Sized_input_reader::do_get_unused_symbol_count): New function.
7470 (Sized_input_reader::do_get_unused_symbol): New function.
7471 (Sized_incremental_binary::do_input_file_count): New function.
7472 (Sized_incremental_binary::do_get_input_reader): Change signature;
7473 use index instead of filename.
7474 (Sized_incremental_binary::section_map_): New data member.
7475 (Sized_incremental_binary::input_entry_readers_): New data member.
7476 (class Sized_incr_relobj): New class.
7477 (class Sized_incr_dynobj): New class.
7478 (make_sized_incremental_object): New function.
7479 (class Incremental_library): New class.
7480 * layout.cc (Free_list::num_lists): New static data member.
7481 (Free_list::num_nodes): New static data member.
7482 (Free_list::num_removes): New static data member.
7483 (Free_list::num_remove_visits): New static data member.
7484 (Free_list::num_allocates): New static data member.
7485 (Free_list::num_allocate_visits): New static data member.
7486 (Free_list::init): New function.
7487 (Free_list::remove): New function.
7488 (Free_list::allocate): New function.
7489 (Free_list::dump): New function.
7490 (Free_list::print_stats): New function.
7491 (Layout_task_runner::run): Resize output file for incremental updates.
7492 (Layout::Layout): Initialize new data members.
7493 (Layout::set_incremental_base): New function.
7494 (Layout::init_fixed_output_section): New function.
7495 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
7496 incremental updates.
7497 (Layout::create_gold_note): Do not create gold note section for
7498 incremental updates.
7499 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
7500 for incremental updates.
7501 (Layout::set_section_offsets): For incremental updates, allocate space
7502 from free list.
7503 (Layout::create_symtab_sections): Layout with offsets relative to
7504 start of section; for incremental updates, allocate space from free
7505 list.
7506 (Layout::create_shdrs): For incremental updates, allocate space from
7507 free list.
7508 (Layout::finish_dynamic_section): For incremental updates, do not
7509 check --as-needed (fixed in subsequent patch).
7510 * layout.h (class Free_list): New class.
7511 (Layout::set_incremental_base): New function.
7512 (Layout::incremental_base): New function.
7513 (Layout::init_fixed_output_section): New function.
7514 (Layout::allocate): New function.
7515 (Layout::incremental_base_): New data member.
7516 (Layout::free_list_): New data member.
7517 * main.cc (main): Print Free_list statistics.
7518 * object.cc (Relobj::finalize_incremental_relocs): Add
7519 clear_counts parameter; clear counts only when clear_counts is set.
7520 (Sized_relobj::Sized_relobj): Initialize new base class.
7521 (Sized_relobj::do_layout): Don't report special sections.
7522 (Sized_relobj::do_for_all_local_got_entries): New function.
7523 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
7524 symtab_off to all symbol table offsets.
7525 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
7526 * object.h (class Got_offset_list): Move to top of file.
7527 (Object::Object): Allow case where input_file == NULL.
7528 (Object::~Object): Likewise.
7529 (Object::input_file): Assert that input_file != NULL.
7530 (Object::lock): Allow case where input_file == NULL.
7531 (Object::unlock): Likewise.
7532 (Object::is_locked): Likewise.
7533 (Object::token): Likewise.
7534 (Object::release): Likewise.
7535 (Object::is_incremental): New function.
7536 (Object::get_mtime): New function.
7537 (Object::for_all_local_got_entries): New function.
7538 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
7539 (Object::set_is_in_system_directory): New function.
7540 (Object::is_in_system_directory): New function.
7541 (Object::do_is_incremental): New function.
7542 (Object::do_get_mtime): New function.
7543 (Object::do_for_all_local_got_entries): New function.
7544 (Object::is_in_system_directory_): New data member.
7545 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
7546 (class Sized_relobj_base): New class.
7547 (class Sized_relobj): Derive from Sized_relobj_base.
7548 (class Sized_relobj::Symbols): Redeclare from base class.
7549 (class Sized_relobj::local_got_offset_list): Remove.
7550 (class Sized_relobj::Output_sections): Redeclare from base class.
7551 (class Sized_relobj::do_for_all_local_got_entries): New function.
7552 (class Sized_relobj::write_local_symbols): Add offset parameter.
7553 (class Sized_relobj::local_symbol_offset_): Update comment.
7554 (class Sized_relobj::local_dynsym_offset_): Update comment.
7555 * options.cc (Input_arguments::add_file): Remove const.
7556 * options.h (Input_file_argument::Input_file_argument):
7557 Initialize arg_serial_ (all constructors).
7558 (Input_file_argument::set_arg_serial): New function.
7559 (Input_file_argument::arg_serial): New function.
7560 (Input_file_argument::arg_serial_): New data member.
7561 (Input_arguments::Input_arguments): Initialize file_count_.
7562 (Input_arguments::add_file): Remove const.
7563 (Input_arguments::number_of_input_files): New function.
7564 (Input_arguments::file_count_): New data member.
7565 (Command_line::number_of_input_files): Call
7566 Input_arguments::number_of_input_files.
7567 * output.cc (Output_segment_headers::Output_segment_headers):
7568 Set current size.
7569 (Output_section::Input_section::current_data_size): New function.
7570 (Output_section::Output_section): Initialize new data members.
7571 (Output_section::add_input_section): Don't do merge sections for
7572 an incremental link; allocate space from free list for an
7573 incremental update.
7574 (Output_section::add_output_section_data): Allocate space from
7575 free list for an incremental update.
7576 (Output_section::update_data_size): New function.
7577 (Output_section::set_fixed_layout): New function.
7578 (Output_section::reserve): New function.
7579 (Output_segment::set_section_addresses): Remove const.
7580 (Output_segment::set_section_list_addresses): Remove const; allocate
7581 space from free list for an incremental update.
7582 (Output_segment::set_offset): Adjust size of RELRO segment for an
7583 incremental update.
7584 * output.h (Output_data::current_data_size): Move here from
7585 child classes.
7586 (Output_data::pre_finalize_data_size): New function.
7587 (Output_data::update_data_size): New function.
7588 (Output_section_headers::update_data_size): new function.
7589 (Output_section_data_build::current_data_size): Move to Output_data.
7590 (Output_data_strtab::update_data_size): New function.
7591 (Output_section::current_data_size): Move to Output_data.
7592 (Output_section::set_fixed_layout): New function.
7593 (Output_section::has_fixed_layout): New function.
7594 (Output_section::reserve): New function.
7595 (Output_section::update_data_size): New function.
7596 (Output_section::has_fixed_layout_): New data member.
7597 (Output_section::free_list_): New data member.
7598 (Output_segment::set_section_addresses): Remove const.
7599 (Output_segment::set_section_list_addresses): Remove const.
7600 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
7601 New function.
7602 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
7603 New function.
7604 * readsyms.cc (Read_symbols::do_read_symbols): Add library
7605 parameter when calling Add_symbols constructor; store argument
7606 serial number for members of a lib group.
7607 (Add_symbols::locks): Allow case where token == NULL.
7608 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
7609 (Read_member::~Read_member): New function.
7610 (Read_member::is_runnable): New function.
7611 (Read_member::locks): New function.
7612 (Read_member::run): New function.
7613 (Check_script::~Check_script): New function.
7614 (Check_script::is_runnable): New function.
7615 (Check_script::locks): New function.
7616 (Check_script::run): New function.
7617 (Check_library::~Check_library): New function.
7618 (Check_library::is_runnable): New function.
7619 (Check_library::locks): New function.
7620 (Check_library::run): New function.
7621 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
7622 (Add_symbols::library_): New data member.
7623 (class Read_member): New class.
7624 (class Check_script): New class.
7625 (class Check_library): New class.
7626 * reloc.cc (Read_relocs::is_runnable): Allow case where
7627 token == NULL.
7628 (Read_relocs::locks): Likewise.
7629 (Scan_relocs::locks): Likewise.
7630 (Relocate_task::locks): Likewise.
7631 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
7632 to clear counters.
7633 (Sized_relobj::incremental_relocs_scan): Fix comment.
7634 (Sized_relobj::do_relocate): Pass output file offset to
7635 write_local_symbols.
7636 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
7637 from class declaration.
7638 * script.cc (read_input_script): Allocate Script_info; pass
7639 argument serial number to report_script.
7640 * script.h (class Script_info): Move to incremental.h.
7641 * symtab.cc (Symbol_table::add_from_incrobj): New function.
7642 * symtab.h (Symbol_table::add_from_incrobj): New function.
7643 (Symbol_table::set_file_offset): New function.
7644
b961d0d7
CC
76452011-04-05 Cary Coutant <ccoutant@google.com>
7646
7647 * incremental-dump.cc (dump_incremental_inputs): Change signature
7648 to take a Sized_incremental_binary; change caller. Use readers
7649 in Sized_incremental_binary.
7650 * incremental.cc
7651 (Sized_incremental_binary::find_incremental_inputs_sections):
7652 Rename do_find_incremental_inputs_sections to this.
7653 (Sized_incremental_binary::setup_readers): New function.
7654 (Sized_incremental_binary::do_check_inputs): Check
7655 has_incremental_info_ flag; move setup code to setup_readers;
7656 use input readers.
7657 (Sized_incremental_binary::do_file_is_unchanged): New function.
7658 (Sized_incremental_binary::do_get_input_reader): New function.
7659 * incremental.h (class Incremental_binary): Move to end of file.
7660 (Incremental_binary::file_is_unchanged): New function.
7661 (Incremental_binary::do_file_is_unchanged): New function.
7662 (Incremental_binary::Input_reader): New class.
7663 (Incremental_binary::get_input_reader): New function.
7664 (class Sized_incremental_binary): Move to end of file.
7665 (Sized_incremental_binary::Sized_incremental_binary): Setup the
7666 input section reader classes.
7667 (Sized_incremental_binary::has_incremental_info): New function.
7668 (Sized_incremental_binary::inputs_reader): New function.
7669 (Sized_incremental_binary::symtab_reader): New function.
7670 (Sized_incremental_binary::relocs_reader): New function.
7671 (Sized_incremental_binary::got_plt_reader): New function.
7672 (Sized_incremental_binary::do_file_is_unchanged): New function.
7673 (Sized_incremental_binary::Sized_input_reader): New class.
7674 (Sized_incremental_binary::get_input_reader): New function.
7675 (Sized_incremental_binary::find_incremental_inputs_sections):
7676 Rename do_find_incremental_inputs_sections to this.
7677 (Sized_incremental_binary::setup_readers): New function.
7678 (Sized_incremental_binary::has_incremental_info_): New data member.
7679 (Sized_incremental_binary::inputs_reader_): New data member.
7680 (Sized_incremental_binary::symtab_reader_): New data member.
7681 (Sized_incremental_binary::relocs_reader_): New data member.
7682 (Sized_incremental_binary::got_plt_reader_): New data member.
7683 (Sized_incremental_binary::current_input_file_): New data member.
7684
a869183f
PP
76852011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
7686
7687 PR gold/12640
7688 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
7689 violation.
7690
76912011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
7692
7693 * archive.cc (Archive::include_member): Adjust call to report_object.
7694 (Add_archive_symbols::run): Add script_info to call to
7695 report_archive_begin.
7696 (Lib_group::include_member): Adjust call to report_object.
7697 (Add_lib_group_symbols::run): Adjust call to report_object.
7698 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
7699 blocks. Add object count for script input files.
7700 * incremental.cc (Incremental_inputs::report_archive_begin): Add
7701 script_info parameter; change all callers.
7702 (Incremental_inputs::report_object): Add script_info parameter;
7703 change all callers.
7704 (Incremental_inputs::report_script): Store backpointer to
7705 incremental info entry.
7706 (Output_section_incremental_inputs::set_final_data_size): Record
7707 additional information for scripts.
7708 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7709 * incremental.h (Incremental_script_entry::add_object): New function.
7710 (Incremental_script_entry::get_object_count): New function.
7711 (Incremental_script_entry::get_object): New function.
7712 (Incremental_script_entry::objects_): New data member; adjust
7713 constructor.
7714 (Incremental_inputs::report_archive_begin): Add script_info parameter.
7715 (Incremental_inputs::report_object): Add script_info parameter.
7716 (Incremental_inputs_reader::get_object_count): New function.
7717 (Incremental_inputs_reader::get_object_offset): New function.
7718 * options.cc (Input_arguments::add_file): Return reference to
7719 new input argument.
7720 * options.h (Input_argument::set_script_info): New function.
7721 (Input_argument::script_info): New function.
7722 (Input_argument::script_info_): New data member; adjust all
7723 constructors.
7724 (Input_file_group::add_file): Return reference to new input argument.
7725 (Input_file_lib::add_file): Likewise.
7726 (Input_arguments::add_file): Likewise.
7727 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
7728 * script.cc (Parser_closure::Parser_closure): Add script_info
7729 parameter; adjust all callers.
7730 (Parser_closure::script_info): New function.
7731 (Parser_closure::script_info_): New data member.
7732 (read_input_script): Report scripts earlier to incremental info.
7733 (script_add_file): Set script_info in Input_argument.
7734 (script_add_library): Likewise.
7735 * script.h (Script_options::Script_info): Rewrite class.
7736
a869183f 77372011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
7738
7739 * archive.cc (Library_base::should_include_member): Move
7740 method here from class Archive.
7741 (Archive::Archive): Initialize base class.
7742 (Archive::should_include_member): Move to base class.
7743 (Archive::do_for_all_unused_symbols): New function.
7744 (Add_archive_symbols::run): Remove redundant access to
7745 incremental_inputs.
7746 (Lib_group::Lib_group): Initialize base class.
7747 (Lib_group::do_filename): New function.
7748 (Lib_group::include_member): Pass pointer to Lib_group to
7749 report_object.
7750 (Lib_group::do_for_all_unused_symbols): New function.
7751 (Add_lib_group_symbols::run): Report archive information for
7752 incremental links.
7753 * archive.h (class Library_base): New base class.
7754 (class Archive): Derive from Library_base.
7755 (Archive::filename): Move to base class.
7756 (Archive::set_incremental_info): Likewise.
7757 (Archive::incremental_info): Likewise.
7758 (Archive::Should_include): Likewise.
7759 (Archive::should_include_member): Likewise.
7760 (Archive::Armap_entry): Remove.
7761 (Archive::Unused_symbol_iterator): Remove.
7762 (Archive::unused_symbols_begin): Remove.
7763 (Archive::unused_symbols_end): Remove.
7764 (Archive::do_filename): New function.
7765 (Archive::do_get_mtime): New function.
7766 (Archive::do_for_all_unused_symbols): New function.
7767 (Archive::task_): Move to base class.
7768 (Archive::incremental_info_): Likewise.
7769 (class Lib_group): Derive from Library_base.
7770 (Lib_group::do_filename): New function.
7771 (Lib_group::do_get_mtime): New function.
7772 (Lib_group::do_for_all_unused_symbols): New function.
7773 (Lib_group::task_): Move to base class.
7774 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
7775 function.
7776 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
7777 function.
7778 * incremental.cc (Incremental_inputs::report_archive_begin):
7779 Use Library_base; call library's get_mtime; add incremental inputs
7780 entry before members.
7781 (class Unused_symbol_visitor): New class.
7782 (Incremental_inputs::report_archive_end): Use Library_base; use
7783 visitor class to record unused symbols; don't add incremental inputs
7784 entry after members.
7785 (Incremental_inputs::report_object): Use Library_base.
7786 * incremental.h
7787 (Incremental_archive_entry::Incremental_archive_entry): Remove
7788 unused Archive parameter.
7789 (Incremental_inputs::report_archive_begin): Use Library_base.
7790 (Incremental_inputs::report_archive_end): Likewise.
7791 (Incremental_inputs::report_object): Likewise.
7792 * object.cc (Sized_relobj::do_for_all_global_symbols): New
7793 function.
7794 * object.h (Object::for_all_global_symbols): New function.
7795 (Object::do_for_all_global_symbols): New function.
7796 (Sized_relobj::do_for_all_global_symbols): New function.
7797 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
7798 function.
7799 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
7800 function.
7801
61ab3e40
ILT
78022011-03-27 Ian Lance Taylor <iant@google.com>
7803
7804 * archive.cc (Archive::interpret_header): Return -1 if something
7805 goes wrong. Change callers accordingly.
7806
30e1f9e6
CC
78072011-03-25 Cary Coutant <ccoutant@google.com>
7808
7809 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
7810 * testsuite/Makefile.in: Regenerate.
7811
9370ce59 78122011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
7813
7814 * plugin.cc (get_view): New.
7815 (Plugin::load): Pass get_view to the plugin.
7816 (Plugin_manager::get_view): New.
7817
9312bb0a
ILT
78182011-03-21 Ian Lance Taylor <iant@google.com>
7819
7820 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 7821 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 7822
7e12ba9e
ST
78232011-03-21 Sriraman Tallam <tmsriram@google.com>
7824
7825 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
7826 Change == to -eq.
7827 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
7828 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
7829 Change == to -eq.
7830 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
7831 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
7832
fd7a005d
ILT
78332011-03-14 Ian Lance Taylor <iant@google.com>
7834
7835 * script-sections.cc (Sort_output_sections::script_compare):
7836 Rename from is_before, change return type.
7837 (Sort_output_sections::operator()): Adjust accordingly.
7838
ed16fd1b
ILT
78392011-03-11 Jeffrey Yasskin <jyasskin@google.com>
7840
7841 PR gold/12572
7842 * testsuite/odr_violation2.cc: Add comment to make all error line
7843 numbers double digits.
7844 * testsuite/debug_msg.sh: Adjust expected errors.
7845
71ff8986
ILT
78462011-03-09 Jeffrey Yasskin <jyasskin@google.com>
7847
7848 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
7849 but mark earlier ones as non-canonical
7850 (offset_to_iterator): Update search target and example
7851 (do_addr2line): Return extra lines in a vector*
7852 (format_file_lineno): Extract from do_addr2line
7853 (one_addr2line): Add vector* out-param
7854 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
7855 when a lineno entry appeared last for its instruction
7856 (Dwarf_line_info): Add vector* out-param
7857 * object.cc (Relocate_info): Pass NULL for the vector* out-param
7858 * symtab.cc (Odr_violation_compare): Include the lineno in the
7859 comparison again.
7860 (linenos_from_loc): New. Combine the canonical line for an
7861 address with its other lines.
7862 (True_if_intersect): New. Helper functor to make
7863 std::set_intersection a query.
7864 (detect_odr_violations): Compare sets of lines instead of just
7865 one line for each function. This became less deterministic, but
7866 has fewer false positives.
7867 * symtab.h: Declarations.
7868 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
7869 mix an optimized and non-optimized object in the same binary
7870 (odr_violation2.so): Same.
7871 * testsuite/Makefile.in: Regenerate from Makefile.am.
7872 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
7873 * testsuite/debug_msg.sh: Update line numbers and add
7874 assertions.
7875 * testsuite/odr_violation1.cc: Use OdrDerived, in a
7876 non-optimized context.
7877 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
7878 isn't inlined, and use OdrDerived in an optimized context.
7879 * testsuite/odr_header1.h: Defines OdrDerived, where
7880 optimization will change the
7881 first-instruction-in-the-destructor's file and line number.
7882 * testsuite/odr_header2.h: Defines OdrBase.
7883
a19fefdc
ILT
78842011-03-09 Ian Lance Taylor <iant@google.com>
7885
7886 * fileread.cc (File_read::clear_views): Don't delete the whole
7887 file view.
7888
ecb351e9
ILT
78892011-03-08 Ian Lance Taylor <iant@google.com>
7890
7891 PR gold/12525
7892 * fileread.cc: #include <climits>.
7893 (GOLD_IOV_MAX): Define.
7894 (File_read::read_multiple): Limit number of entries by iov_max.
7895 * fileread.h (class File_read): Always set max_readv_entries to
7896 128.
7897
b821d13c
ILT
78982011-03-07 Ian Lance Taylor <iant@google.com>
7899
7900 PR gold/12525
7901 * options.h (class General_options): Add -dy and -dn.
7902
89243142
CC
79032011-03-02 Cary Coutant <ccoutant@google.com>
7904
7905 * testsuite/script_test_9.t: Add TLS segment.
7906
d0773f31
ILT
79072011-03-02 Simon Baldwin <simonb@google.com>
7908
7909 * configure.ac: Add check for gnu_indirect_function support in
7910 the toolchain building binutils.
7911 * configure: Rebuild.
7912
9370ce59 79132011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
7914
7915 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
7916 plugin only symbols.
7917 (Symbol_table::sized_finalize_symbol) Mark symbol only present
7918 in plugin files as not needed in the symbol table.
7919
4cf7a849
ST
79202011-02-11 Sriraman Tallam <tmsriram@google.com>
7921
7922 * output.cc (Output_section::add_input_section): Delay fill
7923 generation for section ordering.
7924
b578bd7d
ILT
79252011-02-09 Ian Lance Taylor <iant@google.com>
7926
7927 PR gold/12316
7928 * object.h (class Sized_relobj): Remove clear_local_symbols.
7929 * reloc.cc (Sized_relobj::do_relocate): Don't call
7930 clear_local_symbols.
7931
9370ce59 79322011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
7933
7934 * plugin.cc (is_visible_from_outside): Return true for symbols
7935 in the -u option.
7936
55382fb7
ILT
79372011-02-04 Jeffrey Yasskin <jyasskin@google.com>
7938
7939 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
7940 filename.
7941
4e271fff
ST
79422011-02-02 Sriraman Tallam <tmsriram@google.com>
7943
7944 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 7945 to std::string.
4e271fff 7946 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 7947 section_name to be std::string.
4e271fff
ST
7948 (is_function_ctor_or_dtor): Change type of parameter to std::string.
7949
d433c3ac
ILT
79502011-01-25 Ian Lance Taylor <iant@google.com>
7951
7952 * script.cc (script_add_extern): Rewrite to use
7953 add_symbol_reference.
7954
880473a6
DK
79552011-01-25 Doug Kwan <dougkwan@google.com>
7956
d433c3ac 7957 * icf.cc (get_section_contents): Always lock section's object.
880473a6 7958
f30f86fa
ILT
79592011-01-24 Ian Lance Taylor <iant@google.com>
7960
7961 * options.h (class General_options): Accept
7962 --no-detect-odr-violations.
7963
8e51a0b9
ILT
79642011-01-24 Ian Lance Taylor <iant@google.com>
7965
7966 * version.cc (version_string): Bump to 1.11.
7967
0f3b89d8
ILT
79682011-01-24 Ian Lance Taylor <iant@google.com>
7969
7970 * plugin.cc (class Plugin_rescan): Define new class.
7971 (Plugin_manager::claim_file): Set any_claimed_.
7972 (Plugin_manager::save_archive): New function.
7973 (Plugin_manager::save_input_group): New function.
7974 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
7975 necessary.
7976 (Plugin_manager::new_undefined_symbol): New function.
7977 (Plugin_manager::rescan): New function.
7978 (Plugin_manager::rescannable_defines): New function.
7979 (Plugin_manager::add_input_file): Set any_added_.
7980 * plugin.h (class Plugin_manager): define new fields rescannable_,
7981 undefined_symbols_, any_claimed_, and any_added_. Declare
7982 Plugin_rescan as friend. Declare new functions.
7983 (Plugin_manager::Rescannable): Define type.
7984 (Plugin_manager::Rescannable_list): Define type.
7985 (Plugin_manager::Undefined_symbol_list): Define type.
7986 (Plugin_manager::Plugin_manager): Initialize new fields.
7987 * archive.cc (Archive::defines_symbol): New function.
7988 (Add_archive_symbols::run): Pass archive to plugins if any.
7989 * archive.h (class Archive): Declare defines_symbol.
7990 * readsyms.cc (Input_group::~Input_group): New function.
7991 (Finish_group::run): Pass input_group to plugins if any.
7992 * readsyms.h (class Input_group): Declare destructor.
7993 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
7994 any.
7995
3bb951e5
ILT
79962011-01-10 Ian Lance Taylor <iant@google.com>
7997
7998 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
7999 section as relro.
8000 (Layout::set_segment_offsets): Reset increase_relro before calling
8001 set_section_addresses a second time.
8002
0aa45fac
CC
80032011-01-04 Cary Coutant <ccoutant@google.com>
8004
8005 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
8006 sections before NOBITS sections.
8007
0db46eb4
L
80082011-01-01 H.J. Lu <hongjiu.lu@intel.com>
8009
8010 * version.cc (print_version): Update copyright to 2011.
8011
829c9745
CC
80122010-12-23 Cary Coutant <ccoutant@google.com>
8013
8014 * output.h (Output_data_reloc::add_output_section): Pass OD instead
8015 of OS to this->add. Add OD parameter to second form of the function.
8016
7500420b
ILT
80172010-12-20 Ian Lance Taylor <iant@google.com>
8018
8019 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
8020 second of two consecutive entries with same offset.
8021
f8e9a930
RW
80222010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8023
8024 * testsuite/Makefile.am (ifuncmain2static_LDADD)
8025 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
8026 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
8027 to avoid unneeded links against $(LDADD).
8028 * testsuite/Makefile.in: Regenerate.
8029
2fbb4320
ILT
80302010-12-15 Ian Lance Taylor <iant@google.com>
8031
8032 PR gold/12324
8033 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
8034 for R_X86_64_32 and R_X86_64_PC32.
8035 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
8036 ver_matching_def_pic.o.
8037 (ver_matching_def_pic.o): New target.
8038
fedb228d
RW
80392010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8040
8041 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
8042 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
8043 Move definition before File_read::View member definitions.
8044 (File_read::View::~View): Initialize and hold lock before
8045 updating current_mapped_bytes.
8046
9b547ce6
RW
80472010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8048
8049 * dwarf_reader.cc: Remove outdated comment.
8050 * gold-threads.cc: Fix typo in error message.
8051 * archive.cc: Fix typos in comments.
8052 * archive.h: Likewise.
8053 * arm-reloc-property.cc: Likewise.
8054 * arm-reloc-property.h: Likewise.
8055 * arm-reloc.def: Likewise.
8056 * arm.cc: Likewise.
8057 * attributes.h: Likewise.
8058 * cref.cc: Likewise.
8059 * ehframe.cc: Likewise.
8060 * fileread.h: Likewise.
8061 * gold.h: Likewise.
8062 * i386.cc: Likewise.
8063 * icf.cc: Likewise.
8064 * incremental.h: Likewise.
8065 * int_encoding.cc: Likewise.
8066 * layout.h: Likewise.
8067 * main.cc: Likewise.
8068 * merge.h: Likewise.
8069 * object.cc: Likewise.
8070 * object.h: Likewise.
8071 * options.cc: Likewise.
8072 * readsyms.cc: Likewise.
8073 * reduced_debug_output.cc: Likewise.
8074 * reloc.cc: Likewise.
8075 * script-sections.cc: Likewise.
8076 * sparc.cc: Likewise.
8077 * symtab.h: Likewise.
8078 * target-reloc.h: Likewise.
8079 * target.cc: Likewise.
8080 * target.h: Likewise.
8081 * timer.cc: Likewise.
8082 * timer.h: Likewise.
8083 * x86_64.cc: Likewise.
8084
83e17bd5
CC
80852010-12-09 Cary Coutant <ccoutant@google.com>
8086
8087 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
8088 stack.
8089 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
8090 parameter; change all callers.
8091 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
8092 * options.h (warn_execstack): New option.
8093
017257f8
DK
80942010-12-07 Doug Kwan <dougkwan@google.com>
8095
8096 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
8097 like function call relocations.
8098
c20cbc06
ILT
80992010-12-07 Ian Lance Taylor <iant@google.com>
8100
8101 * archive.cc (Archive::get_elf_object_for_member): Permit
8102 punconfigured to be NULL.
8103 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
8104 (Archive::include_member): Pass NULL to get_elf_object_for_member
8105 if we searched for the archive and this is the first included
8106 object.
8107
4dbfafcc
ILT
81082010-12-01 Ian Lance Taylor <iant@google.com>
8109
8110 * dwarf_reader.h (class Sized_dwarf_line_info): Add
8111 track_relocs_type_ field.
8112 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8113 Set track_relocs_type_.
8114 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
8115 contents when using RELA relocs.
8116 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
8117 reloc_map_.
8118 * reloc.cc (Track_relocs::next_addend): New function.
8119 * reloc.h (class Track_relocs): Declare next_addend.
8120
e5e19edd
ILT
81212010-12-01 Ian Lance Taylor <iant@google.com>
8122
8123 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
8124 virtual destructor.
8125
9a5ce24c
ILT
81262010-12-01 Ian Lance Taylor <iant@google.com>
8127
8128 * README: Update compilers known to work and fail.
8129
c7791212
NC
81302010-11-23 Matthias Klose <doko@ubuntu.com>
8131
8132 * configure.in: For --enable-gold, handle value `default' instead of
8133 `both*'. Always install ld as ld.bfd, install as ld if gold is
8134 not the default.
8135 * configure: Regenerate.
8136
0ad220c9
DK
81372010-11-18 Doug Kwan <dougkwan@google.com>
8138
8139 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
8140 and right_alignment to be zero. Store result alignment only if it is
8141 greater than existing alignment.
8142
ab8056e0
CC
81432010-11-16 Cary Coutant <ccoutant@google.com>
8144
8145 PR gold/12220
8146 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8147 Check for ".zdebug_line".
8148
fd064a5b
CC
81492010-11-16 Doug Kwan <dougkwan@google.com>
8150 Cary Coutant <ccoutant@google.com>
8151
8152 * output.h (Output_segment::set_section_addresses): Pass increase_relro
8153 by reference; adjust all callers.
8154 * output.cc (Output_segment::set_section_addresses): Adjust references
8155 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
8156 list is empty.
8157 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
8158 end at page boundary.
8159
6fc6ea19
CC
81602010-11-16 Cary Coutant <ccoutant@google.com>
8161
8162 PR gold/12220
8163 * layout.cc (Layout::choose_output_section): Transform names of
8164 compressed sections even when using a script with a SECTIONS clause.
8165 (Layout::output_section_name): Remove code to transform
8166 compressed debug section names.
8167 * output.cc (Output_section::add_input_section): Use uncompressed
8168 section size when tracking input sections.
8169
95a2c8d6
RS
81702010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
8171
8172 * symtab.h (Symbol::NON_PIC_REF): Remove.
8173 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
8174 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
8175 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
8176 (Symbol::use_plt_offset): Take a flags argument and pass it
8177 directly to needs_dynamic_reloc. Restrict check for undefined
8178 weak symbols to function calls.
8179 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
8180 (Target_arm::Scan::global): Use it.
8181 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
8182 (Target_arm::Relocate::relocate): Likewise.
8183 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
8184 parameter with an r_type parameter. Use get_reference_flags
8185 to get the flags.
8186 (Target_arm::Relocate::relocate): Update accordingly.
8187 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
8188 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
8189 (Target_i386::Scan::global): Likewise.
8190 (Target_i386::Relocate::relocate): Likewise.
8191 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
8192 parameter with an r_type parameter. Use get_reference_flags
8193 to get the flags.
8194 (Target_i386::Relocate::relocate): Update accordingly.
8195 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
8196 (Target_powerpc::Scan::global): Use it.
8197 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
8198 (Target_powerpc::Relocate::relocate): Likewise.
8199 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
8200 (Target_sparc::Scan::global): Use it.
8201 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
8202 (Target_sparc::Relocate::relocate): Likewise.
8203 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
8204 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
8205 (Target_x86_64::Scan::global): Likewise.
8206 (Target_x86_64::Relocate::relocate): Likewise.
8207
f625ae50
DK
82082010-11-08 Doug Kwan <dougkwan@google.com>
8209 Cary Coutant <ccoutant@google.com>
8210
8211 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
8212 (Arm_exidx_merge_section::section_contents_): New data member.
8213 (Arm_input_section::Arm_input_section): Initialize original_contents_.
8214 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 8215 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
8216 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
8217 in parameters instead of calling Object::section_contents without
8218 locking.
8219 (Arm_output_section::group_section): New parameter TASK. Pass it
8220 to callees that need locking objects.
8221 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
8222 to lock EXIDX input sections. Fix a formatting issue. Call
8223 Arm_exidx_merged_section::build_contents to create merged section
8224 contents.
8225 (Arm_output_section::create_stub_group): New parameter TASK. Use it
8226 to lock object of stub table owner.
8227 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
8228 TEXT_SIZE to initialize data member TEXT_SIZE_.
8229 (Arm_exidx_input_section::addralign): Fix typo in comment.
8230 (Arm_exidx_input_section::text_size): New method.
8231 (Target_arm::do_relax): New parameter TASK. Pass it to callees
8232 that require locking objects. Lock objects before scanning for stubs
8233 and updating local symbols.
8234 (Arm_input_section<big_endian>::init): Copy contents of original
8235 input section.
2e702c99 8236 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
8237 original input section instead of calling Object::section_contents
8238 without locking.
8239 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
8240 size without calling Object::section_size().
8241 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
8242 for size. Allocate a buffer for merged EXIDX entries.
8243 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 8244 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
8245 building code to Arm_exidx_merged_section::build_contetns. Write
8246 out contetns in buffer instead of building it on the fly.
8247 (Arm_relobj::make_exidx_input_section): Also pass text section size
8248 to Arm_exidx_input_section constructor.
8249 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
8250 (Arm_dynobj::do_read_symbols): Fix memory leak.
8251 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
8252 * target.h: (class Task): Add forward declaration.
8253 (Target::relax): Add new parameter TASK and pass it to
8254 Target::do_relax().
8255 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
8256
5f9bcf58
CC
82572010-11-05 Cary Coutant <ccoutant@google.com>
8258
8259 PR gold/10708
8260 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
8261 object when reading from the file.
8262 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
8263 second layout pass.
8264 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
8265 when reading section contents.
8266 (get_section_contents): Likewise.
8267 (icf::find_identical_sections): Likewise.
8268 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
8269 object when reading from the file.
8270 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
8271 the object when doing deferred section layout.
8272
e597fa08
NC
82732010-11-03 Nick Clifton <nickc@redhat.com>
8274
8275 PR gold/12001
8276 * script.h (class Symbol_assignment: name): New member. Returns
8277 the name of the symbol.
8278 * scrfipt.cc (Script_options::is_pending_assignment): New member.
8279 Returns true if the given symbol name is on the list of
8280 assignments wating to be processed.
8281 * archive.cc (should_incldue_member): If the symbol is undefined,
8282 check to see if it is on the list of symbols pending assignment.
8283
3f9a3278
ILT
82842010-11-03 Ryan Mansfield <rmansfield@qnx.com>
8285
8286 * script-sections.cc (Script_sections::find_memory_region): Check
8287 for a NULL output section pointer.
8288
d06fb4d1
DK
82892010-10-29 Doug Kwan <dougkwan@google.com>
8290
8291 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
8292 Output_section::add_relaxed_input_section.
8293 * output.cc (Output_section::add_relaxed_input_section): Add new
8294 arguments LAYOUT and NAME. Set section order index.
8295 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
8296 Copy section order index.
8297 * output.h (Output_section::add_relaxed_input_section): Add new
8298 arguments LAYOUT and NAME.
8299
90e24de5
ILT
83002010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8301
8302 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 8303 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
8304 * testsuite/Makefile.in: Regenerate.
8305
c9484ea5
DK
83062010-10-20 Doug Kwan <dougkwan@google.com>
8307
8308 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
8309 without SHF_LINK_ORDER flags.
8310 * layout.cc (Layout::choose_output_section): Do not filter
8311 SHF_LINK_ORDER flag in a relocatable link.
8312
5bc2f5be
CC
83132010-10-17 Cary Coutant <ccoutant@google.com>
8314
8315 * output.h (Output_segment::set_section_addresses): Change function
8316 signature. Update all callers.
8317 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
8318 sections.
8319 (Output_segment::set_section_addresses): Align after last TLS
8320 section. Add padding before last relro section instead of after.
8321
0c91cf04
DK
83222010-10-17 Doug Kwan <dougkwan@google.com>
8323
8324 * gold/arm.cc (Target_arm::got_section): Use correct order and set
8325 GOT output section to be writable.
8326
8c21d9d3
CC
83272010-10-14 Cary Coutant <ccoutant@google.com>
8328
8329 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
8330 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
8331 * gold.cc (queue_initial_tasks): Check parameters for incremental link
8332 mode.
8333 * incremental.cc (report_command_line): Ignore all forms of
8334 --incremental.
8335 * layout.cc (Layout::Layout): Check parameters for incremental link
8336 mode.
8337 * options.cc (General_options::parse_incremental): New function.
8338 (General_options::parse_no_incremental): New function.
8339 (General_options::parse_incremental_full): New function.
8340 (General_options::parse_incremental_update): New function.
8341 (General_options::incremental_mode_): New data member.
8342 (General_options::finalize): Check incremental_mode_.
8343 * options.h (General_options): Update help text for --incremental.
8344 Add --no-incremental, --incremental-full, --incremental-update.
8345 (General_options::Incremental_mode): New enum type.
8346 (General_options::incremental_mode): New function.
8347 (General_options::incremental_mode_): New data member.
8348 * parameters.cc (Parameters::incremental_mode_): New data member.
8349 (Parameters::set_options): Set incremental_mode_.
8350 (Parameters::set_incremental_full): New function.
8351 (Parameters::incremental): New function.
8352 (Parameters::incremental_update): New function.
8353 (set_parameters_incremental_full): New function.
8354 * parameters.h (Parameters::set_incremental_full): New function.
8355 (Parameters::incremental): New function.
8356 (Parameters::incremental_update): New function.
8357 (Parameters::incremental_mode_): New data member.
8358 (set_parameters_incremental_full): New function.
8359 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
8360 incremental link mode.
8361 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
8362 (Sized_relobj::do_relocate_sections): Likewise.
8363 * testsuite/Makefile.am (incremental_test): Use --incremental-full
8364 option.
8365 * testsuite/Makefile.in: Regenerate.
8366 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 8367
bb32aa18 83682010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
8369
8370 * script-sections.h (class Script_sections): Make
8371 Sections_elements typedef public.
8372 * script-sections.cc (class Sort_output_sections): Add elements_
8373 field. Add constructor which sets it; change all callers.
8374 (Sort_output_sections::is_before): New function.
8375 (Sort_output_sections::operator()): Call is_before.
8376 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
8377 conditional.
8378 * testsuite/script_test_10.sh: New test. Test script section
8379 order.
8380 * testsuite/script_test_10.t: Likewise.
8381 * testsuite/script_test_10.s: Likewise.
8382 * testsuite/Makefile.am: Wrap the cross linker tests and the
8383 common tests into NATIVE_OR_CROSS_LINKER.
8384 (check_SCRIPTS): Add script_test_10.sh.
8385 (check_DATA): Add script_test_10.stdout.
8386 (script_test_10.o, script_test_10): New targets.
8387 (script_test_10.stdout): New target.
8388 * configure, testsuite/Makefile.in: Regenerate.
8389
3cef7179
ILT
83902010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8391
8392 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
8393 error for the deprecated relocations.
8394 (Target_arm::Scan::global): Likewise.
8395 (Target_arm::Relocate::relocate): Likewise.
8396
7411e9a8
RS
83972010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
8398
8399 * fileread.cc (Input_file::find_file): Initialize *found_name
8400 and *namep when using the fallback search for case 4.
8401
6a9da32a
CC
84022010-10-11 Cary Coutant <ccoutant@google.com>
8403
8404 * options.h (class General_options): Redefine -z lazy as an alias for
8405 the negation of -z now.
8406
ac897c20
ILT
84072010-10-11 Ian Lance Taylor <iant@google.com>
8408
8409 * resolve.cc (symbol_to_bits): Report the value of the unsupported
8410 binding.
8411
ea5cae92
NC
84122010-10-06 Nick Clifton <nickc@redhat.com>
8413
8414 * script-sections.cc(class Memory_region): Remove
8415 current_lma_offset_ field. Rename current_vma_offset_ to
8416 current_offset_. Add last_section_ field.
8417 (Memory_region::get_current_vma_address): Rename to
8418 get_current_address.
8419 (Memory_region::get_current_lma_address): Delete.
8420 (Memory_region::increment_vma_offset): Rename to
8421 increment_offset.
8422 (Memory_region::increment_lma_offset): Delete.
8423 (Memory_region::attributes_compatible): New method. Returns
8424 true if the provided section is compatible with the region.
8425 (Memory_region::get_last_section): New method. Returns the last
8426 section to use the region.
8427 (Memory_region::set_last_section): New method. Stores the last
8428 section to use the region.
8429 (Script_sections::block_in_region): New method. Returns true if
8430 a block of memory is contained within a region.
8431 (Script_sections::find_memory_region): New method. Locates a
8432 memory region to be used to set a VMA or LMA address.
8433 (Output_section_definition::set_section_addresses): Add code to
8434 check for addresses set by memory regions.
8435 (Output_segment::set_section_addresses): Remove memory region
8436 walking code.
8437 (Script_sections::create_segment): Add a warning if a header
8438 segment is created outside of any region.
8439 * script-sections.h (class Script_sections): Add prototypes for
8440 find_memory_region and block_in_region methods.
8441 * testsuite/memory_test.s: Use .long instead of .word.
8442 * testsuite/memory_test.t: Add some more output sections.
8443 * testsuite/memory_test.sh: Update expected output.
8444
a9bfd952
DK
84452010-10-02 Doug Kwan <dougkwan@google.com>
8446
8447 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
8448 defintion to symtab.h
8449 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
8450 declaration to defintion.
8451
bacff3ab
NC
84522010-10-01 Nick Clifton <nickc@redhat.com>
8453
8454 * expression.cc (eval): Replace dummy argument with NULL.
8455 (eval_maybe_dot): Check for a NULL result section pointer.
8456 (Symbol_expression::value): Likewise.
8457 (Dot_expression::value): Likewise.
8458 (BINARY_EXPRESSION): Likewise.
8459 (Max_expression::value): Likewise.
8460 (Min_expression::value): Likewise.
8461 (Absolute_expression::value): Likewise.
8462 (Addr_expression::value_from_output_section): Likewise.
8463 (Loaddddr_expression::value_from_output_section): Likewise.
8464 (Segment_start_expression::value): Likewise.
8465 * script-sections.cc
8466 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
8467 argument with NULL.
8468 (Sections_elememt_dot_assignment::set_section_addresses):
8469 Likewise.
8470 (Output_data_expression::do_write_to_buffer): Likewise.
8471 (Output_section_definition::finalize_symbols): Likewise.
8472 (Output_section_definition::set_section_addresses): Likewise.
8473
f81bc8b5
DK
84742010-09-30 Doug Kwan <dougkwan@google.com>
8475
8476 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
8477
c95e9f27
ST
84782010-09-28 Sriraman Tallam <tmsriram@google.com>
8479
8480 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 8481 function.
c95e9f27
ST
8482 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
8483 virtual function.
8484 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
8485 virtual function.
8486 * icf.cc (get_section_contents): Inline merge sections only when
8487 target allows it.
8488
3cac54d2
RW
84892010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8490
8491 * configure: Regenerate.
8492
2904037a
ILT
84932010-09-17 Ian Lance Taylor <iant@google.com>
8494
8495 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
8496 * testsuite/Makefile.am (memory_test.o): New target.
8497 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
8498 memory_test.t.
8499 * testsuite/Makefile.in: Rebuild.
2904037a 8500
bca7fb63
DK
85012010-09-17 Doug Kwan <dougkwan@google.com>
8502
8503 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
8504 defintion if relocation uses GOT entries of the symbol.
8505 * testsuite/icf_safe_test.sh: Fix test.
8506 * testsuite/icf_safe_so_test.sh: Fix test.
8507
4ef28648
CC
85082010-09-16 Cary Coutant <ccoutant@google.com>
8509
8510 * script_sections.cc (class Memory_region): Remove "NULL" from
8511 vector initializations.
8512
793990de
CC
85132010-09-15 Cary Coutant <ccoutant@google.com>
8514
8515 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
8516 Resolve forwarding symbols.
8517
81e015e2
DK
85182010-09-15 Doug Kwan <dougkwan@google.com>
8519
8520 * gold/testsuite/script_test_3.t: Add ARM special sections.
8521 * gold/testsuite/script_test_4.t: Same.
8522 * gold/testsuite/script_test_5.t: Same.
8523 * gold/testsuite/script_test_6.t: Same.
8524 * gold/testsuite/script_test_7.t: Same.
8525 * gold/testsuite/script_test_7.t: Same.
8526 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
8527
36171d64
CC
85282010-09-14 Cary Coutant <ccoutant@google.com>
8529
8530 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
8531 (Target_x86_64::Relocate::relocate_tls): Replace check for
8532 saw_tls_block_reloc_ with test for executable section.
8533
d89051bd
CC
85342010-09-12 Cary Coutant <ccoutant@google.com>
8535
8536 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
8537 position-independent executables to shared libraries need dynamic
8538 relocations.
8539 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
8540 position-independent executables.
8541 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
8542 * testsuite/Makefile.in: Regenerate.
8543
fca41f0f
NC
85442010-09-10 Nick Clifton <nickc@redhat.com>
8545
8546 PR gold/11997
8547 * testsuite/memory_test.t: Discard any sections that are not
8548 needed.
8549
6695e4b3
L
85502010-09-09 H.J. Lu <hongjiu.lu@intel.com>
8551
8552 PR gold/11996
8553 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
8554 "This::" to work around a bug in gcc 4.2.
8555
8556 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
8557
0f72bf6f
RÁE
85582010-09-09 Rafael Espindola <espindola@google.com>
8559
8560 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
8561 sections with different PF_X flags in the same segment.
8562 (Layout::find_first_load_seg): Search all segments to find the first
8563 one.
8564 * options.h (rosegment): New.
8565
85662010-09-08 Rafael Espindola <espindola@google.com>
a6577478 8567
05a79166 8568 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 8569
aa98ff75
DK
85702010-09-08 Doug Kwan <dougkwan@google.com>
8571
8572 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
8573 (Arm_relobj::do_relocate_sections): Add new parameter for output
8574 file to match the parent.
8575 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
8576 of local symbols instead of input values. Update code to track
8577 changes in gold::relocate_section.
8578 * object.cc (Sized_relobj::compute_final_local_value): New methods.
8579 (Sized_relobj::compute_final_local_value_internal): New methods.
8580 (Sized_relobj::do_finalize_local_symbols): Move code from loop
8581 body into private version of Sized_relobj::compute_final_local_value.
8582 Call the inline method.
8583 * object.h (Symbol_value::Symbol_value): Define destructor. Free
8584 merged symbol value if there is one.
8585 (Symbol_value::has_output_value): New method defintiion.
8586 (Sized_relobj::Compute_final_local_value_status): New enum type.
8587 (Sized_relobj::compute_final_local_value): New methods.
8588 (Sized_relobj::compute_final_local_value_internal): New methods.
8589 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
8590 and arm_cortex_a8.sh.
8591 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
8592 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
8593 New tests.
8594 * Makefile.in: Regenerate.
8595 * testsuite/arm_bl_out_of_range.s: Update test.
8596 * testsuite/thumb_bl_out_of_range.s: Ditto.
8597 * testsuite/thumb_blx_out_of_range.s: Ditto.
8598 * testsuite/arm_branch_out_of_range.sh: New file.
8599 * testsuite/arm_cortex_a8.sh: Ditto.
8600 * testsuite/arm_cortex_a8_b.s: Ditto.
8601 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
8602 * testsuite/arm_cortex_a8_b_local.s: Ditto.
8603 * testsuite/arm_cortex_a8_bl.s: Ditto.
8604 * testsuite/arm_cortex_a8_blx.s: Ditto.
8605 * testsuite/arm_cortex_a8_local.s: Ditto.
8606 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
8607 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
8608
05a79166
L
86092010-09-08 Rafael Espindola <espindola@google.com>
8610
8611 * Makefile.am (memory_test.stdout): Run readelf with -W.
8612 * Makefile.in: Regenerate.
8613 * testsuite/memory_test.sh: Make the regexps accept both 32 and
8614 64 bit output.
8615
33dbc701
RÁE
86162010-09-08 Rafael Espindola <espindola@google.com>
8617
8618 * script-sections.cc (Script_sections::add_memory_region): Convert
8619 field precision to int.
8620 * script.cc (script_set_section_region, script_set_section_region):
8621 Convert field precision to int.
8622
731ca54a
RÁE
86232010-09-08 Rafael Espindola <espindola@google.com>
8624
8625 * arm.cc (do_finalize_sections): Create the __exidx_start and
8626 __exdix_end symbols even when the section is missing.
8627
7f8cd844
NC
86282010-09-08 Nick Clifton <nickc@redhat.com>
8629
8630 * README: Remove claim that MEMORY is not supported.
8631 * expression.cc (script_exp_function_origin)
8632 (script_exp_function_length): Move from here to ...
8633 * script.cc: ... here.
8634 (script_set_section_region, script_add_memory)
8635 (script_parse_memory_attr, script_include_directive): New
8636 functions.
8637 * script-sections.cc
8638 (class Memory_region): New class.
8639 (class Output_section_definition): Add set_memory_region,
8640 set_section_vma, set_section_lma and get_section_name methods.
8641 (class Script_Sections): Add add_memory_region,
8642 find_memory_region, find_memory_region_origin,
8643 find_memory_region_length and set_memory_region methods.
8644 Have set_section_addresses method walk the list of set memory
8645 regions.
8646 Extend the print methos to display memory regions.
8647 * script-sections.h: Add prototypes for new methods.
8648 Add enum for MEMORY region attributes.
8649 * yyscript.y: Add support for parsing MEMORY regions.
8650 * script-c.h: Add prototypes for new functions.
8651 * testsuite/Makefile.am: Add test of MEMORY region functionality.
8652 * testsuite/Makefile.in: Regenerate.
8653 * testsuite/memory_test.sh: New script.
8654 * testsuite/memory_test.s: New assembler source file.
8655 * testsuite/memory_test.t: New linker script.
8656
a4649286
DK
86572010-08-27 Doug Kwan <dougkwan@google.com>
8658
8659 * gold/resolve.cc (Symbol_table::should_override): Let a weak
8660 reference override an existing dynamic weak reference.
8661 * testsuite/Makefile.am: Add new test dyn_weak_ref.
8662 * testsuite/Makefile.in: Regenerate.
8663 * testsuite/dyn_weak_ref.sh: New file.
8664 * testsuite/dyn_weak_ref_1.c: Ditto.
8665 * testsuite/dyn_weak_ref_2.c: Ditto.
8666
b56648ad
ILT
86672010-08-27 Ian Lance Taylor <iant@google.com>
8668
8669 * incremental.h (class Incremental_input_entry): Add virtual
8670 destructor.
8671
809313cb
ILT
86722010-08-27 Ian Lance Taylor <iant@google.com>
8673
8674 * testsuite/start_lib_test_3.c: Mark t3 as used.
8675
11e32464
NC
86762010-08-27 Nick Clifton <nickc@redhat.com>
8677
8678 * options.cc (version_script): Fix small typo in previous
8679 whitespace tidyup.
8680
ca09d69a
NC
86812010-08-25 Nick Clifton <nickc@redhat.com>
8682
8683 * archive.cc: Formatting fixes: Remove whitespace between
8684 typename and following asterisk. Remove whitespace between
8685 function name and opening parenthesis.
8686 * archive.h: Likewise.
8687 * arm.cc: Likewise.
8688 * attributes.cc: Likewise.
8689 * attributes.h: Likewise.
8690 * common.cc: Likewise.
8691 * copy-relocs.cc: Likewise.
8692 * dirsearch.h: Likewise.
8693 * dynobj.cc: Likewise.
8694 * ehframe.cc: Likewise.
8695 * ehframe.h: Likewise.
8696 * expression.cc: Likewise.
8697 * fileread.cc: Likewise.
8698 * fileread.h: Likewise.
8699 * gc.h: Likewise.
8700 * gold-threads.cc: Likewise.
8701 * gold.cc: Likewise.
8702 * i386.cc: Likewise.
8703 * icf.h: Likewise.
8704 * incremental-dump.cc: Likewise.
8705 * incremental.cc: Likewise.
8706 * layout.cc: Likewise.
8707 * layout.h: Likewise.
8708 * main.cc: Likewise.
8709 * merge.cc: Likewise.
8710 * merge.h: Likewise.
8711 * object.cc: Likewise.
8712 * object.h: Likewise.
8713 * options.cc: Likewise.
8714 * options.h: Likewise.
8715 * output.cc: Likewise.
8716 * output.h: Likewise.
8717 * plugin.cc: Likewise.
8718 * plugin.h: Likewise.
8719 * powerpc.cc: Likewise.
8720 * reloc.cc: Likewise.
8721 * script-c.h: Likewise.
8722 * script-sections.cc: Likewise.
8723 * script.cc: Likewise.
8724 * stringpool.cc: Likewise.
8725 * symtab.cc: Likewise.
8726 * symtab.h: Likewise.
8727 * target.cc: Likewise.
8728 * timer.cc: Likewise.
8729 * timer.h: Likewise.
8730 * version.cc: Likewise.
8731 * x86_64.cc: Likewise.
8732
b8fa8750
NC
87332010-08-24 Nick Clifton <nickc@redhat.com>
8734
8735 PR 11899
8736 * layout.cc (segment_precedes): Sort segments by their physical
8737 addresses, if they have been set.
8738
9919d93b
CC
87392010-08-23 Cary Coutant <ccoutant@google.com>
8740
8741 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
8742 symbols data.
8743 (Lib_group::include_member): Unlock object after deleting its
8744 symbols data.
8745 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
8746 the bug fixed here.
8747
97b4be1c
CC
87482010-08-19 Neil Vachharajani <nvachhar@google.com>
8749 Cary Coutant <ccoutant@google.com>
8750
8751 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
8752 constructor, and set_blocker.
8753 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
8754 readsyms_blocker_.
8755 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
8756 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
8757 * testsuite/Makefile.am (start_lib_test): New test case.
8758 * testsuite/Makefile.in: Regenerate.
8759 * testsuite/start_lib_test_main.c: New file.
8760 * testsuite/start_lib_test_1.c: New file.
8761 * testsuite/start_lib_test_2.c: New file.
8762 * testsuite/start_lib_test_3.c: New file.
8763
dd0b1884
ILT
87642010-08-19 Ian Lance Taylor <iant@google.com>
8765
8766 * Makefile.in: Rebuild with automake 1.11.1.
8767 * aclocal.m4: Likewise.
8768 * testsuite/Makefile.in: Likewise.
8769
7223e9ca
ILT
87702010-08-19 Ian Lance Taylor <iant@google.com>
8771
8772 PR 10893
8773 * i386.cc (class Output_data_plt_i386): Update declarations.
8774 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
8775 local_ifuncs_ fields.
8776 (Target_i386::do_plt_section_for_global): New function.
8777 (Target_i386::do_plt_section_for_local): New function.
8778 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
8779 parameter; change all callers. Initialize global_ifuncs_ and
8780 local_ifuncs_. If doing a static link define __rel_iplt_start and
8781 __rel_iplt_end.
8782 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
8783 (Output_data_plt_i386::add_local_ifunc_entry): New function.
8784 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
8785 symbols.
8786 (Target_i386::make_plt_section): New function, broken out of
8787 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
8788 (Target_i386::make_plt_entry): Call make_plt_section.
8789 (Target_i386::make_local_ifunc_plt_entry): New function.
8790 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
8791 (Target_i386::Scan::local): Handle IFUNC symbols. Add
8792 R_386_IRELATIVE to switch.
8793 (Target_i386::Scan::global): Likewise.
8794 (Target_i386::Relocate::relocate): Likewise.
8795 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
8796 switch.
8797 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
8798 (Target_x86_64::do_plt_section_for_global): New function.
8799 (Target_x86_64::do_plt_section_for_local): New function.
8800 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
8801 parameter; change all callers. If doing a static link define
8802 __rela_iplt_start and __rela_iplt_end.
8803 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
8804 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
8805 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
8806 to point to .plt.
8807 (Target_x86_64::make_local_ifunc_plt_entry): New function.
8808 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
8809 switch.
8810 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
8811 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
8812 R_X86_64_IRELATIVE to switch.
8813 (Target_x86_64::Scan::global): Likewise.
8814 (Target_x86_64::Relocate::relocate): Likewise.
8815 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
8816 switch.
8817 * target.h (class Target): Add plt_section_for_global and
8818 plt_section_for_local functions. Add do_plt_section_for_global
8819 and do_plt_section_for_local virtual functions.
8820 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
8821 clarifying comments.
8822 (Symbol::use_plt_offset): Handle IFUNC symbol.
8823 * object.cc (Sized_relobj::Sized_relobj): Initialize
8824 local_plt_offsets_.
8825 (Sized_relobj::local_has_plt_offset): New function.
8826 (Sized_relobj::local_plt_offset): New function.
8827 (Sized_relobj::set_local_plt_offset): New function.
8828 (Sized_relobj::do_count): Handle IFUNC symbol.
8829 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
8830 a bit away from input_shndx_ field. Add set_is_func_symbol and
8831 is_ifunc_symbol functions.
8832 (class Sized_relobj): Update declarations. Remove Tls_got_entry
8833 and Local_tls_got_offsets. Define Local_plt_offsets. Add
8834 local_plt_offsets_ field.
8835 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
8836 * output.h (class Output_section_data): Add non-const
8837 output_section function.
8838 (class Output_data_got): Update declarations.
8839 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
8840 Add use_plt_offset parameter to global and local constructors.
8841 Change all callers. Change local_sym_index_ field to 31 bits.
8842 Change GSYM_CODE and CONSTANT_CODE accordingly.
8843 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
8844 doing a static link don't set sh_link field.
8845 (Output_data_got::Got_entry::write): Use PLT offset if
8846 appropriate.
8847 (Output_data_got::add_global_plt): New function.
8848 (Output_data_got::add_local_plt): New function.
8849 * target-reloc.h (relocate_section): Handle IFUNC symbol.
8850 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
8851 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
8852 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
8853 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
8854 IFUNC conditional.
8855 * testsuite/ifunc-sel.h: New file.
8856 * testsuite/ifuncmain1.c: New file.
8857 * testsuite/ifuncmain1vis.c: New file.
8858 * testsuite/ifuncmod1.c: New file.
8859 * testsuite/ifuncdep2.c: New file.
8860 * testsuite/ifuncmain2.c: New file.
8861 * testsuite/ifuncmain3.c: New file.
8862 * testsuite/ifuncmod3.c: New file.
8863 * testsuite/ifuncmain4.c: New file.
8864 * testsuite/ifuncmain5.c: New file.
8865 * testsuite/ifuncmod5.c: New file.
8866 * testsuite/ifuncmain6pie.c: New file.
8867 * testsuite/ifuncmod6.c: New file.
8868 * testsuite/ifuncmain7.c: New file.
8869 * configure, testsuite/Makefile.in: Rebuild.
8870
56f75c03
ILT
88712010-08-18 Ian Lance Taylor <iant@google.com>
8872
8873 * incremental.cc
8874 (Output_section_incremental_inputs::write_input_files): Add cast
8875 to avoid signed/unsigned comparison warning.
8876 (Output_section_incremental_inputs::write_info_blocks): Likewise.
8877
55455f89
CC
88782010-08-12 Cary Coutant <ccoutant@google.com>
8879
8880 * common.cc (Sort_commons::operator()): Remove unnecessary code.
8881
e2054bcb
ILT
88822010-08-13 Ian Lance Taylor <iant@google.com>
8883
8884 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
8885
74f67560
DK
88862010-08-12 Cary Coutant <ccoutant@google.com>
8887 Doug Kwan <dougkwan@google.com>
8888
8889 * resolve.cc (Symbol_table::should_override): When a weak dynamic
8890 defintion overrides non-weak undef, remember that the original undef
8891 is not weak.
8892 * symtab.cc (Symbol_table::sized_write_global): For undef without
8893 an original weak binding, set binding to global in output.
8894 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
8895 * testsuite/Makefile.in: Regenerate.
8896 * testsuite/strong_ref_weak_def.sh: New file.
8897 * testsuite/strong_ref_weak_def_1.c: Ditto.
8898 * testsuite/strong_ref_weak_def_2.c: Ditto.
8899
d1238d12
CC
89002010-08-12 Cary Coutant <ccoutant@google.com>
8901
8902 * testsuite/incremental_test.sh: Rewrite.
8903 * testsuite/incremental_test_1.c: Rewrite.
8904 * testsuite/incremental_test_2.c: Rewrite.
8905
0e70b911
CC
89062010-08-12 Cary Coutant <ccoutant@google.com>
8907
8908 * arm.cc (Target_arm::got_size): Add const.
8909 (Target_arm::got_entry_count): New function.
8910 (Target_arm::plt_entry_count): New function.
8911 (Target_arm::first_plt_entry_offset): New function.
8912 (Target_arm::plt_entry_size): New function.
8913 (Output_data_plt_arm::entry_count): New function.
8914 (Output_data_plt_arm::first_plt_entry_offset): New function.
8915 (Output_data_plt_arm::get_plt_entry_size): New function.
8916 * i386.cc (Target_i386::got_size): Add const.
8917 (Target_i386::got_entry_count): New function.
8918 (Target_i386::plt_entry_count): New function.
8919 (Target_i386::first_plt_entry_offset): New function.
8920 (Target_i386::plt_entry_size): New function.
8921 (Output_data_plt_i386::entry_count): New function.
8922 (Output_data_plt_i386::first_plt_entry_offset): New function.
8923 (Output_data_plt_i386::get_plt_entry_size): New function.
8924 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
8925 find_incremental_inputs_sections. Dump incremental_got_plt section.
8926 * incremental.cc: Include target.h.
8927 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
8928 parameter. Adjust all callers. Find incremental_got_plt section.
8929 (Incremental_inputs::create_data_sections): Create incremental_got_plt
8930 section.
8931 (Output_section_incremental_inputs::set_final_data_size): Calculate
8932 size of incremental_got_plt section.
8933 (Output_section_incremental_inputs::do_write): Write the
8934 incremental_got_plt section.
8935 (Got_plt_view_info): New struct.
8936 (Local_got_offset_visitor): New class.
8937 (Global_got_offset_visitor): New class.
8938 (Global_symbol_visitor_got_plt): New class.
8939 (Output_section_incremental_inputs::write_got_plt): New function.
8940 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
8941 Add parameter. Adjust all callers.
8942 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
8943 (Incremental_inputs::got_plt_section): New function.
8944 (Incremental_inputs::got_plt_section_): New data member.
8945 (Incremental_got_plt_reader): New class.
8946 * layout.cc (Layout::create_incremental_info_sections): Add the
8947 incremental_got_plt section.
8948 * object.h (Got_offset_list::get_list): New function.
8949 (Got offset_list::for_all_got_offsets): New function.
8950 (Sized_relobj::local_got_offset_list): New function.
8951 * powerpc.cc (Target_powerpc::got_size): Add const.
8952 (Target_powerpc::got_entry_count): New function.
8953 (Target_powerpc::plt_entry_count): New function.
8954 (Target_powerpc::first_plt_entry_offset): New function.
8955 (Target_powerpc::plt_entry_size): New function.
8956 (Output_data_plt_powerpc::entry_count): New function.
8957 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
8958 (Output_data_plt_powerpc::get_plt_entry_size): New function.
8959 * sparc.cc (Target_sparc::got_size): Add const.
8960 (Target_sparc::got_entry_count): New function.
8961 (Target_sparc::plt_entry_count): New function.
8962 (Target_sparc::first_plt_entry_offset): New function.
8963 (Target_sparc::plt_entry_size): New function.
8964 (Output_data_plt_sparc::entry_count): New function.
8965 (Output_data_plt_sparc::first_plt_entry_offset): New function.
8966 (Output_data_plt_sparc::get_plt_entry_size): New function.
8967 * symtab.h (Symbol::got_offset_list): New function.
8968 (Symbol_table::for_all_symbols): New function.
8969 * target.h (Sized_target::got_entry_count): New function.
8970 (Sized_target::plt_entry_count): New function.
8971 (Sized_target::plt_entry_size): New function.
8972 * x86_64.cc (Target_x86_64::got_size): Add const.
8973 (Target_x86_64::got_entry_count): New function.
8974 (Target_x86_64::plt_entry_count): New function.
8975 (Target_x86_64::first_plt_entry_offset): New function.
8976 (Target_x86_64::plt_entry_size): New function.
8977 (Output_data_plt_x86_64::entry_count): New function.
8978 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
8979 (Output_data_plt_x86_64::get_plt_entry_size): New function.
8980
09ec0418
CC
89812010-08-12 Cary Coutant <ccoutant@google.com>
8982
8983 * archive.cc: Include incremental.h.
8984 (Archive::Archive): Initialize incremental_info_.
8985 (Archive::include_member): Record archive members in incremental info.
8986 (Add_archive_symbols::run): Record begin and end of an archive in
8987 incremental info.
8988 (Lib_group::include_member): Record objects in incremental info.
8989 * archive.h (Incremental_archive_entry): Forward declaration.
8990 (Archive::set_incremental_info): New member function.
8991 (Archive::incremental_info): New member function.
8992 (Archive::Unused_symbol_iterator): New class.
8993 (Archive::unused_symbols_begin): New member function.
8994 (Archive::unused_symbols_end): New member function.
8995 (Archive::incremental_info_): New data member.
8996 * incremental-dump.cc (find_input_containing_global): New function.
8997 (dump_incremental_inputs): Dump new incremental info sections.
8998 * incremental.cc: Include symtab.h.
8999 (Output_section_incremental_inputs): New class.
9000 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
9001 new incremental info sections.
9002 (Sized_incremental_binary::do_check_inputs): Likewise.
9003 (Incremental_inputs::report_archive): Remove.
9004 (Incremental_inputs::report_archive_begin): New function.
9005 (Incremental_inputs::report_archive_end): New function.
9006 (Incremental_inputs::report_object): New function.
9007 (Incremental_inputs::finalize_inputs): Remove.
9008 (Incremental_inputs::report_input_section): New function.
9009 (Incremental_inputs::report_script): Rewrite.
9010 (Incremental_inputs::finalize): Do nothing but finalize string table.
9011 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9012 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9013 (Incremental_inputs::create_data_sections): New function.
9014 (Incremental_inputs::relocs_entsize): New function.
9015 (Output_section_incremental_inputs::set_final_data_size): New function.
9016 (Output_section_incremental_inputs::do_write): New function.
9017 (Output_section_incremental_inputs::write_header): New function.
9018 (Output_section_incremental_inputs::write_input_files): New function.
9019 (Output_section_incremental_inputs::write_info_blocks): New function.
9020 (Output_section_incremental_inputs::write_symtab): New function.
9021 * incremental.h (Incremental_script_entry): Forward declaration.
9022 (Incremental_object_entry): Forward declaration.
9023 (Incremental_archive_entry): Forward declaration.
9024 (Incremental_inputs): Forward declaration.
9025 (Incremental_inputs_header_data): Remove.
9026 (Incremental_inputs_header): Remove.
9027 (Incremental_inputs_header_write): Remove.
9028 (Incremental_inputs_entry_data): Remove.
9029 (Incremental_inputs_entry): Remove.
9030 (Incremental_inputs_entry_write): Remove.
9031 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
9032 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
9033 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
9034 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
9035 Likewise.
9036 (Incremental_input_entry): New class.
9037 (Incremental_script_entry): New class.
9038 (Incremental_object_entry): New class.
9039 (Incremental_archive_entry): New class.
9040 (Incremental_inputs::Incremental_inputs): Initialize new data members.
9041 (Incremental_inputs::report_inputs): Remove.
9042 (Incremental_inputs::report_archive): Remove.
9043 (Incremental_inputs::report_archive_begin): New function.
9044 (Incremental_inputs::report_archive_end): New function.
9045 (Incremental_inputs::report_object): Change prototype.
9046 (Incremental_inputs::report_input_section): New function.
9047 (Incremental_inputs::report_script): Change prototype.
9048 (Incremental_inputs::get_reloc_count): New function.
9049 (Incremental_inputs::set_reloc_count): New function.
9050 (Incremental_inputs::create_data_sections): New function.
9051 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9052 (Incremental_inputs::inputs_section): New function.
9053 (Incremental_inputs::symtab_section): New function.
9054 (Incremental_inputs::relocs_section): New function.
9055 (Incremental_inputs::get_stringpool): Add const.
9056 (Incremental_inputs::command_line): Add const.
9057 (Incremental_inputs::inputs): Remove.
9058 (Incremental_inputs::command_line_key): New function.
9059 (Incremental_inputs::input_file_count): New function.
9060 (Incremental_inputs::input_files): New function.
9061 (Incremental_inputs::relocs_entsize): New function.
9062 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9063 (Incremental_inputs::finalize_inputs): Remove.
9064 (Incremental_inputs::Input_info): Remove.
9065 (Incremental_inputs::lock_): Remove.
9066 (Incremental_inputs::inputs_): Change type.
9067 (Incremental_inputs::inputs_map_): Remove.
9068 (Incremental_inputs::current_object_entry_): New data member.
9069 (Incremental_inputs::inputs_section_): New data member.
9070 (Incremental_inputs::symtab_section_): New data member.
9071 (Incremental_inputs::relocs_section_): New data member.
9072 (Incremental_inputs::reloc_count_): New data member.
9073 (Incremental_inputs_reader): New class.
9074 (Incremental_symtab_reader): New class.
9075 (Incremental_relocs_reader): New class.
9076 * layout.cc (Layout::finalize): Move finalization of incremental info
9077 and creation of incremental info sections to follow finalization of
9078 symbol table. Set offsets for postprocessing sections.
9079 (Layout::create_incremental_info_sections): Call
9080 Incremental_inputs::create_data_sections. Add incremental symtab
9081 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
9082 sections to layout after input sections.
9083 * layout.h (struct Timespec): Forward declaration.
9084 (Layout::incremental_inputs): Add const.
9085 (Layout::create_incremental_info_sections): Add parameter.
9086 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
9087 * object.cc: Include incremental.h.
9088 (Relobj::finalize_incremental_relocs): New function.
9089 (Sized_relobj::do_layout): Record input sections in incremental info.
9090 * object.h (Object::output_section): New function.
9091 (Object::output_section_offset): Moved from Relobj.
9092 (Object::get_incremental_reloc_base): New function.
9093 (Object::get_incremental_reloc_count): New function.
9094 (Object::do_output_section): New function.
9095 (Object::do_output_section_offset): Moved from Relobj.
9096 (Object::do_get_incremental_reloc_base): New function.
9097 (Object::do_get_incremental_reloc_count): New function.
9098 (Object::Object): Initialize new data members.
9099 (Relobj::output_section): Renamed do_output_section and moved to
9100 protected.
9101 (Relobj::output_section_offset): Moved to Object.
9102 (Relobj::do_get_incremental_reloc_base): New function.
9103 (Relobj::do_get_incremental_reloc_count): New function.
9104 (Relobj::allocate_incremental_reloc_counts): New function.
9105 (Relobj::count_incremental_reloc): New function.
9106 (Relobj::finalize_incremental_relocs): New function.
9107 (Relobj::next_incremental_reloc_index): New function.
9108 (Relobj::reloc_counts_): New data member.
9109 (Relobj::reloc_bases_): New data member.
9110 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
9111 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
9112 (Sized_relobj::incremental_relocs_scan): New function.
9113 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9114 (Sized_relobj::incremental_relocs_write): New function.
9115 (Sized_relobj::incremental_relocs_write_reltype): New function.
9116 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
9117 incremental link.
9118 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
9119 archives and object files elsewhere.
9120 (Add_symbols::run): Report object files here.
9121 (Finish_group::run): Report end of archive at end of group.
9122 * reloc.cc: Include layout.h, incremental.h.
9123 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
9124 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
9125 (Sized_relobj::incremental_relocs_scan): New function.
9126 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9127 (Sized_relobj::do_relocate_sections): Write incremental relocations.
9128 (Sized_relobj::incremental_relocs_write): New function.
9129 (Sized_relobj::incremental_relocs_write_reltype): New function.
9130 * script.cc (read_input_script): Rewrite test for incremental link.
9131 Change call to Incremental_inputs::report_script.
9132 * symtab.h (Symbol_table::first_global_index): New function.
9133 (Symbol_table::output_count): New function.
9134
ce0d1972
DK
91352010-08-12 Doug Kwan <dougkwan@google.com>
9136
9137 * arm.cc (Target_arm::merge_object_attributes): Check command line
9138 options --no-wchar-size-warning and --no-enum-size-warning.
9139 * options.h (General_options): Add ld-compatible options
9140 --no-enum-size-warning and --no-wchar-size-warning.
9141
6e5710ce
ILT
91422010-08-04 Ian Lance Taylor <iant@google.com>
9143
9144 * x86_64.cc (Target_x86_64::Scan::local): Use
9145 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
9146 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
9147 (Target_x86_64::Scan::global): Likewise.
9148 (Target_x86_64::Relocate::relocate): Likewise.
9149 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
9150 Likewise.
9151
fef830db
CC
91522010-08-03 Cary Coutant <ccoutant@google.com>
9153
9154 * merge.cc (Output_merge_string::do_add_input_section): Count strings
9155 to reserve space in merged_strings vector. Keep total input size
9156 for stats.
9157 (Output_merge_string::do_print_merge_stats): Print total input size.
9158 * merge.h (Output_merge_string): Add input_size_ field.
9159 * stringpool.cc (Stringpool_template::string_length): Move
9160 implementations out of Stringpool_template class and place in
9161 stringpool.h.
9162 * stringpool.h (string_length): Move out of Stringpool_template.
9163
1e3811b0
ILT
91642010-08-03 Ian Lance Taylor <iant@google.com>
9165
9166 PR 11712
9167 * layout.cc (relaxation_loop_body): If address of load segment is
9168 set, adjust address to include headers if possible.
9169
7af0c620
ILT
91702010-08-03 Ian Lance Taylor <iant@google.com>
9171
9172 * version.cc (version_string): Bump to 1.10.
9173
22f0da72
ILT
91742010-08-03 Ian Lance Taylor <iant@google.com>
9175
9176 PR 11805
9177 * layout.h (enum Output_section_order): Define.
9178 (class Layout): Update declarations.
9179 * layout.cc (Layout::get_output_section): Add order parameter.
9180 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
9181 is_first_non_relro parameters. Change all callers.
9182 (Layout::choose_output_section): Likewise.
9183 (Layout::add_output_section_data): Likewise.
9184 (Layout::make_output_section): Likewise. Set order.
9185 (Layout::default_section_order): New function.
9186 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
9187 * output.cc (Output_section::Output_section): Initialize order_.
9188 Don't initialize deleted fields.
9189 (Output_segment::Output_segment): Don't initialize deleted
9190 fields.
9191 (Output_segment::add_output_section_to_load): New function
9192 replacing add_output_section. Change all callers to call this or
9193 add_output_section_to_nonload.
9194 (Output_segment::add_output_section_to_nonload): New function.
9195 (Output_segment::remove_output_section): Rewrite.
9196 (Output_segment::add_initial_output_data): Likewise.
9197 (Output_segment::has_any_data_sections): Likewise.
9198 (Output_segment::is_first_section_relro): Likewise.
9199 (Output_segment::maximum_alignment): Likewise.
9200 (Output_segment::has_dynamic_reloc): New function replacing
9201 dynamic_reloc_count. Change all callers.
9202 (Output_segment::has_dynamic_reloc_list): New function replacing
9203 dynamic_reloc_count_list. Change all callers.
9204 (Output_segment::set_section_addresses): Rewrite.
9205 (Output_segment::set_offset): Rewrite.
9206 (Output_segment::find_first_and_last_list): Remove.
9207 (Output_segment::set_tls_offsets): Rewrite.
9208 (Output_segment::first_section_load_address): Likewise.
9209 (Output_segment::output_section_count): Likewise.
9210 (Output_segment::section_with_lowest_load_address): Likewise.
9211 (Output_segment::write_section_headers): Likewise.
9212 (Output_segment::print_sections_to_map): Likewise.
9213 * output.h (class Output_data): Remove dynamic_reloc_count_
9214 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
9215 (Output_data::add_dynamic_reloc): Rewrite.
9216 (Output_data::has_dynamic_reloc): New function.
9217 (Output_data::dynamic_reloc_count): Remove.
9218 (class Output_section): Add order_ field. Remvoe is_relro_local_,
9219 is_last_relro_, is_first_non_relro_, is_interp_,
9220 is_dynamic_linker_section_ fields. Add order and set_order
9221 functions. Remove is_relro_local, set_is_relro_local,
9222 is_last_relro, set_is_last_relro, is_first_non_relro,
9223 set_is_first_non_relro functions, is_interp, set_is_interp,
9224 is_dynamic_linker_section, and set_is_dynamic_linker_section
9225 functions.
9226 (class Output_segment): Change Output_data_list from std::list to
9227 std:;vector. Add output_lists_ field. Remove output_data_ and
9228 output_bss_ fields. Update declarations.
9229
3ff2ccb0
ILT
92302010-08-02 Ian Lance Taylor <iant@google.com>
9231
9232 * arm.cc (Target_arm::gc_process_relocs): Use typename.
9233 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
9234 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
9235
88a4108b
ILT
92362010-08-02 Ian Lance Taylor <iant@google.com>
9237
9238 PR 11855
9239 * script.cc (Script_options::Script_options): Initialize
9240 symbol_definitions_ and symbol_references_.
9241 (Script_options::add_symbol_assignment): Update
9242 symbol_definitions_ and symbol_references_.
9243 (Script_options::add_symbol_reference): New function.
9244 (script_symbol): New function.
9245 * script.h (class Script_options): Add symbol_definitions_ and
9246 symbol_references_ fields.
9247 (Script_options::referenced_const_iterator): New type.
9248 (Script_options::referenced_begin): New function.
9249 (Script_options::referenced_end): New function.
9250 (Script_options::is_referenced): New function.
9251 (Script_options::any_unreferenced): New function.
9252 * script-c.h (script_symbol): Declare.
9253 * yyscript.y (exp): Call script_symbol.
9254 * symtab.cc: Include "script.h".
9255 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
9256 Change all callers. Check symbols referenced by scripts.
9257 (Symbol_table::add_undefined_symbols_from_command_line): Add
9258 layout parameter. Change all callers.
9259 (Symbol_table::do_add_undefined_symbols_from_command_line):
9260 Likewise. Break out loop body. Check symbols referenced by
9261 scripts.
9262 (Symbol_table::add_undefined_symbol_from_command_line): New
9263 function broken out of
9264 do_add_undefined_symbols_from_command_line.
9265 * symtab.h (class Symbol_table): Update declarations.
9266 * archive.cc: Include "layout.h".
9267 (Archive::should_include_member): Add layout parameter. Change
9268 all callers. Check for symbol mentioned in expression.
9269 * archive.h (class Archive): Update declaration.
9270 * object.cc (Sized_relobj::do_should_include_member): Add layout
9271 parameter.
9272 * object.h (Object::should_include_member): Add layout parameter.
9273 Change all callers.
9274 (Object::do_should_include_member): Add layout parameter.
9275 (class Sized_relobj): Update declaration.
9276 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
9277 parameter.
9278 * dynobj.h (class Sized_dynobj): Update declaration.
9279 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
9280 layout parameter.
9281 * plugin.h (class Sized_pluginobj): Update declaration.
9282
5f1ab67a
ILT
92832010-08-02 Ian Lance Taylor <iant@google.com>
9284
9285 PR 11866
9286 * output.cc (Output_segment::set_offset): Search for the first and
9287 last sections rather than assuming that the list is in order.
9288 (Output_segment::find_first_and_last_list): New function.
9289 * output.h (class Output_segment): Update declarations.
9290 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
9291 (relro_strip_test_SOURCES): New variable.
9292 (relro_strip_test_DEPENDENCIES): New variable.
9293 (relro_strip_test_LDFLAGS): New variable.
9294 (relro_strip_test_LDADD): New variable.
9295 (relro_strip_test.so): New target.
9296
a8df5856
ILT
92972010-08-02 Ian Lance Taylor <iant@google.com>
9298
9299 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
9300 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
9301 (Target_i386::got_tlsdesc_section): New function.
9302 (Target_i386::got_section): Create space for GOT entries for
9303 TLSDESC relocations.
9304 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
9305 R_386_TLS_GOTDESC.
9306 (Target_i386::Scan::global): Likewise.
9307 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
9308 using TLSDESC GOT.
9309 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
9310 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
9311 (Target_x86_64::got_tlsdesc_section): New function.
9312 (Target_x86_64::got_section): Create space for GOT entries for
9313 TLSDESC relocations.
9314 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
9315 R_386_TLS_GOTDESC.
9316 (Target_x86_64::Scan::global): Likewise.
9317 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
9318 using TLSDESC GOT.
9319
0c10a0a6
ILT
93202010-08-02 Ian Lance Taylor <iant@google.com>
9321
9322 * testsuite/final_layout.sh: Use dc to convert from hex to
9323 decimal.
9324
41cbeecc
ST
93252010-07-29 Sriraman Tallam <tmsriram@google.com>
9326
9327 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
9328 paramter to the call to gold::gc_process_relocs.
9329 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
9330 paramter to the call to gold::gc_process_relocs.
9331 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
9332 parameter to the call to gold::gc_process_relocs.
9333 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
9334 template parameter to the call to gold::gc_process_relocs.
9335 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
9336 paramter to the call to gold::gc_process_relocs.
9337 * gc.h (get_embedded_addend_size): New function.
9338 (gc_process_relocs): Save the size of the reloc for use by ICF.
9339 * icf.cc (get_section_contents): Get the addend from the text section
9340 for SHT_REL relocation sections.
9341 * icf.h (Icf::Reloc_addend_size_info): New typedef.
9342 (Icf::Reloc_info): Add new member reloc_addend_size_info.
9343 * int_encoding.h (read_from_pointer): New overloaded function.
9344 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
9345 * testsuite/icf_sht_rel_addend_test.sh: New file.
9346 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
9347 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
9348
6ea55b82
RW
93492010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9350
9351 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
9352 * Makefile.in: Regenerate.
9353 * testsuite/Makefile.in: Regenerate.
9354
9691462b
ILT
93552010-07-27 Jeffrey Yasskin <jyasskin@google.com>
9356
9357 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
9358 * gold/testsuite/debug_msg.cc: Likewise.
9359 * gold/testsuite/odr_violation1.cc
9360 * gold/testsuite/odr_violation2.cc
9361
76897331
CC
93622010-07-21 Cary Coutant <ccoutant@google.com>
9363
9364 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
9365 string, and length fields.
9366 (Output_merge_string::Merged_strings_list): New type.
9367 (Output_merge_string::Merged_strings_lists): New typedef.
9368 (Output_merge_string): Replace merged_strings_ with
9369 merged_strings_lists_.
9370 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
9371 Merged_strings_list per input object and section. Don't store pointer
9372 to the string. Don't store length with each merged string entry.
9373 (Output_merge_string::finalize_merged_data): Loop over list of merged
9374 strings lists. Recompute length of each merged string.
9375
78384e8f
CC
93762010-07-15 Cary Coutant <ccoutant@google.com>
9377
9378 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
9379 here.
9380
783659f9
ILT
93812010-07-14 Ian Lance Taylor <iant@google.com>
9382
9383 * descriptors.cc (Descriptors::open): Report correct name in error
9384 message.
9385
131687b4
DK
93862010-07-13 Doug Kwan <dougkwan@google.com>
9387
9388 * arm.cc (Arm_input_section::Arm_input_section): For a
9389 SHT_ARM_EXIDX section, always keeps the input sections.
9390 (Arm_input_section::set_exidx_section_link): New method.
9391 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
9392 has_errors_ to false.
9393 (Arm_exidx_input_section::has_errors,
9394 Arm_exidx_input_section::set_has_errors): New methods.
9395 (Arm_exidx_input_section::has_errors_): New data member.
9396 (Arm_relobj::get_exidx_shndx_list): New method.
9397 (Arm_output_section::append_text_sections_to_list): Do not skip
9398 section without SHF_EXECINSTR.
9399 (Arm_output_section::fix_exidx_coverage): Skip input sections with
9400 errors.
2e702c99 9401 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
9402 section header. Make error messages more verbose. Check for
9403 a non-executable section linked to an EXIDX section.
9404 (Arm_relobj::do_read_symbols): Remove error checking, which has been
9405 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
9406 check that there is no deferred EXIDX section if we exit early.
9407 Instead of not making an EXIDX section in case of an error, make one
9408 and set the has_errors flag of it.
9409 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
9410 in a relocatable link.
9411 (Target_arm::do_relax): Look for the EXIDX output section instead of
9412 assuming that it is called .ARM.exidx.
2e702c99 9413 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
9414 section list. Do not check for SHF_EXECINSTR section flags but
9415 skip any input section with errors.
9416 * output.cc (Output_section::Output_section): Initialize
9417 always_keeps_input_sections_ to false.
9418 (Output_section::add_input_section): Check for
9419 always_keeps_input_sections_.
9420 * output.h (Output_section::always_keeps_input_sections,
9421 Output_section::set_always_keeps_input_sections): New methods.
9422 (Output_section::always_keeps_input_sections): New data member.
9423
69517287
RÁE
94242010-07-13 Rafael Espindola <espindola@google.com>
9425
9426 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
9427 * fileread.h (Input_file): Add try_extra_search_path and find_file.
9428
82742395
ILT
94292010-07-13 Philip Herron <herron.philip@googlemail.com>
9430 Ian Lance Taylor <iant@google.com>
9431
9432 * output.h (Output_section_lookup_maps::add_merge_section):
9433 Correct check of whether value was inserted.
9434 (Output_section_lookup_maps::add_merge_input_section): Likewise.
9435 (Output_section_lookup_maps::add_relaxed_input_section):
9436 Likewise.
9437 * arm.cc (Target_arm::got_section): Remove used local os.
9438 * i386.cc (Target_i386::got_section): Likewise.
9439 * x86_64.cc (Target_x86_64::got_section): Likewise.
9440 * sparc.cc (Target_sparc::got_section): Likewise.
9441 (Target_sparc::relocate): Remove unused local have_got_offset.
9442 * powerpc.cc (Target_powerpc::relocate): Likewise.
9443
f2d707b5
ILT
94442010-07-13 Ian Lance Taylor <iant@google.com>
9445
241531d6
ILT
9446 * compressed_output.cc (zlib_decompress): Fix signature in
9447 !HAVE_ZLIB_H case.
9448
f2d707b5
ILT
9449 * archive.cc (Archive::include_member): Unlock an external member
9450 of a thin archive. Don't bother to delete an object we know is
9451 NULL.
9452
a2e47362
CC
94532010-07-12 Cary Coutant <ccoutant@google.com>
9454
9455 * compressed_output.cc (zlib_decompress): New function.
9456 (get_uncompressed_size): New function.
9457 (decompress_input_section): New function.
9458 * compressed_output.h (get_uncompressed_size): New function.
9459 (decompress_input_section): New function.
9460 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
9461 Handle compressed debug sections.
9462 * layout.cc (is_compressed_debug_section): New function.
9463 (Layout::output_section_name): Map compressed section names to
9464 canonical names.
9465 * layout.h (is_compressed_debug_section): New function.
9466 (is_debug_info_section): Recognize compressed debug sections.
9467 * merge.cc: Include compressed_output.h.
9468 (Output_merge_data::do_add_input_section): Handle compressed
9469 debug sections.
9470 (Output_merge_string::do_add_input_section): Handle compressed
9471 debug sections.
9472 * object.cc: Include compressed_output.h.
9473 (Sized_relobj::Sized_relobj): Initialize new data members.
9474 (build_compressed_section_map): New function.
9475 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
9476 * object.h (Object::section_is_compressed): New method.
9477 (Object::do_section_is_compressed): New method.
9478 (Sized_relobj::Compressed_section_map): New type.
9479 (Sized_relobj::do_section_is_compressed): New method.
9480 (Sized_relobj::compressed_sections_): New data member.
9481 * output.cc (Output_section::add_input_section): Handle compressed
9482 debug sections.
9483 * reloc.cc: Include compressed_output.h.
9484 (Sized_relobj::write_sections): Handle compressed debug sections.
9485
ce279a62
CC
94862010-07-08 Cary Coutant <ccoutant@google.com>
9487
9488 * resolve.cc (Symbol_table::resolve): Remember whether undef was
9489 weak when resolving to a dynamic def.
9490 (Symbol_table::should_override): Add adjust_dyndef flag; set it
9491 for weak undef/dynamic def cases. Adjust callers.
9492 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
9493 undef_binding_weak_.
9494 (Symbol_table::sized_write_globals): Adjust symbol binding.
9495 (Symbol_table::sized_write_symbol): Add binding parameter.
9496 * symtab.h (Symbol::set_undef_binding): New method.
9497 (Symbol::is_undef_binding_weak): New method.
9498 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
9499 (Symbol_table::should_override): Add new parameter.
9500 (Symbol_table::sized_write_symbol): Add new parameter.
9501
9502 * testsuite/weak_undef_file1.cc: Add new test case.
9503 * testsuite/weak_undef_file2.cc: Fix header comment.
9504 * testsuite/weak_undef_test.cc: Add new test case.
9505
b2286c10
DK
95062010-06-29 Doug Kwan <dougkwan@google.com>
9507
9508 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
9509 Initialize USE_SYMBOL_.
9510 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
9511 definition.
9512 (Arm_reloc_property::uses_symbol_): New data member declaration.
9513 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
9514 uses symbol value and symbol is undefined but not weakly undefined.
9515
4802450a
RÁE
95162010-06-28 Rafael Espindola <espindola@google.com>
9517
9518 * plugin.cc (Plugin::load): Use dlerror.
9519
e5ca47ba
ILT
95202010-06-26 Jeffrey Yaskin <jyasskin@google.com>
9521
9522 * symtab.cc (detect_odr_violations): When reporting an ODR
9523 violation, report an object where the symbol is defined.
9524
8a75a161
DK
95252010-06-25 Doug Kwan <dougkwan@google.com>
9526
9527 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
9528 (Target_arm::section_may_have_icf_unsafe_pointers): New method
9529 definition.
9530 (Target_arm::Scan::local_reloc_may_be_function_pointer,
9531 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
9532 target hook to detect function points.
9533 (Target_arm::Scan::possible_function_pointer_reloc): New method.
9534 * icf.h (Icf::check_section_for_function_pointers): Change type of
9535 parameter SECTION_NAME to const reference to std::string. Use
9536 target hook to determine if section may have unsafe pointers.
9537 * target.h (Target::section_may_have_icf_unsafe_pointers): New
9538 method definition.
9539
42218b9f
RÁE
95402010-06-21 Rafael Espindola <espindola@google.com>
9541
9542 * fileread.cc (Input_file::find_fie): New
9543 (Input_file::open): Use Input_file::find_fie.
9544 * fileread.h (Input_file::find_fie): New
9545 * plugin.cc (set_extra_library_path): New.
9546 (Plugin::load): Add set_extra_library_path to the transfer vector.
9547 (Plugin_manager::set_extra_library_path): New.
9548 (Plugin_manager::add_input_file): Use the extra search path if set.
9549 (set_extra_library_path(): New.
9550 * plugin.h (Plugin_manager): Add set_extra_library_path and
9551 extra_search_path_.
9552
a0506cca
CC
95532010-06-19 Cary Coutant <ccoutant@google.com>
9554
9555 * layout.cc (gdb_sections): Add .debug_types.
9556 (lines_only_debug_sections): Likewise.
9557
6508b958
RÁE
95582010-06-18 Rafael Espindola <espindola@google.com>
9559
9560 * plugin.cc (add_input_file,add_input_library)
9561 (Plugin_manager::add_input_file): Make filename arguments const.
9562 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
9563 const.
9564
3e235302
DK
95652010-06-16 Doug Kwan <dougkwan@google.com>
9566
9567 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
9568 .ARM.attributes section if we have not merged any input
9569 attributes sections.
9570
106e8a6c
DK
95712010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9572
9573 * arm.cc: Allow combining objects with no EABI version
9574 information.
9575
91ff43fe
RÁE
95762010-06-15 Rafael Espindola <espindola@google.com>
9577
9578 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
9579
68ed838c
ILT
95802010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9581
9582 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
9583 (struct iovec): Correct !HAVE_READV definition.
9584
f3a2388f
CC
95852010-06-10 Cary Coutant <ccoutant@google.com>
9586
9587 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
9588 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
9589 reloc sections.
9590 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
9591
9592 PR 11683
9593 * symtab.h (Symbol::is_placeholder): New member function.
9594 * target-reloc.h (relocate_section): Check for placeholder symbols.
9595
9596 * testsuite/Makefile.am (plugin_test_8): New test.
9597 (plugin_test_9): New test.
9598 * testsuite/Makefile.in: Regenerate.
9599
e1df38aa
NC
96002010-06-09 Nick Clifton <nickc@redhat.com>
9601
9602 * yyscript.y (input_list_element): Allow strings prefixed with
9603 the '-' character. Treat these as libraries.
9604 * script.cc (script_add_library): New function. Adds a library
9605 specified by "-l<name>" found in an input script.
9606 * script-c.h: Add prototype for script_add_library.
9607
25bbe950
DK
96082010-06-07 Doug Kwan <dougkwan@google.com>
9609
9610 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
9611 Restrict stub-group size to be within long conditional branch
9612 range when working around cortex-A8 erratum.
9613
0f32ea4c
ILT
96142010-06-07 Damien Diederen <dd@crosstwine.com>
9615
9616 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
9617 #ifdef typo.
9618
8fe2a369
ST
96192010-06-03 Sriraman Tallam <tmsriram@google.com>
9620
9621 PR gold/11658
9622 * output.cc
9623 (Output_section::Input_section_sort_entry::compare_section_ordering):
9624 Change to return non-zero correctly.
9625 (Output_section::Input_section_sort_section_order_index_compare
9626 ::operator()): Change to fix ambiguity in comparisons.
9627
6e9ba2ca
ST
96282010-06-01 Sriraman Tallam <tmsriram@google.com>
9629
9630 * gold.h (is_wildcard_string): New function.
9631 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
9632 (Layout::layout_eh_frame): Ditto.
9633 (Layout::find_section_order_index): New method.
9634 (Layout::read_layout_from_file): New method.
9635 * layout.h (Layout::find_section_order_index): New method.
9636 (Layout::read_layout_from_file): New method.
9637 (Layout::input_section_position_): New private member.
9638 (Layout::input_section_glob_): New private member.
9639 * main.cc (main): Call read_layout_from_file here.
9640 * options.h (--section-ordering-file): New option.
9641 * output.cc (Output_section::input_section_order_specified_): New
9642 member.
9643 (Output_section::Output_section): Initialize new member.
9644 (Output_section::add_input_section): Add new parameter.
9645 Keep input sections when --section-ordering-file is used.
9646 (Output_section::set_final_data_size): Sort input sections when
9647 section ordering file is specified.
9648 (Output_section::Input_section_sort_entry): Add new parameter.
9649 Check sorting type.
9650 (Output_section::Input_section_sort_entry::compare_section_ordering):
9651 New method.
9652 (Output_section::Input_section_sort_compare::operator()): Change to
9653 consider section_order_index.
9654 (Output_section::Input_section_sort_init_fini_compare::operator()):
9655 Change to consider section_order_index.
9656 (Output_section::Input_section_sort_section_order_index_compare
9657 ::operator()): New method.
9658 (Output_section::sort_attached_input_sections): Change to sort
9659 according to section order when specified.
e1df38aa
NC
9660 (Output_section::add_input_section<32, true>): Add new parameter.
9661 (Output_section::add_input_section<64, true>): Add new parameter.
9662 (Output_section::add_input_section<32, false>): Add new parameter.
9663 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
9664 * output.h (Output_section::add_input_section): Add new parameter.
9665 (Output_section::input_section_order_specified): New
9666 method.
9667 (Output_section::set_input_section_order_specified): New method.
9668 (Input_section::Input_section): Initialize section_order_index_.
9669 (Input_section::section_order_index): New method.
9670 (Input_section::set_section_order_index): New method.
9671 (Input_section::section_order_index_): New member.
9672 (Input_section::Input_section_sort_section_order_index_compare): New
9673 struct.
9674 (Output_section::input_section_order_specified_): New member.
9675 * script-sections.cc (is_wildcard_string): Delete and move modified
9676 method to gold.h.
9677 (Output_section_element_input::Output_section_element_input): Modify
9678 call to is_wildcard_string.
9679 (Output_section_element_input::Input_section_pattern
9680 ::Input_section_pattern): Ditto.
9681 (Output_section_element_input::Output_section_element_input): Ditto.
9682 * testsuite/Makefile.am (final_layout): New test case.
9683 * testsuite/Makefile.in: Regenerate.
9684 * testsuite/final_layout.cc: New file.
9685 * testsuite/final_layout.sh: New file.
9686
3537c84b
RÁE
96872010-06-01 Rafael Espindola <espindola@google.com>
9688
9689 * plugin.cc (Plugin::load): Pass the output name to the plugin.
9690
105b6afd
RÁE
96912010-06-01 Rafael Espindola <espindola@google.com>
9692
9693 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
9694 visibility of symbols.
9695
29e11421
DK
96962010-05-27 Doug Kwan <dougkwan@google.com>
9697
9698 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
9699 from start of output section instead of address for a local symbol
9700 in a merged or relaxed section when doing a relocatable link.
9701
5e0f337e
RÁE
97022010-05-26 Rafael Espindola <espindola@google.com>
9703
703d02da 9704 PR 11604
5e0f337e
RÁE
9705 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
9706 adding sections the garbage collector removed.
9707 * gold/testsuite/Makefile.am: Add test.
9708 * gold/testsuite/Makefile.in: Regenerate.
9709 * gold/testsuite/plugin_test_7.sh: New.
9710 * gold/testsuite/plugin_test_7_1.c: New.
9711 * gold/testsuite/plugin_test_7_2.c: New.
9712
f4187277
RÁE
97132010-05-26 Rafael Espindola <espindola@google.com>
9714
9715 * script-sections.cc (Output_section_definition::set_section_addresses):
9716 Check for --section-start.
9717
5c388529
DK
97182010-05-26 Doug Kwan <dougkwan@google.com>
9719
9720 * arm.cc (Arm_scan_relocatable_relocs): New class.
9721 (Target_arm::relocate_special_relocatable): New method.
9722 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
9723 (Arm_relocate_functions::thumb_branch_common): Same.
9724 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
9725 instead of Default_scan_relocatable_relocs.
9726 * target-reloc.h (relocate_for_relocatable): Let target handle
9727 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
9728 * target.h (Sized_target::relocate_special_relocatable): New method.
9729
bca1c3ae
ILT
97302010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9731
9732 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
9733
0439c796
DK
97342010-05-23 Doug Kwan <dougkwan@google.com>
9735
9736 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
9737 instead of a cast.
9738 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
9739 with a direct branch, not a conditional branch, to a stub.
9740 * merge.cc (Output_merge_base::record_input_section): New method
9741 defintion.
9742 (Output_merge_data::do_add_input_section): Record input section if
9743 keeps-input-sections flag is set.
9744 (Output_merge_string::do_add_input_section): Ditto.
9745 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
9746 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
9747 INPUT_SECTIONS_.
9748 (Output_merge_base::keeps_input_sections,
9749 Output_merge_base::set_keeps_input_sections,
9750 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
9751 method definitions.
9752 (Output_merge_base::Input_sections): New type declaration.
9753 (Output_merge_base::input_sections_begin,
9754 Output_merge_base::input_sections_end,
9755 Output_merge_base::do_set_keeps_input_sections): New method definitions.
9756 (Output_merge_base::bool keeps_input_sections_,
9757 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
9758 Output_merge_base::input_sections_): New data members.
9759 (Output_merge_data::do_set_keeps_input_sections): New method
9760 defintion.
9761 (Output_merge_string::do_set_keeps_input_sections): Ditto.
9762 * output.cc (Output_section::Input_section::relobj): Move method
9763 defintion from class declaration to here and handle merge sections.
9764 (Output_section::Input_section::shndx): Ditto.
9765 (Output_section::Output_section): Remove initializations of removed
9766 data members and initialize new data member LOOKUP_MAPS_.
9767 (Output_section::add_input_section): Set keeps-input-sections flag
9768 for a newly created merge output section as appropriate. Adjust code
9769 to use Output_section_lookup_maps class.
9770 (Output_section::add_relaxed_input_section): Adjst code for lookup
9771 maps code refactoring.
2e702c99 9772 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
9773 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
9774 class. If adding input section to a newly created merge output
9775 section fails, remove the new merge section.
9776 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 9777 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 9778 (Output_section::find_merge_section): Ditto.
0439c796 9779 (Output_section::build_lookup_maps): New method defintion.
2e702c99 9780 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
9781 Output_section_lookup_maps class.
9782 (Output_section::get_input_sections): Export merge sections. Adjust
9783 code to use Output_section_lookup_maps class.
9784 (Output_section:::add_script_input_section): Adjust code to use
9785 Output_section_lookup_maps class. Update lookup maps for merge
9786 sections also.
9787 (Output_section::discard_states): Use Output_section_lookup_maps.
9788 (Output_section::restore_states): Same.
9789 * output.h (Merge_section_properties): Move class defintion out of
9790 Output_section.
9791 (Output_section_lookup_maps): New class.
9792 (Output_section::Input_section::is_merge_section): New method
9793 defintion.
9794 (Output_section::Input_section::relobj): Move defintion out of class
9795 defintion. Declare method only.
9796 (Output_section::Input_section::shndx): Ditto.
9797 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 9798 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
9799 (Output_section::Merge_section_by_properties_map,
9800 Output_section::Output_section_data_by_input_section_map,
9801 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
9802 Remove types.
2e702c99 9803 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
9804 KEEPS_INPUT_SECTIONS.
9805 (Output_section::build_lookup_maps): New method declaration.
9806 (Output_section::merge_section_map_,
9807 Output_section::merge_section_by_properties_map_,
9808 Output_section::relaxed_input_section_map_,
9809 Output_section::is_relaxed_input_section_map_valid_): Remove data
9810 members.
9811 (Output_section::lookup_maps_): New data member.
9812
76295588
L
98132010-05-21 Doug Kwan <dougkwan@google.com>
9814
9815 PR gold/11619
9816 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
9817 avoid a compilation error.
9818
d103a984
RÁE
98192010-05-19 Rafael Espindola <espindola@google.com>
9820
9821 * script-sections.cc (Output_section_definition::allocate_to_segment):
9822 Update the phdrs_list even when the output section is NULL.
9823 * testsuite/Makefile.am: Add test.
9824 * testsuite/Makefile.in: Regenerate.
9825 * testsuite/script_test_9.cc: New.
9826 * testsuite/script_test_9.sh: New.
9827 * testsuite/script_test_9.t: New.
9828
6625d24e
DK
98292010-05-19 Doug Kwan <dougkwan@google.com>
9830
9831 * arm.cc (Arm_input_section::original_size): New method.
9832 (Arm_input_section::do_addralign): Add a cast.
9833 (Arm_input_section::do_output_offset): Remove static cast.
9834 (Arm_input_section::original_addralign,
9835 Arm_input_section::original_size_): Change type to uint32_t.
9836 (Arm_input_section::init): Add safe casts for section alignment
9837 and size.
9838 (Arm_input_section::set_final_data_size): Do not set address and
9839 offset of stub table.
9840 (Arm_output_section::fix_exidx_coverage): Change use of of
9841 Output_section::Simple_input_section to that of
9842 Output_section::Input_section.
9843 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
9844 except for the first pass.
9845 * output.cc (Output_section::get_input_sections): Change type of
9846 input_sections to std::list<Input_section>.
9847 (Output_section::add_script_input_section): Rename from
9848 Output_section::add_simple_input_section. Change type of SIS
9849 parameter from Simple_input_section to Input_section.
9850 * output.h (Output_section::Simple_input_section): Remove class.
9851 (Output_section::Input_section): Change class visibility to public.
9852 (Output_section::Input_section::addralign): Use stored alignments
9853 for special input sections if set.
9854 (Output_section::Input_section::set_addralign): New method.
9855 (Output_section::get_input_sections): Change parameter type from
9856 list of Simple_input_section to list of Input_section.
9857 (Output_section::add_script_input_section): Rename from
9858 Output_section::add_simple_input_section. Change first parameter's
9859 type from Simple_input_section to Input_section and remove the
9860 second and third parameters.
9861 * script-sections.cc (Input_section::Input_section_list): Change
9862 type to list of Output_section::Input_section/
9863 (Input_section_info::Input_section_info): Change parameter type of
9864 INPUT_SECTION to Output_section::Input_section.
9865 (Input_section_info::input_section): Change return type.
9866 (Input_section_info::input_section_): Change type to
9867 Output_section::Input_section.
9868 (Output_section_element_input::set_section_addresses): Adjust code
9869 to use Output_section::Input_section instead of
9870 Output_section::Simple_input_section. Adjust code for renaming
9871 of Output_section::add_simple_input_section.
9872 (Orphan_output_section::set_section_addresses): Ditto.
9873
e1e82ea4
RW
98742010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9875
9876 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
9877 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
9878
91e75c8a
RÁE
98792010-05-18 Rafael Espindola <espindola@google.com>
9880
9881 * options.cc (General_options::finalize): Handle -nostdlib.
9882 * options.h (nostdlib): New option.
9883 * script.cc (script_add_search_dir): Handle -nostdlib.
9884
da59ad79
DK
98852010-05-12 Doug Kwan <dougkwan@google.com>
9886
9887 * arm.cc (Target_arm::do_finalize_sections): Create an empty
9888 attributes section only if there no attributes section after merging.
9889 (Target_arm::merge_object_attributes): Move value of
e1df38aa 9890 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
9891 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
9892 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
9893 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
9894 and arm_attr_merge_7.stdout.
9895 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
9896 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
9897 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
9898 arm_attr_merge_7b.o): New rules.
9899 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
9900 arm_attr_merge_7
9901 * testsuite/Makefile.in: Regenerate.
9902 * testsuite/arm_attr_merge.sh: New file.
9903 * testsuite/arm_attr_merge_[67][ab].s: Same.
9904
3e01a7fd
NC
99052010-05-05 Nick Clifton <nickc@redhat.com>
9906
9907 * po/es.po: Updated Spanish translation.
9908
7ad2014a
L
99092010-04-27 H.J. Lu <hongjiu.lu@intel.com>
9910
9911 * Makefile.am (install-exec-local): Properly install gold as
9912 default cross linker.
9913 * Makefile.in: Regenerated.
9914
4fda8867
NC
99152010-04-27 H.J. Lu <hongjiu.lu@intel.com>
9916 Nick Clifton <nickc@redhat.com>
9917
9918 * configure.ac (install_as_default): Define and set to false
9919 unless --enable-gold or --enable-gold=both/gold has been
9920 specified.
9921 * configure: Regenerate.
9922
9923 * Makefile.am (install-exec-local): Install the executable as
9924 'ld.gold'. If install_as_default is true then also install it as
9925 'ld'.
9926 * Makefile.in: Regenerated.
9927
bd288ea2
ILT
99282010-04-24 Ian Lance Taylor <iant@google.com>
9929
9930 * layout.cc (Layout::layout_reloc): In relocatable link don't
9931 combine reloc sections for grouped sections.
9932
ef38fd8a
ST
99332010-04-23 Sriraman Tallam <tmsriram@google.com>
9934
9935 * gc.h (gc_process_relocs): Pass information on relocs pointing to
9936 sections that are not ordinary to icf.
9937 * icf.cc (get_section_contents): Handle relocation pointing to section
9938 with no object or shndx information.
9939 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
9940 * testsuite/Makefile.in: Regenerate.
9941 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
9942 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
9943
f6973bdc
ILT
99442010-04-22 Ian Lance Taylor <iant@google.com>
9945
9946 * expression.cc (Expression::Expression_eval_info): Add
9947 result_alignment_pointer field.
9948 (Expression::eval_with_dot): Add result_alignment_pointer
9949 parameter. Change all callers.
9950 (Expression::eval_maybe_dot): Likewise.
9951 (class Binary_expression): Add alignment_pointer parameter to
9952 left_value and right_value. Change all callers.
9953 (BINARY_EXPRESSION): Set result alignment.
9954 (class Trinary_expression): Add alignment_pointer parameter to
9955 arg2_value and arg3_value. Change all callers.
9956 (Trinary_cond::value): Set result alignment.
9957 (Max_expression::value, Min_expression::value): Likewise.
9958 (Align_expression::value): Likewise.
9959 * script-sections.cc (class Sections_element): Add dot_alignment
9960 parameter to set_section_addresses virtual function. Update
9961 instantiations.
9962 (class Output_section_element): Likewise.
9963 (Script_sections::create_segments): Add dot_alignment parameter.
9964 Change all callers.
9965 (Script_sections::create_segments_from_phdrs_clause): Likewise.
9966 (Script_sections::set_phdrs_clause_addresses): Likewise.
9967 * script-sections.h: Update declarations.
9968 * script.h: Update declarations.
9969 * output.h (Output_segment::set_minimum_p_align): Don't decrease
9970 min_p_align.
9971 * testsuite/script_test_3.t: Set large alignment.
9972 * testsuite/script_test_3.sh: Make sure that at least one LOAD
9973 segment has expected alignment.
9974
9c9c98a5
NC
99752010-04-22 Nick Clifton <nickc@redhat.com>
9976
9977 * po/gold.pot: Updated by the Translation project.
9978 * po/vi.po: Updated Vietnamese translation.
9979
2253bfba
L
99802010-04-22 H.J. Lu <hongjiu.lu@intel.com>
9981
9982 * testsuite/Makefile.am (check_PROGRAMS): Add
9983 icf_virtual_function_folding_test.
9984 * testsuite/Makefile.in: Regenerated.
9985
85fdf906
AH
99862010-04-15 Andrew Haley <aph@redhat.com>
9987
9988 * options.h (merge_exidx_entries): New option.
9989 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
9990 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
9991 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
9992 (Target_arm::merge_exidx_entries): New function.
9993 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
9994 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
9995 to Arm_exidx_fixup constructor.
9996 Add new arg, merge_exidx_entries.
9997 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
9998 Arm_output_section::fix_exidx_coverage.
9999
ce97fa81
ST
100002010-04-18 Sriraman Tallam <tmsriram@google.com>
10001
10002 * icf.cc (get_section_contents): Check for preemptible functions.
10003 Ignore addend when appropriate.
10004 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
10005 section folded.
10006 (add_from_relobj): Check for section folded.
10007 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
10008 * symtab.h (should_add_dynsym_entry): Add new parameter.
10009 * target-reloc.h (scan_relocs): Check for section folded.
10010 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
10011 Check reloc types for function pointers in shared objects.
10012 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
10013 case.
10014 (icf_preemptible_functions_test): New test case.
10015 (icf_string_merge_test): New test case.
10016 * testsuite.Makefile.in: Regenerate.
10017 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
10018 bar_glob. Refactor code.
10019 * testsuite/icf_preemptible_functions_test.cc: New file.
10020 * testsuite/icf_preemptible_functions_test.sh: New file.
10021 * testsuite/icf_string_merge_test.cc: New file.
10022 * testsuite/icf_string_merge_test.sh: New file.
10023 * testsuite/icf_virtual_function_folding_test.cc: New file.
10024 * testsuite/icf_virtual_function_folding_test.sh: New file.
10025
04ceb17c
DK
100262010-04-14 Doug Kwan <dougkwan@google.com>
10027
10028 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
10029 for local symbol recounting if we remove a section due to ICF.
10030 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
10031 there are no regular objects in input.
10032
153e7da4
DK
100332010-04-13 Doug Kwan <dougkwan@google.com>
10034
10035 * arm.cc (Arm_input_section::set_final_data_size): Compute
10036 accurate final data size instead of using current data size.
10037
4dbd9faf
DK
100382010-04-09 Doug Kwan <dougkwan@google.com>
10039
10040 * layout.cc (Layout::choose_output_section): Handle script section
10041 types.
10042 (Layout::make_output_section_for_script): Add section type parameter.
10043 Handle script section types.
10044 * layout.h (Layout::make_output_section_for_script): Add section
10045 type parameter.
10046 * output.cc (Output_section::Output_section): Initialize data member
10047 is_noload_.
10048 (Output_section::do_reset_address_and_file_offset): Do not set address
10049 to 0 if section is a NOLOAD section.
10050 * output.h (Output_section::is_noload): New method.
10051 (Output_section::set_is_noload): Ditto.
10052 (Output_section::is_noload_): New data member.
10053 * script-c.h (Script_section_type): New enum type.
10054 (struct Parser_output_section_header): Add new file section_type.
10055 * script-sections.cc (Sections_element::output_section_name): Add
10056 parameter for returning script section type.
10057 (Output_section_definition::output_section_name): Ditto.
10058 (Output_section_definition::section_type)P; New method.
10059 (Output_section_definiton::script_section_type_name): Ditto.
10060 (Output_section_definition::script_section_type_): New data member.
10061 (Output_section_definition::Output_section_definition): Initialize
10062 data member Output_section_definition::script_section_type_.
10063 (Output_section_definition::create_sections): Pass script section type
10064 to Layout::make_output_section_for_script.
10065 (Output_section_definition::output_section_name): Return script
10066 section type to caller.
10067 (Output_section_definition::set_section_address): Do not advance
10068 dot value and load address if section type is NOLOAD. Set address
10069 of NOLOAD sections regardless of section flags.
10070 (Output_section_definition::print): Print section type if it is
10071 not SCRIPT_SECTION_TYPE_NONE.
10072 (Output_section_definition::section_type): New method.
10073 (Output_section_definition::script_section_type_name): Ditto.
10074 (Script_sections::output_section_name): Add new parameter
10075 PSECTION_TYPE for returning script section type. Pass it to
10076 section elements. Handle discard sections.
10077 (Sort_output_sections::operator()): Handle NOLOAD sections.
10078 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 10079 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
10080 returning script section type.
10081 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
10082 INFO and NOLOAD.
10083 * yyscript.y (union): Add new field SECTION_TYPE.
10084 (COPY, DSECT, INFO, NOLOAD): New tokens.
10085 (opt_address_and_section_type): Change type to output_section_header.
10086 (section_type): New non-terminal
10087 (section_header): Handle section type.
2253bfba 10088 (opt_address_and_section_type): Return section type value.
4dbd9faf 10089
721ea635
L
100902010-04-09 H.J. Lu <hongjiu.lu@intel.com>
10091
10092 * testsuite/plugin_common_test_1.c (foo): Add prototype.
10093 * testsuite/plugin_common_test_2.c (foo): Likewise.
10094
6bf924b0
DK
100952010-04-08 Doug Kwan <dougkwan@google.com>
10096
10097 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
10098 Output_merge_data.
10099 * output.cc (Output_section::add_merge_input_section): Simplify
10100 code and return status of Output_merge_base::add_input_section.
e1df38aa 10101 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
10102 returns true.
10103
24af6f92
DK
101042010-04-07 Doug Kwan <dougkwan@google.com>
10105
10106 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
10107 if section is marked as containing instructions but has no mapping
10108 symbols.
10109 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
10110 correct section index.
10111 (Arm_relobj::find_linked_text_section): Ditto.
10112
00698fc5
CC
101132010-04-07 Cary Coutant <ccoutant@google.com>
10114
10115 * archive.cc (include_member): Destroy Read_symbols_data object before
10116 releasing file.
10117 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
10118 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
10119 (Read_symbols_data::~Read_symbols_data) New destructor.
10120 (Section_relocs::Section_relocs) New constructor.
10121 (Section_relocs::~Section_relocs) New destructor.
10122 (Read_relocs_data::Read_relocs_data) New constructor.
10123 (Read_relocs_data::~Read_relocs_data) New destructor.
10124 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
10125 pointers to NULL after deleting.
10126
7296d933
DK
101272010-04-07 Doug Kwan <dougkwan@google.com>
10128
10129 * arm.cc: Replace "endianity" with "endianness" in comments.
10130 (Arm_exidx_cantunwind): Ditto.
10131 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
10132 (Arm_relobj::merge_flags_and_attributes): New method.
10133 (Arm_relobj::merge_flags_and_attributes_): New data member.
10134 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
10135 (Arm_relobj::scan_sections_for_stubs): Ditto.
10136 (Arm_relobj::do_read_symbols): Check to see if we really want to
10137 merge processor-specific flags and attributes. Exit early if
10138 an object is empty except for section names and the undefined symbol.
10139 (Target_arm::do_finalize_sections): Move check for ELF format to
10140 Arm_relobj::do_read_symbols. Merge processor specific flags and
10141 attributes from a regular object only when we have determined that
10142 it is aapropriate. Do not create an .ARM.attributes section in
10143 output if there is no regular input object.
10144 (Target_arm::merge_processor_specific_flags): Check
10145 --warn-mismatch before printing any error.
10146 (Target_arm::merge_object_attributes): Ditto.
10147 * gold.cc (queue_middle_tasks): Handle the case in which there is
10148 no regular object in input.
10149 * options.cc (General_options::parse_EB): New method.
10150 (General_options::parse_EL): Same.
10151 (General_options::General_options): Initialize endianness_.
10152 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
10153 New options.
10154 (General_options::Endianness): New enum.
10155 (General_options::endianness): New method.
10156 (General_options::endianness_): New data member.
10157 * parameters.cc (Parameters::set_options): Check target endianness.
10158 (Parameters::set_target_once): Ditto.
10159 (Parameters::check_target_endianness): New method.
10160 (parameters_force_valid_target): If either -EL or -EB is specified,
10161 use it to define endianness of default target.
10162 * parameters.h (Parameters::check_target_endianness): New method
10163 declaration.
10164 * target.h (class Target): Change "endianity" to "endianness"
10165 in comments.
10166
efc8d4f2
RW
101672010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10168
10169 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
10170 * configure: Regenerate.
10171 * Makefile.in: Regenerate.
10172 * testsuite/Makefile.in: Regenerate.
10173
be234d88
CC
101742010-04-06 Cary Coutant <ccoutant@google.com>
10175
10176 gcc PR lto/42757
10177 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
10178 prevailing definitions of common symbols.
10179 * testsuite/plugin_test_6.sh: New test case.
10180 * testsuite/plugin_common_test_1.c: New test case.
10181 * testsuite/plugin_common_test_2.c: New test case.
10182 * testsuite/Makefile.am (plugin_test_6): New test case.
10183 * testsuite/Makefile.in: Regenerate.
10184
bd32c6bd
NC
101852010-04-06 Nick Clifton <nickc@redhat.com>
10186
10187 * po/vi.po: New Vietnamese translation.
10188
323c532f
DK
101892010-03-30 Doug Kwan <dougkwan@google.com>
10190
10191 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
10192
4fcd97eb
DK
101932010-03-25 Doug Kwan <dougkwan@google.com>
10194
10195 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
10196 to avoid a conversion warning on a 32-bit host.
10197
4ebf39db
ILT
101982010-03-24 Ian Lance Taylor <iant@google.com>
10199
10200 * testsuite/script_test_3.t: Add a TLS segment.
10201 * testsuite/Makefile.am (check_PROGRAMS): Add
10202 tls_phdrs_script_test.
10203 (tls_phdrs_script_test_SOURCES): Define.
10204 (tls_phdrs_script_test_DEPENDENCIES): Define.
10205 (tls_phdrs_script_test_LDFLAGS): Define.
10206 (tls_phdrs_script_test_LDADD): Define.
10207 * testsuite/Makefile.in: Rebuild.
10208
4a599bdd
CC
102092010-03-23 Cary Coutant <ccoutant@google.com>
10210
10211 * fileread.cc (find_or_make_view): Fix comment.
10212
6c93b22c
ILT
102132010-03-23 Ian Lance Taylor <iant@google.com>
10214
10215 * script-sections.cc (class Orphan_section_placement): Define
10216 PLACE_TLS and PLACE_TLS_BSS.
10217 (Orphan_section_placement::Orphan_section_placement): Initialize
10218 new places.
10219 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
10220 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
10221 (tls_script_test_SOURCES): Define.
10222 (tls_script_test_DEPENDENCIES): Define.
10223 (tls_script_test_LDFLAGS): Define.
10224 (tls_script_test_LDADD): Define.
10225 * testsuite/Makefile.in: Rebuild.
10226
a2c7281b
DK
102272010-03-22 Doug Kwan <dougkwan@google.com>
10228
10229 * arm.cc (Arm_relocate_functions::abs8,
10230 Arm_relocate_functions::abs16): Use correct check for overflow
10231 specified in the ARM ELF specs.
10232 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
10233 target of a BLX instruction specially.
10234 (Reloc_stub::stub_type_for_reloc): Ditto.
10235 (Relocate::relocate): Use symbolic names instead of numeric relocation
10236 codes to report error.
10237 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
10238 workaround.
10239 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
10240 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
10241 thumb2_blx_out_of_range.stdout
10242 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
10243 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
10244 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
10245 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
10246 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
10247 thumb2_blx_in_range, thumb2_blx_in_range.o,
10248 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
10249 thumb2_blx_out_of_range.o): New rules.
2e702c99 10250 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
10251 thumb2_blx_in_range and thumb2_blx_out_of_range.
10252 * testsuite/Makefile.in: Regenerate.
10253 * arm_branch_in_range.sh: Add tests for THUMB BLX.
10254 * testsuite/thumb_blx_in_range.s: New file.
10255 * testsuite/thumb_blx_out_of_range.s: New file.
10256
b0193076
RÁE
102572010-03-22 Rafael Espindola <espindola@google.com>
10258
10259 * archive.cc (Should_include): Move to archive.h.
10260 (should_include_member): Make it a member of Archive.
10261 (Lib_group): New.
10262 (Add_lib_group_symbols): New.
10263 * archive.h: Include options.h.
10264 (Archive_member): Moved from Archive.
10265 (Should_include): Moved from archive.cc.
10266 (Lib_group): New.
10267 (Add_lib_group_symbols): New.
10268 * dynobj.cc (do_should_include_member): New.
10269 * dynobj.h (do_should_include_member): New.
10270 * gold.cc (queue_initial_tasks): Update call to queue.
10271 * main.cc (main): Print lib group stats.
10272 * object.cc (do_should_include_member): New.
10273 * object.h: Include archive.h.
10274 (Object::should_include_member): New.
10275 (Object::do_should_include_member): New.
10276 (Sized_relobj::do_should_include_member): New.
10277 * options.cc (General_options::parse_start_lib): New.
10278 (General_options::parse_end_lib): New.
10279 (Input_arguments::add_file): Handle lib groups.
10280 (Input_arguments::start_group): Check we are not in a lib.
10281 (Input_arguments::start_lib): New.
10282 (Input_arguments::end_lib): New.
10283 * options.h (General_options): Add start_lib and end_lib.
10284 (Input_argument::lib_): New.
10285 (Input_argument::lib): New.
10286 (Input_argument::is_lib): New.
10287 (Input_file_lib): New.
10288 (Input_arguments::in_lib_): New.
10289 (Input_arguments::in_lib): New.
10290 (Input_arguments::start_lib): New.
10291 (Input_arguments::end_lib_): New.
10292 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
10293 in unused members as preempted.
10294 (Sized_pluginobj::do_should_include_member): New.
10295 * plugin.h (Sized_pluginobj::do_should_include_member): New.
10296 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
10297 return the blocker.
10298 (Read_symbols::do_whole_lib_group): New.
10299 (Read_symbols::do_lib_group): New.
10300 (Read_symbols::do_read_symbols): Handle lib groups.
10301 (Read_symbols::get_name): Handle lib groups.
10302 * readsyms.h (Read_symbols): Add an archive member pointer.
10303 (Read_symbols::do_whole_lib_group): New.
10304 (Read_symbols::do_lib_group): New.
10305 (Read_symbols::member_): New.
10306 * script.cc (read_input_script): Update call to queue_soon.
10307
d099120c
DK
103082010-03-19 Doug Kwan <dougkwan@google.com>
10309
10310 * arm.cc (Stub_table::Stub_table): Initialize new data members
10311 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10312 (Stub_table::add_reloc_stub): Assign stub offset and update
10313 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10314 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
10315 New data members.
2e702c99 10316 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
10317 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
10318 instead of going over all reloc stubs.
2e702c99 10319 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
10320 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10321 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 10322 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
10323 Stringpool_template::offset_.
10324 * stringpool.h (Stringpool_template::set_no_zero_null): Set
10325 Stringpool_template::offset_ to zero.
10326
1aa37384
DK
103272010-03-15 Doug Kwan <dougkwan@google.com>
10328
10329 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10330 offset_.
10331 (Stringpool_template::new_key_offset): New method.
10332 (Stringpool_template::add_string): Assign offsets when adding new
10333 strings.
10334 (Stringpool_template::set_string_offsets): Do not set string offsets
10335 when not optimizing.
10336 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
10337 member size_.
2e702c99
RM
10338 (Chunked_vector::clear): Clear size_.
10339 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
10340 (Chunked_vector::size): Return size_.
10341 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 10342 (Chunked_vector::size_): New data member.
1aa37384
DK
10343 (Stringpool_template::set_no_zero_null): Assert string set is empty.
10344 (Stringpool_template::new_key_offset): New method declaration.
10345 (Stringpool_template::offset_): New data member.
10346
b672b057
RÁE
103472010-03-15 Rafael Espindola <espindola@google.com>
10348
10349 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
10350 Add_symbols' constructor.
10351 * readsyms.h (Add_symbols): Remove the input_group member.
10352
b6848d3c
ILT
103532010-03-10 Ian Lance Taylor <iant@google.com>
10354
10355 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
10356 target to ask whether a reference to a symbol requires a stack
10357 split.
10358 * target.h (Target::is_call_to_non_split): New function.
10359 (Target::do_is_call_to_non_split): Declare virtual function.
10360 * target.cc: Include "symtab.h".
10361 (Target::do_is_call_to_non_split): New function.
10362 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
10363
a2a5469e
CC
103642010-03-10 Cary Coutant <ccoutant@google.com>
10365
10366 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
10367 (File_read::open[1]): Remove initial mapping of whole_file_view_.
10368 (File_read::open[2]): Add whole_file_view_ to list of views.
10369 (File_read::make_view): Remove test of whole_file_view_.
10370 (File_read::find_or_make_view): Create whole_file_view_ if
10371 necessary.
10372 (File_read::clear_views): Replace bool parameter with enum;
10373 adjust all callers. Don't delete views with permanent data;
10374 do delete cached views and views from archives if
10375 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
10376 if clearing the corresponding view.
10377 * fileread.h (File_read::Clear_views_mode): New enum.
10378 (File_read::View::is_permanent_view): New method.
10379 (File_read::clear_views): Replace bool parameter
10380 with enum; adjust all callers.
10381 * options.h (General_options): Change keep_files_mapped option;
10382 add map_whole_files.
10383 * readsyms.cc (Add_symbols::run): Delete sd_ object before
10384 releasing the file.
10385 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
10386 the file.
10387
8861f32b
DM
103882010-03-10 David S. Miller <davem@davemloft.net>
10389
10390 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
10391
d62d0f5f
ST
103922010-03-09 Sriraman Tallam <tmsriram@google.com>
10393
10394 * icf.cc (get_section_contents): Add '@' marker after processing the
10395 merge reloc.
10396
9177756d
DK
103972010-03-08 Doug Kwan <dougkwan@google.com>
10398
10399 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
10400 due to a conversion warning.
10401 (Arm_relobj::update_output_local_symbol_count): Check for local
10402 symbol with unset output index.
10403
9e9e071b
ILT
104042010-03-05 Ian Lance Taylor <iant@google.com>
10405
10406 * options.h (class General_options): Add --spare-dynamic-tags.
10407 * output.cc (Output_data_dynamic::set_final_data_size): Implement
10408 --spare-dynamic-tags.
10409
a81ee015
ILT
104102010-03-05 Ian Lance Taylor <iant@google.com>
10411
10412 * incremental.cc: Include "libiberty.h".
10413
44ec90b9
RO
104142010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
10415
10416 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
10417 function, is_info_ member.
10418 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
10419 (Versions::Versions): Update caller.
10420 (Versions::define_base_version): Likewise.
10421 (Versions::add_def): Likewise.
10422
0897ed3b
ST
104232010-03-03 Sriraman Tallam <tmsriram@google.com>
10424
10425 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
10426 (Scan::possible_function_pointer_reloc): New function.
10427 (Scan::local_reloc_may_be_function_pointer): Change to call
10428 possible_function_pointer_reloc.
10429 (Scan::global_reloc_may_be_function_pointer): Ditto.
10430 * icf.h (Icf::check_section_for_function_pointers): Change to reject
10431 relocations in ".data.rel.ro._ZTV" section.
10432 * testsuite/icf_safe_so_test.sh: Change to pass i386.
10433 * testsuite/icf_safe_so_test.cc: Ditto.
10434 * testsuite/icf_safe_test.cc: Ditto.
10435 * testsuite/icf_safe_test.sh: Ditto.
10436
d3bbad62
ILT
104372010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10438 Ian Lance Taylor <iant@google.com>
10439
10440 * target-reloc.h (relocate_section): Check the symbol table index
10441 for -1U before setting the local symbol index.
10442 (scan_relocatable_relocs): If copying the relocation, record that
10443 the local symbol is required.
10444 * object.h (Symbol_value::is_output_symtab_index_set): New
10445 function.
10446 (Symbol_value::may_be_discarded_from_output_symtab): New
10447 function.
10448 (Symbol_value::has_output_symtab_entry): New function.
10449 (Symbol_value::needs_output_symtab_entry): Remove.
10450 (Symbol_value::output_symtab_index): Make sure the symbol index is
10451 set.
10452 (Symbol_value::set_output_symtab_index): Make sure the symbol
10453 index is not set. Make sure the new index is valid.
10454 (Symbol_value::set_must_have_output_symtab_entry): New function.
10455 (Symbol_value::has_output_dynsym_entry): New function.
10456 (Symbol_value::set_output_dynsym_index): Make sure the new index
10457 is valid.
10458 (Sized_relobj::set_must_have_output_symtab_entry): New function.
10459 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
10460 local symbol if permitted.
10461 (Sized_relobj::do_finalize_local_symbols): Call
10462 is_output_symtab_index_set rather than needs_output_symtab_entry.
10463 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
10464 rather than needs_output_symtab_entry. Call
10465 has_output_dynsym_entry rather than needs_output_dynsym_entry.
10466 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
10467 is_output_symtab_index_set rather than needs_output_symtab_entry.
10468 * testsuite/discard_locals_relocatable_test.c: New file.
10469 * testsuite/discard_locals_test.sh: Test -r.
10470 * testsuite/Makefile.am (check_DATA): Add
10471 discard_locals_relocatable_test1.syms,
10472 discard_local_relocatable_test2.syms.
10473 (MOSTLYCLEANFILES): Likewise. Also add
10474 discard_locals_relocatable_test1.lout and
10475 discard_locals_relocatable_test2.out.
10476 (discard_locals_relocatable_test1.syms): New target.
10477 (discard_locals_relocatable_test.o): New target.
10478 (discard_locals_relocatable_test1.out): New target.
10479 (discard_locals_relocatable_test2.syms): New target.
10480 (discard_locals_relocatable_test2.out): New target.
10481 (various): Add missing ../ld-new dependencies.
10482 * testsuite/Makefile.in: Rebuild.
10483
7e8ccf26
NC
104842010-03-03 Nick Clifton <nickc@redhat.com>
10485
10486 * po/fi.po: New Finnish translation.
10487
2a0ff005
DK
104882010-03-01 Doug Kwan <dougkwan@google.com>
10489
10490 * layout.cc (Layout::Layout): Force section types of .init_array*,
10491 .preinit_array* and .fini_array* sections.
10492 * output.cc (Output_section::Input_section_sort_entry::has_priority):
10493 Fix check of return value of std::string::find.().
10494 (Output_section::Input_section_sort_compare::operator()): Remove
10495 comment about .init_array.
10496 (Output_section::Input_section_sort_init_fini_compare::operator()):
10497 New method.
10498 (Output_section::sort_attached_input_sections): Handle .init_array
10499 and .fini_array specially.
10500 * output.h (Output_section::Inut_section_sort_compare): Update
10501 comment.
10502 (Output_section::Input_section_sort_init_fini_compare): New struct.
10503
c3e4ae29
DK
105042010-02-26 Doug Kwan <dougkwan@google.com>
10505
10506 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
10507 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
10508 * testsuite/debug_msg.sh: Avoid matching source line number for
10509 use of global variable undef_int.
10510
2fd9ae7a
DK
105112010-02-26 Doug Kwan <dougkwan@google.com>
10512
10513 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
10514 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
10515 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
10516 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
10517 * options.cc (General_options::General_options): Initialize member
10518 fix_v4bx_.
10519 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
10520 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
10521 and rm_no_fix_v4bx.stdout
10522 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
10523 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
10524 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
10525 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
10526 and arm_no_fix_v4bx.
10527 * Makefile.in: Regenerate.
10528 * testsuite/arm_fix_v4bx.s: New file.
10529 * testsuite/arm_fix_v4bx.sh: Ditto.
10530
67ec7d0b
DK
105312010-02-24 Doug Kwan <dougkwan@google.com>
10532
10533 * arm.cc (Target_arm::got_section): Make the .got section the first
10534 non RELRO section in the data segment.
10535 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
10536 suffixes of section names.
10537
10165461
DK
105382010-02-24 Doug Kwan <dougkwan@google.com>
10539
10540 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
10541 flags and attributes merging if an input file is a binary file.
10542 * fileread.cc (Input_file::open): Record format of original file.
10543 * fileread.h (Input_file::Format): New enum type.
2e702c99 10544 (Input_file::Input_file): Initialize data member format_.
10165461
DK
10545 (Input_file::format): New method definition.
10546 (Input_file::format_):: New data member.
10547
4a54abbb
DK
105482010-02-24 Doug Kwan <dougkwan@google.com>
10549
10550 * arm.cc (Arm_output_data_got): New class.
10551 (ARM_TCB_SIZE): New constant
10552 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
10553 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
10554 If user uses a script with a SECTIONS clause, issue only a warning
10555 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 10556 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
10557 garbage collection.
10558 (Target_arm::got_mode_index_entry): Handle static linking.
10559 (Target_arm::Scan::local): Ditto.
10560 (Target_arm::Scan::global): Ditto.
10561 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
10562 all incorrectly implemented relocations.
e1df38aa 10563 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
10564 Arm_output_section::fix_exidx_coverage.
10565 * layout.cc (Layout::section_name_mapping): Remove trailing dots
10566 from ".ARM.exidx." and ".ARM.extab.".
10567
ca419a6f
ILT
105682010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10569
10570 * arm.cc (Target_arm::do_finalize_sections): Create attribute
10571 section if it does not already exist.
10572 * attributes.cc (Attributes_section_data::Attributes_section_data):
10573 Don't crash if size is zero.
10574
135b9c78
ILT
105752010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10576 Ian Lance Taylor <iant@google.com>
10577
10578 * gold.cc (queue_middle_tasks): If no input files were opened,
10579 exit.
10580 * workqueue.h (Task_function::Task_function): Assert that there is
10581 a blocker.
10582
bb0bfe4f
DK
105832010-02-22 Doug Kwan <dougkwan@google.com>
10584
10585 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
10586 * icf.cc (get_section_contents): Cast snprintf arguments to long long
10587 types to avoid warnings due to different uint64_t implementations
10588 on different hosts.
10589
2a2b6d42
DK
105902010-02-21 Doug Kwan <dougkwan@google.com>
10591
10592 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
10593 handling of the maximum backward branch offset.
2e702c99 10594 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
10595 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
10596 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 10597 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
10598 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
10599 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
10600 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
10601 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
10602 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
10603 thumb_bl_out_of_range thumb_bl_out_of_range.o,
10604 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
10605 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
10606 thumb2_bl_out_of_range.o): New rules.
10607 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
10608 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
10609 thumb2_bl_out_of_range
10610 * testsuite/Makefile.in: Regenerate.
10611 * testsuite/arm_bl_in_range.s: New file.
10612 * testsuite/arm_bl_out_of_range.s: Ditto.
10613 * testsuite/arm_branch_in_range.sh: Ditto.
10614 * testsuite/arm_branch_range.t: Ditto.
10615 * testsuite/thumb2_branch_range.t: Ditto.
10616 * testsuite/thumb_bl_in_range.s: Ditto.
10617 * testsuite/thumb_bl_out_of_range.s: Ditto.
10618 * testsuite/thumb_branch_range.t: Ditto.
10619
b487ad64
ST
106202010-02-20 Sriraman Tallam <tmsriram@google.com>
10621
10622 * gc.h (gc_process_relocs): Change vectors to point to the new list.
10623 Add reloc offset information.
10624 * icf.cc (get_section_contents): Change iterators to point to the new
10625 vectors. Add reloc offset information to the contents.
10626 * icf.h (Icf::Sections_reachable_info): New typedef.
10627 (Icf::Sections_reachable_list): New typedef.
10628 (Icf::Offset_info): New typedef.
10629 (Icf::Reloc_info): New struct typedef.
10630 (Icf::Reloc_info_list): New typedef.
10631 (Icf::symbol_reloc_list): Delete method.
10632 (Icf::addend_reloc_list): Delete method.
10633 (Icf::section_reloc_list): Delete method.
10634 (Icf::reloc_info_list): New method.
10635 (Icf::reloc_info_list_): New member.
10636
f96accdf
DK
106372010-02-19 Doug Kwan <dougkwan@google.com>
10638
10639 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
10640 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
10641 * arm.cc (Arm_relocation_functions): New forward declaration.
10642 (Target_arm::Target_arm): Initialize new data members
10643 got_mod_index_offset_ and tls_base_symbol_defined_.
10644 (Target_arm::Relocate::relocate_tls): New method.
10645 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
10646 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
10647 New methods.
2e702c99 10648 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
10649 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
10650 (Target_arm::got_mod_index_offset_,
10651 Target_arm::tls_base_symbol_defined_): New data members.
10652 (Target_arm::Scan::local, Target::Scan::global,
10653 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
10654 relocations.
10655
c8761b9a
DK
106562010-02-18 Doug Kwan <dougkwan@google.com>
10657
10658 * arm.cc (Arm_relobj::find_linked_text_section): New method.
10659 (Arm_relobj::make_exidx_input_section): Pass section index of linked
10660 text section as a parameter becuase some broken tools may not set
10661 the link in section header.
10662 (Target_arm::has_got_section): New method.
10663 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
10664 without any mapping symbol as data only. Remove warning.
10665 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
10666 link in its section header, try to discover the link by inspecting the
10667 REL31 relocation at the beginning of the section.
10668 (Target_arm::Scan::check_non_pic): Report name of offending relocation
10669 in error message.
10670 (Target_arm::Scan::global): Treat any reference to the symbol
10671 _GLOBAL_OFFSET_TABLE_ as a GOT access.
10672
21bb3914
ST
106732010-02-12 Sriraman Tallam <tmsriram@google.com>
10674
10675 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
10676 (Scan::global_reloc_may_be_function_pointer): New function.
10677 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10678 (Scan::global_reloc_may_be_function_pointer): New function.
10679 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10680 (Scan::global_reloc_may_be_function_pointer): New function.
10681 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
10682 (Scan::global_reloc_may_be_function_pointer): New function.
10683 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
10684 (Scan::global_reloc_may_be_function_pointer): New function.
10685 (Scan::possible_function_pointer_reloc): New function.
10686 (Target_x86_64::can_check_for_function_pointers): New function.
10687 * gc.h (gc_process_relocs): Scan relocation types to determine if
10688 function pointers were taken for targets that support it.
10689 * icf.cc (Icf::find_identical_sections): Include functions for
10690 folding in safe ICF whose pointer is not taken.
10691 * icf.h (Secn_fptr_taken_set): New typedef.
10692 (fptr_section_id_): New member.
10693 (section_has_function_pointers): New function.
10694 (set_section_has_function_pointers): New function.
10695 (check_section_for_function_pointers): New function.
10696 * options.h: Fix comment for safe ICF option.
10697 * target.h (can_check_for_function_pointers): New function.
10698 * testsuite/Makefile.am: Add icf_safe_so_test test case.
10699 Modify icf_safe_test for X86-64.
10700 * testsuite/Makefile.in: Regenerate.
10701 * testsuite/icf_safe_so_test.cc: New file.
10702 * testsuite/icf_safe_so_test.sh: New file.
10703 * testsuite/icf_safe_test.cc (kept_func_3): New function.
10704 (main): Change to take pointer to function kept_func_3.
10705 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
10706 folding is done correctly for X86-64.
10707
0da6fa6c
DM
107082010-02-12 David S. Miller <davem@davemloft.net>
10709
10710 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
10711 is_symbolless parameter.
10712 (Output_reloc<SHT_REL>::is_symbolless): New.
10713 (Output_reloc<SHT_REL>::is_symbolless_): New.
10714 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
10715 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
10716 (Output_reloc<SHT_RELA>::is_symbolless): New.
10717 (Output_data_reloc::add_global): Handle is_symbolless.
10718 (Output_data_reloc::add_global_relative): Likewise.
10719 (Output_data_reloc::add_local): Likewise.
10720 (Output_data_reloc::add_local_relative): Likewise.
10721 (Output_data_reloc::add_symbolless_global_addend): New.
10722 (Output_data_reloc::add_symbolless_local_addend): New.
10723 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
10724 is_symbolless.
10725 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
10726 instead of ->is_relative_
10727 (Output_reloc::write): Likewise.
10728 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
10729 (Output_reloc::write_rel): Simplify.
10730
10731 * sparc.cc (Target_sparc::Scan::local): Use
10732 ->add_symbolless_local_addend as needed.
10733 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
10734 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
10735 based upon relocation offset.
10736
e4782e83
DK
107372010-02-11 Doug Kwan <dougkwan@google.com>
10738
10739 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
10740 (Target_arm::Scan::global): Ditto. Also remove a comment before the
10741 beginning of function.
10742 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
10743 and MOVT_ABS relocations. Those are non issued in scanning. Fix
10744 parameter is_32bit in calls to should_apply_static_reloc.
10745 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
10746 (check_DATA): Add arm_abs_global.stdout.
10747 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
10748 arm_abs_global.stdout): New rules.
10749 (MOSTLLYCLEANFILES): Add arm_abs_global
10750 * Makefile.in: Regenerate.
10751 * testsuite/arm_abs_global.s: New file.
10752 * testsuite/arm_abs_global.sh: Ditto.
10753 * testsuite/arm_abs_lib.s: Ditto.
10754
93ceb764
ILT
107552010-02-11 Ian Lance Taylor <iant@google.com>
10756
10757 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
10758 Read_relocs task.
10759 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
10760 Allocate_commons_task first.
10761 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
10762 task, rather than symtab_lock_.
10763 (Gc_process_relocs::~Gc_process_relocs): New function.
10764 (Gc_process_relocs::is_runnable): Check this_blocker_.
10765 (Gc_process_relocs::locks): Use next_blocker_ rather than
10766 blocker_.
10767 (Scan_relocs::~Scan_relocs): New function.
10768 (Scan_relocs::is_runnable): Check this_blocker_ rather than
10769 symtab_lock_.
10770 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
10771 next_blocker_.
10772 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
10773 fields. Add this_blocker_ and next_blocker_ fields. Adjust
10774 constructor accordingly.
10775 (class Gc_process_relocs): Likewise.
10776 (class Scan_relocs): Likewise.
10777 * common.h (class Allocate_commons_task): Remove symtab_lock_
10778 field, and corresponding constructor parameter.
10779 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
10780 symtab_lock_.
10781 (Allocate_commons_task::locks): Likewise.
10782
114dfbe1
ILT
107832010-02-11 Ian Lance Taylor <iant@google.com>
10784
10785 * gold-threads.h (class Once): Define.
10786 (class Initialize_lock): Rewrite as child of Once.
10787 * gold-threads.cc (class Once_initialize): Define.
10788 (once_pointer_control): New static variable.
10789 (once_pointer, once_arg): New static variables.
10790 (c_run_once): New static function.
10791 (Once::Once, Once::run_once, Once::internal_run): New functions.
10792 (class Initialize_lock_once): Remove.
10793 (initialize_lock_control): Remove.
10794 (initialize_lock_pointer): Remove.
10795 (initialize_lock_once): Remove.
10796 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
10797 (Initialize_lock::initialize): Rewrite.
10798 (Initialize_lock::do_run_once): New function.
10799 * archive.cc (Archive::interpret_header): Only clear name if it is
10800 not already empty.
10801 * fileread.cc: Include "gold-threads.h"
10802 (file_counts_lock): New static variable.
10803 (file_counts_initialize_lock): Likewise.
10804 (File_read::release): Only increment counts when using --stats.
10805 Use a lock around the increment.
10806 * parameters.cc (class Set_parameters_target_once): Define.
10807 (set_parameters_target_once): New static variable.
10808 (Parameters::Parameters): Move here from parameters.h.
10809 (Parameters::set_target): Rewrite.
10810 (Parameters::set_target_once): New function.
10811 (Parameters::clear_target): Move here and rewrite.
10812 * parameters.h (class Parameters): Update declarations. Add
10813 set_parameters_target_once_ field.
10814 (Parameters::Parameters): Move to parameters.cc.
10815 (Parameters::clear_target): Likewise.
10816 * readsyms.cc (Read_symbols::do_group): Create a Start_group
10817 task.
10818 (Start_group::~Start_group): New function.
10819 (Start_group::is_runnable): New function.
10820 (Start_group::locks, Start_group::run): New functions.
10821 (Finish_group::run): Change saw_undefined to size_t.
10822 * readsyms.h (class Start_group): Define.
10823 (class Finish_group): Change saw_undefined_ field to size_t.
10824 (Finish_group::Finish_group): Remove saw_undefined and
10825 this_blocker parameters. Change all callers.
10826 (Finish_group::set_saw_undefined): New function.
10827 (Finish_group::set_blocker): New function.
10828 * symtab.h (class Symbol_table): Change saw_undefined to return
10829 size_t. Change saw_undefined_ field to size_t.
10830 * target-select.cc (Set_target_once::do_run_once): New function.
10831 (Target_selector::Target_selector): Initialize set_target_once_
10832 field. Don't initialize lock_ and initialize_lock_ fields.
10833 (Target_selector::instantiate_target): Rewrite.
10834 (Target_selector::set_target): New function.
10835 * target-select.h (class Set_target_once): Define.
10836 (class Target_selector): Update declarations. Make
10837 Set_target_once a friend. Remove lock_ and initialize_lock_
10838 fields. Add set_target_once_ field.
10839
fa17a3f4
ILT
108402010-02-10 Ian Lance Taylor <iant@google.com>
10841
10842 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
10843 queueing any tasks.
10844 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
10845 (queue_middle_tasks): Add all blockers before queueing any tasks.
10846 (queue_final_tasks): Likewise.
10847 * token.h (Task_token::add_blockers): New function.
10848 * object.h (Input_objects::number_of_relobjs): New function.
10849
c7177d31
ILT
108502010-02-10 Ian Lance Taylor <iant@google.com>
10851
5de0e392
ILT
10852 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
10853 shared, not if not position independent.
10854 * x86_64.cc (Relocate::relocate_tls): Likewise.
10855 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
10856 (tls_pie_pic_test): New target.
10857 * testsuite/Makefile.in: Rebuild.
10858
c7177d31
ILT
10859 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
10860 (tls_test_main_pie.o, tls_test_pie.o): New targets.
10861 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
10862 * testsuite/Makefile.in: Rebuild.
10863
684b268a
DM
108642010-02-09 David S. Miller <davem@davemloft.net>
10865
10866 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
10867 R_SPARC_RELATIVE using ->add_local_relative().
10868 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
10869
612a8d3d
DM
10870 * output.h (Output_data_dynamic::add_section_size): New method
10871 that takes two Output_data objects.
10872 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
10873 entry param. Handle it in initializers.
10874 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
10875 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
10876 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
10877 arg.
10878 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
10879 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
10880 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
10881 for dynrel_includes_plt.
10882 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10883 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10884 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
10885 before .rela.plt
10886 (Target_sparc::do_finalize_sections): Update to pass true for
10887 dynrel_includes_plt.
10888 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
10889 output before .rela.plt
10890 (Target_powerpc::do_finalize_sections): Update to pass true for
10891 dynrel_includes_plt when 32-bit.
10892
cb1be87e
DK
108932010-02-08 Doug Kwan <dougkwan@google.com>
10894
10895 * arm.cc (Arm_relobj::simple_input_section_output_address): New
10896 method.
10897 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
10898 Arm_relobj::scan_section_for_cortex_a8_stubs,
10899 Arm_relobj::do_relocation_section): Instead of calling
10900 Output_section::output_address, use faster
10901 Arm_relobj::simple_input_section_output_address.
10902
705b5121
DM
109032010-02-08 David S. Miller <davem@davemloft.net>
10904
10905 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
10906 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
10907 relocation helper function.
10908
024c4466
DM
10909 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
10910 just like R_SPARC_GOT{10,13,22}.
10911 (Target_sparc::Scan::local): Likewise.
10912 (Target_sparc::Relocate:relocate): Likewise.
10913
9109c078
ILT
109142010-02-06 Ian Lance Taylor <iant@google.com>
10915
10916 * configure.ac: Rewrite targetobjs duplicate removal code to use
10917 only shell constructs.
10918 * configure: Rebuild.
10919
cf846138
DK
109202010-02-05 Doug Kwan <dougkwan@google.com>
10921
10922 PR 11247
10923 * arm.cc (Arm_relobj::section_is_scannable): New method.
10924 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
10925 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
10926
6cfaf60b
DK
109272010-02-04 Doug Kwan <dougkwan@google.com>
10928
10929 PR 11247
10930 * arm-reloc-property.cc (cstdio): Include.
10931 * configure.ac (targetobjs): Remove duplicates.
10932 * configure: Regenerate.
10933 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
10934 big and little endian version for a given address size.
10935
5c57f1be
DK
109362010-02-03 Doug Kwan <dougkwan@google.com>
10937
10938 * arm-reloc-property.cc
10939 (Arm_reloc_property_table::reloc_name_in_error_message): New method
10940 definition.
10941 * arm-reloc-property.h
10942 (Arm_reloc_property_table::get_implemented_static_reloc_property):
10943 New method definition.
10944 (Arm_reloc_property_table::reloc_name_in_error_message): New method
10945 declaration.
10946 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
10947 overflow to N.
10948 (GOT_PREL): Change implemented to Y.
10949 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
10950 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
10951 (Arm_relocate_functions::movw_abs_nc): Remove method.
10952 (Arm_relocate_functions::movt_abs): Ditto.
10953 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
10954 (Arm_relocate_functions::thm_movt_abs): Ditto.
10955 (Arm_relocate_functions::movw_rel_nc): Ditto.
10956 (Arm_relocate_functions::movw_rel): Ditto.
10957 (Arm_relocate_functions::movt_rel): Ditto.
10958 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
10959 (Arm_relocate_functions:thm_movw_rel): Ditto.
10960 (Arm_relocate_functions:thm_movt_rel): Ditto.
10961 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
10962 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
10963 New method definitions.
10964 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
10965 (Arm_relocation_functions::arm_grp_ldr): Ditto.
10966 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
10967 (Arm_relocation_functions::arm_grp_ldc): Ditto.
10968 (Target_arm::Relocate::relocate): Check for non-static or
10969 unimplemented relocation code and exit early. Change calls to
10970 Target_arm::reloc_uses_thumb_bit and
10971 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
10972 instead. Refactor code to handle similar relocations to increase
10973 code sharing. Remove check for unsupported relocation code in switch
10974 statement.
10975 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
10976 relocation property table to find out size. Change error message to
10977 print out the name of a relocation code instead of the numeric value.
10978 (Target_arm::scan_reloc_for_stub): Use relocation property table
10979 instead of calling Target_arm::reloc_uses_thumb_bit().
10980
218c5831
DK
109812010-02-02 Doug Kwan <dougkwan@google.com>
10982
10983 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
10984 types of relaxed input section.
10985
0d31c79d
DK
109862010-02-02 Doug Kwan <dougkwan@google.com>
10987
10988 * Makefile.am (HFILES): Add arm-reloc-property.h.
10989 (DEFFILES): New.
2e702c99
RM
10990 (TARGETSOURCES): Add arm-reloc-property.cc
10991 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
10992 (libgold_a_SOURCES): $(DEFFILES)
10993 * Makefile.in: Regenerate.
10994 * arm-reloc-property.cc: New file.
10995 * arm-reloc-property.h: New file.
10996 * arm-reloc.def: New file.
10997 * arm.cc: Update comments.
10998 (arm-reloc-property.h): New included header.
10999 (arm_reloc_property_table): New global variable.
11000 (Target_arm::do_select_as_default_target): New method definition.
11001 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
11002 arm-reloc-property to targ_extra_obj.
11003 * parameters.cc (set_parameters_target): Call
11004 Target::select_as_default_target().
11005 * target.h (Target::select_as_default_target): New method definition.
11006 (Target::do_select_as_default_target): Same.
11007
546c7457
DK
110082010-02-01 Doug Kwan <dougkwan@google.com>
11009
11010 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
11011 first_output_text_section_.
11012 (Arm_exidx_fixup::first_output_text_section): New method definition.
11013 (Arm_exidx_fixup::first_output_text_section_): New data member.
11014 (Arm_exidx_fixup::process_exidx_section): Record the first text
11015 output section seen.
11016 (Arm_output_section::fix_exidx_coverage): Set correct linked section
11017 and entsize in output section header.
11018
11b861d5
DK
110192010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11020
11021 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
11022 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
11023 (Arm_relocate_functions::thm_alu11): New Method.
11024 (Arm_relocate_functions::thm_pc8): New Method.
11025 (Arm_relocate_functions::thm_pc12): New Method.
11026 (Target_arm::Scan::local): Handle the relocations.
11027 (Target_arm::Scan::global): Likewise.
11028 (Target_arm::Relocate::relocate): Likewise.
11029 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11030
c9a2c125
DK
110312010-01-29 Doug Kwan <dougkwan@google.com>
11032
11033 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
11034 of relocation types as ld.
11035
1521477a
DK
110362010-01-29 Doug Kwan <dougkwan@google.com>
11037
11038 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
11039 to public.
11040 (Arm_relocate_functions::thumb_branch_common): Ditto.
11041 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
11042 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
11043 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
11044 Arm_relocate_functions::jump24): Remove.
11045 (Target_arm::Relocate::relocate): Adjust code to call
11046 Arm_relocation_functions::arm_branch_common and
11047 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 11048 wrappers. Merge switch-cases together to reduce source code size.
1521477a 11049
e7eca48c
DK
110502010-01-29 Doug Kwan <dougkwan@google.com>
11051
11052 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
11053 output_local_symbol_count_needs_update_.
11054 (Arm_relobj::output_local_symbol_count_needs_update,
11055 Arm_relobj::set_output_local_symbol_count_needs_update,
11056 Arm_relobj::update_output_local_symbol_count): New methods.
11057 (Arm_relobj::output_local_symbol_count_needs_update_): New data
11058 member.
11059 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
11060 of pointed function as in a R_ARM_PREL31 relocation.
11061 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
11062 for output local symbol count updating.
11063 (Target_arm::do_relax): Update output local symbol counts in objects
11064 if necessary.
11065 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
11066
02961d7e
ILT
110672010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11068
11069 * arm.cc: Added support for the ARM relocations:
11070 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
11071 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
11072 (Arm_relocate_functions::movw_rel_nc): Renamed (was
11073 movw_prel_nc).
11074 (Arm_relocate_functions::movw_rel): New method.
11075 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
11076 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
11077 thm_movw_prel_nc).
11078 (Arm_relocate_functions::thm_movw_rel): New method.
11079 (Arm_relocate_functions::thm_movt_rel): Renamed (was
11080 thm_movt_prel).
11081 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
11082 relocations.
11083 (Target_arm::Scan::global): Likewise.
11084 (Target_arm::Relocate::relocate): Likewise.
11085 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11086 Likewise.
11087
b10d2873
ILT
110882010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11089
11090 * arm.cc: Added support for ARM group relocations.
11091 (Target_arm::reloc_needs_sym_origin): New method.
11092 (Arm_relocate_functions::calc_grp_kn): New method.
11093 (Arm_relocate_functions::calc_grp_residual): New method.
11094 (Arm_relocate_functions::calc_grp_gn): New method.
11095 (Arm_relocate_functions::arm_grp_alu): New Method.
11096 (Arm_relocate_functions::arm_grp_ldr): New Method.
11097 (Arm_relocate_functions::arm_grp_ldrs): New Method.
11098 (Arm_relocate_functions::arm_grp_ldc): New Method.
11099 (Target_arm::Scan::local): Handle the ARM group relocations.
11100 (Target_arm::Scan::global): Likewise.
11101 (Target_arm::Relocate::relocate): Likewise.
11102 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11103 Likewise.
11104
2b328d4e
DK
111052010-01-26 Doug Kwan <dougkwan@google.com>
11106
11107 * arm.cc (set): Include.
11108 (class Arm_exidx_fixup): Change type of last_input_section_ to const
11109 pointer type.
2e702c99 11110 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
11111 (Arm_output_section::append_text_sections_to_list): New method.
11112 (Arm_output_section::fix_exidx_coverage): Ditto.
11113 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 11114 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
11115 Relobj::set_section_offset() instead of
11116 Sized_relobj::invalidate_section_offset().
2e702c99 11117 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
11118 parameter for section headers. Ignore relocation sections for
11119 unallocated sections and EXIDX sections.
11120 (Target_arm::fix_exidx_coverage): New method.
11121 (Target_arm::output_section_address_less_than): New type.
11122 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
11123 linked text section instead of the EXIDX section.
11124 (Arm_output_section::create_stub_group): Add an assertion to check
11125 that this is not an EXIDX output section.
11126 (Arm_output_section::append_text_sections_to_list): New method.
11127 (Arm_output_section::fix_exidx_coverage): Ditto.
11128 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 11129 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
11130 (Target_arm::do_relax): Fix EXIDX output section coverage in the
11131 first pass.
11132 (Target_arm::fix_exidx_coverage): New method.
11133 * object.h (Relobj::set_output_section): New method.
11134 (Sized_relobj::invalidate_section_offset): Remove method.
11135 (Sized_relobj::do_invalidate_section_offset): Remove method.
11136 (Sized_relobj::do_set_section_offset): Handle offset value -1.
11137
c7f3c371
DK
111382010-01-25 Doug Kwan <dougkwan@google.com>
11139
11140 * arm.cc (Arm_exidx_merged_section::do_output_offset):
11141 Fix warning due to signed and unsigned comparison on a 32-bit host.
11142
8923b24c
DK
111432010-01-22 Doug Kwan <dougkwan@google.com>
11144
11145 * arm.cc (Target_arm::do_relax): Record an output section for section
11146 offset adjustment it contains any stub table that has changed.
11147 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
11148 offsets in an output section if necessary.
11149 * output.cc (Output_section::Output_section): Initialize
11150 section_offsets_need_adjustments_.
11151 (Output_section::add_input_section_for_script): Renamed to
11152 Output_section::add_simple_input_section.
11153 (Output_section::save_states): Add a comment.
11154 (Output_section::discard_states): New method defintion.
11155 (Output_section::adjust_section_offsets): Same.
11156 * output.h (Output_section::add_input_section_for_script): Renamed to
11157 Output_section::add_simple_input_section.
11158 (Output_section::discard_states): New method declaration.
11159 (Output_section::adjust_section_offsets): Same.
11160 (Output_section::section_offsets_need_adjustment,
11161 Output_section::set_section_offsets_need_adjustment): New method
11162 definitions.
11163 (Output_section::section_offsets_need_adjustment_): New data member.
11164 * script-sections.cc
11165 (Output_section_element_input::set_section_address): Adjust code for
11166 renaming of Output_section::add_input_section_for_script.
11167 (Orphan_output_section::set_section_address): Same.
11168
9b2fd367
DK
111692010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11170
11171 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
11172 Fix_v4bx enum values .
11173 * gold/options.h (General_options): New option definitions.
11174 (General_options::fix_v4bx): New method.
11175 (General_options::Fix_v4bx): New enum.
11176 * gold/options.cc (General_options::parse_fix_v4bx): New method.
11177 (General_options::parse_fix_v4bx_interworking): New method.
11178
80d0d023
DK
111792010-01-22 Doug Kwan <dougkwan@google.com>
11180
11181 * arm.cc (Arm_exidx_fixup): New class.
11182
af2cdeae
DK
111832010-01-21 Doug Kwan <dougkwan@google.com>
11184
11185 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
11186 classes.
11187 (Arm_exidx_section_offset_map): New type.
11188
993d07c1
DK
111892010-01-21 Doug Kwan <dougkwan@google.com>
11190
11191 * arm.cc (Arm_exidx_input_section): New class.
11192 (Arm_relobj::exidx_input_section_by_link,
11193 Arm_relobj::exidx_input_section_by_shndx,
11194 Arm_relobj::make_exidx_input_section): New methods.
11195 (read_arm_attributes_section): Remove.
11196 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
11197 information about them.
11198 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
11199 to here.
11200
5ac169d4
DK
112012010-01-20 Doug Kwan <dougkwan@google.com>
11202
11203 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
11204 Input_section_specifier to Section_id.
11205 (Target_arm::new_arm_input_section: Adjust code for change of key
11206 type.
11207 (Target_arm::find_arm_input_section): Ditto.
11208 * gc.h (object.h): Include for Section_id nand Section_id_hash.
11209 (Section_id): Remove.
11210 (Garbage_collection::Section_id_hash): Remove.
11211 * icf.h (object.h): Include for Section_id nand Section_id_hash.
11212 (Section_id): Remove.
11213 (Icf::Section_id_hash): Remove.
11214 * object.h (Section_id, Const_section_id, Section_id_hash,
11215 Const_section_id_hash): New type definitions.
11216 * output.cc (Output_section::add_relaxed_input_section): Change to
11217 use Const_section_id instead of Input_section_specifier as key type.
11218 (Output_section::add_merge_input_section): Ditto.
11219 (Output_section::build_relaxation_map): Change to use Section_id
11220 instead of Input_section_specifier as key type.
2e702c99 11221 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
11222 Ditto.
11223 (Output_section::convert_input_sections_to_relaxed_sections): Change
11224 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 11225 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
11226 (Output_section::find_relaxed_input_section): Ditto.
11227 * output.h (Input_section_specifier): Remove class.
11228 (Output_section::Output_section_data_by_input_section_map): Change
11229 key type to Const_section_id.
11230 (Output_section::Output_relaxed_input_section_by_input_section_map):
11231 Ditto.
11232 (Output_section::Relaxation_map): Change key type to Section_id.
11233
a2162063
ILT
112342010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11235
11236 * gold/arm.cc: Added support for R_ARM_V4BX relocation
11237 (class Arm_v4bx_stub): New class.
11238 (DEF_STUBS): Updated definition to support v4_veneer_bx.
11239 (Stub_factory::make_arm_v4bx_stub): New method.
11240 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
11241 (Stub_table::empty): Handle v4bx stubs.
11242 (Stub_table::add_arm_v4bx_stub): New method.
11243 (Stub_table::find_arm_v4bx_stub): New method.
11244 (Arm_relocate_functions::v4bx): New method.
11245 (Target_arm::fix_v4bx): New method.
11246 (Target_arm::Target_arm): Handle R_ARM_V4BX.
11247 (Stub_table::relocate_stubs): Likewise.
11248 (Stub_table::do_write): Likewise.
11249 (Stub_table::update_data_size_and_addralign): Likewise.
11250 (Stub_table::finalize_stubs): Likewise.
11251 (Target_arm::Scan::local): Likewise.
11252 (Target_arm::Scan::global): Likewise.
11253 (Target_arm::do_finalize_sections): Likewise.
11254 (Target_arm::Relocate::relocate): Likewise.
11255 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11256 Likewise.
11257 (Target_arm::scan_reloc_for_stub): Likewise.
11258 (Target_arm::scan_reloc_section_for_stubs): Likewise.
11259
5696ab0b
ILT
112602010-01-19 Ian Lance Taylor <iant@google.com>
11261
11262 * output.cc (Output_section_headers::do_sized_write): Write large
11263 segment count to sh_info field.
11264 (Output_file_header::do_sized_write): For large segment count,
11265 write PN_XNUM to e_phnum field.
11266
800d0f56
ILT
112672010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11268
11269 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
11270 (Arm_relocate_functions::thm_jump8): New function.
11271 (Arm_relocate_functions::thm_jump11): New function.
11272 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
11273 R_ARM_THM_JUMP11.
11274 (Target_arm::Scan::global): Likewise.
11275 (Target_arm::Relocate::relocate): Likewise.
11276 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11277 Likewise.
11278
41263c05
DK
112792010-01-14 Doug Kwan <dougkwan@google.com>
11280
11281 * arm.cc (map, utility): Include headers.
11282 (Target_arm::apply_cortex_a8_workaround): New method.
11283 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
11284 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
11285 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
11286 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
11287 the --[no-]fix-cortex-a8 command line options.
11288 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
11289 (Target_arm::relocate_stub): Use addend in instruction template.
11290 * options.h (DEFINE_bool): Set the user-set flag.
11291 (General_options): Add --[no-]-fix-cortex options.
11292 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 11293 : Update fast look-up map after conversion.
41263c05 11294
459e9b03
ST
112952010-01-14 Sriraman Tallam <tmsriram@google.com>
11296
11297 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
11298 in the first pass of do_layout.
11299
b521dfe4
DK
113002010-01-13 Doug Kwan <dougkwan@google.com>
11301
11302 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11303 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
11304 apparent compiler problem of not folding static constant integral
11305 data members of elfcpp::Elf_sizes<32>.
11306
44272192
DK
113072010-01-13 Doug Kwan <dougkwan@google.com>
11308
11309 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11310 Arm_relobj::section_needs_cortex_a8_stub_scanning,
11311 Arm_relobj::scan_section_for_cortex_a8_erratum,
11312 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
11313 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
11314 sections to scan for relocation stubs into a new method
11315 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
11316 relocation and Cortex-A8 stub scanning.
11317 (Target_arm::do_relax): Force stubs to be after stubbed sections
11318 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 11319 the beginning of a new relaxation pass. Update a comment.
44272192
DK
11320 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
11321
44b71ece
ILT
113222010-01-12 Ian Lance Taylor <iant@google.com>
11323
11324 * target-reloc.h (visibility_error): New inline function.
11325 (relocate_section): Call visibility_error.
11326 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
11327 (MOSTLYCLEANFILES): Likewise.
11328 (protected_4_pic.o, protected_3.err): New targets.
11329 * testsuite/protected_4.cc: New file.
11330
a120bc7f
DK
113312010-01-12 Doug Kwan <dougkwan@google.com>
11332
11333 * arm.cc (Cortex_a8_reloc): New class.
11334 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
11335 and cortex_a8_relocs_info_.
11336 (Target_arm::fix_cortex_a8): New method definition.
11337 (Target_arm::Cortex_a8_relocs_info): New type.
11338 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
11339 New data member declarations.
11340 (Target_arm::scan_reloc_for_stub): Record information about
11341 relocations for THUMB branches that might be exempted from the
11342 Cortex-A8 workaround.
11343 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
11344 at the beginning of a relaxation pass.
11345
20138696
DK
113462010-01-12 Doug Kwan <dougkwan@google.com>
11347
11348 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
11349 (Arm_relobj::Mapping_symbol_position,
11350 Arm_reloj::Mapping_symbol_position_less,
11351 Arm_relobj::Mapping_symbols_info): New types.
11352 (Target_arm::is_mapping_symbol_name): New method definition.
11353 (Arm_relobj::do_count_local_symbols): Save information about mapping
11354 symbols.
11355
089d69dc
DK
113562010-01-11 Doug Kwan <dougkwan@google.com>
11357
11358 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
11359 Arm_relocate_functions::thumb32_branch_upper,
11360 Arm_relocate_functions::thumb32_branch_lower,
11361 Arm_relocate_functions::thumb32_cond_branch_offset,
11362 Arm_relocate_functions::thumb32_cond_branch_upper,
11363 Arm_relocate_functions::thumb32_cond_branch_lower,
11364 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
11365 branch offset encoding.
11366 (Arm_relocate_functions::thumb_branch_common): Use new branch
11367 offset encoding methods to avoid code duplication.
11368 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
11369 (Stub_addend_reader::operator()): Use new branch encoding method
11370 to avoid code duplication.
11371
99e5bff2
DK
113722010-01-11 Doug Kwan <dougkwan@google.com>
11373
11374 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
11375 (Target_arm::do_finalize_sections): Define special EXIDX section
11376 symbols only if referenced.
11377 * gc.h (Garbage_collection::add_reference): New method.
11378 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
11379 code duplication.
11380
98e090bd
ILT
113812010-01-11 Ian Lance Taylor <iant@google.com>
11382
d0a91bd8
ILT
11383 * script.cc (Version_script_info::build_expression_list_lookup):
11384 Change complaing about duplicate wildcard match from error to
11385 warning.
11386
98e090bd
ILT
11387 * script.cc (class Lazy_demangler): Recreate--revert part of patch
11388 of 2009-12-30.
11389 (Version_script_info::Version_script_info): Initialize globs_,
11390 default_version_, default_is_global_, and exact_. Don't
11391 initialize globals_ or locals_.
11392 (Version_script_info::build_lookup_tables): Build local symbols
11393 first.
11394 (Version_script_info::unquote): New function.
11395 (Version_script_info::add_exact_match): New function.
11396 (Version_script_info::build_expression_list_lookup): Remove lookup
11397 parameter. Add is_global parameter. Change all callers. Handle
11398 wildcard pattern specially. Unquote pattern. Call
11399 add_exact_match.
11400 (Version_script_info::get_name_to_match): New function.
11401 (Version_script_info::get_symbol_version): New function.
11402 (Version_script_info::get_symbol_version_helper): Remove.
11403 (Version_script_info::check_unmatched_names): Call unquote.
11404 * script.h (class Version_script_info): Change get_symbol_version
11405 to be non-inline and add is_global parameter; change all callers.
11406 Rewrite symbol_is_local. Update declarations. Define struct
11407 Version_tree_match, Exact, Globs. Don't define struct Lookup.
11408 Remove globals_ and locals_ members. Add exact_, globs_,
11409 default_version_, is_global_.
11410 (Version_script_info::Glob): Remove pattern, add expression and
11411 is_global. Update constructor. Change all callers.
11412 * dynobj.cc (Versions::finalize): Mark the version symbol as the
11413 default version.
11414 (Versions::symbol_section_contents): If a symbol is undefined, or
11415 defined in a dynamic object, set the version index to
11416 VER_NDX_LOCAL.
11417 * symtab.cc (Symbol_table::add_from_relobj): Don't call
11418 symbol_is_local.
11419 (Symbol_table::add_from_pluginobj): Likewise.
11420 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
11421
d56962d3
DK
114222010-01-11 Doug Kwan <dougkwan@google.com>
11423
11424 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
11425 (incremental_dump_LDADD): Add linking option for libintl.
11426 * Makefile.in: Regenerate.
11427
94e6ee91
L
114282010-01-11 H.J. Lu <hongjiu.lu@intel.com>
11429
11430 PR gold/11144
11431 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
11432 instead of -Ds.
11433 * testsuite/Makefile.in: Regenerated.
11434
e96c574b
DK
114352010-01-10 Doug Kwan <dougkwan@google.com>
11436
11437 * options.h (DEFINE_var): Use parentheses around argument varname__
11438 in macro body to avoid any unintended subsequent substitutions.
11439
7198066b
ILT
114402010-01-10 Ian Lance Taylor <iant@google.com>
11441
ba4d53bf
ILT
11442 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
11443 candidates before doing symbol resolution.
11444
7198066b
ILT
11445 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
11446 ODR candidates if only one is weak.
11447
a2beed37
ILT
114482010-01-08 Ian Lance Taylor <iant@google.com>
11449
11450 * script.cc (Version_script_info::build_expression_list_lookup):
11451 Don't warn about ambiguous version, just record the ambiguity.
11452 (Version_script_info::get_symbol_version_helper): Give error if
11453 version is ambiguous.
11454
2fb7225c
DK
114552010-01-08 Doug Kwan <dougkwan@google.com>
11456
11457 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
11458 prev_data_size_ and prev_addralign_. Remove initializer for
11459 deleted data member has_been_changed_.
11460 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
11461 to determine if the table is empty.
11462 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
11463 Remove.
11464 (Stub_table::add_reloc_stub): Define method in class definition
11465 instead of just declaring it there.
11466 (Stub_table::add_cortex_a8_stub): New method definition.
11467 (Stub_table::update_data_size_and_addralign): Ditto.
11468 (Stub_table::finalize_stubs): Ditto.
11469 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
11470 (Stub_table::do_addralign_): Return address alignment in the
11471 (Stub_table::do_reset_address_and_file_offset): Define method in
11472 class definition instead of declaring it there. Set current data
11473 size to be the data size of the previous pass.
11474 (Stub_table::set_final_data_size): Use current data size as the
11475 final data size.
11476 (Stub_table::relocate_stub): Change parameter type of stub from
11477 Reloc_stub pointer to Stub pointer.
11478 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
11479 (Stub_table::Cortex_a8_stub_list): New typedef.
11480 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
11481 Stub_table::prev_addralign_): New data member.
11482 (Arm_relobj::Arm_relobj): Initialize data member
11483 section_has_cortex_a8_workaround_.
11484 (Arm_relobj::section_has_cortex_a8_workaround,
11485 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
11486 definitions.
11487 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
11488 declarations.
11489 (Target_arm::relocate_stub): Change parameter type of stub from
11490 Reloc_stub pointer to Stub pointer.
11491 (Insn_template::size, Insn_template::alignment): Handle
11492 THUMB16_SPECIAL_TYPE.
11493 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
11494 Stub_table::update_data_size_and_addralign,
11495 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
11496 definitions.
11497 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
11498 (Stub_table::do_write): Ditto.
11499 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 11500
880cd20d
ILT
115012010-01-08 Ian Lance Taylor <iant@google.com>
11502
11503 PR 11108
11504 * symtab.h (class Symbol): Remove fields is_target_special_ and
11505 has_plt_offset_. Add field is_defined_in_discarded_section_.
11506 (Symbol::is_defined_in_discarded_section): New function.
11507 (Symbol::set_is_defined_in_discarded_section): New function.
11508 (Symbol::has_plt_offset): Rewrite.
11509 (Symbol::set_plt_offset): Verify that new offset is not -1U.
11510 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
11511 Don't initialize is_target_special_ or has_plt_offset_.
11512 Initialize is_defined_in_discarded_section_.
11513 (Symbol_table::add_from_relobj): If appropriate, set
11514 is_defined_in_discarded_section.
11515 * resolve.cc (Symbol::override_base_with_special): Don't test
11516 is_target_special_. Change has_plt_offset_ to has_plt_offset().
11517 * target-reloc.h (relocate_section): Do special handling for
11518 symbols defined in discarded sections for global symbols as well
11519 as local symbols.
11520
2703e3eb
ILT
115212010-01-08 Ian Lance Taylor <iant@google.com>
11522
11523 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
11524 the SHT_SYMTAB case.
11525
339d40a3
ILT
115262010-01-08 Ian Lance Taylor <iant@google.com>
11527
11528 * object.cc (Sized_relobj::do_layout): Don't get confused if
11529 layout_eh_frame returns NULL.
11530
abecea76
ILT
115312010-01-08 Ian Lance Taylor <iant@google.com>
11532
11533 PR 11084
11534 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
11535 dynamic symbol table, use the normal symbol table.
11536 (Sized_dynobj::do_read_symbols): Remove assertion about type of
11537 symbol table.
11538
6b7dd3f3
ILT
115392010-01-08 Ian Lance Taylor <iant@google.com>
11540
11541 PR 11072
11542 * layout.cc (Layout::include_section): Remove .gnu_debuglink
11543 sections.
11544
36c50e63
L
115452010-01-08 H.J. Lu <hongjiu.lu@intel.com>
11546
11547 * version.cc (print_version): Change to "Copyright 2010".
11548
e291e7b9
ILT
115492010-01-08 Ian Lance Taylor <iant@google.com>
11550
11551 PR 10287
11552 PR 11063
11553 * i386.cc (class Target_i386): Change return type of plt_section
11554 to be non-const.
11555 (class Output_data_plt_i386): Add tls_desc_rel_ field.
11556 (Output_data_plt_i386::Output_data_plt_i386): Initialize
11557 tls_desc_rel_ field.
11558 (Output_data_plt_i386::rel_tls_desc): New function.
11559 (Target_i386::rel_tls_desc_section): New function.
11560 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
11561 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
11562 R_386_TLS_DESC reloc in rel_tls_desc_section.
11563 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
11564 Define struct Tlsdesc_info.
11565 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
11566 (Target_x86_64::do_reloc_symbol_index): New function.
11567 (Target_x86_64::add_tlsdesc_info): New function.
11568 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
11569 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
11570 tlsdesc_rel_ field.
11571 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
11572 all callers.
11573 (Output_data_plt_x86_64::rela_tlsdesc): New function.
11574 (Target_x86_64::rela_tlsdesc_section): New function.
11575 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
11576 handling.
11577 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
11578 (Target_x86_64::do_reloc_addend): New function.
11579 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
11580 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
11581 declarations. Define TARGET_CODE. Add arg field to u1_ union.
11582 (Output_reloc::type): New function.
11583 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
11584 (Output_reloc::is_target_specific): New function.
11585 (Output_reloc::target_arg): New function.
11586 (class Output_reloc) [SHT_RELA]: Add four new constructors for
11587 absolute relocs and target specific relocs.
11588 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
11589 add_target_specific.
11590 (class Output_data_reloc) [SHT_RELA]: Likewise.
11591 * output.cc (Output_reloc::Output_reloc): Add four new versions
11592 for absolute relocs and target specific relocs.
11593 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
11594 (Output_reloc::get_symbol_index): Likewise.
11595 (Output_reloc::local_section_offset): Check that local_sym_index_
11596 is not TARGET_CODE or 0.
11597 (Output_reloc::symbol_value): Likewise.
11598 (Output_reloc::write) [SHT_RELA]: Call target for target specific
11599 reloc.
11600 * target.h (class Target): Add reloc_symbol_index and reloc_addend
11601 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
11602 functions.
11603 * layout.cc (add_target_dynamic_tags): Use output section for
11604 DT_PLTRELSZ and DT_JMPREL.
11605
3a44184e
ILT
116062010-01-07 Ian Lance Taylor <iant@google.com>
11607
11608 PR 11061
11609 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
11610 function.
11611 (class Output_data_reloc_generic): Define.
11612 (class Output_data_reloc_base): Change base class to
11613 Output_data_reloc_generic. Change add() method to call
11614 bump_relative_reloc_count for a relative reloc. Remove
11615 sort_relocs_ field.
11616 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
11617 to sort_relocs().
11618 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
11619 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
11620 appropriate.
11621 * layout.h (class Layout): Update declaration.
11622
ea715a34
ILT
116232010-01-07 Ian Lance Taylor <iant@google.com>
11624
11625 * output.h (class Output_data): Add const version of
11626 output_section and do_output_section.
11627 (class Output_section_data): Add const version of
11628 do_output_section.
11629 (class Output_section): Likewise.
11630 * layout.cc (Layout::add_target_dynamic_tags): New function.
11631 * layout.h (class Layout): Update declarations.
11632 * arm.cc (Target_arm::do_finalize_sections): Use
11633 add_target_dynamic_tags.
11634 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11635 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11636 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11637 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11638
659948a4
ILT
116392010-01-07 Ian Lance Taylor <iant@google.com>
11640
11641 PR 11042
11642 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
11643 object as needed.
11644
9d3b86f6
ILT
116452010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
11646 Ian Lance Taylor <iant@google.com>
11647
11648 PR 11019
11649 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
11650 Xindex::read_symtab_xindex.
11651
bb0d3eb0
DK
116522010-01-07 Doug Kwan <dougkwan@google.com>
11653
11654 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
11655 (Insn_template::thumb16_bcond_insn): New method declaration.
11656 (Insn_template): Fix spelling.
11657 (Stub::thumb16_special): New method declaration.
11658 (Stub::do_write): Define virtual method which was previously pure
11659 virtual.
11660 (Stub::do_thumb16_special): New method declaration.
11661 (Stub::do_fixed_endian_write): New template member.
11662 (Reloc_stub::do_write): Remove.
11663 (Reloc_stub::do_fixed_endian_write): Remove.
11664 (Cortex_a8_stub): New class definition.
11665 (Stub_factory::make_cortex_a8_stub): New method definition.
11666 (Stub_factory::Stub_factory): Add missing static storage class
11667 qualifier for elf32_arm_stub_a8_veneer_blx.
11668
ffeef7df
ILT
116692010-01-07 Ian Lance Taylor <iant@google.com>
11670
dc3f80fe
ILT
11671 PR 10980
11672 * options.h (class General_options): Add --warn-unresolved-symbols
11673 and --error-unresolved-symbols.
11674 * errors.cc (Errors::undefined_symbol): Implement
11675 --warn-unresolved-symbols.
11676
ffeef7df
ILT
11677 * options.h (class General_options): Add -z text and -z textoff.
11678 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
11679
f1ec9ded
ST
116802010-01-06 Sriraman Tallam <tmsriram@google.com>
11681
11682 * gc.h (Garbage_collection::Cident_section_map): New typedef.
11683 (Garbage_collection::cident_sections): New function.
11684 (Garbage_collection::add_cident_section): New function.
11685 (Garbage_collection::cident_sections_): New member.
11686 (gc_process_relocs): Add references to sections whose names are C
11687 identifiers.
11688 * gold.h (cident_section_start_prefix): New constant.
11689 (cident_section_stop_prefix): New constant.
11690 (is_cident): New function.
11691 * layout.cc (Layout::define_section_symbols): Replace string constants
11692 with the newly defined constants.
11693 * object.cc (Sized_relobj::do_layout): Track sections whose names are
11694 C identifiers.
11695 * testsuite/Makefile.am: Add gc_orphan_section_test.
11696 * testsuite/Makefile.in: Regenerate.
11697 * testsuite/gc_orphan_section_test.cc: New file.
11698 * testsuite/gc_orphan_section_test.sh: New file.
11699
6eda8c29
ILT
117002010-01-06 Ian Lance Taylor <iant@google.com>
11701
b9674e17
ILT
11702 PR 10980
11703 * options.h (class General_options): Add --warn-shared-textrel.
11704 * layout.cc (Layout::finish_dynamic_section): Implement
11705 --warn-shared-textrel.
11706
6eda8c29
ILT
11707 PR 10980
11708 * options.h (class General_options): Add --warn-multiple-gp.
11709
32dcd44e
ILT
117102010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11711
11712 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
11713 $(THREADSLIB) and $(LIBDL).
11714 * Makefile.in: Rebuild.
11715
a192ba05
ILT
117162010-01-06 Ian Lance Taylor <iant@google.com>
11717
11718 PR 10980
11719 * options.cc (General_options::parse_section_start): New function.
11720 (General_options::section_start): New function.
11721 (General_options::General_options): Initialize all members.
11722 * options.h: Include <map>
11723 (class General_options): Add --section-start. Add section_starts_
11724 member.
11725 * layout.cc (Layout::attach_allocated_section_to_segment): If
11726 --section-start was used, set the address of the segment. Remove
11727 local sort_sections.
11728 (Layout::relaxation_loop_body): If the address of the load segment
11729 has been set by --section-start, don't use it.
11730 * output.h (Output_segment::update_flags_for_output_section): New
11731 function.
11732 * output.cc (Output_segment::add_output_section): Call
11733 update_flags_for_output_section.
11734
dde3f402
ILT
117352010-01-05 Ian Lance Taylor <iant@google.com>
11736
62dfdd4d
ILT
11737 PR 10980
11738 * options.h (class General_options): Add --undefined-version.
11739 * script.cc (struct Version_expression): Add was_matched_by_symbol
11740 field.
11741 (Version_script_info::matched_symbol): New function.
11742 (Version_script_info::get_symbol_version_helper): Call
11743 matched_symbol.
11744 (Version_script_info::check_unmatched_names): New function.
11745 * script.h (class Version_script_info): Update declarations.
11746 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
11747
9c4ae156
ILT
11748 * options.h (class General_options): Use DEFINE_bool_alias for
11749 allow_multiple_definition.
11750 * resolve.cc (Symbol_table::should_override): Don't test
11751 allow_multiple_definition.
11752
dde3f402
ILT
11753 PR 10980
11754 * options.h (class General_options): Add --cref.
11755 * main.cc (main): Print cref table if --cref. Don't close mapfile
11756 until after printing cref table.
11757 * cref.cc: Include "symtab.h".
11758 (class Cref_inputs): Define Cref_table_compare and Cref_table.
11759 (Cref_table_compare::operator()): New function.
11760 (Cref_inputs::gather_cref): New function.
11761 (filecol): New static const.
11762 (Cref_inputs::print_cref): New function.
11763 (Cref::print_cref): New function.
11764 * cref.h: Include <cstdio>.
11765 (class Cref): Update declarations.
11766 * mapfile.h (Mapfile::file): New function.
11767 * object.h (class Object): Define Symbols. Declare virtual
11768 do_get_global_symbols.
11769 (Object::get_global_symbols): New function.
11770 * object.cc (Input_objects::add_object): Pass object to cref_ if
11771 --cref.
11772 (Input_objects::archive_start): Likewise.
11773 (Input_objects::archive_stop): Likewise.
11774 (Input_objects::print_cref): New function.
11775 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
11776 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
11777 --cref.
11778 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
11779 function.
11780 * plugin.h (class Sized_pluginobj): Update declarations.
11781
8781f709
ILT
117822010-01-05 Ian Lance Taylor <iant@google.com>
11783
11784 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
11785 to is_default_version. Rename insdef to insdefault.
11786 (Symbol_table::add_from_relobj): Rename def to is_default_version
11787 and local to is_forced_local.
11788 (Symbol_table::add_from_pluginobj): Likewise.
11789 (Symbol_table::add_from_dynobj): Likewise.
11790 (Symbol_table::define_special_symbol): Rename insdef to
11791 insdefault.
11792
fe35d28d
ILT
117932010-01-04 Ian Lance Taylor <iant@google.com>
11794
30bc8c46
ILT
11795 PR 10980
11796 * options.h (class General_options): Add
11797 --allow-multiple-definition and -z muldefs.
11798 * resolve.cc (Symbol_table::should_override): Don't warn about a
11799 multiple symbol definition if --allow-multiple-definition or -z
11800 muldefs.
11801
7eaea549
ILT
11802 PR 10980
11803 * options.h (class General_options): Add --add-needed and
11804 --copy-dt-needed-entries. Tweak --as-needed help entry.
11805 * object.cc (Input_objects::check_dynamic_dependencies): Give an
11806 error if --copy-dt-needed-entries aka --add-needed is used and
11807 would cause a change in behaviour.
11808
fe35d28d
ILT
11809 PR 10980
11810 * options.h (class General_options): Add -G as a short version of
11811 --shared. Add no-op options -assert, -g, and -i.
11812
55a2bb35
ST
118132010-01-04 Sriraman Tallam <tmsriram@google.com>
11814
11815 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
11816 check for .text or .gnu.linkonce.t sections.
11817 * icf.cc (Icf::find_identical_sections): Ditto.
11818 Change the detection for mangled function name within the section
11819 name.
11820 * icf.h (is_section_foldable_candidate): New function.
11821
719328e1
ILT
118222009-12-30 Ian Lance Taylor <iant@google.com>
11823
11824 PR 10980
11825 * options.h (class General_options): Permit two dashes with
11826 --retain-symbols-file.
11827
d7bb5745
ILT
118282009-12-30 Ian Lance Taylor <iant@google.com>
11829
403a15dd
ILT
11830 PR 10979
11831 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
11832 don't put the file header and segment headers in the text
11833 segment.
11834
eda294df
ILT
11835 PR 10979
11836 * common.cc (Sort_commons::operator()): Stabilize sort when both
11837 entries are NULL.
11838 (Symbol_table::do_allocate_commons_list): When allocating common
11839 symbols, skip a symbol which is no longer common.
11840 * symtab.h (Symbol::is_common): Test whether the symbol comes from
11841 an object before checking its type.
11842 * testsuite/common_test_2.c: New file.
11843 * testsuite/common_test_3.c: New file.
11844 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
11845 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
11846 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
11847 (common_test_2_pic.o, common_test_2.so): New targets.
11848 (common_test_3_pic.o, common_test_3.so): New targets.
11849 * testsuite/Makefile.in: Rebuild.
11850
d7bb5745
ILT
11851 PR 10979
11852 * script.cc (read_input_script): If we see a new SECTIONS clause,
11853 and we have added an input section, give an error.
11854 * layout.h (class Layout): Add have_added_input_section function.
11855 Add have_added_input_section_ field.
11856 * layout.cc (Layout::Layout): Initialize
11857 have_added_input_section_.
11858 (Layout::layout): Set have_added_input_section_.
11859 (Layout::layout_eh_frame): Likewise.
11860
fc59c572
ILT
118612009-12-30 Ian Lance Taylor <iant@google.com>
11862
11863 PR 10931
11864 * options.h (class General_options): Add --sort-common option.
11865 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
11866 * common.cc (Sort_common): Add sort_order parameter to
11867 constructor. Add sort_order_ field.
11868 (Sort_commons::operator): Check sort_order_.
11869 (Symbol_table::allocate_commons): Determine the sort order.
11870 (Symbol_table::do_allocate_commons): Add sort_order parameter.
11871 Change all callers.
11872 (Symbol_table::do_allocate_commons_list): Likewise.
11873
1c74fab0
ILT
118742009-12-30 Ian Lance Taylor <iant@google.com>
11875
11876 PR 10916
11877 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
11878 symbols from this object, don't change the visibility of an
11879 undefined symbol.
11880 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
11881
6affe781
ILT
118822009-12-30 Ian Lance Taylor <iant@google.com>
11883
11884 PR 10861
11885 * script.h (class Version_script_info): Define Language enum.
11886 Update declarations. Define Glob, Exact, and Lookup types. Add
11887 new fields globals_, locals_, and is_finalized_.
11888 * script.cc: Various formatting fixes.
11889 (class Parser_closure): Change language_stack_ from a vector of
11890 std::string to one of Version_script_info::Language. Adjust all
11891 uses accordingly.
11892 (class Lazy_demangler): Remove.
11893 (struct Version_expression): Change language from std::string to
11894 Version_script_info::Language.
11895 (Version_script_info::Version_script_info): New function.
11896 (Version_script_info::~Version_script_info): Don't call clear.
11897 (Version_script_info::finalize): New function.
11898 (Version_script_info::build_lookup_tables): New function.
11899 (Version_script_info::build_expression_list_lookup): New
11900 function.
11901 (Version_script_info::get_symbol_version_helper): Rewrite to use
11902 lookup tables.
11903 (Version_script_info::print_expression_list): Adjust to use
11904 Version_script_info::Language.
11905 (script_push_lex_into_version_mode): Check that the version script
11906 has not been finalized.
11907 (version_script_push_lang): Change language string to
11908 Version_script_info::Language.
11909 * options.cc (Command_line::version_script): New function.
11910 * options.h (class General_options): Add finalize_dynamic_list
11911 function. Change version_script from declaration to definition.
11912 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
11913 * testsuite/version_script.map: Remove duplicate def of foo.
11914 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
11915 version_script.map.
11916 * testsuite/Makefile.in: Rebuild.
11917
818bf354
ILT
119182009-12-30 Ian Lance Taylor <iant@google.com>
11919
11920 PR 10843
11921 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
11922 if the input symbol index is 0, make the output symbol index 0.
11923
ebcc8304
ILT
119242009-12-30 Ian Lance Taylor <iant@google.com>
11925
11926 PR 10670
11927 * options.h (class General_options): Add -x/--discard-all.
11928 * object.cc (Sized_relobj::do_count_local_symbols): Handle
11929 --discard-all. If the local symbol needs a dynamic entry, check
11930 that before handling --discard-locals.
11931
176fe33f
ILT
119322009-12-30 Ian Lance Taylor <iant@google.com>
11933
bb321bb1
ILT
11934 PR 10450
11935 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
11936 flags to PF_R.
11937 (Output_segment::add_output_section): Don't change the flags if
11938 the type is PT_TLS.
11939
176fe33f
ILT
11940 PR 10450
11941 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
11942 GNU hash table if they need a dynamic value. Otherwise, don't add
11943 them if they are defined in a dynamic object or are forced local.
11944
e8cd95c7
ILT
119452009-12-29 Ian Lance Taylor <iant@google.com>
11946
1b81fb71
ILT
11947 PR 10450
11948 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
11949 .gnu.hash table for a 32-bit target.
11950
8d6d383d
ILT
11951 PR 10450
11952 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
11953 regular and a dynamic object only needs a dynamic symbol table
11954 entry if it is externally visible.
11955
e785ec03
ILT
11956 PR 10450
11957 * i386.cc (class Target_i386): Initialize global_offset_table_ in
11958 constructor. Add global_offset_table_ field.
11959 (Target_i386::got_section): Set global_offset_table_.
11960 (Target_i386::do_finalize_sections): Set global_offset_table_
11961 size.
11962 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
11963 in constructor. Add global_offset_table_ field.
11964 (Target_x86_64::got_section): Set global_offset_table_.
11965 (Target_x86_64::do_finalize_sections): Set global_offset_table_
11966 size.
11967
1a2dff53
ILT
11968 * layout.cc (Layout::Layout): Initialize increase_relro_.
11969 (Layout::get_output_section): Add is_relro, is_last_relro, and
11970 is_first_non_relro parameters. Change all callers.
11971 (Layout::choose_output_section): Likewise.
11972 (Layout::add_output_section_data): Likewise.
11973 (Layout::make_output_section): Likewise.
11974 (Layout::set_segment_offsets): Clear increase_relro when using a
11975 linker script.
11976 * layout.h (class Layout): Add increase_relro method. Add
11977 increase_relro_ field. Update declarations.
11978 * output.cc (Output_section::Output_section): Initialize
11979 is_last_relro_ and is_first_non_relro_.
11980 (Output_segment::add_output_section): Group relro sections is
11981 do_sort is true. Handle is_last_relro and is_first_non_relro.
11982 (Output_segment::maximum_alignment): Remove relro handling.
11983 (Output_segment::set_section_addresses): Add increase_relro
11984 parameter. Change all callers. Add initial alignment to align
11985 relro sections on separate page. Remove old relro handling.
11986 (Output_segment::set_section_list_addresses): Remove in_relro
11987 parameter. Change all callers.
11988 (Output_segment::set_offset): Add increase parameter. Change all
11989 callers. Remove old relro handling.
11990 * output.h (class Output_section): Add new methods: is_last_relro,
11991 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
11992 Add is_last_relro_ and is_first_non_relro_ fields.
11993 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
11994 Create separate .got.plt section. Call increase_relro.
11995 * x86_64.cc (Target_x86_64::got_section): Likewise.
11996 * testsuite/relro_script_test.t: Add .got.plt.
11997
f0ba79e2
ILT
11998 PR 10450
11999 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
12000 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
12001 (Layout::finalize): Call set_dynamic_symbol_size.
12002 (Layout::set_dynamic_symbol_size): New function.
12003 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
12004 set_dynamic_symbol_size.
12005
e8cd95c7
ILT
12006 PR 10450
12007 * output.h (class Output_section): Add is_entsize_zero_ field.
12008 * output.cc (Output_section::Output_section): Initialize
12009 is_entsize_zero_.
12010 (Output_section::set_entsize): If two different entsizes are
12011 requested, force it to zero.
12012 (Output_section::add_input_section): Set flags for .debug_str
12013 before updating section flags. Set entsize.
12014 (Output_section::update_flags_for_input_section): Set SHF_MERGE
12015 and SHF_STRING if all input sections have those flags.
12016
3e1b9a8a
RÁE
120172009-12-29 Rafael Espindola <espindola@google.com>
12018
12019 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
12020 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
12021 reporting.
3e1b9a8a 12022
3dcad376
ST
120232009-12-29 Sriraman Tallam <tmsriram@google.com>
12024
12025 * options.cc (General_options::parse_version): Allow -v to exit
12026 without an error if there is nothing to link.
12027
084e2665
ILT
120282009-12-29 Ian Lance Taylor <iant@google.com>
12029
12030 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
12031 using a version of gcc before 4.1.
12032 * configure: Rebuild.
12033
250acde3
CD
120342009-12-28 Chris Demetriou <cgd@google.com>
12035
12036 * attributes.cc (Output_attributes_section_data::do_write): Use
12037 std::vector::front rather than std::vector::data.
12038
99fff23b
ILT
120392009-12-28 Ian Lance Taylor <iant@google.com>
12040
12041 * symtab.h (class Symbol_table): Add enum Defined.
12042 * resolve.cc (Symbol_table::should_override): Add defined
12043 parameter. Change all callers. Test whether object is NULL
12044 before calling a method on it.
12045 (Symbol_table::report_resolve_problem): Add defined parameter.
12046 Change all callers.
12047 (Symbol_table::should_override_with_special): Likewise.
12048 * symtab.cc (Symbol_table::define_in_output_data): Add defined
12049 parameter. Change all callers.
12050 (Symbol_table::do_define_in_output_data): Likewise.
12051 (Symbol_table::define_in_output_segment): Likewise.
12052 (Symbol_table::do_define_in_output_segment): Likewise.
12053 (Symbol_table::define_as_constant): Likewise.
12054 (Symbol_table::do_define_as_constant): Likewise.
12055 * script.h (class Symbol_assignment): Add is_defsym parameter to
12056 constructor; change all callers.
12057 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
12058 parameter. Change all callers. Add is_defsym_ field.
12059 (class Parser_closure): Add parsing_defsym parameter to
12060 constructor; change all callers. Add parsing_defsym accessor
12061 function. Add parsing_defsym_ field.
12062
556bd683
ILT
120632009-12-28 Ian Lance Taylor <iant@google.com>
12064
12065 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 12066 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 12067
1782c879
ILT
120682009-12-23 Ian Lance Taylor <iant@google.com>
12069
12070 * i386.cc (Target_i386::do_calls_non_split): Recognize
12071 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
12072 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
12073 -fsplit-stack prologue when using %r11.
1782c879 12074
329ca2b1
ST
120752009-12-21 Sriraman Tallam <tmsriram@google.com>
12076
12077 * options.cc (General_options::parse_version): Make -v continue and do
12078 the link like GNU ld does.
12079
d675ff46
RÁE
120802009-12-17 Rafael Avila de Espindola <espindola@google.com>
12081
12082 * Makefile.am (CCFILES): Add timer.cc.
12083 (HFILES): Add timer.h.
12084 * configure.ac: Check for sysconf and times.
12085 * main.cc: include timer.h.
12086 (main): Use Timer instead of get_run_time.
12087 * timer.cc: New.
12088 * timer.h: New.
12089 * workqueue.cc: include timer.h.
12090 (Workqueue::find_and_run_task):
12091 Report user, sys and wall time.
12092 * Makefile.in: Regenerate.
12093 * config.in: Regenerate.
12094 * configure: Regenerate.
12095
d6344fb5
DK
120962009-12-16 Doug Kwan <dougkwan@google.com>
12097
12098 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
12099 sections.
12100 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
12101 relaxed input sections.
12102 * output.cc (Output_section::find_relaxed_input_section): Change
12103 return type to Output_relaxed_input_section pointer. Adjust code
12104 for new type of relaxed_input_section_map_.
12105 * output.h (Output_section::find_relaxed_input_section): Change
12106 return type to Output_relaxed_input_section pointer.
12107 (Output_section::Output_relaxed_input_section_by_input_section_map):
12108 New type.
12109 (Output_section::relaxed_input_section_map_): Change type to
12110 Output_section::Output_relaxed_input_section_by_input_section_map.
12111 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
12112 input section.
12113
0e0d5469
ILT
121142009-12-15 Ian Lance Taylor <iant@google.com>
12115
12116 * layout.cc (Layout::create_shstrtab): Only write out after input
12117 sections if we are compressing debug sections.
12118
0649a889
ILT
121192009-12-15 Ian Lance Taylor <iant@google.com>
12120
12121 * archive.cc (Archive::add_symbols): Only look up a symbol without
12122 a version if there is, in fact, a version.
12123
2ea97941
ILT
121242009-12-14 Ian Lance Taylor <iant@google.com>
12125
12126 Revert -Wshadow changes, all changes from:
12127 2009-12-11 Doug Kwan <dougkwan@google.com>
12128 2009-12-11 Nick Clifton <nickc@redhat.com>
12129 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
12130
b0eec2cc
DK
121312009-12-11 Doug Kwan <dougkwan@google.com>
12132
12133 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
12134 due to -Wshadow.
12135 * attributes.cc (Object_attribute::size): Ditto.
12136 (Attributes_section_data::size): Ditto.
12137 (Attributes_section_data::Attributes_section_data): Ditto.
12138 (Output_attributes_section_data::do_write): Ditto.
12139 * attributes.h (Object_attribute::set_type): Ditto.
12140 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
12141
91d6fa6a
NC
121422009-12-11 Nick Clifton <nickc@redhat.com>
12143
12144 * archive.cc: Fix shadowed variable warnings.
12145 * arm.cc: Likewise.
12146 * compressed_output.cc: Likewise.
12147 * compressed_output.h: Likewise.
12148 * configure: Likewise.
12149 * dwarf_reader.cc: Likewise.
12150 * dynobj.cc: Likewise.
12151 * dynobj.h: Likewise.
12152 * ehframe.cc: Likewise.
12153 * ehframe.h: Likewise.
12154 * errors.cc: Likewise.
12155 * expression.cc: Likewise.
12156 * fileread.cc: Likewise.
12157 * fileread.h: Likewise.
12158 * freebsd.h: Likewise.
12159 * i386.cc: Likewise.
12160 * icf.cc: Likewise.
12161 * incremental.h: Likewise.
12162 * layout.cc: Likewise.
12163 * layout.h: Likewise.
12164 * mapfile.cc: Likewise.
12165 * merge.cc: Likewise.
12166 * merge.h: Likewise.
12167 * object.cc: Likewise.
12168 * object.h: Likewise.
12169 * options.h: Likewise.
12170 * output.cc: Likewise.
12171 * output.h: Likewise.
12172 * parameters.cc: Likewise.
12173 * plugin.cc: Likewise.
12174 * powerpc.cc: Likewise.
12175 * reduced_debug_output.cc: Likewise.
12176 * reduced_debug_output.h: Likewise.
12177 * reloc.cc: Likewise.
12178 * reloc.h: Likewise.
12179 * resolve.cc: Likewise.
12180 * script-sections.cc: Likewise.
12181 * script.cc: Likewise.
12182 * script.h: Likewise.
12183 * sparc.cc: Likewise.
12184 * symtab.cc: Likewise.
12185 * symtab.h: Likewise.
12186 * target-select.cc: Likewise.
12187 * target-select.h: Likewise.
12188 * token.h: Likewise.
12189 * workqueue.cc: Likewise.
12190 * workqueue.h: Likewise.
12191 * x86_64.cc: Likewise.
12192
a0351a69
DK
121932009-12-10 Doug Kwan <dougkwan@google.com>
12194
12195 * arm.cc (attributes.h): New include.
12196 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
12197 (Arm_relobj::~Arm_relobj): Delete object pointed by
12198 attributes_section_data_.
12199 (Arm_relobj::attributes_section_data): New method definition.
12200 (Arm_relobj::attributes_section_data_): New data member declaration.
12201 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
12202 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
12203 attributes_section_data_.
12204 (Arm_dynobj::attributes_section_data): New method definition.
12205 (Arm_dynobj::attributes_section_data_): New data member declaration.
12206 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
12207 initialization value of may_use_blx_ to false.
2e702c99 12208 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
12209 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
12210 object attributes to compute results instead of hard-coding.
12211 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
12212 Target_arm::get_secondary_compatible_arch,
12213 Target_arm::set_secondary_compatible_arch
12214 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12215 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
12216 New method declarations.
12217 (Target_arm::get_aeabi_object_attribute): New method definition.
12218 (Target_arm::attributes_section_data_): New data member declaration.
12219 (read_arm_attributes_section): New template definition.
12220 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
12221 (Arm_dynobj::do_read_symbols): Ditto.
12222 (Target_arm::do_finalize_sections): Merge attributes sections from
12223 input. Check for BLX use after attributes section merging.
12224 Fix __exidx_start and __exidx_end visibility. Create an
12225 .ARM.attributes section if necessary.
12226 (Target_arm::get_secondary_compatible_arch,
12227 Target_arm::set_secondary_compatible_arch,
12228 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12229 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 12230 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
12231 New method definitions.
12232
b59befec
ILT
122332009-12-09 Ian Lance Taylor <iant@google.com>
12234
12235 * plugin.cc (Plugin::load): Don't cast from void* to a function
12236 pointer.
12237
1276bc89
ILT
122382009-12-09 Ian Lance Taylor <iant@google.com>
12239
12240 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
12241 information fields.
12242
2f2de248
L
122432009-12-09 H.J. Lu <hongjiu.lu@intel.com>
12244
12245 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
12246 Replace two_file_shared_1.so with two_file_shared_2.so.
12247 * testsuite/Makefile.in: Regenerated.
12248
4f787271
DK
122492009-12-08 Doug Kwan <dougkwan@google.com>
12250
12251 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
12252 (HFILES): Add attributes.h and int_encoding.h.
12253 * Makefile.in: Regenerate.
12254 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
12255 function definitions to int_encoding.cc
12256 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
12257 prototypes to int_encoding.h
12258 * reduced_debug_output.cc (int_encoding.h): New include.
12259 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
12260 function definitions to int_encoding.cc
12261 (insert_into_vector, read_from_pointer): Move template definitions to
12262 int_encoding.h
12263 * attributes.cc: New file.
12264 * attributes.h: New file.
12265 * int_encoding.cc: New file.
12266 * int_encoding.h: New file.
12267
20b52f1a
RÁE
122682009-12-07 Rafael Avila de Espindola <espindola@google.com>
12269
12270 PR gold/11055
12271 * incremental-dump.cc (dump_incremental_inputs): New.
12272 (main): Use dump_incremental_inputs.
12273
53d7974c
L
122742009-12-07 H.J. Lu <hongjiu.lu@intel.com>
12275
12276 PR gold/10893
12277 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
12278 checking elfcpp::STT_FUNC.
12279 (Target_i386::Relocate::relocate): Likewise.
12280 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
12281
12282 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
12283 symbols from shared libraries into normal FUNC symbols.
12284
12285 * symtab.h (Symbol): Add is_func and use it.
12286
05a352e6
DK
122872009-12-05 Doug Kwan <dougkwan@google.com>
12288
12289 * arm.cc (Target_arm::arm_info): Initialize new fields
12290 attributes_section and attributes_vendor.
12291 * i386.cc (Target_i386::i386_info): Same.
12292 * object.cc (Sized_relobj::do_layout): Skip attribute section.
12293 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
12294 fields attributes_section and attributes_vendor.
53d7974c 12295 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
12296 * target.h (Target::attributes_section, Target::attributes_vendor,
12297 Target::is_attributes_section, Target::attribute_arg_type,
12298 Target::attributes_order): New method definitions.
12299 (Target::Target_info::attributes_section,
12300 Target::Target_info::attributes_vendor): New fields.
12301 (Target::do_attribute_arg_type, Target::do_attributes_order): New
12302 virtual method definitions.
12303 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
12304 attributes_section and attributes_vendor.
12305 * testsuite/testfile.cc (Target_test::test_target_info): Same.
12306
f4e5969c
DK
123072009-12-05 Doug Kwan <dougkwan@google.com>
12308
12309 * arm.cc: Update comments about interworking and stub generation.
12310 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
12311 considered as non-PIC.
12312 (Arm_relocate_functions::base_abs): Fix formatting.
12313 (Arm_relocate_functions::got_prel): Fix comment. Change interface
12314 of function to use GOT entry address instead of offset.
12315 (Target_arm::Scan::global): Issue an error if a symbol would need a
12316 PLT does not get one because it is untyped. Remove code to create
12317 dynamic symbols for relative branches.
12318 (Target_arm::Relocate::relocate: Use 0 instead of false since function
12319 takes unsigned integer instead of boolean.
12320
1abce4a6
L
123212009-12-05 H.J. Lu <hongjiu.lu@intel.com>
12322
12323 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
12324 (two_file_test_LDADD): Likewise.
12325 (common_test_1_LDADD): Likewise.
12326 (exception_test_LDADD) Likewise.
12327 (weak_test_LDADD): Likewise.
12328 (many_sections_test_LDADD): Likewise.
12329 (initpri1_LDADD): Likewise.
12330 (script_test_1_LDADD): Likewise.
12331 (script_test_2_LDADD): Likewise.
12332 (justsyms_LDADD): Likewise.
12333 (binary_test_LDADD): Likewise.
12334 (large_LDADD): Likewise.
12335 * testsuite/Makefile.in: Regenerated.
12336
adcf2816 123372009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 12338
adcf2816
L
12339 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
12340 (Symbol_table::override_with_special): Likewise.
12341 (Symbol_table::add_from_object): Likewise.
12342
28e67f5d
RÁE
123432009-12-04 Rafael Avila de Espindola <espindola@google.com>
12344
12345 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12346 Don't set the data_offset twice.
12347
ae10a101
RÁE
123482009-12-04 Rafael Avila de Espindola <espindola@google.com>
12349
12350 * testsuite/Makefile.in: Regenerate.
12351
f59f41f3
DK
123522009-12-03 Doug Kwan <dougkwan@google.com>
12353
12354 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
12355 (Target_arm::do_finalize_sections): Add parameter for symbol table
12356 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
12357 * i386.cc (Target_i386::do_finalize_sections): Add an additional
12358 parameter for symbol table pointer.
12359 * layout.cc (Layout::finalize): Call Target::finalize_sections with
12360 an additional parameter for a pointer to symbol table.
12361 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
12362 parameter for a symbol table pointer.
12363 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
12364 * target.h (Target::finalize_sections, Target::do_finalize_sections):
12365 Ditto.
12366 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
12367 parameter for a symbol table pointer.
12368
ca55d848
RÁE
123692009-12-03 Rafael Avila de Espindola <espindola@google.com>
12370
12371 * incremental.cc (Incremental_inputs_header)
12372 (Incremental_inputs_header_write, Incremental_inputs_entry)
12373 (Incremental_inputs_entry_write): Move ...
12374 * incremental.h (Incremental_inputs_header)
12375 (Incremental_inputs_header_write, Incremental_inputs_entry)
12376 (Incremental_inputs_entry_write): here.
12377
3aec4f9c
RÁE
123782009-12-02 Rafael Avila de Espindola <espindola@google.com>
12379
12380 * incremental.cc (make_sized_incremental_binary): Set the target.
12381 Error if it is incompatible.
12382 * output.h (Output_file): Add filename method.
12383
9c0ae74d
RÁE
123842009-12-02 Rafael Avila de Espindola <espindola@google.com>
12385
12386 * incremental.cc (Incremental_inputs_entry): Remove unused argument
12387 from the get_* methods.
12388
a45500ae
RÁE
123892009-12-02 Rafael Avila de Espindola <espindola@google.com>
12390
12391 * incremental-dump.cc (main): Check that the offeset of a script is 0.
12392 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12393 Write 0 for the data_offset of scripts.
12394
325e6408
RÁE
123952009-12-02 Rafael Avila de Espindola <espindola@google.com>
12396
12397 * testsuite/Makefile.am: Add the incremental_test.sh test.
12398 * testsuite/incremental_test.sh: New.
12399 * testsuite/incremental_test_1.c: New.
12400 * testsuite/incremental_test_2.c: New.
12401
954c3e2e
RÁE
124022009-12-01 Rafael Avila de Espindola <espindola@google.com>
12403
703d02da 12404 * incremental-dump.cc (main): Fix typos.
954c3e2e 12405
f8086623
RÁE
124062009-11-27 Rafael Avila de Espindola <espindola@google.com>
12407
12408 PR gold/11025
12409 * incremental-dump.cc (main): Use llu to print 64 bit values.
12410
3b0dd6ac
L
124112009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
12412 H.J. Lu <hongjiu.lu@intel.com>
12413
12414 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
12415 $(LIBDL).
12416 (incremental_dump_LDADD): Likewise.
12417 * Makefile.in: Regenerated.
12418
a6d1ef57 124192009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 12420
a6d1ef57
DK
12421 Revert:
12422
12423 2009-11-25 Doug Kwan <dougkwan@google.com>
12424
12425 * arm.cc (Target_arm::Target_arm): Move method definition
12426 outside of class definition. Add code to handle
12427 --target1-rel, --target1-abs and --target2= options.
12428 (Target_arm::get_reloc_reloc_type): Change method to be
12429 non-static and const.
12430 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
12431 New data member declaration.
12432 (Target_arm::Scan::local, Target_arm::Scan::global,
12433 Target_arm::Relocate::relocate,
12434 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12435 Adjust call to Target_arm::get_real_reloc_type.
12436 (Target_arm::get_real_reloc_type): Use command line options
12437 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12438 * options.h (--target1-rel, --target1-abs, --target2): New
12439 ARM-only options.
12440
50aeb7d4
DK
124412009-11-25 Doug Kwan <dougkwan@google.com>
12442
12443 * arm.cc (Target_arm::Target_arm): Move method definition outside of
12444 class definition. Add code to handle --target1-rel, --target1-abs
12445 and --target2= options.
12446 (Target_arm::get_reloc_reloc_type): Change method to be non-static
12447 and const.
12448 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
12449 member declaration.
12450 (Target_arm::Scan::local, Target_arm::Scan::global,
12451 Target_arm::Relocate::relocate,
12452 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
12453 call to Target_arm::get_real_reloc_type.
12454 (Target_arm::get_real_reloc_type): Use command line options to
12455 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12456 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
12457 options.
12458
51938283
DK
124592009-11-25 Doug Kwan <dougkwan@google.com>
12460
12461 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
12462 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
12463 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
12464 formatting.
12465 (Arm_relocate_functions::thm_call): Replace body with a call to
12466 Arm_relocate_functions::thumb_branch_common.
12467 (Arm_relocate_functions::thm_jump24,
12468 Arm_relocate_functions::thm_xpc22): New method definitions.
12469 (Arm_relocate_functions::thumb_branch_common): New method definition.
12470 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
12471 operator.
12472 (Target_arm::Relocate::relocate): Adjust call to thm_call.
12473 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
12474
e2b8f3c4
RÁE
124752009-11-24 Rafael Avila de Espindola <espindola@google.com>
12476
12477 * Makefile.am: Build incremental-dump
12478 * Makefile.in: Regenerate.
12479 * incremental-dump.cc: New.
12480 * incremental.cc (Incremental_inputs_header_data,
12481 Incremental_inputs_entry_data): Move to incremental.h
12482 * incremental.h: (Incremental_inputs_header_data,
12483 Incremental_inputs_entry_data): Move from incremental.cc
12484
bcba9aec
RÁE
124852009-11-24 Rafael Avila de Espindola <espindola@google.com>
12486
12487 * incremental.cc (Incremental_inputs_header,
12488 Incremental_inputs_header_write, Incremental_inputs_entry,
12489 Incremental_inputs_entry_write): Add a typedef with the data type.
12490
7c3afe08
RÁE
124912009-11-24 Rafael Avila de Espindola <espindola@google.com>
12492
12493 * incremental.cc (Incremental_inputs_header,
12494 Incremental_inputs_header_write, Incremental_inputs_entry,
12495 Incremental_inputs_entry_write): Update comment about which
12496 type has the filed descriptions.
12497
d204b6e9
DK
124982009-11-15 Doug Kwan <dougkwan@google.com>
12499
12500 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
12501 (Arm_relocate_functions::arm_branch_common): Change method defintion
12502 in class definition to a method declaration and update list of formal
12503 parameters.
12504 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
12505 Arm_relocation_functions::jump24): Adjust call to
12506 Arm_relocate_functions::arm_branch_common. Update list of formal
12507 parameters.
12508 (Arm_relocate_functions::xpc25): New method definition.
12509 (Arm_relocate_functions::arm_branch_common): Move method defintion
12510 out from class definition. Use stubs for mode-switching and extending
12511 branch ranges.
12512 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
12513 specially. Change code to enable use of stubs in ARM branches.
12514
43d12afe
DK
125152009-11-10 Doug Kwan <dougkwan@google.com>
12516
12517 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
12518 in method declaration.
12519 (Target_arm::relocate_stub): New method declaration.
12520 (Target_arm::default_target): Change to return a pointer instead of
12521 a const reference.
12522 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
12523 Target_arm::default_target.
12524 (Arm_Relobj::do_relocate_sections): Remove options paramater in
12525 method definition.
12526 (Target_arm::relocate_section): Adjust view.
12527 (Target_arm::relocate_stub): New method definition.
12528
ac33a407
DK
125292009-11-10 Doug Kwan <dougkwan@google.com>
12530
12531 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
12532 a format warning.
12533 * incremental.cc (open_incremental_binary): Initialized local
12534 variables to avoid warnings.
12535 * object.cc (make_elf_object): Ditto.
12536 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
12537 a format warning.
e1df38aa 12538
88ee28e9
L
12539009-11-09 H.J. Lu <hongjiu.lu@intel.com>
12540
12541 PR gold/10930
12542 * testsuite/plugin_test.c: Include "config.h".
12543
2daedcd6
DK
125442009-11-09 Doug Kwan <dougkwan@google.com>
12545
12546 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
12547 (arm_symbol_value): Remove.
12548 (Arm_relocate_functions::arm_branch_common,
12549 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
12550 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
12551 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
12552 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
12553 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
12554 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
12555 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
12556 Arm_relocate_functions::thm_mobw_abs_nc,
12557 Arm_relocate_functions::thm_mov_abs,
12558 Arm_relocate_functions::movw_prel_nc,
12559 Arm_relocate_functions::thm_movt_abs,
12560 Arm_relocate_functions::movt_prel,
12561 Arm_relocate_functions::thm_movw_prel_nc,
12562 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
12563 (Target_arm::Relocate::relocate): Only decompose address into two
12564 parts if relocation type uses the thumb-bit and pass the actual
12565 bit instead of a flag indicating that the thumb-bit is used. Adjust
12566 calls to methods in Arm_relocate_functions for this change.
12567
1276bc89 125682009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
12569
12570 PR 10925
12571 * reloc.cc: Instantiate
12572 Sized_relobj::initialize_input_to_output_maps and
12573 Sized_relobj:free_input_to_output_maps.
12574
e53ad1b5
ILT
125752009-11-06 Ian Lance Taylor <iant@google.com>
12576
12577 PR 10876
12578 * defstd.cc (in_segment): Set only_if_ref true for "end".
12579
eb44217c
DK
125802009-11-06 Doug Kwan <dougkwan@google.com>
12581
12582 * arm.cc (class Reloc_stub): Correct a comment.
12583 (Target_arm::Target_arm): Initialize arm_input_section_map_.
12584 (Target_arm::scan_section_for_stubs): New method declaration.
12585 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
12586 Change methods from private to protected.
12587 (Target_arm::do_may_relax): New method definition.
12588 (Target_arm::do_relax, Target_arm::group_sections,
12589 Target_arm::scan_reloc_for_stub,
12590 Target_arm::scan_reloc_section_for_stubs): New method declarations.
12591 (Target_arm::arm_input_section_map_): New data member declaration.
12592 (Target_arm::scan_reloc_for_stub,
12593 Target_arm::scan_reloc_section_for_stubs,
12594 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
12595 Target_arm::do_relax): New method definitions.
12596
5d329b7d
ILT
125972009-11-06 Mikolaj Zalewski <mikolaj@google.com>
12598
12599 * configure.ac: Check for (struct stat)::st_mtim
12600 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
12601 * config.in: Regenerate.
12602 * configure: Regenerate.
12603
96a0d71b
ILT
126042009-11-05 Ian Lance Taylor <iant@google.com>
12605
12606 PR 10910
12607 * output.cc (Output_segment::add_output_section): Add missing
12608 return statement.
12609
594c8e5e
ILT
126102009-11-04 Ian Lance Taylor <iant@google.com>
12611
12612 PR 10880
12613 * object.h (class Object): Add is_needed and set_is_needed
12614 methods. Add is_needed_ field. Make bool fields into bitfields.
12615 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
12616 defined in a dynamic object and referenced by a regular object,
12617 set is_needed for the dynamic object.
12618 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
12619 if the file is marked with as_needed and it is not needed.
12620
22b127cc
ILT
126212009-11-04 Ian Lance Taylor <iant@google.com>
12622
12623 PR 10887
12624 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
12625 tags if data is discarded by linker script.
12626 * i386.cc (Target_i386::do_finalize_sections): Likewise.
12627 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
12628 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
12629 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
12630
f5c870d2
ILT
126312009-11-04 Ian Lance Taylor <iant@google.com>
12632
12633 * layout.cc (Layout::get_output_section): Add is_interp and
12634 is_dynamic_linker_section parameters. Change all callers.
12635 (Layout::choose_output_section): Likewise.
12636 (Layout::make_output_section): Likewise.
12637 (Layout::add_output_section_data): Add is_dynamic_linker_section
12638 parameter. Change all callers.
12639 * layout.h (class Layout): Update declarations.
12640 * output.h (class Output_section): Add is_interp, set_is_interp,
12641 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
12642 Add is_interp_, is_dynamic_linker_section_ fields. Change
12643 generate_code_fills_at_write_ to a bitfield.
12644 * output.cc (Output_section::Output_sections): Initialize new
12645 fields.
12646 (Output_segment::add_output_section): Add do_sort parameter.
12647 Change all callers.
12648
1ae4d23b
ILT
126492009-11-03 Ian Lance Taylor <iant@google.com>
12650
12651 PR 10860
12652 * options.h (class General_options): Add --warn-common.
12653 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
12654 merging two common symbols.
12655 (Symbol_table::should_override): Handle --warn-common when merging
12656 a common symbol with a defined symbol. Use report_resolve_problem
12657 for multiple definitions.
12658 (Symbol_table::report_resolve_problem): New function.
12659 * symtab.h (class Symbol_table): Declare report_resolve_problem.
12660
55da9579
DK
126612009-11-03 Doug Kwan <dougkwan@google.com>
12662
12663 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
12664 stub_factory_.
12665 (Target_arm::stub_factory): New method definition.
12666 (Target_arm::new_arm_input_section,
12667 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
12668 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 12669 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
12670 New type definitions.
12671 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
12672 member declarations.
12673 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
12674 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
12675 New method definitions.
12676
37a9ac43
ILT
126772009-11-03 Ian Lance Taylor <iant@google.com>
12678
12679 * options.h (class General_options): Add --warn_constructors.
12680
b3d6a3d4
ILT
126812009-11-03 Ian Lance Taylor <iant@google.com>
12682
12683 PR 10893
12684 * defstd.cc (in_section): Add entries for __rel_iplt_start,
12685 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
12686
934b01dd
ILT
126872009-11-03 Ian Lance Taylor <iant@google.com>
12688
12689 PR 10895
12690 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
12691 --msgid-bugs-address.
12692 (install-pdf): New target.
12693 (install-data_yes): Look up one directory to find mkinstalldirs.
12694
03c1939b
L
126952009-11-03 H.J. Lu <hongjiu.lu@intel.com>
12696
12697 * po/Make-in (.po.gmo): Don't generate .gmo files in source
12698 tree.
12699
ebd95253
DK
127002009-10-30 Doug Kwan <dougkwan@google.com>
12701
12702 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
12703
e9bbb538
DK
127042009-10-30 Doug Kwan <dougkwan@google.com>
12705
12706 * arm.cc (Stub_addend_reader): New struct template definition
12707 and partial specializations.
12708 (Stub_addend_reader::operator()): New method definition for a
12709 partially specialized template.
12710
d5b40221
DK
127112009-10-30 Doug Kwan <dougkwan@google.com>
12712
12713 * arm.cc (Arm_relobj::processor_specific_flags): New method
12714 definition.
12715 (Arm_relobj::do_read_symbols): New method declaration.
12716 (Arm_relobj::processor_specific_flags_): New data member declaration.
12717 (Arm_dynobj): New class definition.
12718 (Target_arm::do_finalize_sections): Add input_objects parameter.
12719 (Target_arm::do_adjust_elf_header): New method declaration.
12720 (Target_arm::are_eabi_versions_compatible,
12721 (Target_arm::merge_processor_specific_flags): New method declaration.
12722 (Target_arm::do_make_elf_object): New overloaded method definitions
12723 and declaration.
12724 (Arm_relobj::do_read_symbols): New method definition.
12725 (Arm_dynobj::do_read_symbols): Ditto.
12726 (Target_arm::do_finalize_sections): Add input_objects parameters.
12727 Merge processor-specific flags from all input objects.
12728 (Target_arm::are_eabi_versions_compatible,
12729 Target_arm::merge_processor_specific_flags,
12730 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
12731 New method definitions.
12732 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
12733 Input_objects pointer type parameter.
12734 * layout.cc (Layout::finalize): Pass input objects to target's.
12735 finalize_sections function.
12736 * output.cc (Output_file_header::do_sized_write): Set ELF file
12737 header's processor-specific flags.
12738 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
12739 Input_objects pointer type parameter.
12740 * sparc.cc (Target_sparc::do_finalize_sections): Same.
12741 * target.h (Input_objects): New forward class declaration.
12742 (Target::processor_specific_flags,
12743 Target::are_processor_specific_flags_sect): New method definitions.
12744 (Target::finalize_sections): Add input_objects parameter.
12745 (Target::Target): Initialize processor_specific_flags_ and
12746 are_processor_specific_flags_set_.
12747 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
12748 parameter.
12749 (Target::set_processor_specific_flags): New method definition.
12750 (Target::processor_specific_flags_,
12751 Target::are_processor_specific_flags_set_): New data member
12752 declarations.
12753 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
12754 Input_objects pointer type parameter.
12755
ebabffbd
DK
127562009-10-30 Doug Kwan <dougkwan@google.com>
12757
12758 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
12759
ad0f2072
ILT
127602009-10-28 Ian Lance Taylor <iant@google.com>
12761
12762 * object.h (class Relobj): Drop options parameter from
12763 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
12764 do_scan_relocs, do_relocate. Change all callers.
12765 (class Sized_relobj): Drop options parameters from
12766 do_gc_process_relocs, do_scan_relocs, do_relocate,
12767 do_relocate_sections, relocate_sections, emit_relocs_scan,
12768 emit_relocs_scan_reltype. Change all callers.
12769 (struct Relocate_info): Remove options field and all references to
12770 it.
12771 * reloc.h (class Read_relocs): Remove options constructor
12772 parameter and options_ field. Change all callers.
12773 (class Gc_process_relocs, class Scan_relocs): Likewise.
12774 (class Relocate_task): Likewise.
12775 * target-reloc.h (scan_relocs): Remove options parameter. Change
12776 all callers.
12777 (scan_relocatable_relocs): Likewise.
12778 * target.h (class Sized_target): Remove options parameter from
12779 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
12780 all callers.
12781 * gc.h (gc_process_relocs): Remove options parameter. Change all
12782 callers.
12783 * arm.cc: Update functions to remove options parameters.
12784 * i386.cc: Likewise.
12785 * powerpc.cc: Likewise.
12786 * sparc.cc: Likewise.
12787 * x86_64.cc: Likewise.
12788 * testsuite/testfile.cc: Likewise.
12789
8ffa3667
DK
127902009-10-28 Doug Kwan <dougkwan@google.com>
12791
12792 * arm.cc (Arm_relobj): New class definition.
e1df38aa 12793 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
12794 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
12795 New method definitions.
12796
40f36857
CC
127972009-10-28 Cary Coutant <ccoutant@google.com>
12798
12799 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
12800 (Plugin::cleanup_done_): New member.
12801 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
12802 (Plugin_manager::cleanup_done_): Remove.
12803 (Plugin_manager::add_input_file): Edit error message.
12804 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
12805 (Plugin_manager::cleanup): Remove use of cleanup_done_.
12806
2c849493
ILT
128072009-10-27 Mikolaj Zalewski <mikolajz@google.com>
12808
12809 * fileread.cc: (File_read::View::~View): Use the new
12810 data_ownership_ filed.
12811 (File_read::~File_read): Dispose the new whole_file_view_.
12812 (File_read::open): Mmap the whole file if needed.
12813 (File_read::open): Use whole_file_view_ instead of contents_.
12814 (File_read::find_view): Use whole_file_view_ if applicable.
12815 (File_read::do_read): Use whole_file_view_ instead of contents_.
12816 (File_read::make_view): Use whole_file_view_ instead of contents_,
12817 update File_read::View::View call.
12818 (File_read::find_or_make_view): Update File_read::View::View
12819 call.
12820 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
12821 remove contents_
12822 (File_read::View::Data_ownership): New enum.
12823 (File_read::View::View): Replace bool mapped_ with Data_ownership
12824 argument.
12825 (File_read::View::mapped_): Remove (replaced by data_ownership_).
12826 (File_read::View::data_ownership_): New field.
12827 (File_read::contents_): Remove (replaced by whole_file_view_).
12828 (File_read::whole_file_view_): New field.
12829 * options.h (class General_options): Add --keep-files-mapped.
12830
24998053
CC
128312009-10-27 Cary Coutant <ccoutant@google.com>
12832
12833 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
12834 * testsuite/Makefile.am (plugin_test_5): New test case.
12835 * testsuite/Makefile.in: Regenerate.
12836
72adc4fa
DK
128372009-10-25 Doug Kwan <dougkwan@google.com>
12838
12839 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
12840 from private to protected to allow access by child class.
12841 (Sized_relobj::do_relocate_sections): New method declaration.
12842 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 12843 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
12844 Sized_relobj::relocate_sections. Instantiate template explicitly
12845 for different target sizes and endianity.
12846
07f508a2
DK
128472009-10-24 Doug Kwan <dougkwan@google.com>
12848
12849 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
12850 (Arm_input_section::as_arm_input_section): New method.
12851 (Arm_output_section): New class definition.
12852 (Arm_output_section::create_stub_group,
12853 Arm_output_section::group_sections): New method definitions.
12854
10ad9fe5
DK
128552009-10-22 Doug Kwan <dougkwan@google.com>
12856
12857 * arm.cc (Arm_input_section): New class definition.
12858 (Arm_input_section::init, Arm_input_section:do_write,
12859 Arm_input_section::set_final_data_size,
12860 Arm_input_section::do_reset_address_and_file_offset): New method
12861 definitions.
12862
56ee5e00
DK
128632009-10-21 Doug Kwan <dougkwan@google.com>
12864
12865 * arm.cc (Stub_table, Arm_input_section): New forward class
12866 declarations.
12867 (Stub_table): New class defintion.
12868 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
12869 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
12870 New method definition.
12871
b569affa
DK
128722009-10-21 Doug Kwan <dougkwan@google.com>
12873
12874 * arm.cc: Update copyright comments.
12875 (Target_arm): New forward class template declaration.
12876 (Arm_address): New type.
12877 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
12878 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
12879 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
12880 constants.
12881 (Insn_template): Same.
12882 (DEF_STUBS): New macro.
12883 (Stub_type): New enum type.
12884 (Stub_template): New class definition.
12885 (Stub): Same.
12886 (Reloc_stub): Same.
12887 (Stub_factory): Same.
12888 (Target_arm::Target_arm): Initialize may_use_blx_ and
12889 should_force_pic_veneer_.
12890 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
12891 Target_arm::should_force_pic_veneer,
12892 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
12893 Target_arm::using_thumb_only, Target_arm:;default_target): New
12894 method defintions.
12895 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
12896 New data member declarations.
12897 (Insn_template::size, Insn_template::alignment): New method defintions.
12898 (Stub_template::Stub_template): New method definition.
12899 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
12900 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
12901 (Stub_factory::Stub_factory): New method definition.
12902 * gold.h (string_hash): New template.
12903 * output.h (Input_section_specifier::hash_value): Use
12904 gold::string_hash.
12905 (Input_section_specifier::string_hash): Remove.
12906 * stringpool.cc (Stringpool_template::string_hash): Use
12907 gold::string_hash.
12908
6c172549
DK
129092009-10-20 Doug Kwan <dougkwan@google.com>
12910
12911 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
12912 symbols of relaxed input sections.
12913 * output.h (Output_section::find_relaxed_input_section): Make
12914 method public.
12915
c5617f2f
DK
129162009-10-16 Doug Kwan <dougkwan@google.com>
12917
12918 * dynobj.cc (Versions::Versions): Initialize version_script_.
12919 Only insert base version symbol definition for a shared object
12920 if version script defines any version versions.
12921 (Versions::define_base_version): New method definition.
12922 (Versions::add_def): Check that base version is not needed.
12923 (Versions::add_need): Define base version lazily.
12924 * dynobj.h (Versions::define_base_version): New method declaration.
12925 (Versions::needs_base_version_): New data member declaration.
12926 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
12927 (check_DATA): Add no_version_test.stdout.
12928 (libno_version_test.so, no_version_test.o no_version_test.stdout):
12929 New make rules.
12930 * testsuite/Makefile.in: Regenerate.
12931 * testsuite/no_version_test.c: New file.
12932 * testsuite/no_version_test.sh: Ditto.
12933
3c12dcdb
DK
129342009-10-16 Doug Kwan <dougkwan@google.com>
12935
12936 * expression.cc (class Segment_start_expression): New class definition.
12937 (Segment_start_expression::value): New method definition.
12938 (script_exp_function_segment_start): Return a new
12939 Segment_start_expression.
12940 * gold/script-c.h (script_saw_segment_start_expression): New function
12941 prototype.
12942 * script-sections.cc (Script_sections::Script_sections): Initialize
12943 SAW_SEGMENT_START_EXPRESSION_ to false.
12944 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
12945 and -Tbbs options to specify section addresses if given in
12946 command line and no SEGMENT_START expression is seen in a script.
12947 * script-sections.h (Script_sections::saw_segment_start_expression,
12948 Script_sections::set_saw_segment_start_expression): New method
12949 definition.
12950 (Script_sections::saw_segment_start_expression_): New data member
12951 declaration.
12952 * script.cc (script_saw_segment_start_expression): New function.
12953 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
12954 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
12955 script_test_7.sh and script_test_8.sh.
12956 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
12957 script_test_8.stdout.
12958 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
12959 (script_test_6, script_test_6.stdout, script_test_7,
12960 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
12961 * Makefile.in: Regenerate.
12962 * testsuite/script_test_6.sh: New file.
12963 * testsuite/script_test_6.t: Same.
12964 * testsuite/script_test_7.sh: Same.
12965 * testsuite/script_test_7.t: Same.
12966 * testsuite/script_test_8.sh: Same.
12967
64b1ae37
DK
129682009-10-16 Doug Kwan <dougkwan@google.com>
12969
12970 * output.cc (Output_segment::set_section_list_address): Cast
12971 expressions to unsigned long long type to avoid format warnings.
12972
661be1e2
ILT
129732009-10-15 Ian Lance Taylor <iant@google.com>
12974
12edd763 12975 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 12976 dot assignment to script_sections_.
12edd763
ILT
12977 * script-sections.cc (Script_sections::add_dot_assignment):
12978 Initialize if necessary.
12979
68b6574b
ILT
12980 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
12981 program headers with no load segment if there is a linker script.
12982
661be1e2
ILT
12983 * layout.cc (Layout::set_segment_offsets): Align the file offset
12984 to the segment aligment for -N or -n with no load segment.
12985 * output.cc (Output_segment::add_output_section): Don't crash if
12986 the first section is a TLS section.
12987 (Output_segment::set_section_list_addresses): Print an error
12988 message if the address moves backward in a linker script.
12989 * script-sections.cc
12990 (Output_section_element_input::set_section_addresses): Don't
12991 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
12992 (Orphan_output_section::set_section_addresses): Likewise.
12993
f15f61a7
DK
129942009-10-15 Doug Kwan <dougkwan@google.com>
12995
12996 * layout.cc (Layout::finish_dynamic_section): Generate tags
12997 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
12998 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
12999 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
13000
82bb573a
ILT
130012009-10-14 Ian Lance Taylor <iant@google.com>
13002
13003 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
13004 fields.
13005 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
13006 data_shdr fields of relinfo.
13007 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
13008 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
13009 R_386_TLS_LDO_32, adjust based on section flags.
13010 (Target_i386::Relocate::fix_up_ldo): Remove.
13011
374ad285
ILT
130122009-10-13 Ian Lance Taylor <iant@google.com>
13013
13014 Add support for -pie.
13015 * options.h (class General_options): Add -pie and
13016 --pic-executable.
13017 (General_options::output_is_position_independent): Test -pie.
13018 (General_options::output_is_executable): Return true if not shared
13019 and not relocatable.
13020 (General_options::output_is_pie): Remove.
13021 * options.cc (General_options::finalize): Reject incompatible uses
13022 of -pie.
13023 * gold.cc (queue_middle_tasks): A -pie link is not static.
13024 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
13025 * symtab.cc (Symbol::final_value_is_known): Return false if
13026 output_is_position_independent.
13027 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
13028 output_is_position_independent.
13029 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
13030 output_is_position_independent.
13031 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
13032 output_is_position_independent.
13033 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
13034 two_file_pie_test.
13035 (basic_pie_test.o, basic_pie_test): New targets.
13036 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
13037 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
13038 (two_file_pie_test): New target.
13039 * testsuite/Makefile.in: Rebuild.
13040 * README: Remove note saying that -pie is not supported.
13041
c6585162
ILT
130422009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
13043
13044 * options.h (class General_options): Add -init and -fini.
13045 * layout.cc (Layout::finish_dynamic_section): Emit
13046 given init and fini functions.
13047
032ce4e9
ST
130482009-10-13 Sriraman Tallam <tmsriram@google.com>
13049
13050 * gc.h (gc_process_relocs): Check if icf is enabled using new
13051 function.
13052 * gold.cc (queue_initial_tasks): Likewise.
13053 (queue_middle_tasks): Likewise.
13054 * object.cc (do_layout): Likewise.
13055 * symtab.cc (is_section_folded): Likewise.
13056 * main.cc (main): Likewise.
13057 * reloc.cc (Read_relocs::run): Likewise.
13058 (Sized_relobj::do_scan_relocs): Likewise.
13059 * icf.cc (is_function_ctor_or_dtor): New function.
13060 (Icf::find_identical_sections): Check if function is ctor or dtor when
13061 safe icf is chosen.
13062 * options.h (General_options::icf): Change option to be an enum.
13063 (Icf_status): New enum.
13064 (icf_enabled): New method.
13065 (icf_safe_folding): New method.
13066 (set_icf_status): New method.
13067 (icf_status_): New variable.
13068 * (options.cc) (General_options::finalize): Set icf_status_.
13069 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
13070 icf_test and icf_keep_unique_test to use the --icf enum flag.
13071 * testsuite/icf_safe_test.sh: New file.
e1df38aa 13072 * testsuite/icf_safe_test.cc: New file.
032ce4e9 13073
f345227a
ST
130742009-10-12 Sriraman Tallam <tmsriram@google.com>
13075
13076 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
13077 includes to gc.h and icf.h.
13078 * arm.cc: Include gc.h.
13079 * gold.cc: Likewise.
13080 * i386.cc: Likewise.
13081 * powerpc.cc: Likewise.
13082 * sparc.cc: Likewise.
13083 * x86_64.cc: Likewise.
13084 * gc.h: Include icf.h.
13085
1c7814ed
ILT
130862009-10-11 Ian Lance Taylor <iant@google.com>
13087
13088 * plugin.cc: Include "gold.h" before other header files.
13089
ae3b5189
CD
130902009-10-10 Chris Demetriou <cgd@google.com>
13091
13092 * options.h (Input_file_argument::Input_file_type): New enum.
13093 (Input_file_argument::is_lib_): Replace with...
13094 (Input_file_argument::type_): New member.
13095 (Input_file_argument::Input_file_argument): Take Input_file_type
13096 'type' rather than boolean 'is_lib' as second argument.
13097 (Input_file_argument::is_lib): Use type_.
13098 (Input_file_argument::is_searched_file): New function.
13099 (Input_file_argument::may_need_search): Handle is_searched_file.
13100 * options.cc (General_options::parse_library): Support -l:filename.
13101 (General_options::parse_just_symbols): Update for Input_file_argument
13102 changes.
13103 (Command_line::process): Likewise.
13104 * archive.cc (Archive::get_file_and_offset): Likewise.
13105 * plugin.cc (Plugin_manager::release_input_file): Likewise.
13106 * script.cc (read_script_file, script_add_file): Likewise.
13107 * fileread.cc (Input_file::Input_file): Likewise.
13108 (Input_file::will_search_for): Handle is_searched_file.
13109 (Input_file::open): Likewise.
13110 * readsyms.cc (Read_symbols::get_name): Likewise.
13111 * testsuite/Makefile.am (searched_file_test): New test.
13112 * testsuite/Makefile.in: Regenerate.
13113 * testsuite/searched_file_test.cc: New file.
13114 * testsuite/searched_file_test_lib.cc: New file.
13115
f3048a1d
ILT
131162009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13117 Ian Lance Taylor <iant@google.com>
13118
13119 * descriptor.cc: Include <cstdio> and "binary-io.h".
13120 (Descriptors::open): Open the files in binary mode always.
13121 * script.cc (Lex::get_token): Treat \r as whitespace.
13122
d4780e57
ILT
131232009-10-09 Ian Lance Taylor <iant@google.com>
13124
13125 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
13126
d9a893b8
ILT
131272009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13128 Ian Lance Taylor <iant@google.com>
13129
13130 * configure.ac: Check for readv function also.
13131 * fileread.cc (readv): Define if not HAVE_READV.
13132 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
13133 does not exist.
13134 * config.in: Regenerate.
13135 * configure: Regenerate.
13136
c0a62865
DK
131372009-10-09 Doug Kwan <dougkwan@google.com>
13138
13139 * layout.cc (Layout::make_output_section): Call target hook to make
13140 ordinary output section.
13141 (Layout::finalize): Adjust parameter list of call the
13142 Target::may_relax().
13143 * layout.h (class Layout::section_list): New method.
13144 * merge.h (Output_merge_base::entsize): Change visibility to public.
13145 (Output_merge_base::is_string, Output_merge_base::do_is_string):
13146 New methods.
13147 (Output_merge_string::do_is_string): New method.
13148 * object.cc (Sized_relobj::do_setup): renamed from
13149 Sized_relobj::set_up.
13150 * object.h (Sized_relobj::adjust_shndx,
13151 Sized_relobj::initializ_input_to_output_maps,
13152 Sized_relobj::free_input_to_output_maps): Change visibilities to
13153 protected.
13154 (Sized_relobj::setup): Virtualize.
13155 (Sized_relobj::do_setup): New method declaration.
13156 (Sized_relobj::invalidate_section_offset,
13157 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
13158 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
13159 * options.cc (parse_int): New function.
13160 * options.h (parse_int): New declaration.
13161 (DEFINE_int): New macro.
13162 (stub_group_size): New option.
13163 * output.cc (Output_section::Output_section): Initialize memebers
13164 merge_section_map_, merge_section_by_properties_map_,
13165 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
13166 (Output_section::add_input_section): Handled deferred code-fill
13167 generation and remove an old comment.
13168 (Output_section::add_relaxed_input_section): New method definition.
13169 (Output_section::add_merge_input_section): Use merge section by
13170 properties map to speed to search. Update merge section maps
13171 as appropriate.
13172 (Output_section::build_relaxation_map): New method definition.
13173 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
13174 Same.
13175 (Output_section::relax_input_section): Renamed to
13176 Output_section::convert_input_sections_to_relaxed_sections and change
13177 interface to take a vector of pointers to relaxed sections.
13178 (Output_section::find_merge_section,
13179 Output_section::find_relaxed_input_section): New method definitions.
13180 (Output_section::is_input_address_mapped,
13181 Output_section::output_offset, Output_section::output_address):
13182 Use output section data maps to speed up searching.
13183 (Output_section::find_starting_output_address): Add comments.
13184 (Output_section::do_write,
13185 Output_section::write_to_postprocessing_buffer): Do code-fill
13186 generation as appropriate.
13187 (Output_section::get_input_sections): Invalidate relaxed input section
13188 map.
13189 (Output_section::restore_states): Adjust type of checkpoint .
13190 Invalidate relaxed input section map.
13191 * output.h (Output_merge_base): New class declaration.
13192 (Input_section_specifier): New class defintion.
13193 (class Output_relaxed_input_section) Change base class to
13194 Output_section_data_build.
13195 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
13196 base class initializer.
13197 (Output_section::add_relaxed_input_section): New method declaration.
13198 (Output_section::Input_section): Change visibility to protected.
2e702c99 13199 (Output_section::Input_section::relobj,
c0a62865
DK
13200 Output_section::Input_section::shndx): Handle relaxed input sections.
13201 Output_section::input_sections) Change visibility to protected. Also
13202 define overload to return a non-const pointer.
13203 (Output_section::Merge_section_properties): New class defintion.
13204 (Output_section::Merge_section_by_properties_map,
13205 Output_section::Output_section_data_by_input_section_map,
13206 Output_section::Relaxation_map): New types.
13207 (Output_section::relax_input_section): Rename method to
13208 Output_section::convert_input_sections_to_relaxed_sections and change
13209 interface to take a vector of relaxed section pointers.
13210 (Output_section::find_merge_section,
13211 Output_section::find_relaxed_input_section,
13212 Output_section::build_relaxation_map,
13213 Output_section::convert_input_sections_in_list_to_relaxed_sections):
13214 New method declarations.
13215 (Output_section::merge_section_map_
13216 Output_section::merge_section_by_properties_map_,
13217 Output_section::relaxed_input_section_map_,
13218 Output_section::is_relaxed_input_section_map_valid_,
13219 Output_section::generate_code_fills_at_write_): New data members.
13220 * script-sections.cc
13221 (Output_section_element_input::set_section_addresses): Call
13222 current_data_size and addralign methods of relaxed input sections.
13223 (Orphan_output_section::set_section_addresses): Call current_data_size
13224 and addralign methods of relaxed input sections.
13225 * symtab.cc (Symbol_table::compute_final_value): Extract template
13226 from the body of Symbol_table::sized_finalize_symbol.
13227 (Symbol_table::sized_finalized_symbol): Call
13228 Symbol_table::compute_final_value.
13229 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
13230 (Symbol_table::compute_final_value): New templated method declaration.
13231 * target.cc (Target::do_make_output_section): New method defintion.
13232 * target.h (Target::make_output_section): New method declaration.
13233 (Target::relax): Add more parameters for input objects, symbol table
13234 and layout. Adjust call to do_relax.
13235 (Target::do_make_output_section): New method declaration.
13236 (Target::do_relax): Add parameters for input objects, symbol table
13237 and layout.
13238
d446d6c4
ILT
132392009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13240
13241 * pread.c: Include stdio.h.
13242
bc06c745
ILT
132432009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13244
13245 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
13246 defined.
13247
75aea3d0
ILT
132482009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13249
13250 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
13251 Change read_shndx type to unsigned int.
13252 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13253 int.
13254 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13255 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
13256 Change read_shndx type to unsigned int.
13257 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13258 int.
13259 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13260 * layout.cc (Layout::create_symtab_sections): Cast the result of
13261 local_symcount * symsize to off_t in the gold_assert.
13262
be8fcb75
ILT
132632009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13264
13265 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
13266 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
13267 R_ARM_BASE_ABS.
13268 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
13269 (Arm_relocate_functions::thm_abs5): New function.
13270 (Arm_relocate_functions::abs12): New function.
13271 (Arm_relocate_functions::abs16): New function.
13272 (Arm_relocate_functions::base_abs): New function.
13273 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
13274 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
13275 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
13276 R_ARM_BASE_ABS.
13277 (Scan::global): Likewise.
13278 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
13279 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
13280 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
13281 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
13282 R_ARM_BASE_ABS.
13283
c2a122b6
ILT
132842009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13285
13286 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
13287 (Arm_relocate_functions::movt_prel): New function.
13288 (Arm_relocate_functions::thm_movw_prel_nc): New function.
13289 (Arm_relocate_functions::thm_movt_prel): New function.
13290 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
13291 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
13292 (Scan::global, Relocate::relocate): Likewise.
13293 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13294
c4aa1e2d
ILT
132952009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13296
13297 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
13298 Incremental_checker.
13299 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
13300 unsigned int.
13301 (class Incremental_inputs_header): New class.
13302 (Incremental_inputs_header_writer): Edit comment.
13303 (Incremental_inputs_entry): New class.
13304 (Incremental_inputs_entry_writer): Edit comment.
13305 (Sized_incremental_binary::do_find_incremental_inputs_section):
13306 Add *strtab_shndx parameter, fill it.
13307 (Sized_incremental_binary::do_check_inputs): New method.
13308 (Incremental_checker::can_incrementally_link_output_file): Use
13309 Sized_incremental_binary::check_inputs.
13310 (Incremental_inputs::report_command_line): Save command line in
13311 command_line_.
13312 * incremental.h:
13313 (Incremental_binary::find_incremental_inputs_section): New
13314 method.
13315 (Incremental_binary::do_find_incremental_inputs_section): Add
13316 strtab_shndx parameter.
13317 (Incremental_binary::do_check_inputs): New pure virtual method.
13318 (Sized_incremental_binary::do_check_inputs): Declare.
13319 (Incremental_checker::Incremental_checker): Add incremental_inputs
13320 parameter, use it to initialize incremental_inputs_.
13321 (Incremental_checker::incremental_inputs_): New field.
13322 (Incremental_checker::command_line): New method.
13323 (Incremental_checker::inputs): New method.
13324 (Incremental_checker::command_line_): New field.
13325
c549a694
ILT
133262009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13327
13328 * incremental.cc: Include <cstdarg> and "target-select.h".
13329 (vexplain_no_incremental): New function.
13330 (explain_no_incremental): New function.
13331 (Incremental_binary::error): New method.
13332 (Sized_incremental_binary::do_find_incremental_inputs_section): New
13333 method.
13334 (make_sized_incremental_binary): New function.
13335 (open_incremental_binary): New function.
13336 (can_incrementally_link_file): Add checks if output is ELF and has
13337 inputs section.
13338 * incremental.h: Include "elfcpp_file.h" and "output.h".
13339 (Incremental_binary): New class.
13340 (Sized_incremental_binary): New class.
13341 (open_incremental_binary): Declare.
13342 * object.cc (is_elf_object): Use
13343 elfcpp::Elf_recognizer::is_elf_file.
13344 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
13345 * output.h (Output_file::filesize): New method.
13346
fd3c5f0b
ILT
133472009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13348
13349 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
13350 New function.
13351 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
13352 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
13353 function.
13354 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
13355 function.
13356 (Arm_relocate_functions::movw_abs_nc): New function.
13357 (Arm_relocate_functions::movt_abs): New function.
13358 (Arm_relocate_functions::thm_movw_abs_nc): New function.
13359 (Arm_relocate_functions::thm_movt_abs): New function.
13360 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
13361 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
13362 (Scan::global): Likewise.
13363 (Relocate::relocate): Likewise.
13364 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13365
7f5309a5
ILT
133662009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13367
13368 * arm.cc (Arm_relocate_functions::got_prel) New function.
13369 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
13370 (Relocate::relocate): Likewise.
13371 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13372
364c7fa5
ILT
133732009-10-06 Ian Lance Taylor <iant@google.com>
13374
13375 * options.h (class General_options): Define
13376 split_stack_adjust_size parameter.
13377 * object.h (class Object): Add uses_split_stack_ and
13378 has_no_split_stack_ fields. Add uses_split_stack and
13379 has_no_split_stack accessor functions. Declare
13380 handle_split_stack_section.
13381 (class Reloc_symbol_changes): Define.
13382 (class Sized_relobj): Define Function_offsets. Declare
13383 split_stack_adjust, split_stack_adjust_reltype, and
13384 find_functions.
13385 * object.cc (Object::handle_split_stack_section): New function.
13386 (Sized_relobj::do_layout): Call handle_split_stack_section.
13387 * dynobj.cc (Sized_dynobj::do_layout): Call
13388 handle_split_stack_section.
13389 * reloc.cc (Sized_relobj::relocate_sections): Call
13390 split_stack_adjust for executable sections in split_stack
13391 objects. Pass reloc_map to relocate_section.
13392 (Sized_relobj::split_stack_adjust): New function.
13393 (Sized_relobj::split_stack_adjust_reltype): New function.
13394 (Sized_relobj::find_functions): New function.
13395 * target-reloc.h: Include "object.h".
13396 (relocate_section): Add reloc_symbol_changes parameter. Change
13397 all callers.
13398 * target.h (class Target): Add calls_non_split method. Declare
13399 do_calls_non_split virtual method. Declare match_view and
13400 set_view_to_nop.
13401 * target.cc: Include "elfcpp.h".
13402 (Target::do_calls_non_split): New function.
13403 (Target::match_view): New function.
13404 (Target::set_view_to_nop): New function.
13405 * gold.cc (queue_middle_tasks): Give an error if mixing
13406 split-stack and non-split-stack objects with -r.
13407 * i386.cc (Target_i386::relocate_section): Add
13408 reloc_symbol_changes parameter.
13409 (Target_i386::do_calls_non_split): New function.
13410 * x86_64.cc (Target_x86_64::relocate_section): Add
13411 reloc_symbol_changes parameter.
13412 (Target_x86_64::do_calls_non_split): New function.
13413 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
13414 parameter.
13415 * powerpc.cc (Target_powerpc::relocate_section): Add
13416 reloc_symbol_changes parameter.
13417 * sparc.cc (Target_sparc::relocate_section): Add
13418 reloc_symbol_changes parameter.
13419 * configure.ac: Call AM_CONDITIONAL for the default target.
13420 * configure: Rebuild.
13421 * testsuite/Makefile.am (TEST_AS): New variable.
13422 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
13423 (check_DATA): Add split_i386 and split_x86_64 files.
13424 (SPLIT_DEFSYMS): Define.
13425 (split_i386_[1234n].o): New targets.
13426 (split_i386_[124]): New targets.
13427 (split_i386_[1234r].stdout): New targets.
13428 (split_x86_64_[1234n].o): New targets.
13429 (split_x86_64_[124]): New targets.
13430 (split_x86_64_[1234r].stdout): New targets.
13431 (MOSTLYCLEANFILES): Add new executables.
13432 * testsuite/split_i386.sh: New file.
13433 * testsuite/split_x86_64.sh: New file.
13434 * testsuite/split_i386_1.s: New file.
13435 * testsuite/split_i386_2.s: New file.
13436 * testsuite/split_i386_3.s: New file.
13437 * testsuite/split_i386_4.s: New file.
13438 * testsuite/split_i386_n.s: New file.
13439 * testsuite/split_x86_64_1.s: New file.
13440 * testsuite/split_x86_64_2.s: New file.
13441 * testsuite/split_x86_64_3.s: New file.
13442 * testsuite/split_x86_64_4.s: New file.
13443 * testsuite/split_x86_64_n.s: New file.
13444 * testsuite/testfile.cc (Target_test): Update relocation_section
13445 function.
13446 * testsuite/Makefile.in: Rebuild.
13447
e8a9fcda
ILT
134482009-10-06 Ian Lance Taylor <iant@google.com>
13449
13450 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
13451 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
13452 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
13453 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
13454 the address on ldo_addrs_.
13455 (Target_i386::Relocate::fix_up_ldo): New function.
13456
e99daf92
ILT
134572009-10-06 Rafael Espindola <espindola@google.com>
13458
13459 * plugin.cc (add_input_library): New.
13460 (Plugin::load): Add add_input_library to tv.
13461 (Plugin_manager::add_input_file): Add the is_lib argument.
13462 (add_input_file): Update call to Plugin_manager::add_input_file.
13463 (add_input_library): New.
13464 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
13465
966d4097
DK
134662009-09-30 Doug Kwan <dougkwan@google.com>
13467
13468 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
13469 symbol and call Symbol::may_need_copy_reloc to determine if
13470 a copy reloc is needed.
13471 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
13472 nocopyreloc is given in command line.
13473 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
13474 given in command line.
13475 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
13476 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
13477 of the removed Target_i386::may_need_copy_reloc.
13478 * options.h (copyreloc): New option with default value false.
13479 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13480 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
13481 instead of the removed Target_powerpc::may_need_copy_reloc.
13482 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13483 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
13484 instead of the removed Target_sparc::may_need_copy_reloc.
13485 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
13486 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
13487 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
13488 instead of the removed Target_x86_64::may_need_copy_reloc.
13489
029ba973
ILT
134902009-09-30 Ian Lance Taylor <iant@google.com>
13491
13492 * object.h (class Object): Remove target_ field, and target,
13493 sized_target, and set_target methods.
13494 (Object::sized_target): Remove.
13495 (class Sized_relobj): Update declarations. Remove sized_target.
13496 * object.cc (Sized_relobj::setup): Remove target parameter.
13497 Change all callers.
13498 (Input_objects::add_object): Don't do anything with the target.
13499 (make_elf_sized_object): Add punconfigured parameter. Change all
13500 callers. Set or test parameter target.
13501 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
13502 Change all callers.
13503 * parameters.cc (Parameters::set_target): Change parameter type to
13504 be non-const.
13505 (Parameters::default_target): Remove.
13506 (set_parameters_target): Change parameter type to be non-const.
13507 (parameters_force_valid_target): New function.
13508 (parameters_clear_target): New function.
13509 * parameters.h (class Parameters): Update declarations. Remove
13510 default_target method. Add sized_target and clear_target
13511 methods. Change target_ to be non-const.
13512 (set_parameters_target): Update declaration.
13513 (parameters_force_valid_target): Declare.
13514 (parameters_clear_target): Declare.
13515 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
13516 as NULL if we aren't searching.
13517 (Add_symbols::run): Don't check for compatible target.
13518 * fileread.cc (Input_file::open_binary): Call
13519 parameters_force_valid_target.
13520 * gold.cc (queue_middle_tasks): Likewise.
13521 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
13522 set_target on object.
13523 * dynobj.h (class Sized_dynobj): Update declarations.
13524 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
13525 make_elf_object returns NULL.
13526 (Archive::include_member): Don't check whether object target is
13527 compatible.
13528 * output.cc (Output_section::add_input_section): Get target from
13529 parameters.
13530 (Output_section::relax_input_section): Likewise.
13531 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
13532 parameters.
13533 (Sized_relobj::do_scan_relocs): Likewise.
13534 (Sized_relobj::relocate_sections): Likewise.
13535 * resolve.cc (Symbol_table::resolve): Likewise.
13536 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
13537 parameter. Change all callers.
13538 (Symbol_table::add_from_object): Get target from parameters.
13539 (Symbol_table::add_from_relobj): Don't check object target.
13540 (Symbol_table::add_from_dynobj): Likewise.
13541 (Symbol_table::define_special_symbol): Get target from
13542 parameters.
13543 * symtab.h (class Symbol_table): Update declaration.
13544 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
13545 parameter. Change all callers. Clear parameter target.
13546 (Binary_test): Test target here.
13547 * testsuite/object_unittest.cc (gold_testsuite): Remove
13548 target_test_pointer parameter. Change all callers.
13549 (Object_test): Test target here.
13550
a6a22b83
ILT
135512009-09-26 Ian Lance Taylor <iant@google.com>
13552
13553 * testsuite/initpri1.c: Don't try to use constructor priorities if
13554 compiling with gcc before 4.3.
13555
6a8f49fe
ILT
135562009-09-22 Mikolaj Zalewski <mikolajz@google.com>
13557
13558 * testsuite/retain_symbols_file_test.sh (check_present): Change
13559 output file name to retain_symbols_file_test.stdout.
13560 (check_absent): Likewise.
13561
8c604651
CS
135622009-09-18 Craig Silverstein <csilvers@google.com>
13563
13564 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
13565 * options.cc: Include <cerrno> and <fstream>.
13566 (General_options::finalize): Parse -retain-symbols-file tag.
13567 * options.h: New flag.
13568 (General_options): New method should_retain_symbol, new
13569 variable symbols_to_retain.
13570 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
13571 should_retain_symbol map.
13572 * testsuite/Makefile.am (retain_symbols_file_test): New test.
13573 * testsuite/Makefile.in: Regenerate.
13574 * testsuite/retain_symbols_file_test.sh: New file.
13575
ca58b19f
NC
135762009-09-18 Nick Clifton <nickc@redhat.com>
13577
13578 * po/es.po: Updated Spanish translation.
13579
20e6d0d6
DK
135802009-09-17 Doug Kwan <dougkwan@google.com>
13581
13582 * debug.h (DEBUG_RELAXATION): New constant.
13583 (DEBUG_ALL): Add DEBUG_RELAXATION.
13584 (debug_string_to_enum): Add relaxation debug option.
13585 * layout.cc
13586 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
13587 Layout::Relaxation_debug_check::read_sections,
13588 Layout::Relaxation_debug_check::read_sections): New method definitions.
13589 (Layout::Layout): Initialize data members
13590 record_output_section_data_from_scrips_,
13591 script_output_section_data_list_ and relaxation_debug_check_.
13592 (Layout::save_segments, Layout::restore_segments,
13593 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13594 Layout::relaxation_loop_body): New method definitions.
13595 (Layout::finalize): Support relaxation. Move section layout code to
13596 Layout::relaxation_loop_body.
13597 (Layout::set_asection_address_from_script): Move code for orphan
13598 section placement out.
13599 (Layout::place_orphan_sections_in_script): New method definition.
13600 * layout.h (Output_segment_headers, Output_file_header):
13601 New forward class declarations.
13602 (Layout::~Layout): Define.
13603 (Layout::new_output_section_data_from_script): New method definition.
13604 (Layout::place_orphan_sections_in_script): New method declaration.
13605 (Layout::Segment_states): New type declaration.
13606 (Layout::save_segments, Layout::restore_segments,
13607 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13608 Layout::relaxation_loop_body): New method declarations.
13609 (Layout::Output_section_data_list): New type declaration.
13610 (Layout::Relaxation_debug_check): New class definition.
13611 (Layout::record_output_section_data_from_script_,
13612 Layout::script_output_section_data_list_, Layout::segment_states_,
13613 Layout::relaxation_debug_check_): New data members.
13614 * output.cc: (Output_section_headers::do_size): New method definition.
13615 (Output_section_headers::Output_section_headers): Move size
13616 computation to Output_section_headers::do_size.
13617 (Output_segment_headers::do_size): New method definition.
e1df38aa 13618 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
13619 Output_file_header::do_size and call it.
13620 (Output_file_header::do_size): New method definition.
13621 (Output_data_group::Output_data_group): Adjust call to
13622 Output_section_data.
13623 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
13624 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 13625 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
13626 RELAXED_INPUT_SECTION_CODE.
13627 (Output_section::Output_section): Initialize data member checkpoint_.
13628 (Output_section::~Output_section): Delete checkpoint object pointed
13629 by checkpoint_.
13630 (Output_section::add_input_section): Always add an Input_section if
13631 relaxing.
13632 (Output_section::add_merge_input_section): Add assert.
13633 (Output_section::relax_input_section): New method definition.
13634 (Output_section::set_final_data_size): Set load address to zero for
13635 an unallocated section.
13636 (Output_section::do_address_and_file_offset_have_reset_values):
13637 New method definition.
13638 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
13639 Handle relaxed input section.
13640 (Output_section::sort_attached_input_sections): Checkpoint input
13641 section list lazily.
13642 (Output_section::get_input_sections): Change type of input_sections to
13643 list of Simple_input_section pointers. Checkpoint input section list
13644 lazily. Also handle relaxed input sections.
13645 (Output_section::add_input_section_for_script): Take a reference to
13646 a Simple_input_section object instead of Relobj pointer and section
13647 index as parameter. Handle relaxed input sections.
13648 (Output_section::save_states, Output_section::restore_states): New
13649 method definitions.
13650 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
13651 (Output_data::is_data_size_fixed): New method definition.
13652 (Output_data::reset_addresss_and_file_offset): Do not reset data size
13653 if it is fixed.
13654 (Output_data::address_and_file_offset_have_reset_values): New method
13655 definition.
13656 (Output_data::do_address_and_file_offset_have_reset_values): New method
13657 definition.
13658 (Output_data::set_data_size): Check that data size is not fixed.
13659 (Output_data::fix_data_size): New method definition.
13660 (Output_data::is_data_size_fixed_): New data member.
13661 (Output_section_headers::set_final_data_size): New method definition.
13662 (Output_section_headers::do_size): New method declaration.
13663 (Output_segment_headers::set_final_data_size): New method definition.
13664 (Output_segment_headers::do_size): New method declaration.
13665 (Output_file_header::set_final_data_size)::New method definition.
13666 (Output_file_header::do_size)::New method declaration.
13667 (Output_section_data::Output_section_data): Add new parameter
13668 is_data_size_fixed and use it to fix data size.
13669 (Output_data_const::Output_data_const): Adjust call to base class
13670 constructor and fix data size.
13671 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
13672 base class constructor and fix data size.
13673 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
13674 base class constructor and fix data size.
13675 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
13676 class constructor and fix data size.
13677 (Output_data_group::set_final_data_size): New method definition.
13678 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
13679 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
13680 class constructor and fix data size.
13681 (Output_relaxed_input_section): New class definition.
13682 (Output_section::Simple_input_section): New class definition.
13683 (Output_section::get_input_sections): Adjust parameter list.
13684 (Output_section::add_input_section_for_script): Same.
13685 (Output_section::save_states, Output_section::restore_states,
13686 Output_section::do_address_and_file_offset_have_reset_values,
13687 (Output_section::Input_section::Input_section): Handle
13688 RELAXED_INPUT_SECTION_CODE. Add new overload for
13689 Output_relaxed_input_section.
13690 (Output_section::Input_section::is_input_section,
13691 Output_section::Input_section::set_output_section): Handle relaxed
13692 input section.
13693 (Output_section::Input_section::is_relaxed_input_section,
13694 Output_section::Input_section::output_section_data,
13695 Output_section::Input_section::relaxed_input_section): New method
13696 definitions.
13697 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
13698 value.
13699 (Output_section::Input_section::u1_): Update comments.
13700 (Output_section::Input_section::u2_): Add new union member poris.
13701 (Output_section::Checkpoint_output_section): New classs definition.
13702 (Output_section::relax_input_section): New method declaration.
13703 (Output_section::checkpoint_): New data member.
13704 (Output_segment): Update comments.
13705 (Output_segment::Output_segment): Un-privatize copy constructor.
13706 (Output_segment::operator=): Un-privatize.
13707 * script-sections.cc (Output_section_element::Input_section_list):
13708 Change element type to Output_section::Simple_input_section.
13709 (Output_section_element_dot_assignment::set_section_addresses):
13710 Register output section data for relaxation clean up.
13711 (Output_data_exression::Output_data_expression): Adjust call to base
13712 constructor to fix data size.
13713 (Output_section_element_data::set_section_addresses): Register
13714 Output_data_expression object for relaxation clean up.
13715 (struct Input_section_info): Replace Relobj pointer and section index
13716 pair with Output_section::Simple_input_section and Convert struct to a
13717 class.
13718 (Input_section_sorter::operator()): Adjust access to
e1df38aa 13719 Input_section_info data member to use accessors.
20e6d0d6
DK
13720 (Output_section_element_input::set_section_addresses): Use layout
13721 parameter. Adjust code to use Output_section::Simple_input_section
13722 and Input_secction_info classes. Register filler for relaxation
13723 clean up.
13724 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
13725 and section index pair with Output_section::Simple_input_section
13726 class. Adjust code accordingly.
13727 (Phdrs_element::release_segment): New method definition.
13728 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
13729 segment list.
13730 (Script_sections::release_segments): New method definition.
13731 * gold/script-sections.h (Script_sections::release_segments): New
13732 method declaration.
13733 * gold/target.h (Target::may_relax, Target::relax,
13734 Target::do_may_relax, Target::do_relax): New method definitions.
13735
5e445df6
ILT
137362009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13737
13738 * arm.cc (has_signed_unsigned_overflow): New function.
13739 (Arm_relocate_functions::abs8): New function.
13740 (Target_arm::Scan::local): Handle R_ARM_ABS8.
13741 (Target_arm::Scan::global): Likewise.
13742 (Target_arm::relocate::relocate): Likewise.
13743 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
13744 Likewise.
13745
8c604651 137462009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
13747
13748 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
13749 * testsuite/Makefile.in: Regenerate.
13750
1e9cc1c2
NC
137512009-09-11 Nick Clifton <nickc@redhat.com>
13752
13753 * po/gold.pot: Updated by the Translation project.
13754
6a89f575
CC
137552009-09-08 Cary Coutant <ccoutant@google.com>
13756
13757 * output.cc (Output_file::open): Add execute permission to empty file.
13758 * testsuite/Makefile.am (permission_test): New test.
13759 * testsuite/Makefile.in: Regenerate.
13760
fdcac5af
ILT
137612009-09-02 Ian Lance Taylor <iant@google.com>
13762
13763 * output.cc (Output_file::resize): Call map_no_anonymous rather
13764 than map.
13765
44453f85
ILT
137662009-09-01 Mikolaj Zalewski <mikolajz@google.com>
13767
13768 * gold.cc: Include "incremental.h".
13769 (queue_initial_tasks): Call Incremental_checker methods.
13770 * incremental.cc: Include "output.h".
13771 (Incremental_checker::can_incrementally_link_output_file): New
13772 method.
13773 * incremental.h (Incremental_checker): New class.
13774
13775 * output.cc (Output_file::open_for_modification): New method.
13776 (Output_file::map_anonymous): Changed return type to bool. Record
13777 map in base_ field.
13778 (Output_file::map_no_anonymous): New method, broken out of map.
13779 (Output_file::map): Use map_no_anonymous and map_anonymous.
13780 * output.h (class Output_file): Update declarations.
13781
293c1386
CC
137822009-08-24 Cary Coutant <ccoutant@google.com>
13783
13784 * options.h (Command_line::Pre_options): New class.
13785 (Command_line::pre_options): New member.
13786 * options.cc (gold::options::ready_to_register): New variable.
13787 (One_option::register_option): Do nothing if not registering options.
13788 Assert if same short option registered twice.
13789 (General_options::General_options): Turn off option registration when
13790 done constructing.
13791 (Command_line::Pre_options::Pre_options): New constructor.
13792
f773f3d2
CC
137932009-08-24 Cary Coutant <ccoutant@google.com>
13794
06a73cfe
CC
13795 * options.h (General_options::no_keep_memory): Remove incorrect
13796 short option.
f773f3d2 13797
a15af8e2
RW
137982009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13799
13800 * Makefile.am (am__skiplex, am__skipyacc): New.
13801 * Makefile.in: Regenerate.
13802
c462b41b
RW
138032009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13804
14ec8efd
RW
13805 * Makefile.am (AM_CPPFLAGS): Renamed from ...
13806 (INCLUDES): ... this.
13807 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
13808 (AM_CPPFLAGS): Renamed from ...
13809 (INCLUDE): ... this.
13810 * Makefile.in, testsuite/Makefile.in: Regenerate.
13811
81ecdfbb
RW
13812 * Makefile.in: Regenerate.
13813 * aclocal.m4: Likewise.
13814 * config.in: Likewise.
13815 * configure: Likewise.
13816 * testsuite/Makefile.in: Likewise.
13817
c462b41b
RW
13818 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
13819 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
13820 * Makefile.in: Regenerate.
13821 * testsuite/Makefile.in: Regenerate.
13822
2da73f13
CC
138232009-08-19 Cary Coutant <ccoutant@google.com>
13824
13825 * resolve.cc (Symbol_table::resolve): Don't complain about defined
13826 symbols in shared libraries overridden by hidden or internal symbols
13827 in the main program.
13828
2db70501
CD
138292009-08-19 Chris Demetriou <cgd@google.com>
13830
13831 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
13832 checking source file names in error messages.
13833
f733487b
DK
138342009-08-18 Doug Kwan <dougkwan@google.com>
13835
13836 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
13837 an elcpp::Ehdr as parameter. Adjust call to set_target.
13838 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
13839 an elfcpp::Ehdr as parameter.
13840 * object.cc (Object::set_target): Remove the version that looks up
13841 a target and sets it.
13842 (Sized_relobj::setup): Take a Target object instead of
13843 an elfcpp::Ehdr as parameter. Adjust call to set_target.
13844 (make_elf_sized_object): Find target and ask target to
13845 make an ELF object.
13846 * object.h: (Object::set_target): Remove the version that looks up
13847 a target and sets it.
13848 (Sized_relobj::setup): Take a Target object instead of
13849 an elfcpp:Ehdr as parameter.
13850 * target.cc: Include dynobj.h.
13851 (Target::do_make_elf_object_implementation): New.
2e702c99 13852 (Target::do_make_elf_object): New.
f733487b
DK
13853 * target.h (Target::make_elf_object): New template declaration.
13854 (Target::do_make_elf_object): New method declarations.
13855 (Target::do_make_elf_object_implementation): New template declaration.
13856
cc70f101
ILT
138572009-08-14 Ian Lance Taylor <iant@google.com>
13858
13859 * gold.h (FUNCTION_NAME): Define.
13860 (gold_unreachable): Use FUNCTION_NAME.
13861
ef5e0cb1
ST
138622009-08-12 Sriraman Tallam <tmsriram@google.com>
13863
13864 * icf.cc (Icf::find_identical_sections): Issue a warning when a
13865 symbol in the --keep-unique list is not found.
13866
48c187ce
ST
138672009-08-12 Sriraman Tallam <tmsriram@google.com>
13868
13869 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
13870 been maked as --keep-unique.
13871 (Icf::unfold_section): New function.
13872 * icf.h (Icf::unfold_section): New function.
13873 * options.h (General_options::keep_unique): New option.
13874 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
13875 * testsuite/Makefile.in: Regenerate.
13876 * testsuite/icf_keep_unique_test.sh: New file.
13877 * testsuite/icf_keep_unique_test.cc: New file.
13878
645afe0c
CC
138792009-08-12 Cary Coutant <ccoutant@google.com>
13880
13881 PR 10471
13882 * resolve.cc (Symbol_table::resolve): Check for references from
13883 dynamic objects to hidden and internal symbols.
13884 * testsuite/Makefile.am (hidden_test.sh): New test.
13885 * testsuite/Makefile.in: Regenerate.
13886 * testsuite/hidden_test.sh: New script.
13887 * testsuite/hidden_test_1.c: New test source.
13888 * testsuite/hidden_test_main.c: New test source.
13889
11af873f
DK
138902009-08-11 Doug Kwan <dougkwan@google.com>
13891
13892 * arm.cc: Update comments.
13893 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
13894 segment to locate the .ARM.exidx section if present.
13895
b9f7d72d
DK
138962009-08-09 Doug Kwan <dougkwan@google.com>
13897
13898 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
13899 patch.
13900
ddd3c53c
ST
139012009-08-07 Sriraman Tallam <tmsriram@google.com>
13902 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
13903 compiler warnings.
13904
27721062
ST
139052009-08-06 Sriraman Tallam <tmsriram@google.com>
13906
13907 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
13908 valid tls_segment only for non-debug-section relocations.
13909 * testsuite/Makefile.am: Add gc_tls_test.
13910 * testsuite/Makefile.in: Regenerate.
13911 * testsuite/gc_tls_test.cc: New file.
13912 * testsuite/gc_tls_test.sh: New file.
13913
ef15dade 139142009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 13915
ef15dade
ST
13916 * icf.cc: New file.
13917 * icf.h: New file.
13918 * Makefile.am (CCFILES): Add icf.cc.
13919 (HFILES): Add icf.h
13920 * Makefile.in: Regenerate.
13921 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
13922 * gc.h (gc_process_relocs): Populate lists used by icf to contain
13923 section, symbol and addend information for the relocs.
13924 * gold.cc (queue_middle_tasks): Call identical code folding.
13925 * gold.h: Add defines for multimap.
13926 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
13927 to the call of finalize_local_symbols.
13928 * main.cc (main): Create object of class Icf.
13929 * object.cc (Sized_relobj::do_layout): Allow this function to be
13930 called twice during icf.
13931 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
13932 to sections marked as identical by icf.
13933 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
13934 when available.
13935 (Sized_relobj::do_section_entsize): New function.
13936 * object.h (Object::section_entsize): New function.
13937 (Object::do_section_entsize): New pure virtual function.
13938 (Relobj::finalize_local_symbols): Add new parameter.
13939 (Relobj::do_section_entsize): New function.
13940 * options.h (General_options::icf): New option.
13941 (General_options::icf_iterations): New option.
13942 (General_options::print_icf_sections): New option.
13943 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
13944 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
13945 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
13946 icf.
13947 * symtab.cc (Symbol_table::is_section_folded): New function.
13948 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
13949 to sections marked as identical by icf.
13950 * symtab.h (Symbol_table::set_icf): New function.
13951 (Symbol_table::icf): New function.
13952 (Symbol_table::is_section_folded): New function.
13953 (Symbol_table::icf_): New data member.
13954 * target-reloc.h (relocate_section): Ignore sections folded by icf.
13955 * testsuite/Makefile.am: Add commands to build icf_test.
13956 * testsuite/Makefile.in: Regenerate.
13957 * testsuite/icf_test.sh: New file.
13958 * testsuite/icf_test.cc: New file.
13959
c3b65ac4
CD
139602009-07-24 Chris Demetriou <cgd@google.com>
13961
13962 * layout.cc (is_compressible_debug_section): Fix incorrect
13963 comment about compressed section names.
13964
1caf2c51
ILT
139652009-07-20 Ian Lance Taylor <ian@airs.com>
13966
13967 PR 10419
13968 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
13969
1ef4d87f
ILT
139702009-07-16 Ian Lance Taylor <iant@google.com>
13971
13972 PR 10400
13973 * layout.h: #include <map>.
13974 (class Kept_section): Change from struct to class. Add accessors
13975 and setters. Add section size to Comdat_group mapping. Change
13976 Comdat_group to std::map. Add is_comdat_ field. Add
13977 linkonce_size field in union.
13978 (class Layout): Update declaration of find_or_add_kept_section.
13979 Don't declare find_kept_object.
13980 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
13981 parameter. Add object, shndx, is_comdat, and is_group_name
13982 parameters. Change all callers. Adjust for new Kept_section.
13983 (Layout::find_kept_object): Remove.
13984 * object.cc (Sized_relobj::include_section_group): Update use of
13985 Kept_section. Rename secnum to shndx. Only record
13986 Kept_comdat_section if sections are the same size.
13987 (Sized_relobj::include_linkonce_section): Update use of
13988 Kept_section. Only record Kept_comdat_section if sections are the
13989 same size. Set size of linkonce section.
13990 (Sized_relobj::map_to_kept_section): Update call to
13991 get_kept_comdat_section.
13992 * object.h (class Sized_relobj): Rename fields in
13993 Kept_comdat_section to drop trailing underscores; change object
13994 field to Relobj*. Change Kept_comdat_section_table to store
13995 struct rather than pointer.
13996 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
13997 Add kept_object and kept_shndx parameters. Change all callers.
13998 (Sized_relobj::get_kept_comdat_section): Change return type to
13999 bool. Add kept_object and kept_shndx parameters. Change all
14000 callers.
14001 * plugin.cc (Pluginobj::include_comdat_group): Update call to
14002 Layout::find_or_add_kept_section.
14003
37c3b7b0
ILT
140042009-07-09 Ian Lance Taylor <iant@google.com>
14005
14006 * merge.cc (Object_merge_map::initialize_input_to_output_map):
14007 Reserve space in the hash table.
14008
98fa85cb
ILT
140092009-07-06 Mikolaj Zalewski <mikolajz@google.com>
14010
14011 * fileread.cc (File_read::get_mtime): New method.
14012 * fileread.h (Timespec): New structure.
14013 (File_read::get_mtime): New method.
14014 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
14015 Renamed from timestamp_nsec.
14016 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
14017 Elf_Xword.
e1df38aa 14018 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 14019 timestamp_nsec.
e1df38aa 14020 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
14021 (Incremental_inputs::report_obejct): Save mtime; style fix.
14022 (Incremental_inputs::report_script): Save mtime; style fix.
14023 (Incremental_inputs::finalize_inputs): Style fix.
14024 (Incremental_inputs::finalize): Style fix.
14025 (Incremental_inputs::create_input_section_data): Store inputs
14026 mtime.
14027 * incremental.h (Incremental_inputs::report_script): Add mtime
14028 argument.
14029 (Incremental_inputs::Input_info::Input_info): Intialize only one
14030 union member.
14031 (Incremental_inputs::Input_info::archive): Move to nameless
14032 union.
14033 (Incremental_inputs::Input_info::obejct): Move to nameless union.
14034 (Incremental_inputs::Input_info::script): Move to nameless union.
14035 (Incremental_inputs::mtime): New field.
14036 * script.cc (read_input_script): Pass file mtime to
14037 Incremental_input.
14038 * script.h (Script_info::inputs): Style fix.
14039
c9d70757
ILT
140402009-07-01 Ian Lance Taylor <ian@airs.com>
14041
14042 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
14043 instead of 32.
14044
9c547ec3
ILT
140452009-06-24 Ian Lance Taylor <iant@google.com>
14046
14047 PR 10156
14048 * layout.cc (Layout::choose_output_section): If we find an
14049 existing section, update the flags.
14050 (Layout::create_notes): New function, broken out of
14051 Layout::finalize.
14052 (Layout::finalize): Don't create note sections.
14053 (Layout::create_note): Don't crash if linker script discards
14054 section.
14055 (Layout::create_gold_note): Likewise.
14056 (Layout::create_build_id): Likewise. Don't set
14057 after_input_sections on the section.
14058 (Layout::create_executable_stack_info): Remove target parameter.
14059 Change caller.
14060 * layout.h (class Layout): Declare create_notes. Update
14061 declaration of create_executable_stack_info.
14062 * gold.cc (queue_middle_tasks): Call create_notes.
14063 * output.cc (Output_section::update_flags_for_input_section): Move
14064 here from output.h. If SHF_ALLOC flag is newly set, mark address
14065 invalid.
14066 * output.h (Output_data::mark_address_invalid): New function.
14067 (class Output_section): Only declare, not define,
14068 update_flags_for_input_section. Remove set_flags.
14069
55458500
ILT
140702009-06-24 Ian Lance Taylor <iant@google.com>
14071
14072 * script-sections.cc (Output_section_definition::
14073 set_section_addresses): Rename shadowing local load_address to
14074 laddr.
14075
1307d6cd
ILT
140762009-06-24 Ian Lance Taylor <iant@google.com>
14077
14078 PR 10244
14079 * reloc.cc (relocate_sections): Skip empty relocation sections.
14080
ec3f783e
ILT
140812009-06-23 Ian Lance Taylor <iant@google.com>
14082
14083 PR 10156
14084 * layout.cc (Layout::create_note): Use choose_output_section
14085 rather than make_output_section.
14086
459c9f1c
ILT
140872009-06-23 Ian Lance Taylor <iant@google.com>
14088
14089 PR 10237
14090 * options.cc (General_options::parse_V): Set printed_version_.
14091 (General_options::General_options): Initialize printed_version_.
14092 * options.h (class General_options): Add printed_version_ field.
14093 * gold.cc (queue_initial_tasks): If there are no input files,
14094 don't give a fatal error if we printed the version information.
14095 (queue_middle_tasks): If using -r with a shared object, give a
14096 fatal error rather than an ordinary error.
14097
1518dc8f
ILT
140982009-06-23 Ian Lance Taylor <iant@google.com>
14099
14100 PR 10219
14101 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
14102 (Layout::make_output_section): Set have_stabstr_section_ if we see
14103 a .stab*str section.
14104 (Layout::finalize): Call link_stabs_sections.
14105 (Layout::link_stabs_sections): New file.
14106 * layout.h (class Layout): Add have_stabstr_section_ field.
14107 Declare link_stabs_sections.
14108
3d857b98
DK
141092009-06-23 Doug Kwan <dougkwan@google.com>
14110
14111 * Makefile.am (libgold_a_LIBADD): New.
14112 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 14113 * Makefile.in: Regenerate.
3d857b98
DK
14114 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
14115 * configure: Regenerate.
14116 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
14117 * fileread.cc: Include sys/state.h
14118 * gold.h: Declare memmem and strndup if found missing.
14119 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
14120
0639a6f6
ILT
141212009-06-23 Ian Lance Taylor <iant@google.com>
14122
14123 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
14124 * configure: Rebuild.
14125
8d63875c
ILT
141262009-06-23 Ian Lance Taylor <iant@google.com>
14127
14128 PR 10147
14129 * object.cc (Object::section_contents): Don't try to get a view if
14130 the section has length zero.
14131 (Object::handle_gnu_warning_section): If the section is empty, use
14132 the name of the section as the warning.
14133
f7c8a183
ILT
141342009-06-23 Ian Lance Taylor <iant@google.com>
14135
14136 PR 10133
14137 * stringpool.h (class Stringpool_template): Add optimize_ field.
14138 (Stringpool_template::set_optimize): New function.
14139 * stringpool.cc (Stringpool_template::Stringpool_template):
14140 Initialize optimize_ field.
14141 (Stringpool_template::set_string_offsets): Test local optimize
14142 fild rather than parameter.
14143 * layout.cc (Layout::Layout): Call set_optimize on the section
14144 name stringpool.
14145
e6a307ba
ILT
141462009-06-22 Ian Lance Taylor <iant@google.com>
14147
14148 PR 10030
14149 * yyscript.y: Parse TARGET.
14150 * script.cc (script_set_target): New function.
14151 * script-c.h (script_set_target): Declare.
14152 * options.cc (General_options::string_to_object_format): Rename
14153 from string_to_object_format in anonymous namespace. Change
14154 callers.
14155 * options.h (class General_options): Declare
14156 string_to_object_format.
14157
3ee173de
ILT
141582009-06-22 Ian Lance Taylor <iant@google.com>
14159
14160 * script-sections.cc (Script_sections::create_segments): Don't put
14161 program headers in a PT_LOAD segment if -n or -N.
14162
141632009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
14164
14165 PR 10141
14166 * options.h (class General_options): Add -z lazy and -z now. Sort
14167 -z options into alphabetical order.
14168 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
14169
cd6739a1 141702009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
14171
14172 * layout.cc (Layout::make_output_section): Call
14173 Target::new_output_section.
14174 (Layout::attach_allocated_section_to_segment): Put large section
14175 sections in a separate load segment with the large segment flag
14176 set.
14177 (Layout::segment_precedes): Sort large data segments after other
14178 load segments.
14179 (align_file_offset): New static function.
14180 (Layout::set_segment_offsets): Use align_file_offset.
14181 * output.h (class Output_section): Add is_small_section_ and
14182 is_large_section_ fields.
14183 (Output_section::is_small_section): New function.
14184 (Output_section::set_is_small_section): New function.
14185 (Output_section::is_large_section): New function.
14186 (Output_section::set_is_large_section): New function.
14187 (Output_section::is_large_data_section): New function.
14188 (class Output_segment): Add is_large_data_segment_ field.
14189 (Output_segment::is_large_data_segment): New function.
14190 (Output_segment::set_is_large_data_segment): New function.
14191 * output.cc (Output_section::Output_section): Initialize new
14192 fields.
14193 (Output_segment::Output_segment): Likewise.
14194 (Output_segment::add_output_section): Add assertion that large
14195 data sections always go in large data segments. Force small data
14196 sections to the end of the list of data sections. Force small BSS
14197 sections to the start of the list of BSS sections. For large BSS
14198 sections to the end of the list of BSS sections.
14199 * symtab.h (class Symbol): Declare is_common_shndx.
14200 (Symbol::is_defined): Check Symbol::is_common_shndx.
14201 (Symbol::is_common): Likewise.
14202 (class Symbol_table): Define enum Commons_section_type. Update
14203 declarations. Add small_commons_ and large_commons_ fields.
14204 * symtab.cc (Symbol::is_common_shndx): New function.
14205 (Symbol_table::Symbol_table): Initialize new fields.
14206 (Symbol_table::add_from_object): Put small and large common
14207 symbols in the right list.
14208 (Symbol_table::sized_finalized_symbol): Check
14209 Symbol::is_common_shndx.
14210 (Symbol_table::sized_write_globals): Likewise.
14211 * common.cc (Symbol_table::do_allocate_commons): Allocate new
14212 common symbol lists. Don't call do_allocate_commons_list if the
14213 list is empty.
14214 (Symbol_table::do_allocate_commons_list): Remove is_tls
14215 parameter. Add comons_section_type parameter. Change all
14216 callers. Handle small and large common symbols.
14217 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
14218 Symbol::is_common_shndx.
14219 * resolve.cc (symbol_to_bits): Likewise.
14220 * target.h (Target::small_common_shndx): New function.
14221 (Target::small_common_section_flags): New function.
14222 (Target::large_common_shndx): New function.
14223 (Target::large_common_section_flags): New function.
14224 (Target::new_output_section): New function.
14225 (Target::Target_info): Add small_common_shndx, large_common_shndx,
14226 small_common_section_flags, and large_common_section_flags
14227 fields.
14228 (Target::do_new_output_section): New virtual function.
14229 * arm.cc (Target_arm::arm_info): Initialize new fields.
14230 * i386.cc (Target_i386::i386_info): Likewise.
14231 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
14232 Likewise.
14233 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
14234 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
14235 (Target_x86_64::do_new_output_section): New function.
14236 * configure.ac: Define conditional MCMODEL_MEDIUM.
14237 * testsuite/Makefile.am (check_PROGRAMS): Add large.
14238 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
14239 (large_LDFLAGS): Define.
14240 * testsuite/large.c: New file.
14241 * testsuite/testfile.cc (Target_test::test_target_info):
14242 Initialize new fields.
14243 * configure, testsuite/Makefile.in: Rebuild.
14244
bb04269c
DK
142452009-06-05 Doug Kwan <dougkwan@google.com>
14246
14247 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 14248 * Makefile.in: Regenerate.
bb04269c
DK
14249 * i386.cc (class Target_i386): Define new virtual method to
14250 override do_is_local_label_name in parent.
14251 * object.cc (Sized_relobj::do_count_local_symbols): Discard
14252 local symbols if --discard-locals or -X is given.
14253 * options.h (class General_options): Declare new options
14254 '--discard-locals' and '-X' for discarding locals.
14255 * target.h (class Target): Define new methods is_local_label_name.
14256 Declare new virtual method do_is_local_label_name.
14257 * target.cc: New file.
14258 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
14259 (check_SCRIPTS): Add discard_locals_test.sh.
14260 (check_DATA): Add discard_local_tests.syms.
14261 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
14262 (discard_local_tests.syms, discard_locals_test.o): New make rules.
14263 * testsuite/Makefile.in: Regenerate.
14264 * testsuite/discard_locals_test.c: New file.
14265 * testsuite/discard_locals_test.sh: Same.
14266
805bb01c
DK
142672009-06-05 Doug Kwan <dougkwan@google.com>
14268
14269 * object.cc (Sized_relobj::Sized_relobj): Initialize
14270 discarded_eh_frame_shndx_ to -1U.
14271 (Sized_relobj::do_layout): Record index of a discard .eh_frame
14272 section.
14273 (Sized_relobj::do_count_local_symbols): Skip local symbols in
14274 a discarded .eh_frame section.
14275 (Sized_relobj::do_finalize_local_symbols): Ditto.
14276 * object.h (class Sized_relobj): Declare new member
14277 discarded_eh_frame_shndx_.
14278 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
14279 (local_labels_test.o, local_labels_test): New rules.
14280 * testsuite/Makefile.in: Regenerate.
14281
1dcd334d
DK
142822009-06-04 Doug Kwan <dougkwan@google.com>
14283
14284 * layout.cc (Layout::section_name_mapping): Add mapping for
14285 special ARM sections.
14286
96d49306
DK
142872009-06-03 Doug Kwan <dougkwan@google.com>
14288
14289 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
14290 (utils::has_overflow): Same.
14291
dff16297
ILT
142922009-06-03 Ian Lance Taylor <iant@google.com>
14293
14294 * layout.cc (Layout::section_name_mapping): New array, replacing
14295 Layout::linkonce_mapping.
14296 (Layout::section_name_mapping_count): New variable, replacing
14297 Layout::linkonce_mapping_count.
14298 (Layout::linkonce_output_name): Remove.
14299 (Layout::output_section_name): Rewrite.
14300 * layout.h (class Layout): Rename Linkonce_mapping to
14301 Section_name_mapping, linkonce_mapping to section_name_mapping,
14302 linkonce_mapping_count to section_name_mapping_count. Don't
14303 declare linkonce_output_name.
14304
c121c671
DK
143052009-06-03 Doug Kwan <dougkwan@google.com>
14306
14307 * gold/arm.cc (namespace utils): New.
14308 (Target_arm::reloc_is_non_pic): Define new method.
14309 (class Arm_relocate_functions): New.
14310 (Target_arm::Relocate::relocate): Handle relocation types used by
14311 Android.
14312
07800fab
ILT
143132009-06-03 Ian Lance Taylor <iant@google.com>
14314
14315 * arm.cc (Target_arm::scan::global): Use || instead of |.
14316
c121c671
DK
143172009-06-02 Doug Kwan <dougkwan@google.com>
14318
14319 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
14320 issued_non_pic_error_.
14321 (class Target_arm::Scan): Declare new method check_non_pic.
14322 Define new method symbol_needs_plt_entry.
14323 Declare new data member issued_non_pic_error_.
14324 (class Target_arm::Relocate): Declare new method
14325 should_apply_static_reloc.
14326 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
14327 (Target_arm::Scan::check_non_pic): Define new method.
14328 (Target_arm::Scan::local): Handle a small subset of reloc types used
14329 by Android.
14330 (Target_arm::Scan::local): Same.
14331 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
14332
b19b0c6d
ILT
143332009-05-31 Mikolaj Zalewski <mikolajz@google.com>
14334
14335 * incremental.cc (Incremental_inputs::report_command_line): Filter
14336 out --incremental-* options.
14337
94cdfcff
DK
143382009-05-29 Doug Kwan <dougkwan@google.com>
14339
14340 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
14341 template class.
14342 (class Target_arm): Update comment.
14343 (Target_arm::Target_arm): Initialize new data members GOT_,
14344 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
14345 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
14346 and Target_arm::rel_dyn_section.
14347 Declare new_enum Target_arm::Got_type.
14348 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
14349 and DYNBSS_.
14350 Update commments for member do_dynsym_value.
14351 (Target_arm::got_size, Target_arm::plt_section,
14352 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
14353 new methods inside class defintion.
14354 (Target_arm::got_section): Define new method.
14355 (Target_arm::rel_dyn_section): Same.
14356 (Output_data_plt_arm): New template class.
14357 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
14358 (Output_data_plt_arm:do_adjust_output_section): Define new method.
14359 (Output_data_plt_arm::add_entry): Same.
14360 (Output_data_plt_arm::first_plt_entry): Define new
14361 static data member for PLT instruction template.
14362 (Output_data_plt_arm::plt_entry): Same.
14363 (Output_data_plt_arm::do_write): Define new method.
14364 (Target_arm::make_plt_entry): Same.
14365 (Target_arm::do_finalize_sections): Same.
14366 (Target_arm::do_dynsym_value): Same.
14367
4a657b0d
DK
143682009-05-28 Doug Kwan <dougkwan@google.com>
14369
14370 * Makefile.am (TARGETSOURCES): Add arm.cc.
14371 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
14372 * Makefile.in: Regenerate.
14373 * arm.cc: New file.
14374 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
14375
e7ae8c36
DK
143762009-05-26 Doug Kwan <dougkwan@google.com>
14377
14378 * options.cc (General_options::parse_exclude_libs). Fix a comment.
14379 (General_options::check_excluded_libs): Strip off directories in
14380 archive name before matching like GNU ld does.
14381 * testsuite/Makefile.am (MOSTLYCLEANFILES,
14382 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
14383 (exclude_libs_test_LDFLAGS): Add linker option
14384 -Wl,--exclude-libs,libexclude_libs_test_3
14385 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
14386 an explicit archive without using -l.
14387 (alt/libexclude_libs_test_3.a): New make rule.
14388 * testsuite/Makefile.in: Regenerate.
14389 * testsuite/exclude_libs_test.c : Declare lib3_default().
14390 (main): Call it.
14391 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
14392 * exclude_libs_test_3.c: New file.
14393
f12e7348
NC
143942009-05-26 Nick Clifton <nickc@redhat.com>
14395
14396 * po/id.po: New Indonesian translation.
14397 * po/gold.pot: Updated template file.
14398
4daadc0d
ST
143992009-05-22 Sriraman Tallam <tmsriram@google.com>
14400
e1df38aa 14401 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
14402 gc_comdat_test files. Add -Wl,--gc-sections to build
14403 gc_comdat_test.
14404 * testsuite/Makefile.in: Regenerate.
14405 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
14406
531813ad
ST
144072009-05-21 Sriraman Tallam <tmsriram@google.com>
14408
14409 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
14410 kept comdat section was garbage collected.
14411 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
14412 * testsuite/Makefile.in: Regenerate.
14413 * testsuite/gc_comdat_test.sh: New file.
14414 * testsuite/gc_comdat_test_1.cc: New file.
14415 * testsuite/gc_comdat_test_2.cc: New file.
14416
65514900
CC
144172009-05-19 Doug Kwan <dougkwan@google.com>
14418
14419 * archive.cc (Archive::Archive): Move constructor from archive.h
14420 to here. Initialize no_export_.
14421 (Archive::get_elf_object_for_member): Set no_export flag of object.
14422 * archive.h (Archive::Archive): Move constructor body to
14423 archive.cc.
14424 (Archive::no_export): New method.
14425 (Archive::no_export_): New field.
14426 * object.h (Object::Object): Initialize no_export_ to false.
14427 (Object::no_export, Object::set_no_export): New methods.
14428 (Object::no_export_): New field.
14429 * options.cc (General_options::parse_exclude_libs): New method.
14430 (General_options::check_excluded_libs) Same.
14431 * options.h (exclude_libs): New option.
14432 (General_options::check_excluded_libs): New method declaration.
14433 (General_options::excluded_libs_): New field.
14434 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
14435 default or protected visibility if an object has no-export flag set.
14436 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
14437 (check_SCRIPTS): Add exclude_libs_test.sh.
14438 (check_DATA): Add exclude_libs_test.syms.
14439 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
14440 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
14441 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
14442 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
14443 (exclude_libs_test.syms, libexclude_libs_test_1.a,
14444 libexclude_libs_test_2.a): New rules.
14445 * testsuite/Makefile.in: Regenerate.
14446 * testsuite/exclude_libs_test.c: New file.
14447 * testsuite/exclude_libs_test.sh: Ditto.
14448 * testsuite/exclude_libs_test_1.c: Ditto.
14449 * testsuite/exclude_libs_test_2.c: Ditto.
14450
1b77ea50
ILT
144512009-05-15 Ian Lance Taylor <iant@google.com>
14452
14453 * configure.ac: Check for declarations for cases where libiberty.h
14454 checks HAVE_DECL_xxx.
14455 * configure, config.in: Rebuild.
14456
072fe7ce
ILT
144572009-05-15 Mikolaj Zalewski <mikolajz@google.com>
14458
14459 * gold.h (Incremental_argument_list): Remove (invalid) forward
14460 declaration.
14461 * incremental.cc (Incremental_inputs::report_achive): New method.
14462 (Incremental_inputs::report_object): New method.
14463 (Incremental_inputs::report_script): New method.
14464 (Incremental_inputs::finalize_inputs): New method.
14465 (Incremental_inputs::finalize): Call finalize_inputs().
14466 (Incremental_inputs::sized_create_incremental_inputs_section_data):
14467 Create inputs entries.
14468 * incremental.h (Incremental_input_type): New enum.
14469 (Incremental_inputs::Incremental_input): Initialize new fields.
14470 (Incremental_inputs::report_inputs): New method.
14471 (Incremental_inputs::report_achive): New method.
14472 (Incremental_inputs::report_object): New method.
14473 (Incremental_inputs::report_script): New method.
14474 (Incremental_inputs::finalize_inputs): New method.
14475 (Incremental_inputs::Input_info): New struct.
14476 (Incremental_inputs::Input_info_map): New typedef.
14477 (Incremental_inputs::lock_): New field.
14478 (Incremental_inputs::Inputs_): New field.
14479 (Incremental_inputs::Inputs_map): New field.
14480 * main.cc (main): Call Incremental_input::report_inputs.
14481 * options.h (Input_argument_list): Typedef moved from
14482 Input_arguments.
14483 (Input_file_group::Files): Remove, use ::Input_argument_list.
14484 (Input_file_group::Input_argument_list): Remove, use
14485 ::Input_argument_list.
14486 * plugin.cc (Plugin_manager::add_input_file): Add error in
14487 incremental build.
14488 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
14489 functions.
14490 * script.cc (read_input_script): Call
14491 Incremental_input::report_script.
14492 * script.h (Script_info): New class.
14493
b0481b0b
ILT
144942009-04-27 Ian Lance Taylor <iant@google.com>
14495
14496 * x86_64.cc (do_adjust_output_section): Set entsize to
14497 plt_entry_size.
14498
b22a5a41 144992009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
14500
14501 * output.cc (Output_file::close): After short writes, continue
14502 writing from the correct offset in the buffer being written.
14503
40fde488
CD
145042009-04-23 Chris Demetriou <cgd@google.com>
14505
14506 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
14507 * configure: Regenerate.
14508 * config.in: Regenerate.
14509 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
14510 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
14511
3ce2c28e
ILT
145122009-04-21 Mikolaj Zalewski <mikolajz@google.com>
14513
14514 * incremental.cc (Incremental_inputs_header_data): Renamed from
14515 Incremental_input_header_data.
14516 (Incremental_inputs_header_data::data_size): New field.
14517 (Incremental_inputs_header_data::put_input_file_count): Renamed
14518 from input_file_count.
14519 (Incremental_inputs_header_data::put_command_line_offset): Renamed
14520 from command_line_offset.
14521 (Incremental_inputs_header_data::put_reserved): Renamed from
14522 put_reserved.
14523 (Incremental_inputs_entry_data): Renamed from
14524 Incremental_input_entry_data.
14525 (Incremental_inputs_entry_data::data_size): New field.
14526 (Incremental_inputs::report_command_line): New method.
14527 (Incremental_inputs::finalize): New method.
14528 (Incremental_inputs::create_incremental_inputs_data): New method.
14529 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
14530 * incremental.h: New file.
14531 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 14532 (Layout::finalize): Create incremental inputs section in
3ce2c28e 14533 incremental builds.
703d02da 14534 (Layout::create_incremental_info_sections): New method.
3ce2c28e 14535 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
14536 (Layout::create_incremental_info_sections): New method.
14537 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
14538 * main.cc (main): Notify Incremental_input of the command line.
14539
e55bde5e
ILT
145402009-04-01 Ian Lance Taylor <iant@google.com>
14541 Mikolaj Zalewski <mikolajz@google.com>
14542
14543 * gold.h (reserve_unordered_map): Define, three versions, one for
14544 each version of Unordered_map.
14545 * layout.cc (Layout::Layout): Remove options parameter. Add
14546 number_of_input_files parameter. Don't initialize options_.
14547 Initialize number_of_input_files_ and resized_signatures_. Move
14548 sections_are_attached_.
14549 (Layout::layout_group): Reserve space for group_signatures_.
14550 (Layout::find_or_add_kept_section): Change name parameter to be a
14551 reference. Resize signatures_ map when it gets large enough.
14552 (Layout::layout_eh_frame): Use parameters->options() instead of
14553 this->options_.
14554 (Layout::make_output_section): Likewise.
14555 (Layout::attach_allocated_section_to_segment): Likewise.
14556 (Layout::finalize, Layout::create_executable_stack): Likewise.
14557 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
14558 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
14559 * layout.h (class Layout): Update declarations. Remove options_
14560 field. Add number_of_input_files_ and resized_signatures_
14561 fields. Move sections_are_attached_ field.
14562 * main.cc (main): Pass number of input files to Layout
14563 constructor. Don't pass options.
14564
154b857c
ILT
145652009-03-30 Ian Lance Taylor <iant@google.com>
14566
14567 * ffsll.c (ffsll): Correct implementation.
14568
2f35ab9b
ILT
145692009-03-27 Ian Lance Taylor <iant@google.com>
14570
fd03461a
ILT
14571 * ffsll.c: New file.
14572 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
14573 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
14574 * ftruncate.c (ftruncate): Declare before definition.
14575 * mremap.c (mremap): Likewise.
14576 * pread.c (pread): Likewise.
14577 * configure, Makefile.in, config.in: Rebuild.
14578
2f35ab9b
ILT
14579 * mremap.c: New file.
14580 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
14581 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
14582 (mremap): Declare if HAVE_MREMAP is not defined.
14583 * configure, Makefile.in, config.in: Rebuild.
14584
33aea2fd
CC
145852009-03-27 Cary Coutant <ccoutant@google.com>
14586
14587 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
14588 position independent.
14589 * sparc.cc (Target_sparc::check_non_pic): Likewise.
14590 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
14591
6d479619
CC
145922009-03-24 Cary Coutant <ccoutant@google.com>
14593
14594 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
14595 an executable.
14596 (needs_dynamic_reloc): Likewise.
14597
afc06bb8
ILT
145982009-03-24 Ian Lance Taylor <iant@google.com>
14599
14600 * yyscript.y (file_cmd): Recognize EXTERN.
14601 (extern_name_list, extern_name_list_body): New nonterminals.
14602 * script.cc (script_add_extern): Define.
14603 * script-c.h (script_add_extern): Declare.
14604
f6060a4d
ILT
146052009-03-24 Rafael Avila de Espindola <espindola@google.com>
14606
14607 * object.cc (is_elf_object): Define.
14608 * object.h (is_elf_object): Declare.
14609 * archive.cc (Archive::get_elf_object_for_member): Call
14610 is_elf_object.
33aea2fd 14611 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 14612
26736d8e
ILT
146132009-03-24 Elliott Hughes <enh@google.com>
14614
14615 * output.cc (Output_file::map_anonymous): Define.
14616 (Output_file::map): Use map_anonymous. If the regular mmap fails,
14617 try an anonymous one. Report the size if the mmap fails.
14618 * output.h (class Output_file): Declare map_anonymous.
14619
22fd9730
ILT
146202009-03-24 Ian Lance Taylor <iant@google.com>
14621
14622 * target-select.cc (instantiate_target): Don't acquire the lock if
14623 the instantiated_target_ field has already been set.
14624
cb010894
ILT
146252009-03-23 Ian Lance Taylor <iant@google.com>
14626
7f055c20
ILT
14627 * gold-threads.h (class Initialize_lock): Define.
14628 * gold-threads.cc (class Initialize_lock_once): Define.
14629 (initialize_lock_control): New static variable.
14630 (initialize_lock_pointer): New static variable.
14631 (initialize_lock_once): New static function.
14632 (Initialize_lock::Initialize_lock): Define.
14633 (Initialize_lock::initialize): Define.
14634 * target-select.h: Include "gold-threads.h".
14635 (class Target_selector): Add lock_ and initialize_lock_ fields.
14636 Don't define instantiate_target, just declare it.
14637 * target-select.cc (Target_selector::Target_selector): Initialize
14638 new fields.
14639 (Target_selector::instantiate_target): Define.
14640 * descriptors.h: Include "gold-threads.h".
14641 (class Descriptors): Add initialize_lock_ field.
14642 * descriptors.cc (Descriptors::Descriptors): Initialize new
14643 field.
14644 (Descriptors::open): Use initialize_lock_ field
14645 * errors.h (class Errors): Add initialize_lock_ field.
14646 * errors.cc (Errors::Errors): Initialize new field.
14647 (Errors::initialize_lock): Use initialize_lock_ field.
14648 * powerpc.cc (class Target_selector_powerpc): Remove
14649 instantiated_target_ field. In do_recognize call
14650 instantiate_target rather than do_instantiate_target. In
14651 do_instantiate_target just allocate a new target.
14652 * sparc.cc (class Target_selector_sparc): Likewise.
14653
36959681
ILT
14654 * freebsd.h: New file.
14655 * i386.cc: Include "freebsd.h".
14656 (Target_i386): Derive from Target_freebsd rather than
14657 Sized_target.
14658 (Target_selector_i386): Derive from Target_selector_freebsd rather
14659 than Target_selector.
14660 * x86_64.cc: Include "freebsd.h".
14661 (Target_x86_64): Derive from Target_freebsd rather than
14662 Sized_target.
14663 (Target_selector_x86_64): Derive from Target_selector_freebsd
14664 rather than Target_selector.
14665 * target.h (class Target): Add adjust_elf_header and
14666 do_adjust_elf_header.
14667 * output.cc (Output_file_header:: do_sized_write): Call target
14668 adjust_elf_header routine.
14669 * configure.tgt: Set targ_osabi.
14670 * configure.ac: Define GOLD_DEFAULT_OSABI.
14671 * parameters.cc (Parameters::default_target): Pass
14672 GOLD_DEFAULT_OSABI to select_target.
14673 * target-select.h (class Target_selector): Make instantiate_target
14674 protected rather than private.
14675 * Makefile.am (HFILES): Add freebsd.h.
14676 * configure, Makefile.in, config.in: Rebuild.
14677
cb010894
ILT
14678 * merge.cc (do_add_input_section): Correct pend value. Change
14679 message about last entry not being null terminated from error to
14680 warning.
14681
0e879927
ILT
146822009-03-20 Mikolaj Zalewski <mikolajz@google.com>
14683
14684 * incremental.cc: New file.
14685 * Makefile.am (CCFILES): Add incremental.cc.
14686 * Makefile.in: Rebuild.
14687
41105937
PP
146882009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
14689
14690 * layout.cc (Layout::output_section_name): Preserve names
14691 of '.note.' sections.
e1df38aa 14692
60439920
ILT
146932009-03-19 Ian Lance Taylor <iant@google.com>
14694
14695 * descriptors.cc (Descriptors::open): Check that the options are
14696 valid before using them.
14697
0d371ad3
ILT
146982009-03-18 Ian Lance Taylor <iant@google.com>
14699
14700 * script-sections.h: Include <list>.
14701 (class Script_sections): Change Sections_elements from std::vector
14702 to std::list. Typedef public Elements_iterator. Add
14703 orphan_section_placement_, data_segment_align_start_, and
14704 saw_data_segment_align_ fields. Remove data_segment_align_index_
14705 field.
14706 * script-sections.cc (class Orphan_section_placement): New class.
14707 (class Sections_element): Add virtual functions is_relro and
14708 orphan_section_init. Remove virtual function place_orphan_here.
14709 (class Output_section_definition): Add is_relro and
14710 orphan_section_init. Remove place_orphan_here.
14711 (class Orphan_output_section): Likewise.
14712 (Script_sections::Script_sections): Update for field changes.
14713 (Script_sections::data_segment_align): Set saw_data_segment_align_
14714 and data_segment_align_start_, not data_segment_align_index.
14715 (Script_sections::data_segment_relro_end): Check
14716 saw_data_segment_align_. Use data_segment_align_start_ rather
14717 than data_segment_align_index_.
14718 (Script_sections::place_orphan): Rewrite to use
14719 Orphan_section_placement.
14720
9201d894
ILT
147212009-03-17 Ian Lance Taylor <iant@google.com>
14722
9c5b8369
ILT
14723 * archive.cc (Archive::add_symbols): Check for a version attached
14724 to the symbol name in the archive map.
14725 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
14726 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
14727 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
14728 (ver_test_11.a): New target.
14729 * testsuite/Makefile.in: Rebuild.
14730
9201d894
ILT
14731 * configure.ac: Check for chsize and posix_fallocate. Replace
14732 ftruncate.
14733 * ftruncate.c: New file, from gnulib.
14734 * output.cc (posix_fallocate): Define dummy version if not
14735 HAVE_POSIX_FALLOCATE.
14736 (Output_file::map): Call posix_fallocate rather than lseek and
14737 write.
14738 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
14739 * configure, Makefile.in, config.in: Rebuild.
14740
ef4ab7a8 147412009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 14742
ef4ab7a8
PP
14743 * layout.h (Layout::create_note): Add section_name parameter.
14744 * layout.cc (Layout::create_note): Likewise.
14745 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 14746
8c500701
ILT
147472009-03-17 Ian Lance Taylor <iant@google.com>
14748
e85b18e1
ILT
14749 * descriptors.cc: Include "options.h".
14750 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
14751 (Descriptors::open): Always use O_CLOEXEC when opening a new
14752 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
14753 then set FD_CLOEXEC.
14754
9efe6174
ILT
14755 * sparc.cc (class Target_sparc): Add has_got_section.
14756 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
14757 make sure we have a GOT section.
14758
14759 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
14760 (Target_sparc::Scan::local): Likewise.
14761 (Target_sparc::Scan::global): Likewise.
14762 (Target_sparc::Relocate::relocate): Likewise.
14763 (Target_sparc::Relocate::relocate_tls): Likewise.
14764
8c500701
ILT
14765 * symtab.cc (Symbol_table::define_default_version): New function,
14766 broken out of add_from_object.
14767 (Symbol_table::add_from_object): Call define_default_version.
14768 (Symbol_table::define_special_symbol): Add resolve_oldsym
14769 parameter. Change all callers. If the version for a symbol comes
14770 from a version script, resolve it with the symbol with the same
14771 name with no version. Also add the symbol without a version if
14772 appropriate.
14773 (do_define_in_output_data): If resolving with oldsym, don't delete
14774 sym.
14775 (do_define_in_output_segment): Likewise.
14776 (do_define_as_constant): Likewise.
14777 * symtab.h (class Symbol_table): Update declarations.
14778
f1ed28fb
ILT
147792009-03-13 Ian Lance Taylor <iant@google.com>
14780
15f8229b
ILT
14781 * readsyms.cc (Read_symbols::incompatible_warning): New function.
14782 (Read_symbols::requeue): New function.
14783 (Read_symbols::do_read_symbols): If make_elf_object fails because
14784 the target type is not configured, and the file was searched for,
14785 issue a warning and retry with the next directory.
14786 (Add_symbols::run): If the file has an incompatible format, and
14787 it was searched for, requeue the Read_symbols task. On error,
14788 release the object.
14789 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
14790 dirindex parameter to constructor. Change all callers. Declare
14791 incompatible_warning and requeue.
14792 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
14793 input_argument_ and input_group_ fields. Add them to
14794 constructor. Change all callers.
14795 (class Read_script): Add dirindex_ field. Add it to constructor.
14796 Change all callers.
14797 * archive.cc (Archive::setup): Remove input_objects parameter.
14798 Change all callers.
14799 (Archive::get_file_and_offset): Likewise.
14800 (Archive::read_all_symbols): Likewise.
14801 (Archive::read_symbols): Likewise.
14802 (Archive::get_elf_object_for_member): Remove input_objects
14803 parameter. Add punconfigured parameter. Change all callers.
14804 (Archive::add_symbols): Change return type to bool. Check return
14805 value of include_member.
14806 (Archive::include_all_members): Likewise.
14807 (Archive::include_member): Change return type to bool. Return
14808 false if first included object has incompatible target. Set
14809 included_member_ field.
14810 (Add_archive_symbols::run): If add_symbols returns false, requeue
14811 Read_symbols task.
14812 * archive.h (class Archive): Add included_member_ field.
14813 Initialize it in constructor. Add input_file and searched_for
14814 methods. Update declarations.
14815 (class Add_archive_symbols): Add dirpath_, dirindex_, and
14816 input_argument_ fields. Add them to constructor. Change all
14817 callers.
14818 * script.cc: Include "target-select.h".
14819 (class Parser_closure): Add skip_on_incompatible_target_ and
14820 found_incompatible_target_ fields. Add
14821 skip_on_incompatible_target parameter to constructor. Change all
14822 callers. Add methods skip_on_incompatible_target,
14823 clear_skip_on_incompatible_target, found_incompatible_target, and
14824 set_found_incompatible_target.
14825 (read_input_script): Add dirindex parameter. Change all callers.
14826 If parser finds an incompatible target, requeue Read_symbols
14827 task.
14828 (script_set_symbol): Clear skip_on_incompatible_target in
14829 closure.
14830 (script_add_assertion, script_parse_option): Likewise.
14831 (script_start_sections, script_add_phdr): Likewise.
14832 (script_check_output_format): New function.
14833 * script.h (read_input_script): Update declaration.
14834 * script-c.h (script_check_output_format): Declare.
14835 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
14836 (ignore_cmd): Remove OUTPUT_FORMAT.
14837 * fileread.cc (Input_file::Input_file): Add explicit this.
14838 (Input_file::will_search_for): New function.
14839 (Input_file::open): Add pindex parameter. Change all callers.
14840 * fileread.h (class Input_file): Add input_file_argument method.
14841 Declare will_search_for. Update declarations.
14842 * object.cc (make_elf_object): Add punconfigured parameter.
14843 Change all callers.
14844 * object.h (class Object): Make input_file public. Add
14845 searched_for method.
14846 (make_elf_object): Update declaration.
14847 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
14848 restart search.
14849 * dirsearch.h (class Dirsearch): Update declaration.
14850 * options.h (class General_options): Add --warn-search-mismatch.
14851 * parameters.cc (Parameters::is_compatible_target): New function.
14852 * parameters.h (class Parameters): Declare is_compatible_target.
14853 * workqueue.cc (Workqueue::add_blocker): New function.
14854 * workqueue.h (class Workqueue): Declare add_blocker.
14855
f1ed28fb
ILT
14856 * fileread.cc (Input_file::open): Remove options parameter.
14857 Change all callers.
14858 (Input_file::open_binary): Likewise.
14859 * script.cc (read_input_script): Likewise.
14860 * readsyms.h (class Read_symbols): Remove options_ field. Remove
14861 options parameter from constructor. Change all callers.
14862 (class Read_script): Likewise.
14863 * fileread.h (class Input_file): Update declarations.
14864 * script.h (read_input_script): Update declaration.
14865
34dd024a
NC
148662009-03-10 Nick Clifton <nickc@redhat.com>
14867
14868 * po/es.po: New Spanish translation.
14869
6d71b17c
CC
148702009-03-06 Cary Coutant <ccoutant@google.com>
14871
14872 * options.cc (parse_short_option): Keep dash_z from registering itself.
14873
031cdbed
ILT
148742009-03-03 Ian Lance Taylor <iant@google.com>
14875
14876 PR 9918
14877 * target-reloc.h (relocate_section): Pass output_section to
14878 relocate.
14879 * i386.cc (Target_i386::should_apply_static_reloc): Add
14880 output_section parameter. Change all callers.
14881 (Target_i386::Relocate::relocate): Add output_section parameter.
14882 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
14883 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
14884 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
14885 * testsuite/two_file_shared.sh: New script.
14886 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
14887 (check_DATA): Add two_file_shared.dbg.
14888 (two_file_shared.dbg): New target.
14889 * testsuite/Makefile.in: Rebuild.
14890
15d5fa16
ILT
148912009-03-01 Ian Lance Taylor <iant@google.com>
14892
14893 * configure.ac: Check for byteswap.h.
14894 * configure: Rebuild.
14895 * config.in: Rebuild.
14896
8a4c0b0d
ILT
148972009-03-01 Mikolaj Zalewski <mikolajz@google.com>
14898
14899 * layout.cc (Layout::find_or_add_kept_section): New function.
14900 (Layout::add_comdat): Removed.
14901 * layout.h (struct Kept_section): Move out of class Layout.
14902 Remove trailing underscores from field names. Add group_sections
14903 field. Rename group_ field to is_group. Change all uses.
14904 (class Layout): Declare find_or_add_kept_section, not add_comdat.
14905 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
14906 comdat_groups_ field.
14907 (Sized_relobj::include_section_group): Use
14908 find_or_add_kept_section and Kept_section::group_sections.
14909 (Sized_relobj::include_linkonce_section): Likewise.
14910 * object.cc (class Sized_relobj): Don't define Comdat_group or
14911 Comdat_group_table. Remove find_comdat_group and
14912 add_comdat_group. Remove comdat_groups_ field.
14913 * plugin.cc (include_comdat_group): Use
14914 Layout::find_or_add_kept_section.
14915
b4ecf66b
ILT
149162009-02-28 Ian Lance Taylor <iant@google.com>
14917
14359ca0
ILT
14918 * README: --gc-sections and map files are now supported. Document
14919 some build requirements.
14920
b4ecf66b
ILT
14921 PR 6992
14922 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
14923 relocatable link set the value of the section symbol to zero.
14924 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
14925 relocatable link don't include the section address in the local
14926 symbol value.
14927
0602e05a
ILT
149282009-02-27 Ian Lance Taylor <iant@google.com>
14929
fd9d194f
ILT
14930 PR 6811
14931 * options.h (class Search_directory): Add is_system_directory.
14932 (class General_options): Declare is_in_system_directory.
14933 * options.cc (get_relative_sysroot): Make static.
14934 (get_default_sysroot): Make static.
14935 (General_optoins::is_in_system_directory): New function.
14936 * fileread.cc (Input_file::is_in_system_directory): New function.
14937 * fileread.h (class Input_file): Declare is_in_system_directory.
14938 * object.h (class Object): Add is_in_system_directory.
14939 (class Input_objects): Remove system_library_directory_ field.
14940 * object.cc (Input_objects::add_object): Don't set
14941 system_library_directory_.
14942 (input_objects::found_in_system_library_directory): Remove.
14943 * symtab.cc (Symbol_table::write_globals): Remove input_objects
14944 parameter. Change all callers.
14945 (Symbol_table::sized_write_globals): Likewise.
14946 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
14947 Call Object::is_in_system_directory.
14948 * symtab.h (class Symbol_table): Update declarations.
14949
61edd21f
ILT
14950 PR 5990
14951 * descriptors.h (Open_descriptor): Add is_on_stack field.
14952 * descriptors.cc (Descriptors::open): If the descriptor is on the
14953 top of the stack, remove it. Initialize is_on_stack field.
14954 (Descriptors::release): Only add pod to stack if it is not on the
14955 stack already.
14956 (Descriptors::close_some_descriptor): Clear stack_next and
14957 is_on_stack fields.
14958
e29e076a
ILT
14959 PR 7091
14960 * output.cc (Output_section::find_starting_output_address): Rename
14961 from starting_output_address; add PADDR parameter; change return
14962 type.
14963 * output.h (class Output_section): Declare
14964 find_starting_output_address instead of starting_output_address.
14965 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
14966 section symbol for which we can't find a merge section.
14967
0602e05a
ILT
14968 PR 9836
14969 * symtab.cc (Symbol_table::add_from_object): If the visibility is
14970 hidden or internal, force the symbol to be local.
14971 * resolve.cc (Symbol::override_visibility): Define.
14972 (Symbol::override_base): Use override_visibility.
14973 (Symbol_table::resolve): Likewise.
14974 (Symbol::override_base_with_special): Likewise.
14975 (Symbol_table::override_with_special): If the visibility is hidden
14976 or internal, force the symbol to be local.
14977 * symtab.h (class Symbol): Add set_visibility and
14978 override_visibility.
14979 * testsuite/ver_test_1.sh: New file.
14980 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
14981 (check_DATA): Add ver_test_1.syms.
14982 (ver_test_1.syms): New target.
14983 * testsuite/Makefile.in: Rebuild.
14984
401a9a73
CC
149852009-02-25 Cary Coutant <ccoutant@google.com>
14986
14987 * layout.cc (Layout::choose_output_section): Don't rename sections
14988 when using a linker script that has a SECTIONS clause.
14989 * Makefile.in: Regenerate.
14990
14991 * testsuite/Makefile.am (script_test_5.sh): New test case.
14992 * testsuite/Makefile.in: Regenerate.
14993 * testsuite/script_test_5.cc: New file.
14994 * testsuite/script_test_5.sh: New file.
14995 * testsuite/script_test_5.t: New file.
14996
f488e4b0
CC
149972009-02-13 Rafael Avila de Espindola <espindola@google.com>
14998
14999 * archive.cc (Archive::include_member): Update calls to add_symbols.
15000 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
15001 the Layout argument.
15002 * dynobj.h (do_add_symbols): Add the Layout argument.
15003 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
15004 Layout argument.
15005 * object.h (Object::add_symbols): Add the Layout argument.
15006 (Object::do_add_symbols): Add the Layout argument.
15007 (Sized_relobj::do_add_symbols): Add the Layout argument.
15008 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
15009 Unify the two versions.
15010 (Add_plugin_symbols): Remove.
15011 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
15012 (Sized_pluginobj::do_add_symbols): Unify the two versions.
15013 (Add_plugin_symbols): Remove.
15014 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
15015 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
15016 (Add_symbols::run): Make it work with Pulginobj.
15017
89dd1680
ILT
150182009-02-06 Ian Lance Taylor <iant@google.com>
15019
15020 * object.cc (Sized_relobj::do_layout): Make info message start
15021 with lower case letter.
15022
266d0a74
ILT
150232009-02-06 Mikolaj Zalewski <mikolajz@google.com>
15024
602b464e
ILT
15025 * binary.cc: Fix file comment.
15026
266d0a74
ILT
15027 * options.h (enum Incremental_disposition): Define.
15028 (class General_options): Add new options: --incremental,
15029 --incremental_changed, --incremental_unchanged,
15030 --incremental_unknown. Add incremental_disposition_ and
15031 implicit_incremental_ fields.
15032 (General_options::incremental_disposition): New function.
15033 (class Position_dependent_options): Add incremental_disposition
15034 option.
15035 (Position_dependent_options::copy_from_options): Set incremental
15036 dispositions.
15037 * options.cc (General_options::parse_incremental_changed): New
15038 function.
2e702c99
RM
15039 (General_options::parse_incremental_unchanged): New function.
15040 (General_options::parse_incremental_unknown): New function.
15041 (General_options::General_options): Initialize new fields
266d0a74 15042 incremental_disposition_ and implicit_incremental_.
2e702c99 15043 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
15044 without --incremental.
15045
f073bbf7
CD
150462009-02-06 Chris Demetriou <cgd@google.com>
15047
15048 * gold.h (gold_undefined_symbol): Change to take only a Symbol
15049 pointer and to report location as the file name associated with
15050 the symbol.
15051 (gold_undefined_symbol_at_location): New function to replace the
15052 old gold_undefined_symbol functionality.
15053 * target-reloc.h (relocate_section): Update to use
15054 gold_undefined_symbol_at_location.
15055 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
15056 Call gold_undefined_symbol function rather than gold_error.
15057 * errors.h (Errors::undefined_symbol): Take location as a
15058 string, rather than calculating it from a relocation.
15059 * errors.cc (Errors::fatal): Print "fatal error:" before the
15060 formatted message.
15061 (Errors::error, Errors::error_at_location): Print "error: "
15062 before the formatted message.
15063 (Errors::undefined_symbol): Take location as a string, rather
15064 than calculating it from a relocation.
15065 (gold_undefined_symbol_at_location): New function akin to
15066 old gold_undefined_symbol, calculates location from relocation.
15067 (gold_undefined_symbol): Change to take only a Symbol pointer
15068 and to report location as the file name associated with the symbol.
15069 * testsuite/debug_msg.sh: Update for changed error messages.
15070 * testsuite/undef_symbol.sh: Likewise.
15071
8e94a90c
ILT
150722009-02-04 Duncan Sands <baldrick@free.fr>
15073
15074 PR 9812
15075 * reduced_debug_output.h
15076 (Output_reduced_debug_abbrev_section::failed): Use format for
15077 gold_warning.
15078 (Output_reduced_debug_info_section::faild): Likewise.
15079
88a0e15b
ILT
150802009-01-31 Mikolaj Zalewski <mikolajz@google.com>
15081
15082 * script.cc (Lazy_demangler): New class.
2e702c99 15083 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
15084 symbol only once.
15085
5efc7cd2
CC
150862009-01-29 Cary Coutant <ccoutant@google.com>
15087
15088 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
15089 to __tls_get_addr.
15090 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
15091
e0ebcf42
ILT
150922009-01-28 Ian Lance Taylor <iant@google.com>
15093
5efc7cd2 15094 * version.cc (version_string): Bump to 1.9.
75fe7426 15095
e0ebcf42
ILT
15096 * gold.h: Include <cstring> and <stdint.h>.
15097 * version.cc: Include <cstdio>.
15098 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
15099 warning.
15100 * reduced_debug_output.cc (insert_into_vector): Rename from
15101 Insert_into_vector; change all callers. Use Swap_unaligned to
15102 avoid aliasing issue; remove union since it is unnecessary.
15103
8e2813be 151042009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
15105
15106 * Makefile.am (CCFILES): Add gc.cc.
15107 (HFILES): Add gc.h.
15108 * Makefile.in: Regenerate.
15109 * gold.cc (Gc_runner): New class.
15110 (queue_initial_tasks): Call garbage collection related tasks
15111 when corresponding options are invoked.
15112 (queue_middle_gc_tasks): New function.
15113 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
15114 processed early before laying out sections during garbage collection.
15115 * gold.h (queue_middle_gc_tasks): New function.
15116 (is_prefix_of): Move from "layout.cc".
15117 * i386.cc (Target_i386::gc_process_relocs): New function.
15118 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
15119 * main.cc (main): Create object of class "Garbage_collection".
15120 * object.cc (Relobj::copy_symbols_data): New function.
15121 (Relobj::is_section_name_included): New function.
e1df38aa
NC
15122 (Sized_relobj::do_layout): Allow this function to be called twice
15123 during garbage collection and defer layout of section during the
6d03d481
ST
15124 first call.
15125 * object.h (Relobj::get_symbols_data): New function.
15126 (Relobj::is_section_name_included): New function.
15127 (Relobj::copy_symbols_data): New function.
15128 (Relobj::set_symbols_data): New function.
15129 (Relobj::get_relocs_data): New function.
15130 (Relobj::set_relocs_data): New function.
15131 (Relobj::is_output_section_offset_invalid): New pure virtual function.
15132 (Relobj::gc_process_relocs): New function.
15133 (Relobj::do_gc_process_relocs): New pure virtual function.
15134 (Relobj::sd_): New data member.
15135 (Sized_relobj::is_output_section_offset_invalid): New function.
15136 (Sized_relobj::do_gc_process_relocs): New function.
15137 * options.h (General_options::gc_sections): Modify to not be a no-op.
15138 (General_options::print_gc_sections): New option.
15139 * plugin.cc (Plugin_finish::run): Remove function call to
15140 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
15141 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
15142 * reloc.cc (Read_relocs::run): Add task to process relocs and
15143 determine unreferenced sections when doing garbage collection.
15144 (Gc_process_relocs): New class.
15145 (Sized_relobj::do_gc_process_relocs): New function.
15146 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
15147 sections that are garbage collected.
15148 * reloc.h (Gc_process_relocs): New class.
15149 * sparc.cc (Target_sparc::gc_process_relocs): New function.
15150 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
15151 symbols whose corresponding sections are garbage collected.
15152 (Symbol_table::Symbol_table): Add new parameter for the garbage
15153 collection object.
15154 (Symbol_table::gc_mark_undef_symbols): New function.
15155 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15156 (Symbol_table::gc_mark_dyn_syms): New function.
15157 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
15158 as garbage.
15159 (Symbol_table::add_from_object): Likewise.
15160 (Symbol_table::add_from_relobj): When building shared objects, do not
15161 treat externally visible symbols as garbage.
15162 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
15163 table information for static and relocatable links.
15164 * symtab.h (Symbol_table::set_gc): New function.
15165 (Symbol_table::gc): New function.
15166 (Symbol_table::gc_mark_undef_symbols): New function.
15167 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15168 (Symbol_table::gc_mark_dyn_syms): New function.
15169 (Symbol_table::gc_): New data member.
e1df38aa 15170 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
15171 function.
15172 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
15173 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
15174
3b293544
CF
151752009-01-20 Chris Faylor <me.sourceware@sourceware.org>
15176
15177 * options.h (General_options::gc_sections): Define as a no-op for now.
15178 (General_options::no_keep_memory): Ditto.
15179 (General_options::Bshareable): Define.
15180 * options.cc (General_options::finalize): Honor -Bshareable.
15181
83d22aa8
AS
151822009-01-20 Andreas Schwab <schwab@suse.de>
15183
15184 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
15185 read the value in the contents, since we don't use it. Use the
15186 template endianness when writing.
15187 (Relocate::relocate): Use it for R_PPC_REL16_HA.
15188
cd536b21
AS
151892009-01-19 Andreas Schwab <schwab@suse.de>
15190
15191 * configure.tgt (powerpc64-*): Fix targ_obj.
15192
99e9a495
ILT
151932009-01-15 Ian Lance Taylor <iant@google.com>
15194
15195 * object.cc (Sized_relobj::write_local_symbols): Don't write out
15196 local symbols when stripping all symbols.
15197
bbbfea06
CC
151982009-01-14 Cary Coutant <ccoutant@google.com>
15199
99e9a495 15200 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 15201
0f7c0701
CC
152022009-01-14 Cary Coutant <ccoutant@google.com>
15203
15204 * archive.cc (Archive::get_elf_object_for_member): Remove call
15205 to File_read::claim_for_plugin.
15206 * descriptors.cc (Descriptors::open): Remove reference to
15207 is_claimed.
15208 (Descriptors::claim_for_plugin): Remove.
15209 * descriptors.h (Descriptors::claim_for_plugin): Remove.
15210 (Descriptors::is_claimed): Remove.
15211 (claim_descriptor_for_plugin): Remove.
15212 * fileread.cc (File_read::claim_for_plugin): Remove.
15213 * fileread.h (File_read::claim_for_plugin): Remove.
15214 (File_read::descriptor): Reopen descriptor if necessary.
15215 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
15216 (Plugin_manager::all_symbols_read): Add task parameter. Change
15217 all callers.
15218 (Plugin_manager::get_input_file): New function.
15219 (Plugin_manager::release_input_file): New function.
15220 (Pluginobj::Pluginobj): Add filesize parameter and initialize
15221 corresponding data member.
15222 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
15223 and pass to base constructor. Change all callers.
15224 (get_input_file, release_input_file): New functions.
15225 (make_sized_plugin_object): Add filesize parameter. Change all callers.
15226 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
15227 (Plugin_manager::all_symbols_read): Add task parameter.
15228 (Plugin_manager::get_input_file): New function.
15229 (Plugin_manager::release_input_file): New function.
15230 (Plugin_manager::task_): New data member.
15231 (Pluginobj::Pluginobj): Add filesize parameter.
15232 (Pluginobj::filename): New function.
15233 (Pluginobj::descriptor): New function.
15234 (Pluginobj::filesize): New function.
15235 (Pluginobj::filesize_): New data member.
15236 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
15237 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
15238 File_read::claim_for_plugin; use Object::unlock to unlock the file.
15239
15240 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
15241 with archive libraries.
15242 * testsuite/Makefile.in: Regenerate.
15243 * testsuite/plugin_test.c (struct sym_info): New type.
15244 (get_input_file, release_input_file): New static variables.
15245 (onload): Capture new transfer vector entries.
15246 (claim_file_hook): Stop reading at end of file according to filesize.
15247 Factor out parsing of readelf output into separate function.
15248 (all_symbols_read_hook): Exercise get_input_file and release_input_file
15249 APIs and get the source file name from the symbol table. Convert
15250 source file name to corresponding object file name. Print info
15251 message when adding new input files.
15252 (parse_readelf_line): New function.
15253 * testsuite/plugin_test_1.sh: Add checks for new info messages.
15254 * testsuite/plugin_test_2.sh: Likewise.
15255 * testsuite/plugin_test_3.sh: Likewise.
15256 * testsuite/plugin_test_4.sh: New test case.
15257
62a6d109
ILT
152582009-01-07 Ian Lance Taylor <iant@google.com>
15259
15260 * version.cc (version_string): Bump to 1.8.
15261
483620e8
CC
152622008-12-23 Cary Coutant <ccoutant@google.com>
15263
15264 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
15265 * plugin.cc (Plugin_manager::finish): Rename as
15266 layout_deferred_objects. Move cleanup to separate function.
15267 (Plugin_manager::cleanup): New function.
15268 (Plugin_finish::run): Call layout_deferred_objects and cleanup
15269 separately.
15270 * plugin.h (Plugin_manager::finish): Rename as
15271 layout_deferred_objects.
15272 (Plugin_manager::cleanup): New function.
15273 (Plugin_manager::cleanup_done): New field.
15274
d66a9eb3
CC
152752008-12-23 Cary Coutant <ccoutant@google.com>
15276
15277 * plugin.cc (is_visible_from_outside): New function.
15278 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
15279 so we don't return "IR only" status for exported symbols or -r links.
15280
15281 * testsuite/Makefile.am (plugin_test_3): New test case.
15282 * testsuite/Makefile.in: Regenerate.
15283 * testsuite/plugin_test_3.sh: New file.
15284
5995b570
CC
152852008-12-22 Cary Coutant <ccoutant@google.com>
15286
15287 * object.cc (Sized_relobj::layout_section): New function.
15288 (Sized_relobj::do_layout): Defer layout of input sections until after
15289 plugin has provided replacement files.
15290 (Sized_relobj::do_layout_deferred_sections): New function.
15291 * object.h (Relobj::set_section_offset): Remove virtual keyword.
15292 (Relobj::layout_deferred_sections): New function.
15293 (Relobj::do_layout_deferred_sections): New function.
15294 (Sized_relobj::do_layout_deferred_sections): New function.
15295 (Sized_relobj::layout_section): New function.
15296 (Sized_relobj::Deferred_layout): New structure.
15297 (Sized_relobj::deferred_layout_): New field.
15298 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
15299 Change all callers. Layout deferred sections.
15300 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
15301 references.
15302 (Plugin_hook::run): Move code from do_plugin_hook inline.
15303 (Plugin_hook::do_plugin_hook): Remove.
15304 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
15305 (Plugin_manager::finish): Renamed, was cleanup.
15306 (Plugin_manager::should_defer_layout): New function.
15307 (Plugin_manager::add_deferred_layout_object): New function.
15308 (Plugin_manager::Deferred_layout_list): New type.
15309 (Plugin_manager::deferred_layout_objects_): New field.
15310 (Plugin_hook::do_plugin_hook): Remove.
15311
ee769c88
ILT
153122008-12-17 Ian Lance Taylor <iant@google.com>
15313
15314 * options.h (class General_options): Add --no case for
15315 --export-dynamic.
15316
abc8dcba
CC
153172008-12-16 Cary Coutant <ccoutant@google.com>
15318
15319 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
15320 vector.
15321 (Plugin_manager::claim_file): Create plugin object even if
15322 plugin did not call the add_symbols callback.
15323 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
15324 asking for more symbols than were added.
15325 * testsuite/Makefile.am (plugin_test_1): Add test case with
15326 no global symbols.
15327 (empty.syms): New target.
15328 * testsuite/Makefile.in: Regenerate.
15329 * testsuite/plugin_test.c (claim_file_hook): Add new debug
15330 message. Don't call add_symbols if no globals.
15331 (all_symbols_read_hook): Don't provide replacement for empty
15332 claimed file.
15333
b0074644
ILT
153342008-12-12 Ian Lance Taylor <iant@google.com>
15335
68943102
ILT
15336 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
15337 r_type == 0 for a local symbol with r_sym == 0.
15338 (scan_relocatable_relocs): Pass r_sym to
15339 local_non_section_strategy.
15340 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
15341 r_sym parameter.
15342
b0074644
ILT
15343 * configure.ac: Update test for TLS descriptors: they are
15344 supported as of glibc 2.9.
15345 * configure: Rebuild.
15346
c2508178
ILT
153472008-12-11 Ian Lance Taylor <iant@google.com>
15348
15349 PR 7091
15350 * target-reloc.h (Default_scan_relocatable_relocs): For each
15351 function, map r_type == 0 to RELOC_DISCARD.
15352
2756a258
CC
153532008-12-10 Cary Coutant <ccoutant@google.com>
15354
15355 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
15356 object to override a kept COMDAT group from a plugin object.
15357
bb6f53d3
ILT
153582008-12-09 Ian Lance Taylor <iant@google.com>
15359
fbc558e1
ILT
15360 PR 7088
15361 * yyscript.y (file_cmd): Handle INPUT.
15362
bb6f53d3
ILT
15363 * testsuite/initpri1.c: Change all declarations to be full
15364 prototypes by adding void, to avoid compiler warnings.
15365
4674ecfc
CC
153662008-12-05 Rafael Avila de Espindola <espindola@google.com>
15367
15368 * options.cc (General_options::parse_plugin_opt): New.
15369 (General_options::add_plugin): The argument now is just the filename.
15370 (General_options::add_plugin_option): New.
15371 * options.h (plugin_opt): New.
15372 (add_plugin): Change argument name.
15373 (add_plugin_option): New.
15374 * plugin.cc (Plugin::load): Don't parse the plugin option.
15375 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
15376 (Plugin::add_option): New.
15377 (Plugin::args_): Change type.
15378 (Plugin::filename_): New.
15379 (Plugin_manager::add_plugin_option): New.
15380 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
15381 * testsuite/Makefile.in: Regenerate.
15382
fd06b4aa
CC
153832008-12-05 Cary Coutant <ccoutant@google.com>
15384
15385 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
15386 Handle --strip-lto-sections option.
15387 * options.h (strip_lto_sections): New option.
15388
6c52134c
CC
153892008-12-01 Cary Coutant <ccoutant@google.com>
15390
15391 * plugin.cc (ld_plugin_message): Change format parameter to const.
15392 Fix mismatch between new[] and delete.
15393
a45248e0
CC
153942008-11-14 Cary Coutant <ccoutant@google.com>
15395
15396 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
15397 instead of -1U.
15398
c82fbeee
CS
153992008-11-05 Craig Silverstein <csilvers@google.com>
15400
15401 * options.cc (General_options::parse_dynamic_list): New function.
15402 * options.h (General_options): New flags dynamic_list,
15403 dynamic_list_data, dynamic_list_cpp_new, and
15404 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
15405 (General_options::in_dynamic_list): New function.
15406 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
15407 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
15408 (Lex::can_continue_name): Likewise.
15409 (yylex): Likewise.
15410 (read_script_file): New parameter script_options.
15411 (read_dynamic_list): New function.
15412 (Script_options::define_dynamic_list): New function.
15413 (dynamic_list_keyword_parsecodes): New variable.
15414 (dynamic_list_keywords): New variable.
15415 * script.h (Script_options::define_dynamic_list): New function
15416 prototype.
15417 (read_dynamic_list): New function prototype.
15418 * symtab.cc (strprefix): New macro.
15419 (Symbol::should_add_dynsym_entry): Support dynamic_list,
15420 dynamic_list_data, dynamic_list_cpp_new, and
15421 dynamic_list_cpp_typeinfo.
15422 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
15423 (dynamic_list_expr): New rule.
15424 (dynamic_list_nodes): Likewise.
15425 (dynamic_list_node): Likewise.
15426 * testsuite/Makefile.am (dynamic_list): New test.
15427 * testsuite/Makefile.in: Regenerated.
15428 * testsuite/dynamic_list.t: New file.
15429 * testsuite/dynamic_list.sh: New file.
15430
e0bb29a5
CS
154312008-11-05 Craig Silverstein <csilvers@google.com>
15432
15433 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
15434 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
15435 (t11_last): Likewise.
15436 * testsuite/ver_test_6.c (main): Likewise.
15437
4e1e25e0
CC
154382008-10-07 Cary Coutant <ccoutant@google.com>
15439
15440 * options.c (General_options::finalize): Add check for -static and
15441 -shared.
15442 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
15443 is not empty.
15444
92f03fcb
CC
154452008-10-02 Cary Coutant <ccoutant@google.com>
15446
15447 * plugin.cc (make_sized_plugin_object): Fix conditional
15448 compilation to work when not all targets are enabled.
15449
fbd8a257
CC
154502008-09-29 Cary Coutant <ccoutant@google.com>
15451
15452 * archive.cc (Archive::get_file_and_offset): Use filename instead
15453 of name to get library path.
15454 (Archive::include_member): Unlock external member of a thin archive.
15455
15456 * testsuite/Makefile.am (TEST_AR): New variable.
15457 (thin_archive_test_1): New test.
15458 (thin_archive_test_2): New test.
81636b3f
CC
15459 * testsuite/Makefile.in: Regenerate.
15460 * testsuite/thin_archive_main.cc: New file.
15461 * testsuite/thin_archive_test_1.cc: New file.
15462 * testsuite/thin_archive_test_2.cc: New file.
15463 * testsuite/thin_archive_test_3.cc: New file.
15464 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 15465
eff45813
CC
154662008-09-29 Cary Coutant <ccoutant@google.com>
15467
15468 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
15469 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
15470 instead of -1U.
15471 (Sized_relobj::do_finalize_local_symbols): Likewise.
15472 (Sized_relobj::map_to_kept_section): Likewise.
15473 * object.h (Sized_relobj::invalid_address): New constant.
15474 (Sized_relobj::do_output_section_offset): Check for invalid_address
15475 and return -1ULL.
15476 * output.cc (Output_reloc::local_section_offset): Use constant
15477 invalid_address instead of -1U.
15478 (Output_reloc::get_address): Likewise.
15479 (Output_section::output_address): Change -1U to -1ULL.
15480 * output.h (Output_reloc::invalid_address): New constant.
15481 * reloc.cc (Sized_relobj::write_sections): Use constant
15482 invalid_address instead of -1U.
15483 (Sized_relobj::relocate_sections): Likewise.
15484 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
15485 values for merge sections.
15486 * target-reloc.h (relocate_for_relocatable): Use constant
15487 invalid_address instead of -1U.
15488
89fc3421
CC
154892008-09-19 Cary Coutant <ccoutant@google.com>
15490
15491 Add plugin functionality for link-time optimization (LTO).
15492 * configure.ac (plugins): Add --enable-plugins option.
15493 * configure: Regenerate.
15494 * config.in: Regenerate.
15495 * Makefile.am (LIBDL): New variable.
15496 (CCFILES): Add plugin.cc.
15497 (HFILES): Add plugin.h.
15498 (ldadd_var): Add LIBDL.
15499 * Makefile.in: Regenerate.
15500
15501 * archive.cc: Include "plugin.h".
15502 (Archive::setup): Don't preread archive symbols when using a plugin.
15503 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
15504 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
15505 files.
15506 (Archive::include_member): Add symbols from plugin objects.
15507 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
15508 * descriptors.cc (Descriptors::open): Check for file descriptors
15509 abandoned by plugins.
15510 (Descriptors::claim_for_plugin): New function.
15511 * descriptors.h (Descriptors::claim_for_plugin): New function.
15512 (Open_descriptor::is_claimed): New field.
15513 (claim_descriptor_for_plugin): New function.
15514 * fileread.cc (File_read::claim_for_plugin): New function.
15515 * fileread.h (File_read::claim_for_plugin): New function.
15516 (File_read::descriptor): New function.
15517 * gold.cc: Include "plugin.h".
15518 (queue_initial_tasks): Add task to call plugin hooks for generating
15519 new object files.
15520 * main.cc: Include "plugin.h".
15521 (main): Load plugin libraries.
15522 * object.h (Pluginobj): Declare.
15523 (Object::pluginobj): New function.
15524 (Object::do_pluginobj): New function.
15525 (Object::set_target): New function.
15526 * options.cc: Include "plugin.h".
15527 (General_options::parse_plugin): New function.
15528 (General_options::General_options): Initialize plugins_ field.
15529 (General_options::add_plugin): New function.
15530 * options.h (Plugin_manager): Declare.
15531 (General_options): Add --plugin option.
15532 (General_options::has_plugins): New function.
15533 (General_options::plugins): New function.
15534 (General_options::add_plugin): New function.
15535 (General_options::plugins_): New field.
15536 * plugin.cc: New file.
15537 * plugin.h: New file.
15538 * readsyms.cc: Include "plugin.h".
15539 (Read_symbols::do_read_symbols): Check for archive before checking
15540 for ELF file. Call plugin hooks to claim files.
15541 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
15542 from a real object file; force override when processing replacement
15543 files.
15544 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
15545 (Symbol::init_base_object): Likewise.
15546 (Symbol::init_base_output_data): Likewise.
15547 (Symbol::init_base_output_segment): Likewise.
15548 (Symbol::init_base_constant): Likewise.
15549 (Symbol::init_base_undefined): Likewise.
15550 (Symbol::output_section): Assert that object is not a plugin.
15551 (Symbol_table::add_from_pluginobj): New function.
15552 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
15553 undefined.
15554 (Symbol_table::sized_write_globals): Likewise.
15555 (Symbol_table::add_from_pluginobj): Instantiate template.
15556 * symtab.h (Sized_pluginobj): Declare.
15557 (Symbol::in_real_elf): New function.
15558 (Symbol::set_in_real_elf): New function.
15559 (Symbol::in_real_elf_): New field.
15560 (Symbol_table::add_from_pluginobj): New function.
15561
15562 * testsuite/Makefile.am (AM_CFLAGS): New variable.
15563 (LIBDL): New variable.
15564 (LDADD): Add LIBDL.
15565 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
15566 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
15567 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
15568 (MOSTLYCLEANFILES): Likewise.
15569 * testsuite/Makefile.in: Regenerate.
15570 * testsuite/plugin_test.c: New file.
15571 * testsuite/plugin_test_1.sh: New file.
15572 * testsuite/plugin_test_2.sh: New file.
15573
de31bda5
ILT
155742008-09-16 Ian Lance Taylor <iant@google.com>
15575
9c2d0ef9
ILT
15576 * target-reloc.h (relocate_section): Check whether a symbol is
15577 defined by the ABI before reporting an undefined symbol error.
15578 * target.h (Target::is_defined_by_abi): Make parameter const.
15579 (Target::do_is_defined_by_abi): Likewise.
15580 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
15581 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
15582 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
15583 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
15584 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
15585 * testsuite/Makefile.in: Rebuild.
15586
de31bda5
ILT
15587 * fileread.cc (make_view): Add casts to avoid warning.
15588
9fa33bee
AO
155892008-09-16 Alexandre Oliva <aoliva@redhat.com>
15590
15591 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
15592 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15593
183fd0e3
AO
155942008-09-16 Alexandre Oliva <aoliva@redhat.com>
15595
15596 * options.h (General_options::output_is_executable): New.
15597 (General_options::output_is_pie): New.
15598 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
15599 for shared libraries.
15600 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15601
7be8330a
CD
156022008-09-11 Chris Demetriou <cgd@google.com>
15603
15604 * options.h (origin): New -z option.
15605 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
15606 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
15607 in DT_FLAGS_1.
15608
a9caad02
CC
156092008-09-05 Cary Coutant <ccoutant@google.com>
15610
15611 * fileread.cc (File_read::make_view): Add check for attempt to map
15612 beyond end of file.
15613
ae6dce4d
CC
156142008-09-05 Cary Coutant <ccoutant@google.com>
15615
15616 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
15617 explicit instantiations.
15618
d7ab2a47
KVH
156192008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
15620
15621 PR gold/6858
15622 * options.cc (General_options::finalize): Allow undefined symbols
15623 in shlibs if linking -shared.
15624
15625 PR gold/6859
15626 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
15627 symbols as not needing a dynsym entry.
15628
1e52a9c1
CS
156292008-08-20 Craig Silverstein <csilvers@google.com>
15630
15631 * fileread.cc (File_read::open): Do not lock the file unless it
15632 was successfully opened.
15633
d85c80a3
CC
156342008-08-14 Cary Coutant <ccoutant@google.com>
15635
15636 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
15637 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
15638 * testsuite/tls_test.cc (struct int128): 128-bit struct
15639 for testing TLS relocs with non-zero addend.
15640 (v12): New TLS variable.
15641 (t12): New test.
15642 (t_last): Add check for v12.
15643 * testsuite/tls_test.h (t12): New function.
15644 * testsuite/tls_test_main.cc (thread_routine): Call new test.
15645
2d924fd9
ILT
156462008-08-13 Ian Lance Taylor <iant@google.com>
15647
15648 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
15649 set tls_segment_ or relro_segment_.
15650 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
15651 when appropriate.
15652 * output.h (Output_section::clear_is_relro): New function.
15653 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
15654 sections specially even when output_data_ is empty.
15655 (Output_segment::maximum_alignment): When first section is relro,
15656 only force alignment for PT_LOAD segments.
15657 * script.cc (script_data_segment_align): New function.
15658 (script_data_segment_relro_end): New function.
15659 * script-c.h (script_data_segment_align): Declare.
15660 (script_data_segment_relro_end): Declare.
15661 * script-sections.h (class Script_sections): Declare
15662 data_segment_align and data_segment_relro_end. Add fields
15663 segment_align_index_ and saw_relro_end_.
15664 * script-sections.cc (class Sections_element): Add set_is_relro
15665 virtual function. Add new bool* parameter to place_orphan_here.
15666 Add get_output_section virtual function.
15667 (class Output_section_definition): Add set_is_relro. Add new
15668 bool* parameter to place_orphan_here. Add get_output_section.
15669 Add is_relro_ field.
15670 (Output_section_definition::Output_section_definition): Initialize
15671 evaluated_address_, evaluated_load_address, evaluated_addralign_,
15672 and is_relro_ fields.
15673 (Output_section_definition::place_orphan_here): Add is_relro
15674 parameter.
15675 (Output_section_definition::set_section_addresses): Set relro for
15676 output section.
15677 (Output_section_definition::alternate_constraint): Likewise.
15678 (class Orphan_output_section): Add new bool* parameter to
15679 place_orphan_here. Add get_output_section.
15680 (Orphan_output_section::place_orphan_here): Add is_relro
15681 parameter.
15682 (Script_sections::Script_sections): Initialize
15683 data_segment_align_index_ and saw_relro_end_.
15684 (Script_sections::data_segment_align): New function.
15685 (Script_sections::data_segment_relro_end): New function.
15686 (Script_sections::place_orphan): Set or clear is_relro.
15687 (Script_sections::set_section_addresses): Force alignment of first
15688 TLS section.
15689 * yyscript.y (exp): Call script_data_segment_align and
15690 script_data_segment_relro_end.
15691 * testsuite/relro_script_test.t: New file.
15692 * testsuite/relro_test.cc (using_script): Declare.
15693 (t1, t2): Test using_script.
15694 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
15695 (relro_script_test_SOURCES): Define.
15696 (relro_script_test_DEPENDENCIES): Define.
15697 (relro_script_test_LDFLAGS): Define.
15698 (relro_script_test_LDADD): Define.
15699 (relro_script_test.so): New target.
15700 * testsuite/Makefile.in: Rebuild.
15701
f827c9a9
CC
157022008-08-06 Cary Coutant <ccoutant@google.com>
15703
15704 * archive.cc (Archive::total_archives, Archive::total_members)
15705 (Archive::total_members_loaded): New variables.
15706 (Archive::setup): Add parameter. Add option to preread
15707 archive symbols.
15708 (Archive::read_armap): Add counter.
15709 (Archive::get_file_and_offset): New function.
15710 (Archive::get_elf_object_for_member): New function.
15711 (Archive::read_all_symbols): New function.
15712 (Archive::read_symbols): New function.
15713 (Archive::add_symbols): Add counters.
15714 (Archive::include_all_members): Use armap to find members if it's
15715 already built.
15716 (Archive::include_member): Skip reading symbols if already read.
15717 Factored code into Archive::get_file_and_offset and
15718 Archive::get_elf_object_for_member. Changed call to
15719 Mapfile::report_include_archive_member.
15720 (Archive::print_stats): New function.
15721 * archive.h: Declare Object and Read_symbols_data classes.
15722 (Archive::Archive): Add initializers for new members.
15723 (Archive::setup): Add parameter.
15724 (Archive::print_stats): New function.
15725 (Archive::total_archives, Archive::total_members)
15726 (Archive::total_members_loaded): New variables.
15727 (Archive::get_file_and_offset): New function.
15728 (Archive::get_elf_object_for_member): New function.
15729 (Archive::read_all_symbols): New function.
15730 (Archive::read_symbols): New function.
15731 (Archive::Archive_member): New class.
15732 (Archive::members_): New member.
15733 (Archive::num_members_): New member.
15734 * main.cc: Include archive.h.
15735 (main): Call Archive::print_stats.
15736 * mapfile.cc (Mapfile::report_include_archive_member): Delete
15737 archive parameter; member_name is now the fully-decorated name.
15738 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
15739 * options.h: (General_options): Add --preread-archive-symbols option.
15740 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
15741 Archive::setup.
15742
de4c45bd
ILT
157432008-08-04 Ian Lance Taylor <iant@google.com>
15744
15745 * symtab.h (Symbol::use_plt_offset): New function.
15746 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
15747 * powerpc.cc (Relocate::relocate): Likewise.
15748 * sparc.cc (Relocate::relocate): Likewise.
15749 * x86_64.cc (Relocate::relocate): Likewise.
15750 * testsuite/weak_plt.sh: New test.
15751 * testsuite/weak_plt_main.cc: New test.
15752 * testsuite/weak_plt_shared.cc: New test.
15753 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
15754 (check_PROGRAMS): Add weak_plt.
15755 (check_DATA): Add weak_plt_shared.so.
15756 (weak_plt_main_pic.o, weak_plt): New targets.
15757 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
15758 * testsuite/Makefile.in: Rebuild.
15759
15760 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
15761 gcctestdir/ld.
15762 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
15763 * testsuite/Makefile.in: Rebuild.
15764
323ee3f4
AM
157652008-08-04 Alan Modra <amodra@bigpond.net.au>
15766
15767 * Makefile.am (POTFILES.in): Set LC_ALL=C.
15768 * Makefile.in: Regenerate.
15769 * po/POTFILES.in: Regenerate.
15770
7c07ecec
ILT
157712008-07-29 Ian Lance Taylor <iant@google.com>
15772
15773 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
15774 symbols before other symbols.
15775 * testsuite/script_test_2.cc (test_addr): Declare.
15776 (test_addr_alias): Declare.
15777 (main): Check that test_addr and test_addr_alias have the right
cd536b21 15778 values.
7c07ecec
ILT
15779 * testsuite/script_test_2.t: Define test_addr_alias and
15780 test_addr.
15781
5778530e
ILT
157822008-07-24 Ian Lance Taylor <iant@google.com>
15783
2a00e4fb
ILT
15784 PR 5990
15785 * descriptors.cc: New file.
15786 * descriptors.h: New file.
15787 * gold-threads.h (class Hold_optional_lock): New class.
15788 * fileread.cc: Include "descriptors.h".
15789 (File_read::~File_read): Release descriptor rather than closing
15790 it.
15791 (File_read::open) [file]: Call open_descriptor rather than open.
15792 Set is_descriptor_opened_.
15793 (File_read::open) [memory]: Assert that descriptor is not open.
15794 (File_read::reopen_descriptor): New function.
15795 (File_read::release): Release descriptor.
15796 (File_read::do_read): Make non-const. Reopen descriptor.
15797 (File_read::read): Make non-const.
15798 (File_read::make_view): Reopen descriptor.
15799 (File_read::do_readv): Likewise.
15800 * fileread.h (class File_read): Add is_descriptor_opened_ field.
15801 Update declarations.
15802 * layout.cc: Include "descriptors.h".
15803 (Layout::create_build_id): Use open_descriptor rather than open.
15804 * output.cc: Include "descriptors.h".
15805 (Output_file::open): Use open_descriptor rather than open.
15806 * archive.cc (Archive::const_iterator): Change Archive to be
15807 non-const.
15808 (Archive::begin, Archive::end): Make non-const.
15809 (Archive::count_members): Likewise.
15810 * archive.h (class Archive): Update declarations.
15811 * object.h (Object::read): Make non-const.
15812 * Makefile.am (CCFILES): Add descriptors.cc.
15813 (HFILES): Add descriptors.h.
15814 * Makefile.in: Rebuild.
15815
801647d1
ILT
15816 PR 6716
15817 * gold.h: Always include <clocale>. Add Solaris workarounds
15818 following code in binutils/sysdep.h.
15819
5edd166e
ILT
15820 PR 6048
15821 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
15822 this->eh_frame_hdr_ is NULL before using it.
15823
c89ad728
ILT
15824 * dynobj.cc (Versions::Versions): Update comment.
15825
aa86f06b
ILT
15826 * dynobj.cc (Versions::Versions): If there is an soname, use it as
15827 the base version name.
15828
5778530e
ILT
15829 * stringpool.cc (Stringpool_template::add_with_length): Set key to
15830 array size plus one.
15831 (Stringpool_template::set_string_offsets): Subtract one from key
15832 before using it as an array index.
15833 (Stringpool_template::get_offset_with_length): Likewise.
15834 (Stringpool_template::write_to_buffer): Likewise.
15835 * stringpool.h (Stringpool_template::get_offset_from_key):
15836 Likewise.
15837
057ead22
ILT
158382008-07-23 Ian Lance Taylor <iant@google.com>
15839
7f649c59
ILT
15840 PR 6658
15841 * object.h (Merged_symbol_value::value): Do our best to handle a
15842 negative addend.
15843
057ead22
ILT
15844 PR 6647
15845 * script.cc (Version_script_info::get_versions): Don't add empty
15846 version tag to return value.
15847 (Version_script_info::get_symbol_version_helper): Change return
15848 type to bool. Add pversion parameter. Change all callers.
15849 (script_register_vers_node): Don't require a non-NULL tag.
15850 * script.h (class Version_script_info): Update declarations.
15851 (Version_script_info::get_symbol_version): Change return type to
15852 bool. Add version parameter. Change all callers.
15853 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
15854 handling. Handle an empty version from a version script.
15855 (Symbol_table::define_special_symbol): Likewise.
15856 * testsuite/ver_test_10.script: New file.
15857 * testsuite/ver_test_10.sh: New file.
15858 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
15859 (check_DATA): Add ver_test_10.syms.
15860 (ver_test_10.syms, ver_test_10.so): New target.
15861 * testsuite/Makefile.in: Rebuild.
15862
58e54ac2
CD
158632008-07-23 Simon Baldwin <simonb@google.com>
15864
15865 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
15866 to zero for undefined symbols from dynamic libraries.
15867
95d14cd3
ILT
158682008-07-23 Ian Lance Taylor <iant@google.com>
15869
15870 * symtab.cc (Symbol_table::resolve): Remove version parameter.
15871 Change all callers.
15872 * symtab.h (class Symbol_table): Update declaration.
15873 * testsuite/ver_test_9.cc: New file.
15874 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
15875 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
15876 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
15877 (ver_test_9.so, ver_test_9.o): New targets.
15878 * testsuite/Makefile.in: Rebuild.
15879
92de84a6
ILT
158802008-07-22 Ian Lance Taylor <iant@google.com>
15881
34810851
ILT
15882 * options.h (class General_options): Define --check-sections.
15883 * layout.cc (Layout::set_segment_offsets): Handle
15884 --check-sections.
15885
af6156ef
ILT
15886 * options.h (class General_options): Define -n/--nmagic and
15887 -N/--omagic.
15888 * options.cc (General_options::finalize): For -n/--nmagic or
15889 -N/--omagic, set -static.
15890 * layout.cc (Layout::attach_allocated_section_to_segment): If
15891 -N/--omagic, don't put read-only and read-write sections in
15892 different segments.
15893 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
15894 finding a read-only segment.
15895 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
15896 don't set the minimum segment alignment to the common page size,
15897 and don't set the file offset to the address modulo the page size.
15898 * script-sections.cc (Script_sections::create_segments): If
15899 -n/--omagic, don't put read-only and read-write sections in
15900 different segments.
15901
92de84a6
ILT
15902 * cref.cc: New file.
15903 * cref.h: New file.
15904 * options.h (class General_options): Add --print-symbol-counts.
15905 * main.cc (main): Issue defined symbol report if requested.
15906 * archive.cc (Archive::interpret_header): Make into a const member
15907 function.
15908 (Archive::add_symbols): Call Input_objects::archive_start and
15909 archive_stop.
15910 (Archive::const_iterator): Define new class.
15911 (Archive::begin, Archive::end): New functions.
15912 (Archive::include_all_members): Rewrite to use iterator.
15913 (Archive::count_members): New function.
15914 * archive.h (class Archive): Update declarations.
15915 (Archive::filename): New function.
15916 * object.cc: Include "cref.h".
15917 (Sized_relobj::Sized_relobj): Initialize defined_count_.
15918 (Sized_relobj::do_get_global_symbol_counts): New function.
15919 (Input_objects::add_object): Add object to cross-referencer.
15920 (Input_objects::archive_start): New function.
15921 (Input_objects::archive_stop): New function.
15922 (Input_objects::print_symbol_counts): New function.
15923 * object.h: Declare Cref and Archive.
15924 (Object::get_global_symbol_counts): New function.
15925 (Object::do_get_global_symbol_counts): New pure virtual function.
15926 (class Sized_relobj): Add defined_count_ field. Update
15927 declarations.
15928 (class Input_objects): Add cref_ field. Update constructor.
15929 Update declarations.
15930 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
15931 defined_count_.
15932 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
15933 symbol counts.
15934 (Sized_dynobj::do_get_global_symbol_counts): New function.
15935 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
15936 defined_count_. Update declarations. Define Symbols typedef.
15937 * symtab.cc (Symbol_table::add_from_relobj): Add defined
15938 parameter. Change all callers.
15939 (Symbol_table::add_from_dynobj): Add sympointers and defined
15940 parameters. Change all callers.
15941 * symtab.h (class Symbol_table): Update declarations.
15942 * Makefile.am (CCFILES): Add cref.cc.
15943 (HFILES): Add cref.h.
15944 * Makefile.in: Rebuild.
15945
3f7c5e1d
CD
159462008-07-22 Simon Baldwin <simonb@google.com>
15947
15948 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
15949 to zero when writing undefined symbols.
15950
e0b64032
ILT
159512008-07-22 Ian Lance Taylor <iant@google.com>
15952
15953 * output.cc (Output_section::add_input_section): Don't try to
15954 merge empty merge sections.
15955
096b02cf
CS
159562008-07-21 Craig Silverstein <csilvers@google.com>
15957
15958 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
15959 Include symbol version in error message.
cd536b21 15960
1d1f116d
CD
159612008-07-20 Chris Demetriou <cgd@google.com>
15962
cd536b21 15963 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
15964 (RANDOM_SEED_CFLAGS): New substituted variable.
15965 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
15966 * configure: Rebuild.
15967 * Makefile.in: Likewise.
15968 * testsuite/Makefile.in: Likewise.
15969
a18f591e
ILT
159702008-07-18 Ian Lance Taylor <iant@google.com>
15971
15972 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
15973 where we see NAME/NULL and NAME/VERSION as separate symbols.
15974 * testsuite/ver_test_main.cc (main): Call t4.
15975 (t4, t4_2a): Define.
15976 * testsuite/ver_test_2.cc (t4_2): Define.
15977 * testsuite/ver_test_2.script: Put t4_2a in VER2.
15978 * testsuite/ver_test_4.cc (t4_2a): Define.
15979 * testsuite/ver_test_4.script: Put t4_2a in VER2.
15980 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
15981
c6e3f6ed
ILT
159822008-07-17 Ian Lance Taylor <iant@google.com>
15983
15984 * dynobj.cc (Versions::add_def): If we give an error about a
15985 missing version, go ahead and create the version anyhow.
15986
ef9beddf
ILT
159872008-07-10 Ian Lance Taylor <iant@google.com>
15988
15989 Handle output sections with more than 0x7fffffff bytes.
15990 * object.h (class Relobj): Change map_to_output_ to
15991 output_sections_, and just keep a section pointer. Change all
15992 uses. Move comdat group support to Sized_relobj.
15993 (Relobj::is_section_specially_mapped): Remove.
15994 (Relobj::output_section): Remove poff parameter. Change all
15995 callers.
15996 (Relobj::output_section_offset): New function.
15997 (Relobj::set_section_offset): Rewrite.
15998 (Relobj::map_to_output): Remove.
15999 (Relobj::output_sections): New function.
16000 (Relobj::do_output_section_offset): New pure virtual function.
16001 (Relobj::do_set_section_offset): Likewise.
16002 (class Sized_relobj): Add section_offsets_ field. Add comdat
16003 group support from Relobj. Update declarations.
16004 (Sized_relobj::get_output_section_offset): New function.
16005 (Sized_relobj::do_output_section_offset): New function.
16006 (Sized_relobj::do_set_section_offset): New function.
16007 * object.cc (Relobj::output_section_address): Remove.
16008 (Sized_relobj::Sized_relobj): Initialize new fields.
16009 (Sized_relobj::include_section_group): Cast find_kept_object to
16010 Sized_relobj.
16011 (Sized_relobj::include_linkonce_section): Likewise.
16012 (Sized_relobj::do_layout): Use separate arrays for output section
16013 and output offset.
16014 (Sized_relobj::do_count_local_symbols): Change map_to_output to
16015 output_sections.
16016 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
16017 output_sections and section_offsets.
16018 (Sized_relobj::write_local_symbols): Likewise.
16019 (map_to_kept_section): Compute output address directly.
16020 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
16021 output_sections and section_offsets.
16022 (Sized_relobj::write_sections): Likewise.
16023 (Sized_relobj::relocate_sections): Likewise.
16024 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
16025 * output.h (class Output_reloc): Update declarations. Change
16026 u2_.relobj to Sized_relobj*.
16027 (class Output_data_reloc): Change add functions to use
16028 Sized_relobj*.
16029 * output.cc (Output_reloc::Output_reloc): Change relobj to
16030 Sized_relobj*.
16031 (Output_reloc::local_section_offset): Change return type to
16032 Elf_Addr. Use get_output_section_offset.
16033 (Output_reloc::get_address): Likewise.
16034 (Output_section::is_input_address_mapped): Don't call
16035 is_section_specially_mapped.
16036 (Output_section::output_offset): Likewise.
16037 (Output_section::output_address): Likewise.
16038 (Output_section::starting_output_address): Likewise.
16039 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
16040 parameter to Sized_relobj*.
16041 (Copy_relocs::need_copy_reloc): Likewise.
16042 (Copy_relocs::save): Likewise.
16043 * copy-relocs.h (class Copy_relocs): Update declarations.
16044 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
16045 Sized_relobj*. Change relobj_ field to Sized_relobj*.
16046 * target-reloc.h (relocate_for_relocatable): Change
16047 offset_in_output_section type to Elf_Addr. Change code that uses
16048 it as well.
16049 * layout.cc (Layout::layout): Always set *off.
16050 * mapfile.cc (Mapfile::print_input_section): Use
16051 output_section_offset.
16052 * i386.cc (Target_i386::copy_reloc): Change object parameter to
16053 Sized_relobj*.
16054 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
16055 * sparc.cc (Target_sparc::copy_reloc): Likewise.
16056 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
16057
5cb66f97
ILT
160582008-07-03 Ian Lance Taylor <iant@google.com>
16059
16060 * layout.cc (Layout::include_section): Do not discard unrecognized
16061 SHT_STRTAB sections.
16062
afe47622
CS
160632008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
16064
16065 * script.cc (Lex::can_continue_name): Make '?' allowable in
16066 version-script names.
16067 * testsuite/version_script.map: Change glob pattern to use '?'
16068
5adf9721
ILT
160692008-06-30 Manish Singh <yosh@gimp.org>
16070
16071 PR 6585
16072 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
16073 Correct typo.
16074
e6fde208
ILT
160752008-06-30 Ian Lance Taylor <iant@google.com>
16076
16077 PR 6660
16078 PR 6682
16079 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
16080 versions]: Don't try to read the value in the contents, since we
16081 don't use it. Use the template endianness when writing.
16082
3f2e6a2d
CC
160832008-06-25 Cary Coutant <ccoutant@google.com>
16084
16085 * fileread.cc (File_read::make_view): Assert on zero-length view.
16086 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
16087 symbol table when there are no symbols to read.
16088
c43d3a48
CS
160892008-06-23 Craig Silverstein <csilvers@google.com>
16090
16091 * version.cc (version_string): Bump to 1.7
16092
5f494ea0
CS
160932008-06-18 Craig Silverstein <csilvers@google.com>
16094
16095 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
16096 constant 0xFFFF to type Valtype.
16097 (Powerpc_relocate_functions::rel16_ha): Likewise.
16098
c42e122e
ILT
160992008-06-17 Ian Lance Taylor <iant@google.com>
16100
f34787f8
ILT
16101 * output.h (Output_section::Input_section): Initialize p2align_ to
16102 zero for Output_section_data constructors.
16103 (Output_section::Input_section::addralign): If not an input
16104 section, return the alignment of the Output_section_data.
16105 * testsuite/copy_test.cc: New file.
16106 * testsuite/copy_test_1.cc: New file.
16107 * testsuite/copy_test_2.cc: New file.
16108 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
16109 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
16110 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
16111 (copy_test_1_pic.o, copy_test_1.so): New targets.
16112 (copy_test_2_pic.o, copy_test_2.so): New targets.
16113 * testsuite/Makefile.in: Rebuild.
16114
c42e122e
ILT
16115 * script-sections.cc (Script_sections::place_orphan): Initialize
16116 local variable exact.
16117
ce3ac18a
DE
161182008-06-13 David Edelsohn <edelsohn@gnu.org>
16119
16120 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
16121
42cacb20
DE
161222008-06-12 David Edelsohn <edelsohn@gnu.org>
16123 David S. Miller <davem@davemloft.net>
16124
16125 * powerpc.cc: New file.
16126 * Makefile.am (TARGETSOURCES): Add powerpc.cc
16127 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
16128 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
16129 * Makefile.in: Rebuild.
16130
7b308235
ILT
161312008-06-09 Ian Lance Taylor <iant@google.com>
16132
16133 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
16134 <exception>.
16135 (throwing, orig_terminate): New static variables.
16136 (terminate_handler): New static function.
16137 (t2): Set terminate handler.
16138
f0b886e3
ILT
161392008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
16140
16141 PR 6584
cd536b21 16142 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
16143 alignment.
16144
3e90f135
CC
161452008-05-30 Cary Coutant <ccoutant@google.com>
16146
16147 * archive.cc (Archive::include_all_members) Correct to step
16148 over symbol table and extended name table in thin archives.
16149
e09ad04a
ILT
161502008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
16151
16152 PR 6407
16153 * target-reloc.h (relocate_for_relocatable): Fix new_offset
16154 calculation.
16155
62b01cb5
ILT
161562008-05-28 Caleb Howe <cshowe@google.com>
16157
16158 * reduced_debug_output.cc: New file.
16159 * reduced_debug_output.h: New file.
92de84a6 16160 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
16161 * options.cc (General_options::finalize): Add strip_debug_non_line
16162 to the strip heirarchy.
16163 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
16164 fields.
16165 * layout.cc: Include "reduced_debug_output.h".
16166 (Layout::Layout): Initialize new fields.
16167 (line_only_debug_sections): New static array.
16168 (is_lines_only_debug_sections): New static inline function.
16169 (Layout::include_section): Handle --strip-debug-non-line.
16170 (Layout::make_output_section): If --strip-debug-non-line, build
16171 new output sections for .debug_abbrev and .debug_info.
16172 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
16173 gold. Warn about possible overflow.
16174 (read_signed_LEB_128): Likewise.
16175 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
16176 (read_signed_LEB_128): Declare.
16177 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
16178 (HFILES): Add reduced_debug_output.h.
16179 * Makefile.in: Rebuild.
16180
7d9e3d98
ILT
161812008-05-21 Ian Lance Taylor <iant@google.com>
16182
16183 * mapfile.cc: New file.
16184 * mapfile.h: New file.
16185 * options.h (class General_options): Add -M/--print-map and -Map.
16186 * options.cc (General_options::finalize): Make -M equivalent to
16187 -Map -.
16188 * main.cc: Include <cstdio> and "mapfile.h".
16189 (main): Open mapfile if requested.
16190 * gold.cc (class Middle_runner): Add mapfile_ field. Update
16191 constructor. Change caller.
16192 (queue_initial_tasks): Add mapfile parameter. Change caller.
16193 (queue_middle_tasks): Likewise.
16194 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
16195 declarations.
16196 * archive.cc: Include "mapfile.h".
16197 (Archive::add_symbols): Add mapfile parameter. Change all
16198 callers. Pass mapfile, symbol, and reason to include_member.
16199 (Archive::include_all_members): Add mapfile parameter. Change all
16200 callers.
16201 (Archive::include_member): Add mapfile, sym, and why parameters.
16202 Change all callers. Report inclusion to map file.
16203 * archive.h: Include "fileread.h".
16204 (class Archive): Update declarations.
16205 (Archive::file): New const method.
16206 (class Add_archive_symbols): Add mapfile_ field. Update
16207 constructor. Change all callers.
16208 * readsyms.h (class Read_symbols): Likewise.
16209 (class Finish_group): Likewise.
16210 (class Read_script): Likewise.
16211 * common.cc: Include "mapfile.h".
16212 (Symbol_table::allocate_commons): Add mapfile parameter. Change
16213 all callers.
16214 (Symbol_table::do_allocate_commons): Likewise.
16215 (Symbol_table::do_allocate_commons_list): Likewise. Report common
16216 symbol allocation to mapfile.
16217 * common.h (class Allocate_commons_task): Add mapfile_ field.
16218 Update constructor. Change all callers.
16219 * symtab.h (class Symbol_table): Update declarations.
16220 * layout.cc: Include "mapfile.h".
16221 (Layout_task_runner::run): Print information to mapfile.
16222 (Layout::create_gold_note): Change Output_data_fixed_space to
16223 Output_data_zero_fill.
16224 (Layout::create_build_id): Likewise.
16225 (Layout::print_to_mapfile): New function.
16226 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
16227 constructor. Change caller.
16228 (class Layout): Declare print_to_mapfile.
16229 * output.cc (Output_section::Input_section::print_to_mapfile): New
16230 function.
16231 (Output_section::add_input_section): If producing a map, always
16232 add to input_sections_ list.
16233 (Output_section::do_print_to_mapfile): New function.
16234 (Output_segment::print_sections_to_mapfile): New function.
16235 (Output_segment::print_section_list_to_mapfile): New function.
16236 * output.h: Include "mapfile.h".
16237 (Output_data::print_to_mapfile): New function.
16238 (Output_data::do_print_to_mapfile): New virtual function.
16239 (Output_segment_headers::do_print_to_mapfile): New function.
16240 (Output_file_header::do_print_to_mapfile): New function.
16241 (Output_data_const::do_print_to_mapfile): New function.
16242 (class Output_data_const_buffer): Add map_name_ field. Update
16243 constructor. Change all callers. Add do_print_to_mapfile
16244 function.
16245 (class Output_data_fixed_space): Likewise.
16246 (class Output_data_space): Likewise.
16247 (class Output_data_zero_fill): New class.
16248 (Output_data_strtab::do_print_to_mapfile): New function.
16249 (Output_data_reloc_base::do_print_to_mapfile): New function.
16250 (Output_relocatable_relocs::do_print_to_mapfile): New function.
16251 (Output_data_group::do_print_to_mapfile): New function.
16252 (Output_data_got::do_print_to_mapfile): New function.
16253 (Output_data_dynamic::do_print_to_mapfile): New function.
16254 (Output_symtab_xindex::do_print_to_mapfile): New function.
16255 (class Output_section): Declare do_print_to_mapflie. Declare
16256 print_to_mapfile in Input_section.
16257 (class Output_segment): Declare new functions.
16258 * object.h (Sized_relobj::symbol_count): New function.
16259 * script-sections.cc
16260 (Output_section_element_dot_assignment::set_section_addresses):
16261 Change Output_data_fixed_space to Output_data_zero_fill.
16262 (Output_data_expression::do_print_to_mapfile): New function.
16263 * script.cc (read_input_script): Add mapfile parameter. Change
16264 all callers.
16265 * script.h (read_input_script): Update declaration.
16266 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
16267 (Eh_frame::do_print_to_mapfile): New function.
16268 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
16269 (Output_merge_string::do_print_to_mapfile): New function.
16270 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
16271 function.
16272 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
16273 function.
16274 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
16275 function.
16276 * Makefile.am (CCFILES): Add mapfile.cc.
16277 (HFILES): Add mapfile.h.
16278 * Makefile.in: Rebuild.
16279
9f1d377b
ILT
162802008-05-19 Ian Lance Taylor <iant@google.com>
16281
16282 * options.h (class General_options): Add -z relro.
16283 * layout.cc (Layout::Layout): Initialize relro_segment_.
16284 (Layout::add_output_section_data): Return the output section.
16285 (Layout::make_output_section): Rcognize relro sections and mark
16286 them appropriately.
16287 (Layout::attach_allocated_section_to_segment): Put relro sections
16288 in a PT_GNU_RELRO segment.
16289 (Layout::create_initial_dynamic_sections): Mark the .dynamic
16290 section as relro.
16291 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
16292 PT_TLS segments.
16293 (Layout::linkonce_mapping): Map d.rel.ro.local to
16294 .data.rel.ro.local.
16295 (Layout::output_section_name): Us .data.rel.ro.local for any
16296 section which begins with that.
16297 * layout.h (class Layout): Update add_output_section_data
16298 declaration. Add relro_segment_ field.
16299 * output.cc (Output_section::Output_section): Initialize is_relro_
16300 and is_relro_local_ fields.
16301 (Output_segment::add_output_section): Group relro sections.
16302 (Output_segment::is_first_section_relro): New function.
16303 (Output_segment::maximum_alignment): If there is a relro section,
16304 align the segment to the common page size.
16305 (Output_segment::set_section_addresses): Track whether we are
16306 looking at relro sections. If the last section is a relro
16307 section, align to the common page size.
16308 (Output_segment::set_section_list_addresses): Add in_relro
16309 parameter. Change all callers. Align to the page size when
16310 moving from relro to non-relro section.
16311 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
16312 segment.
16313 * output.h (class Output_section): Add is_relro_ and
16314 is_relro_local_ fields.
16315 (Output_section::is_relro): New function.
16316 (Output_section::set_is_relro): New function.
16317 (Output_section::is_relro_local): New function.
16318 (Output_section::set_is_relro_local): New function.
16319 (class Output_segment): Update declarations.
16320 * i386.cc (Target_i386::got_section): Mark .got section as relro.
16321 * sparc.cc (Target_sparc::got_section): Likewise.
16322 * x86_64.cc (Target_x86_64::got_section): Likewise.
16323 * testsuite/relro_test_main.cc: New file.
16324 * testsuite/relro_test.cc: New file.
16325 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
16326 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
16327 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
16328 (relro_test.so, relro_test_pic.o): New targets.
16329 * testsuite/Makefile.in: Rebuild.
16330
a984ee1d
ILT
163312008-05-16 Ian Lance Taylor <iant@google.com>
16332
01676dcd
ILT
16333 * output.cc (Output_segment::add_output_section): Remove front
16334 parameter.
16335 * output.h (class Output_segment): Remove
16336 add_initial_output_section and overloaded add_output_section.
16337 Update declaration of remaining add_output_section.
16338 * layout.cc (Layout::create_interp): Call add_output_section
16339 rather than add_initial_output_section.
16340 (Layout::finish_dynamic_section): Likewise.
16341
497897f9
ILT
16342 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
16343 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
16344 know the dynamic type.
16345 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
16346 field. Initialize it in constructor.
16347 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
16348 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
16349 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
16350 reloc.
16351
a984ee1d
ILT
16352 * output.cc (Output_reloc::get_address): Change return type to
16353 Elf_Addr.
16354 * output.h (class Output_reloc): Update get_address declaration.
16355 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
16356 for section addresses.
16357
55ba0940
ILT
163582008-05-09 Ian Lance Taylor <iant@google.com>
16359
16360 PR 6493
16361 * gold.cc (gold_nomem): Use return value of write.
16362
75517b77
ILT
163632008-05-08 Ian Lance Taylor <iant@google.com>
16364
16365 * symtab.c (Symbol::init_base_output_data): Add version
16366 parameter. Change all callers.
16367 (Symbol::init_base_output_segment): Likewise.
16368 (Symbol::init_base_constant): Likewise.
16369 (Symbol::init_base_undefined): Likewise.
16370 (Sized_symbol::init_output_data): Likewise.
16371 (Sized_symbol::init_output_segment): Likewise.
16372 (Sized_symbol::init_constant): Likewise.
16373 (Sized_symbol::init_undefined): Likewise.
16374 (Symbol_table::do_define_in_output_data): If the new symbol has a
16375 version, mark it as the default.
16376 (Symbol_table::do_define_in_output_segment): Likewise.
16377 (Symbol_table::do_define_as_constant): Likewise.
16378 * symtab.h (class Symbol): Update declarations.
16379 (class Sized_symbol): Likewise.
16380 * resolve.cc (Symbol::override_version): New function.
c42e122e 16381 (Symbol::override_base): Call override_version.
75517b77
ILT
16382 (Symbol::override_base_with_special): Likewise.
16383 * testsuite/ver_script_8.script: New file.
16384 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
16385 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
16386 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
16387 (ver_test_8_1.so, ver_test_8_2.so): New targets.
16388
f1f70eae
ILT
163892008-05-06 Ian Lance Taylor <iant@google.com>
16390
f3e9c5c5
ILT
16391 PR 6049
16392 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
16393 functions.
16394 (class General_options): Remove existing --undefined, and add
16395 --no-undefined instead. Add new --undefined as synonym for -u.
16396 * archive.cc (Archive::add_symbols): Check whether symbol was
16397 named with -u.
16398 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
16399 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
16400 all uses. Add IS_UNDEFINED. Update declarations to split
16401 different versions of init_base. Declare init_base_undefined.
16402 (Symbol::is_defined): Handle IS_UNDEFINED.
16403 (Symbol::is_undefined): Likewise.
16404 (Symbol::is_weak_undefined): Call is_undefined.
16405 (Symbol::is_absolute): Handle IS_CONSTANT.
16406 (class Sized_symbol): Update declarations to split different
16407 versions of init. Declare init_undefined.
16408 (class Symbol_table): Declare new functions.
16409 * symtab.cc (Symbol::init_base_object): Rename from init_base.
16410 Change all callers.
16411 (Symbol::init_base_output_data): Likewise.
16412 (Symbol::init_base_output_segment): Likewise.
16413 (Symbol::init_base_constant): Likewise.
16414 (Symbol::init_base_undefined): New function.
16415 (Sized_symbol::init_object): Rename from init. Change all
16416 callers.
16417 (Sized_symbol::init_output_data): Likewise.
16418 (Sized_symbol::init_output_segment): Likewise.
16419 (Sized_symbol::init_constant): Likewise.
16420 (Sized_symbol::init_undefined): New function.
16421 (Symbol_table::add_undefined_symbols_from_command_line): New
16422 function.
16423 (Symbol_table::do_add_undefined_symbols_from_command_line): New
16424 function.
16425 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
16426 (Symbol::output_section): Likewise.
16427 (Symbol::set_output_section): Likewise.
16428 (Symbol_table::sized_finalize_symbol): Likewise.
16429 (Symbol_table::sized_write_globals): Likewise.
16430 * resolve.cc (Symbol_table::should_override): Likewise.
16431 (Symbol::override_base_with_special): Likewise.
16432
8bdcdf2c
ILT
16433 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
16434 symbol, change it to have default visibility.
16435 * testsuite/protected_1.cc: New file.
16436 * testsuite/protected_2.cc: New file.
16437 * testsuite/protected_3.cc: New file.
16438 * testsuite/protected_main_1.cc: New file.
16439 * testsuite/protected_main_2.cc: New file.
16440 * testsuite/protected_main_3.cc: New file.
16441 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
16442 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
16443 (protected_1_LDFLAGS, protected_1_LDADD): Define.
16444 (protected_1.so): New target.
16445 (protected_1_pic.o, protected_2_pic.o): New targets.
16446 (protected_3_pic.o): New target.
16447 (check_PROGRAMS): Add protected_2.
16448 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
16449 (protected_2_LDFLAGS, protected_2_LDADD): Define.
16450 * testsuite/Makefile.in: Rebuild.
16451
2b706932
ILT
16452 * options.h (DEFINE_var): Add set_user_set_##varname__.
16453 (DEFINE_bool_alias): New macro.
16454 (class General_options): Define -Bstatic using DEFINE_bool_alias
16455 rather than DEFINE_special. Add --undefined as an alias for -z
16456 defs.
16457 * options.cc (General_options::parse_Bstatic): Remove.
16458
d82a5bcc
ILT
16459 * options.h (class General_options): Add --fatal-warnings.
16460 * main.cc (main): Implement --fatal-warnings.
16461 * errors.h (Errors::warning_count): New function.
16462
f1f70eae
ILT
16463 * options.h (class General_options): Add -Bsymbolic-functions.
16464 * symtab.h (Symbol::is_preemptible): Check for
16465 -Bsymbolic-functions.
16466
8825ac63
ILT
164672008-05-05 Ian Lance Taylor <iant@google.com>
16468
d98bc257
ILT
16469 * options.h (DEFINE_bool): For DASH_Z, create the negative option
16470 as noVARNAME rather than no-VARNAME.
16471 (class General_options): Add option -z combreloc.
16472 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
16473 get_address.
16474 (Output_reloc::sort_before) [SHT_REL]: New function.
16475 (Output_reloc::sort_before) [SHT_RELA]: New function.
16476 (class Output_data_reloc_base): Add sort_relocs_ field. Define
16477 Sort_relocs_comparison.
16478 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
16479 parameter. Change all callers.
16480 (Output_data_reloc::Output_data_reloc) [both versions]: Add
16481 sort_relocs parameter. Change all callers.
16482 * output.cc (Output_reloc::get_address): New function, broken out
16483 of write_rel.
16484 (Output_reloc::write_rel): Call it.
16485 (Output_reloc::compare): New function.
16486 (Output_data_reloc_base::do_write): Optionally sort relocs.
16487
60b2b4e7
ILT
16488 * configure.ac: If targ_extra_obj is set, link it in.
16489 * configure.tgt: Initialize all variables.
16490 (x86_64*): Set targ_extra_obj and targ_extra_size.
16491 * configure: Rebuild.
16492
8825ac63
ILT
16493 * object.cc (Sized_relobj::include_section_group): Adjust section
16494 indexes read from group data. Build vector to pass to
16495 layout_group.
16496 * layout.cc (Layout::layout_group): Add flags and shndxes
16497 parameters. Remove contents parameter. Change caller. Update
16498 explicit instantiations.
16499 * layout.h (class Layout): Update layout_group declaration.
16500 * output.cc (Output_data_group::Output_data_group): Add flags and
16501 input_shndxes parameters. Remove contents parameter. Change
16502 caller.
16503 (Output_data_group::do_write): Change input_sections_ to
16504 input_shndxes_.
16505 * output.h (class Output_data_group): Update constructor
16506 declaration. Rename input_sections_ to input_shndxes_.
16507 * testsuite/many_sections_test.cc: Add template.
16508
e94cf127
CC
165092008-04-30 Cary Coutant <ccoutant@google.com>
16510
4418b2d5
CC
16511 * target-reloc.h (relocate_section): Fix dead-pointer bug.
16512
e94cf127
CC
16513 * layout.cc (Layout::include_section): Refactored check for debug
16514 info section.
16515 (Layout::add_comdat): Add new parameters. Change type
16516 of signature parameter. Add object and shndx to signatures table.
16517 (Layout::find_kept_object): New function.
16518 * layout.h: Include <cstring>.
16519 (Layout::is_debug_info_section): New function.
16520 (Layout::add_comdat): Add new parameters.
16521 (Layout::find_kept_object): New function.
16522 (Layout::Kept_section): New struct.
16523 (Layout::Signatures): Change type of map range.
16524 * object.cc (Relobj::output_section_address): New function.
16525 (Sized_relobj::include_section_group): Add new parameters. Change
16526 calls to Layout::add_comdat. Change to build table of kept comdat
16527 groups and table mapping discarded sections to kept sections.
16528 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
16529 (Sized_relobj::do_layout): Change calls to include_section_group and
16530 include_linkonce_section.
16531 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
16532 value to zero when section is discarded.
16533 (Sized_relobj::map_to_kept_section): New function.
16534 * object.h (Relobj::output_section_address): New function.
16535 (Relobj::Comdat_group): New type.
16536 (Relobj::find_comdat_group): New function.
16537 (Relobj::Comdat_group_table): New type.
16538 (Relobj::Kept_comdat_section): New type.
16539 (Relobj::Kept_comdat_section_table): New type.
16540 (Relobj::add_comdat_group): New function.
16541 (Relobj::set_kept_comdat_section): New function.
16542 (Relobj::get_kept_comdat_section): New function.
16543 (Relobj::comdat_groups_): New field.
16544 (Relobj::kept_comdat_sections_): New field.
16545 (Symbol_value::input_value): Update comment.
16546 (Sized_relobj::map_to_kept_section) New function.
16547 (Sized_relobj::include_linkonce_section): Add new parameter.
16548 * target-reloc.h (Comdat_behavior): New type.
16549 (get_comdat_behavior): New function.
16550 (relocate_section): Add code to map a discarded section to the
16551 corresponding kept section when applying a relocation.
16552
e4e5049b
CS
165532008-04-30 Craig Silverstein <csilvers@google.com>
16554
16555 * dwarf_reader.cc (next_generation_count): New static var.
16556 (Addr2line_cache_entry): New struct.
16557 (addr2line_cache): New static var.
16558 (Dwarf_line_info::one_addr2line): Added caching.
16559 (Dwarf_line_info::clear_addr2line_cache): New function.
16560 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
16561 cache-size parameter.
16562 (Dwarf_line_info::one_addr2line_cache): New function.
16563 * symtab.cc (Symbol_table::detect_odr_violations): Pass
16564 new cache-size argument to one_addr2line(), and clear cache.
16565
d09e9154
CC
165662008-04-28 Cary Coutant <ccoutant@google.com>
16567
16568 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
16569 R_386_PC8 relocations.
16570
7ef73768
ILT
165712008-04-23 Ian Lance Taylor <iant@google.com>
16572
55438702
ILT
16573 * object.cc (Sized_relobj::include_section_group): Check for
16574 invalid section group.
16575
c165fb93
ILT
16576 * object.cc (make_elf_object): Correct test for 64-bit ELF file
16577 header size.
16578
7ef73768
ILT
16579 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
16580 than read for file header.
16581 * archive.cc (Archive::include_member): Likewise.
16582
6194aaab
L
165832008-04-23 Paolo Bonzini <bonzini@gnu.org>
16584
16585 * aclocal.m4: Regenerate.
16586 * configure: Regenerate.
16587
d491d34e
ILT
165882008-04-19 Ian Lance Taylor <iant@google.com>
16589
5ea2bac6
ILT
16590 * version.cc (version_string): Bump to 1.6.
16591
7bc3e21a
ILT
16592 * testsuite/Makefile.am (many_sections_r_test): New target.
16593 (many_sections_r_test_SOURCES): Remove.
16594 (many_sections_r_test_DEPENDENCIES): Remove.
16595 (many_sections_r_test_LDFLAGS): Remove.
16596 (many_sections_r_test_LDADD): Remove.
16597
7fcd3aa9
ILT
16598 * object.cc (Sized_relobj::do_add_symbols): Always pass
16599 local_symbol_count_ to add_from_relobj.
16600
4c94d6ae
ILT
16601 * testsuite/Makefile.am (many_sections_check.h): Only check one in
16602 every thousand variables.
16603 * testsuite/Makefile.in: Rebuild.
16604
d491d34e
ILT
16605 * object.cc (Xindex::initialize_symtab_xindex): New function.
16606 (Xindex::read_symtab_xindex): New function.
16607 (Xindex::sym_xindex_to_shndx): New function.
16608 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
16609 available.
16610 (Sized_relobj::do_initialize_xindex): New function.
16611 (Sized_relobj::do_read_symbols): Adjust section links.
16612 (Sized_relobj::symbol_section_and_value): Add is_ordinary
16613 parameter. Change all callers.
16614 (Sized_relobj::include_section_group): Adjust section links and
16615 symbol section indexes.
16616 (Sized_relobj::do_layout): Adjust section links.
16617 (Sized_relobj::do_count_local_symbols): Adjust section links and
16618 symbol section indexes.
16619 (Sized_relobj::do_finalize_local_symbols): Distinguish between
16620 ordinary and special symbols.
16621 (Sized_relobj::write_local_symbols): Add symtab_xindex and
16622 dynsym_xindex parameters. Change all callers. Adjust section
16623 links. Use SHN_XINDEX when needed.
16624 (Sized_relobj::get_symbol_location_info): Adjust section links.
16625 Don't get fooled by special symbols.
16626 * object.h (class Xindex): Define.
16627 (class Object): Add xindex_ parameter. Declare virtual functoin
16628 do_initialize_xindex.
16629 (Object::adjust_sym_shndx): New function.
16630 (Object::set_xindex): New protected function.
16631 (class Symbol_value): Add is_ordinary_shndx_ field.
16632 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
16633 (Symbol_value::value): Assert ordinary section.
16634 (Symbol_value::initialize_input_to_output_map): Likewise.
16635 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
16636 Change all callers.
16637 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
16638 all callers.
16639 (class Sized_relobj): Update declarations.
16640 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
16641 parameter. Change all callers.
16642 (Sized_relobj::adjust_shndx): New function.
16643 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
16644 field.
16645 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
16646 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
16647 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
16648 (Sized_dynobj::read_dynsym_section): Adjust section links.
16649 (Sized_dynobj::read_dynamic): Likewise.
16650 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
16651 section links.
16652 (Sized_dynobj::do_initialize_xindex): New function.
16653 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
16654 do_initialize_xindex.
16655 (Sized_dynobj::adjust_shndx): New function.
16656 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
16657 dynsym_xindex_ fields.
16658 (Layout::finalize): Add a call to set_section_indexes before
16659 creating the symtab sections.
16660 (Layout::set_section_indexes): Don't do anything if the section
16661 already has a section index.
16662 (Layout::create_symtab_sections): Add shnum parameter. Change
16663 caller. Create .symtab_shndx section if needed.
16664 (Layout::create_shdrs): Add shstrtab_section parameter. Change
16665 caller.
16666 (Layout::allocated_output_section_count): New function.
16667 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
16668 needed.
16669 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
16670 fields. Update declarations.
16671 (Layout::symtab_xindex): New function.
16672 (Layout::dynsym_xindex): New function.
16673 (class Write_symbols_task): Add layout_ field.
16674 (Write_symbols_task::Write_symbols_task): Add layout parameter.
16675 Change caller.
16676 * output.cc (Output_section_headers::Output_section_headers): Add
16677 shstrtab_section parameter. Change all callers.
16678 (Output_section_headers::do_sized_write): Store overflow values
16679 for section count and section string table section index in
16680 section header zero.
16681 (Output_file_header::do_sized_write): Check for overflow of
16682 section count and section string table section index.
16683 (Output_symtab_xindex::do_write): New function.
16684 (Output_symtab_xindex::endian_do_write): New function.
16685 * output.h (class Output_section_headers): Add shstrtab_section_.
16686 Update declarations.
16687 (class Output_symtab_xindex): Define.
16688 (Output_section::has_out_shndx): New function.
16689 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
16690 field.
16691 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
16692 Change all callers.
16693 (Sized_symbol::init): Likewise.
16694 (Symbol::output_section): Check for ordinary symbol.
16695 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
16696 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
16697 callers.
16698 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
16699 Change all callers. Simplify handling of symbols from sections
16700 not included in the link.
16701 (Symbol_table::add_from_dynobj): Handle ordinary symbol
16702 distinction.
16703 (Weak_alias_sorter::operator()): Assert that symbols are
16704 ordinary.
16705 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
16706 distinction.
16707 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
16708 parameters. Change all callers.
16709 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
16710 symbol distinction. Use SHN_XINDEX when needed.
16711 (Symbol_table::write_section_symbol): Add symtab_xindex
16712 parameter. Change all callers.
16713 (Symbol_table::sized_write_section_symbol): Likewise. Use
16714 SHN_XINDEX when needed.
16715 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
16716 declarations.
16717 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
16718 (Symbol::is_defined): Check is_ordinary.
16719 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
16720 (Symbol::is_absolute, Symbol::is_common): Likewise.
16721 (class Sized_symbol): Update declarations.
16722 (class Symbol_table): Update declarations.
16723 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
16724 parameters. Change all callers.
16725 (Sized_symbol::override): Likewise.
16726 (Symbol_table::override): Likewise.
16727 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
16728 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
16729 is_ordinary, and orig_st_shndx parameters. Change all callers.
16730 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
16731 to be in an ordinary section.
16732 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
16733 object and is_ordinary parameters. Change all callers.
16734 (Sized_dwarf_line_info::read_relocs): Add object parameter.
16735 Change all callers. Don't add undefined or non-ordinary symbols
16736 to reloc_map_.
16737 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
16738 Change all callers.
16739 * dwarf_reader.h (class Sized_dwarf_line_info): Update
16740 declarations.
16741 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
16742 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
16743 (Sized_relobj::relocate_sections): Likewise.
16744 * target-reloc.h (scan_relocs): Adjust section symbol index.
16745 (scan_relocatable_relocs): Likewise.
16746 * i386.cc (Scan::local): Check for ordinary symbols.
16747 * sparc.cc (Scan::local): Likewise.
16748 * x86_64.cc (Scan::local): Likewise.
16749 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
16750 to symbol_section_and_value.
16751 * testsuite/many_sections_test.cc: New file.
16752 * testsuite/Makefile.am (BUILT_SOURCES): Define.
16753 (check_PROGRAMS): Add many_sections_test.
16754 (many_sections_test_SOURCES): Define.
16755 (many_sections_test_DEPENDENCIES): Define.
16756 (many_sections_test_LDFLAGS): Define.
16757 (BUILT_SOURCES): Add many_sections_define.h.
16758 (many_sections_define.h): New target.
16759 (BUILT_SOURCES): Add many_sections_check.h.
16760 (many_sections_check.h): New target.
16761 (check_PROGRAMS): Add many_sections_r_test.
16762 (many_sections_r_test_SOURCES): Define.
16763 (many_sections_r_test_DEPENDENCIES): Define.
16764 (many_sections_r_test_LDFLAGS): Define.
16765 (many_sections_r_test_LDADD): Define.
16766 (many_sections_r_test.o): New target.
16767 * testsuite/Makefile.in: Rebuild.
16768
c5818ff1
CC
167692008-04-17 Cary Coutant <ccoutant@google.com>
16770
16771 * errors.cc (Errors::info): New function.
16772 (gold_info): New function.
16773 * errors.h (Errors::info): New function.
16774 * gold.h (gold_info): New function.
16775 * object.cc (Input_objects::add_object): Print trace output.
16776 * options.cc (options::parse_set): New function.
16777 (General_options::parse_wrap): Deleted.
16778 (General_options::General_options): Deleted initializer.
16779 * options.h (options::String_set): New typedef.
16780 (options::parse_set): New function.
16781 (DEFINE_set): New macro.
16782 (General_options::wrap): Changed to use DEFINE_set. Changed
16783 callers of any_wrap_symbols and is_wrap_symbol.
16784 (General_options::trace, General_options::trace_symbol):
16785 New options.
16786 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
16787 (General_options::wrap_symbols_): Deleted.
16788 * symtab.cc (Symbol_table::add_from_object): Print trace output.
16789
b5be4a7c
DM
167902008-04-17 David S. Miller <davem@davemloft.net>
16791
16792 * options.cc (General_options::parse_V): New function.
16793 * options.h: Add entries for -V and -Qy.
16794
155a0dd7
ILT
167952008-04-17 Ian Lance Taylor <iant@google.com>
16796
16797 * common.cc (Symbol_table::allocate_commons): Remove options
16798 parameter. Change caller.
16799 (Symbol_table::do_allocate_commons): Remove options parameter.
16800 Change caller. Just call do_allocate_commons_list twice.
16801 (Symbol_table::do_allocate_commons_list): New function, broken out
16802 of do_allocate_commons.
16803 * common.h (class Allocate_commons_task): Remove options_ field.
16804 Update constructor.
16805 * symtab.cc (Symbol_table::Symbol_table): Initialize
16806 tls_commons_.
16807 (Symbol_table::add_from_object): Put TLS common symbols on
16808 tls_commons_ list.
16809 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
16810 which are IN_OUTPUT_DATA.
16811 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
16812 allocate_commons and do_allocate_commons declarations. Declare
16813 do_allocate_commons_list.
16814 * gold.cc (queue_middle_tasks): Update creation of
16815 Allocate_commons_task to not pass options.
16816 * testsuite/Makefile.am (INCLUDES): Add -I.. .
16817 (TLS_TEST_C_FLAGS): New variable.
16818 (tls_test_c_pic.o): New target.
16819 (tls_test_shared.so): Link in tls_test_c_pic.o.
16820 (tls_test_c_pic_ie.o): New target.
16821 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
16822 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
16823 (tls_test_c.o): New target.
16824 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
16825 (tls_pic_test_LDADD): Likewise.
16826 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
16827 (tls_shared_gd_to_ie_test_LDADD): Likewise.
16828 (tls_test_c_gnu2.o): New target.
16829 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
16830 tls_test_c_gnu2.o.
16831 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
16832 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
16833 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
16834 * testsuite/tls_test.cc: Include "config.h".
16835 (t_last): Call t11_last.
16836 * testsuite/tls_test.h (t11, t11_last): Declare.
16837 * testsuite/tls_test_c.c: New file.
16838 * testsuite/tls_test_main.cc (thread_routine): Call t11.
16839 * configure.ac: Check for OpenMP support.
16840 * configure, config.in, Makefile.in: Rebuild.
16841 * testsuite/Makefile.in: Rebuild.
16842
edfbb029
CC
168432008-04-16 Cary Coutant <ccoutant@google.com>
16844
16845 * i386.cc (Target_i386::define_tls_base_symbol): New function.
16846 (Target_i386::tls_base_symbol_defined_): New field.
16847 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
16848 (Target_i386::Scan::global): Likewise.
16849 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
16850 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
16851 (Target_x86_64::tls_base_symbol_defined_): New field.
16852 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
16853 (Target_x86_64::Scan::global): Likewise.
16854
f3c69fca
CC
168552008-04-16 Cary Coutant <ccoutant@google.com>
16856
16857 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
16858 (Symbol::needs_plt_entry): Allow weak undefined symbols.
16859 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
16860 building shared libraries.
16861 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
16862 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
16863 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
16864 * testsuite/Makefile.in: Rebuild.
16865 * testsuite/weak_undef.h: New file.
16866 * testsuite/weak_undef_file1.cc: Add extra test cases.
16867 * testsuite/weak_undef_file2.cc: Likewise.
16868 * testsuite/weak_undef_test.cc: Likewise.
16869
7c414435
DM
168702008-04-16 David S. Miller <davem@davemloft.net>
16871
32b769e1
DM
16872 * sparc.cc (Target_sparc::Scan): Change from struct to class.
16873 Add issued_non_pic_error_ field. Declare check_non_pic.
16874 (Target_sparc::Scan::check_non_pic): New function.
16875 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
16876 (Target_sparc::Scan::global): Likewise.
16877
11936fb1
DM
16878 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
16879 * configure: Rebuild.
16880
7c414435
DM
16881 * options.h (DEFINE_enable): New macro.
16882 (new_dtags): New enable option.
16883 (initfirst, interpose, loadfltr, nodefaultlib,
16884 nodelete, nodlopen, nodump): New -z options.
16885 * layout.cc (Layout:finish_dynamic_section): If new
16886 dtags enabled, emit DT_RUNPATH. Also, emit a
16887 DT_FLAGS_1 containing any specified -z flags.
16888
85c7bf8b
ILT
168892008-04-16 Ian Lance Taylor <iant@google.com>
16890
12c0daef
ILT
16891 * copy-relocs.cc: New file.
16892 * copy-relocs.h: New file.
16893 * reloc.cc: Remove Copy_relocs code.
16894 * reloc.h: Likewise.
16895 * reloc-types.h (struct Reloc_types) [both versions]: Add
16896 get_reloc_addend_noerror.
16897 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
16898 variants of add_global which take an addend which must be zero.
16899 * i386.cc: Include "copy-relocs.h".
16900 (class Target_i386): Change type of copy_relocs_ to variable,
16901 update initializer.
16902 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
16903 Change all callers.
16904 (Target_i386::do_finalize_sections): Change handling of
16905 copy_relocs_.
16906 * sparc.cc: Include "copy-relocs.h".
16907 (class Target_sparc): Change type of copy_relocs_ to variable,
16908 update initializer.
16909 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
16910 Change all callers.
16911 (Target_sparc::do_finalize_sections): Change handling of
16912 copy_relocs_.
16913 * x86_64.cc: Include "copy-relocs.h".
16914 (class Target_x86_64): Change type of copy_relocs_ to variable,
16915 update initializer.
16916 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
16917 class. Change all callers.
16918 (Target_x86_64::do_finalize_sections): Change handling of
16919 copy_relocs_.
16920 * Makefile.am (CCFILES): Add copy-relocs.cc.
16921 (HFILES): Add copy-relocs.h.
16922
4f4995b6
ILT
16923 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
16924
85c7bf8b
ILT
16925 * testsuite/script_test_4.sh: Permit leading zeroes.
16926
4f2a9edd
ILT
169272008-04-15 Ian Lance Taylor <iant@google.com>
16928
e6188289
ILT
16929 * script-sections.cc (Script_sections::create_segments): Use
16930 header_size_adjustment even when there is enough room for the
16931 headers.
16932 * testsuite/script_test_4.sh: New file.
16933 * testsuite/script_test_4.t: New file.
16934 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
16935 (check_DATA): Add script_test_4.stdout.
16936 (MOSTLYCLEANFILES): Likewise.
16937 (script_test_4): New target.
16938 (script_test_4.stdout): New target.
16939 * testsuite/Makefile.in: Rebuild.
16940
4f2a9edd
ILT
16941 * sparc.cc: Add definitions for Output_data_plt_sparc class
16942 constants.
16943
f5314dd5
DM
169442008-04-14 David S. Miller <davem@davemloft.net>
16945
16946 * sparc.cc: New file.
16947 * Makefile.am (TARGETSOURCES): Add sparc.cc
16948 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
16949 * configure.tgt: Document targ_extra_size and
16950 targ_extra_big_endian. Add entries for sparc-* and
16951 sparc64-*.
16952 * configure.ac: Handle targ_extra_size and
16953 targ_extra_big_endian.
16954 * Makefile.in: Rebuild.
16955 * configure: Likewise.
16956 * po/POTFILES.in: Likewise.
16957 * po/gold.pot: Likewise.
16958
154e0e9a
ILT
169592008-04-14 Ian Lance Taylor <iant@google.com>
16960
16961 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
16962 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
16963 in the name/type/flags to section mapping. Don't call
16964 allocate_output_section.
16965 (Layout::choose_output_section): Change parameter from adjust_name
16966 to is_input_section. Don't permit input sections after sections
16967 are attached to segments. Don't call allocate_output_section.
16968 (Layout::layout_eh_frame): Call update_flags_for_input_section,
16969 not write_enable_output_section.
16970 (Layout::make_output_section): Don't push to
16971 unattached_section_list_ nor call attach_to_segment. Call
16972 attach_section_to_segment if sections are attached.
16973 (Layout::attach_sections_to_segments): New function.
16974 (Layout::attach_section_to_segment): New function.
16975 (Layout::attach_allocated_section_to_segment): Rename from
16976 attach_to_segment. Remove flags parameter.
16977 (Layout::allocate_output_section): Remove function.
16978 (Layout::write_enable_output_section): Remove function.
16979 * layout.h (class Layout): Update for above changes. Add new
16980 field sections_are_attached_.
16981 * output.h (Output_section::update_flags_for_input_section): New
16982 function.
16983 * output.cc (Output_section::add_input_section): Call
16984 update_flags_for_input_section.
16985 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
16986
009a67a2
CC
169872008-04-11 Cary Coutant <ccoutant@google.com>
16988
16989 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
16990 thought unnecessary.
16991 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
16992
759b1a24
ILT
169932008-04-11 Ian Lance Taylor <iant@google.com>
16994
16995 * output.h (class Output_section_data): Remove inline definition
16996 of set_addralign.
16997 * output.cc (Output_section_data::set_addralign): New function.
16998
c2b45e22
CC
169992008-04-11 Cary Coutant <ccoutant@google.com>
17000
17001 Add support for TLS descriptors for i386 and x86_64.
17002 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
17003 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
17004 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
17005 GOT_TYPE_TLS_DESC.
17006 (Target_i386::got_mod_index_entry): Remove unnecessary code.
17007 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
17008 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
17009 relocations.
17010 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
17011 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
17012 Fix problem with initial-exec relocations.
17013 (Target_i386::Relocate::relocate_tls): Likewise.
17014 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
17015 relaxation.
17016 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
17017 support for section-plus-offset dynamic table entries.
17018 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
17019 (Output_data_dynamic::Dynamic_entry): Add support for
17020 section-plus-offset dynamic table entries.
17021 (Output_data_dynamic::Classification): Likewise.
17022 (Output_data_dynamic::classification_): Renamed offset_.
17023 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
17024 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
17025 (Target_x86_64::make_plt_section): New function.
17026 (Target_x86_64::reserve_tlsdesc_entries): New function.
17027 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
17028 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
17029 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
17030 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
17031 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
17032 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
17033 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
17034 add extra PLT entry for TLS descriptors.
17035 (Output_data_plt_x86_64::got_): New field.
17036 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
17037 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
17038 fields.
17039 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
17040 descriptors.
17041 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
17042 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
17043 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
17044 R_386_TLS_DESC_CALL relocations.
17045 (Target_x86_64::Scan::global): Likewise.
17046 (Target_x86_64::do_finalize_sections): Add dynamic table entries
17047 for TLS descriptors.
17048 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
17049 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
17050 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
17051 GD-to-IE relaxation.
17052 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
17053 and TLS_DESCRIPTORS.
17054 * Makefile.in: Rebuild.
17055 * configure: Rebuild.
17056 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
17057 (tls_test_shared2.so): New target.
17058 (tls_shared_gd_to_ie_test_SOURCES): New variable.
17059 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
17060 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
17061 (tls_shared_gd_to_ie_test_LDADD): New variable.
17062 (tls_shared_gnu2_gd_to_ie_test): New target.
17063 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
17064 New targets.
17065 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
17066 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
17067 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
17068 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
17069 (tls_shared_gnu2_test): New target.
17070 (tls_test_gnu2_shared.so): New target.
17071 (tls_shared_gnu2_test_SOURCES): New variable.
17072 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
17073 (tls_shared_gnu2_test_LDFLAGS): New variable.
17074 (tls_shared_gnu2_test_LDADD): New variable.
17075 * testsuite/Makefile.in: Rebuild.
17076 * testsuite/Makefile.
17077
83bfb6b7
ILT
170782008-04-11 Ian Lance Taylor <iant@google.com>
17079
17080 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
17081 justsyms.t.
17082 * testsuite/Makefile.in: Rebuild.
17083
17084 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
17085 long.
17086 * testsuite/script_test_2.cc (main): Adjust test.
17087
706e1f5e
ILT
170882008-04-11 David S. Miller <davem@davemloft.net>
17089 Ian Lance Taylor <iant@google.com>
17090
17091 * options.h (General_options): Add entries for '-Y' and
17092 '-relax'.
17093 * options.cc (General_options:finalize): If -Y was used, add those
17094 entries to the library path instead of the default "/lib" and
17095 "/usr/lib".
17096
7c98e6bb
DM
170972008-04-11 David S. Miller <davem@davemloft.net>
17098
17099 * testsuite/justsyms.t: Start at 0x100.
17100 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
17101 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
17102 long.
17103 * testsuite/script_test_2.cc: Adjust string and section length
17104 checks.
7c98e6bb 17105
99a37bfd
ILT
171062008-04-09 Ian Lance Taylor <iant@google.com>
17107
2cefc357
ILT
17108 PR gold/5996
17109 * script-sections.cc (Sections_element::allocate_to_segment): Add
17110 orphan parameter.
17111 (Output_section_definition::allocate_to_segment): Likewise.
17112 (Orphan_output_section::allocate_to_segment): Likewise.
17113 (Script_sections::attach_sections_using_phdrs_clause): Don't
17114 propagate non-PT_LOAD segments to orphan sections.
17115 * testsuite/Makefile.am (script_test_3.stdout): Generate using
17116 readelf rather than objdump.
17117 * testsuite/script_test_3.sh: Adjust accordingly. Test that
17118 .interp section and PT_INTERP segment are the same size.
17119 * testsuite/Makefile.in: Rebuild.
17120
99a37bfd
ILT
17121 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
17122 aliases for symbols defined in the same object.
17123 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
17124 (weak_alias_test_SOURCES): New variable.
17125 (weak_alias_test_DEPENDENCIES): New variable.
17126 (weak_alias_test_LDFLAGS): New variable.
17127 (weak_alias_test_LDADD): New variable.
17128 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
17129 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
17130 (weak_alias_test_3.o): New target.
17131 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
17132 * testsuite/weak_alias_test_main.cc: New file.
17133 * testsuite/weak_alias_test_1.cc: New file.
17134 * testsuite/weak_alias_test_2.cc: New file.
17135 * testsuite/weak_alias_test_3.cc: New file.
17136
780e49c5
ILT
171372008-04-08 Ian Lance Taylor <iant@google.com>
17138
cdb0b8f5
ILT
17139 * options.h (class General_options): Add --noinhibit-exec option.
17140 * main.cc (main): Check --noinhibit-exec.
17141
0864d551
ILT
17142 * options.h (class General_options): Define --wrap as a special
17143 option. Add wrap_symbols_ field.
17144 (General_options::any_wrap_symbols): New function.
17145 (General_options::is_wrap_symbol): New function.
17146 * options.cc (General_options::parse_wrap): New function.
17147 (General_options::General_options): Initialize wrap_symbols_.
17148 * symtab.cc (Symbol_table::wrap_symbol): New function.
17149 (Symbol_table::add_from_object): Handle --wrap.
17150 * symtab.h (class Symbol_table): Declare wrap_symbol.
17151 * target.h (Target::wrap_char): New function.
17152 (Target::Target_info): Add wrap_char field.
17153 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
17154 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
17155 * testsuite/testfile.cc (Target_test::test_target_info):
17156 Likewise.
17157
789aa6de
ILT
17158 * errors.cc (Errors::undefined_symbol): Mention symbol version if
17159 there is one.
17160
2c38906f
ILT
17161 * layout.h (class Layout): Add added_eh_frame_data_ field.
17162 * layout.cc (Layout::Layout): Initialize new field.
17163 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
17164 output section until we find a section we merged successfully.
17165 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
17166 that the size be non-zero.
17167
780e49c5
ILT
17168 * merge.cc (Object_merge_map::get_output_offset): Remove inline
17169 qualifier.
17170
7fcd0256
ILT
171712008-04-08 Craig Silverstein <csilvers@google.com>
17172
17173 * configure.ac: Export new conditional variable HAVE_ZLIB.
17174 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
17175 on HAVE_ZLIB.
17176 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
17177 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17178
6835af53
ILT
171792008-04-07 Ian Lance Taylor <iant@google.com>
17180
e24f324c
ILT
17181 * version.cc (version_string): Set to "1.5".
17182
a036edd8
ILT
17183 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
17184 Add issued_non_pic_error_ field. Declare check_non_pic.
17185 (Target_x86_64::Scan::check_non_pic): New function.
17186 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
17187 (Target_x86_64::Scan::global): Likewise.
17188
624f8810
ILT
17189 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
17190 addend parameter. Change caller. Handle merge sections.
17191 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
17192 Address to Addend. Don't add in the result of
17193 local_section_offset, pass down the addend and use the returned
17194 value.
17195 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
17196 Update declarations of local_section_offset and symbol_value.
17197 * testsuite/two_file_test_1.cc (t18): New function.
17198 * testsuite/two_file_test_2.cc (f18): New function.
17199 * testsuite/two_file_test_main.cc (main): Call t18.
17200 * testsuite/two_file_test.h (t18, f18): Declare.
17201
6835af53
ILT
17202 * configure.ac: Don't test for objdump, c++filt, or readelf.
17203 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
17204 conditionals.
17205 (TEST_READELF): New variable.
17206 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
17207 (check_PROGRAMS): Add two_file_strip_test.
17208 (two_file_strip_test): New target.
17209 (check_PROGRAMS): Add two_file_same_shared_strip_test.
17210 (two_file_same_shared_strip_test_SOURCES): New variable.
17211 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
17212 (two_file_same_shared_strip_test_LDFLAGS): New variable.
17213 (two_file_same_shared_strip_test_LDADD): New variable.
17214 (two_file_shared_strip.so): New target.
17215 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
17216 (ver_test_5.syms, ver_test_7.syms): Likewise.
17217 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
17218 (strip_test_3.stdout): Use TEST_OBJDUMP.
17219 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17220
86925eef
CC
172212008-04-04 Cary Coutant <ccoutant@google.com>
17222
17223 * symtab.h (Symbol::is_weak_undefined): New function.
17224 (Symbol::is_strong_undefined): New function.
17225 (Symbol::is_absolute): New function.
17226 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
17227 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
17228 absolute symbols.
17229 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
17230 (weak_undef_test): New target.
17231 * testsuite/Makefile.in: Rebuild.
17232 * testsuite/weak_undef_file1.cc: New file.
17233 * testsuite/weak_undef_file2.cc: New file.
17234 * testsuite/weak_undef_test.cc: New file.
17235
126f3ece
ILT
172362008-04-03 Craig Silverstein <csilvers@google.com>
17237
17238 * compressed_output.h (class Output_compressed_section): Use
17239 unsigned buffer.
17240 * compressed_output.cc (zlib_compress): Use unsigned buffers,
17241 add zlib header.
17242 (zlib_compressed_suffix): Removed.
17243 (Output_compressed_section::set_final_data_size): Use unsigned
17244 buffers.
17245 * testsuite/Makefile.am (flagstest_compress_debug_sections):
17246 Fix linker invocation.
17247 (flagstest_o_specialfile_and_compress_debug_sections):
17248 Likewise.
17249 * testsuite/Makefile.in: Regenerated.
17250
deae2a14
DM
172512008-04-02 David S. Miller <davem@davemloft.net>
17252
17253 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
17254 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
17255
70752818
ILT
172562008-04-02 Craig Silverstein <csilvers@google.com>
17257
17258 * TODO: New file.
17259
39d0cb0e
ILT
172602008-04-02 Ian Lance Taylor <iant@google.com>
17261
17262 * fileread.cc (File_read::find_view): Add byteshift and vshifted
17263 parameters. Update for new key type to views_. Change all
17264 callers.
17265 (File_read::read): Adjust for byteshift in returned view.
17266 (File_read::add_view): New function, broken out of
17267 find_and_make_view.
17268 (File_read::make_view): New function, broken out of
17269 find_and_make_view.
17270 (File_read::find_or_make_view): Add offset and aligned
17271 parameters. Rewrite accordingly. Change all callers.
17272 (File_read::get_view): Add offset and aligned parameters. Adjust
17273 for byteshift in return value.
17274 (File_read::get_lasting_view): Likewise.
17275 * fileread.h (class File_read): Update declarations.
17276 (class File_read::View): Add byteshift_ field. Add byteshift to
17277 constructor. Add byteshift method.
17278 * archive.h (Archive::clear_uncached_views): New function.
17279 (Archive::get_view): Add aligned parameter. Change all callers.
17280 * object.h (Object::get_view): Add aligned parameter. Change all
17281 callers.
17282 (Object::get_lasting_view): Likewise.
17283
17284 * fileread.cc (File_read::release): Don't call clear_views if
17285 there are multiple objects.
17286 * fileread.h (File_read::clear_uncached_views): New function.
17287 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
17288 on the archive.
17289
a1207466
CC
172902008-03-31 Cary Coutant <ccoutant@google.com>
17291
17292 Add thin archive support.
17293 * archive.cc (Archive::armagt): New const.
17294 (Archive::setup): Remove task parameter and calls to unlock.
17295 (Archive::unlock_nested_archives): New function.
17296 (Archive::read_header): Add nested_off parameter. Change
17297 all callers.
17298 (Archive::interpret_header): Likewise.
17299 (Archive::include_all_members): Change to handle thin
17300 archives.
17301 (Archive::include_member): Likewise.
17302 * archive.h (Archive::Archive): Add new parameters and
17303 initializers.
17304 (Archive::armagt): New const.
17305 (Archive::setup): Remove task parameter.
17306 (Archive::unlock_nested_archives): New function.
17307 (Archive::read_header): Add nested_off parameter.
17308 (Archive::interpret_header): Likewise.
17309 (Archive::Nested_archive_table): New typedef.
17310 (Archive::is_thin_archive_): New field.
17311 (Archive::nested_archives_): New field.
17312 (Archive::options_): New field.
17313 (Archive::dirpath_): New field.
17314 (Archive::task_): New field.
17315 * readsyms.cc (Read_symbols::do_read_symbols): Add check
17316 for thin archives. Pass additional parameters to
17317 Archive::Archive. Unlock the archive file after calling
17318 Archive::setup.
cd536b21 17319
479f6503
ILT
173202008-03-29 Ian Lance Taylor <iant@google.com>
17321
686c8caf
ILT
17322 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
17323 version symbol to be local.
17324 * testsuite/ver_test_4.sh: New file.
17325 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
17326 (check_DATA): Add ver_test_4.syms.
17327 (ver_test_4.syms): New target.
17328 * testsuite/Makefile.in: Rebuild.
17329
ab794b6b
ILT
17330 * output.cc
17331 (Output_section::Input_section_sort_entry::has_priority): New
17332 function.
17333 (Output_section::Input_section_sort_entry::match_file_name): New
17334 function.
17335 (Output_section::Input_section_sort_entry::match_section_name):
17336 Remove.
17337 (Output_section::Input_section_sort_entry::match_section_name_prefix):
17338 Remove.
17339 (Output_section::Input_section_sort_entry::match_section_file):
17340 Remove.
17341 (Output_section::Input_section_sort_compare::operator()): Rewrite
17342 using new Input_section_sort_entry functions. Sort crtbegin and
17343 crtend first. Sort sections with no priority before sections with
17344 a priority.
17345 * testsuite/initpri1.c (d3): Check j != 4.
17346 (cd5): New constructor/destructor function.
17347 (main): Check j != 2.
17348
479f6503
ILT
17349 * symtab.cc (Symbol_table::add_from_object): If we don't use the
17350 new symbol when resolving, don't call set_is_default.
17351 * testsuite/ver_test_7.cc: New file.
17352 * testsuite/ver_test_7.sh: New file.
17353 * testsuite/Makefile.am (ver_test_7.so): New target.
17354 (ver_test_7.o): New target.
17355 (check_SCRIPTS): Add ver_test_7.sh.
17356 (check_DATA): Add ver_test_7.syms.
17357 (ver_test_7.syms): New target.
17358
2fd32231
ILT
173592008-03-28 Ian Lance Taylor <iant@google.com>
17360
17361 * layout.cc (Layout::layout): If we see an input section with a
17362 name that needs sorting, set the must_sort flag for the output
17363 section.
17364 (Layout::make_output_section): If the name of the output section
17365 indicates that it might require sorting, set the may_sort flag.
17366 * output.h (Output_section::may_sort_attached_input_sections): New
17367 function.
17368 (Output_section::set_may_sort_attached_input_sections): New
17369 function.
17370 (Output_section::must_sort_attached_input_sections): New
17371 function.
17372 (Output_section::set_must_sort_attached_input_sections): New
17373 function.
17374 (class Output_section): Declare Input_section_sort_entry. Define
17375 Input_section_sort_compare. Declare
17376 sort_attached_input_sections. Add new fields:
17377 may_sort_attached_input_sections_,
17378 must_sort_attached_input_sections_,
17379 attached_input_sections_are_sorted_.
17380 * output.cc (Output_section::Output_section): Initialize new
17381 fields.
17382 (Output_section::add_input_section): Add an entry to
17383 input_sections_ if may_sort or must_sort are true.
17384 (Output_section::set_final_data_size): Call
17385 sort_attached_input_sections if necessary.
17386 (Output_section::Input_section_sort_entry): Define new class.
17387 (Output_section::Input_section_sort_compare::operator()): New
17388 function.
17389 (Output_section::sort_attached_input_sections): New function.
17390 * configure.ac: Check whether the compiler supports constructor
17391 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
17392 * testsuite/initpri1.c: New file.
17393 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
17394 CONSTRUCTOR_PRIORITY.
17395 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
17396 (initpri1_LDFLAGS): New variable.
17397 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17398
18e6b24e
ILT
173992008-03-27 Ian Lance Taylor <iant@google.com>
17400
49bdd526
ILT
17401 * common.cc (Sort_commons::operator): Correct sorting algorithm.
17402 * testsuite/common_test_1.c: New file.
17403 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
17404 (common_test_1_SOURCES): New variable.
17405 (common_test_1_DEPENDENCIES): New variable.
17406 (common_test_1_LDFLAGS): New variable.
17407
18e6b24e
ILT
17408 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
17409 and commons_ correctly when NAME/VERSION does not override
17410 NAME/NULL.
17411 * testsuite/ver_test_6.c: New file.
17412 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
17413 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
17414 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
17415
04bf7072
ILT
174162008-03-26 Ian Lance Taylor <iant@google.com>
17417
5871526f
ILT
17418 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
17419 of an undefined symbol from a version script.
17420 * testsuite/Makefile.am (ver_test_5.so): New target.
17421 (ver_test_5.o): New target.
17422 (check_SCRIPTS): Add ver_test_5.sh.
17423 (check_DATA): Add ver_test_5.syms.
17424 (ver_test_5.syms): New target.
17425 * testsuite/ver_test_5.cc: New file.
17426 * testsuite/ver_test_5.script: New file.
17427 * testsuite/ver_test_5.sh: New file.
17428 * Makefile.in, testsuite/Makefile.in: Rebuild.
17429
04bf7072
ILT
17430 PR gold/5986
17431 Fix problems building gold with gcc 4.3.0.
17432 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
17433 (gold_error_at_location, gold_warning_at_location): Use it.
17434 * configure.ac: Check whether we can compile and use a template
17435 function with a printf attribute.
17436 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
17437 when jumping over bytes.
17438 * object.cc: Instantiate Object::read_section_data.
17439 * debug.h: Include <cstring>
17440 * dwarf_reader.cc: Include <algorithm>
17441 * main.cc: Include <cstring>.
17442 * options.cc: Include <cstring>.
17443 * output.cc: Include <cstring>.
17444 * script.cc: Include <cstring>.
17445 * script.h: Include <string>.
17446 * symtab.cc: Include <cstring> and <algorithm>.
17447 * target-select.cc: Include <cstring>.
17448 * version.cc: Include <string>.
17449 * testsuite/testmain.cc: Include <cstdlib>.
17450 * configure, config.in: Rebuild.
17451
874c5b28
ILT
174522008-03-25 Ian Lance Taylor <iant@google.com>
17453
819d6c3a
ILT
17454 * options.cc: Include "../bfd/bfdver.h".
17455 (options::help): Print bug reporting address.
17456
f4b2c6f5
ILT
17457 * version.cc (print_version): Adjust output for current value of
17458 BFD_VERSION_STRING.
17459
17460 * NEWS: New file.
17461
e96caa79
ILT
17462 * options.cc (options::help): Print list of supported targets.
17463 * target-select.h: Include <vector>.
17464 (class Target_selector): Make machine_, size_, and is_big_endian_
17465 fields const. Add bfd_name_ and instantiated_target_ fields.
17466 (Target_selector::Target_selector): Add bfd_name parameter.
17467 (Target_selector::recognize): Make non-virtual, call
17468 do_recognize.
17469 (Target_selector::recognize_by_name): Make non-virtual, call
17470 do_recognize_by_name.
17471 (Target_selector::supported_names): New function.
17472 (Target_selector::bfd_name): New function.
17473 (Target_selector::do_instantiate_target): New pure virtual
17474 function.
17475 (Target_selector::do_recognize): New virtual function.
17476 (Target_selector::do_recognize_by_name): New virtual function.
17477 (Target_selector::instantiate_target): New private function.
17478 (supported_target_names): Declare.
17479 * target-select.cc (Target_selector::Target_selector): Update for
17480 new parameter and fields.
17481 (select_target_by_name): Check that the name matches before
17482 calling recognize_by_name.
17483 (supported_target_names): New function.
17484 * i386.cc (class Target_selector_i386): Update Target_selector
17485 constructor call. Remove recognize and recognize_by_name. Add
17486 do_instantiate_target.
17487 * x86_64.cc (class Target_selector_x86_64): Likewise.
17488 * testsuite/testfile.cc (class Target_selector_test): Update for
17489 changes to Target_selector.
17490
874c5b28
ILT
17491 * README: Rewrite, with some notes on unsupported features.
17492
0a65a3a7
CC
174932008-03-24 Cary Coutant <ccoutant@google.com>
17494
17495 * i386.cc (Target_i386::Got_type): New enum declaration.
17496 (Target_i386::Scan::local): Updated callers of Output_data_got
17497 member functions.
17498 (Target_i386::Scan::global): Likewise.
17499 (Target_i386::Relocate::relocate): Likewise.
17500 (Target_i386::Relocate::relocate_tls): Likewise.
17501 * object.h (Got_offset_list): New class.
17502 (Sized_relobj::local_has_got_offset): Added got_type parameter.
17503 (Sized_relobj::local_got_offset): Likewise.
17504 (Sized_relobj::set_local_got_offset): Likewise.
17505 (Sized_relobj::local_has_tls_got_offset): Removed.
17506 (Sized_relobj::local_tls_got_offset): Removed.
17507 (Sized_relobj::set_local_tls_got_offset): Removed.
17508 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
17509 * output.cc (Output_data_got::add_global): Added got_type parameter.
17510 (Output_data_got::add_global_with_rel): Likewise.
17511 (Output_data_got::add_global_with_rela): Likewise.
17512 (Output_data_got::add_global_pair_with_rel): New function.
17513 (Output_data_got::add_global_pair_with_rela): New function.
17514 (Output_data_got::add_local): Added got_type parameter.
17515 (Output_data_got::add_local_with_rel): Likewise.
17516 (Output_data_got::add_local_with_rela): Likewise.
17517 (Output_data_got::add_local_pair_with_rel): New function.
17518 (Output_data_got::add_local_pair_with_rela): New function.
17519 (Output_data_got::add_global_tls): Removed.
17520 (Output_data_got::add_global_tls_with_rel): Removed.
17521 (Output_data_got::add_global_tls_with_rela): Removed.
17522 (Output_data_got::add_local_tls): Removed.
17523 (Output_data_got::add_local_tls_with_rel): Removed.
17524 (Output_data_got::add_local_tls_with_rela): Removed.
17525 * output.h (Output_data_got::add_global): Added got_type parameter.
17526 (Output_data_got::add_global_with_rel): Likewise.
17527 (Output_data_got::add_global_with_rela): Likewise.
17528 (Output_data_got::add_global_pair_with_rel): New function.
17529 (Output_data_got::add_global_pair_with_rela): New function.
17530 (Output_data_got::add_local): Added got_type parameter.
17531 (Output_data_got::add_local_with_rel): Likewise.
17532 (Output_data_got::add_local_with_rela): Likewise.
17533 (Output_data_got::add_local_pair_with_rel): New function.
17534 (Output_data_got::add_local_pair_with_rela): New function.
17535 (Output_data_got::add_global_tls): Removed.
17536 (Output_data_got::add_global_tls_with_rel): Removed.
17537 (Output_data_got::add_global_tls_with_rela): Removed.
17538 (Output_data_got::add_local_tls): Removed.
17539 (Output_data_got::add_local_tls_with_rel): Removed.
17540 (Output_data_got::add_local_tls_with_rela): Removed.
17541 * resolve.cc (Symbol::override_base_with_special): Removed
17542 reference to has_got_offset_ field.
17543 * symtab.cc (Symbol::init_fields): Replaced initialization
17544 of got_offset_ with got_offsets_. Removed initialization
17545 of has_got_offset_
53fcba31 17546 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
17547 (Symbol::got_offset): Likewise.
17548 (Symbol::set_got_offset): Likewise.
17549 (Symbol::has_tls_got_offset): Removed.
17550 (Symbol::tls_got_offset): Removed.
17551 (Symbol::set_tls_got_offset): Removed.
17552 (Symbol::got_offset_): Removed.
17553 (Symbol::tls_mod_got_offset_): Removed.
17554 (Symbol::tls_pair_got_offset_): Removed.
17555 (Symbol::got_offsets_): New field.
17556 (Symbol::has_got_offset): Removed.
17557 (Symbol::has_tls_mod_got_offset): Removed.
17558 (Symbol::has_tls_pair_got_offset): Removed.
17559 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
17560 (Target_x86_64::Scan::local): Updated callers of Output_data_got
17561 member functions.
17562 (Target_x86_64::Scan::global): Likewise.
17563 (Target_x86_64::Relocate::relocate): Likewise.
17564 (Target_x86_64::Relocate::relocate_tls): Likewise.
17565
bd52eafb
BE
175662008-03-25 Ben Elliston <bje@au.ibm.com>
17567
17568 * yyscript.y: Fix spelling error in comment.
17569
8b105e34
ILT
175702008-03-24 Ian Lance Taylor <iant@google.com>
17571
8ed814a9
ILT
17572 * options.h (class General_options): Define build_id option.
17573 * layout.h (class Layout): Declare write_build_id, create_note,
17574 create_build_id. Add build_id_note_ member.
17575 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
17576 "libiberty.h", "md5.h", "sha1.h".
17577 (Layout::Layout): Initialize eh_frame_data_,
17578 eh_frame_hdr_section_, and build_id_note_.
17579 (Layout::finalize): Call create_build_id.
17580 (Layout::create_note): New function, broken out of
17581 Layout::create_gold_note.
17582 (Layout::create_gold_note): Call create_note.
17583 (Layout::create_build_id): New function.
17584 (Layout::write_build_id): New function.
17585 (Close_task_runner::run): Call write_build_id.
17586
8b105e34
ILT
17587 * x86_64.cc: Correct license to GPLv3.
17588
086a1841
ILT
175892008-03-23 Ian Lance Taylor <iant@google.com>
17590
17591 * options.cc: Include "demangle.h".
17592 (parse_optional_string): New function.
17593 (parse_long_option): Handle takes_optional_argument.
17594 (parse_short_option): Update dash_z initializer. Handle
17595 takes_optional_argument.
17596 (General_options::General_options): Initialize do_demangle_.
17597 (General_options::finalize): Set do_demangle_. Handle demangling
17598 style.
17599 * options.h (parse_optional_string): Declare.
17600 (struct One_option): Add optional_arg field. Update constructor.
17601 Update call constructor calls. Add takes_optional_argument
17602 function.
17603 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
17604 (DEFINE_optional_string): Define.
17605 (General_options::demangle): Change from DEFINE_bool to
17606 DEFINE_optional_string.
17607 (General_options::no_demangle): New function.
17608 (General_options::do_demangle): New function.
17609 (General_options::set_do_demangle): New function.
17610 (General_options::execstack_status_): Move definition to end of
17611 class definition.
17612 (General_options::static_): Likewise.
17613 (General_options::do_demangle_): New field.
17614 * object.cc (big_endian>::get_symbol_location_info): Call
17615 Options::do_demangle, not Options::demangle.
17616 * symtab.cc (demangle): Likewise.
17617
cbb93e63
ILT
176182008-03-22 Ian Lance Taylor <iant@google.com>
17619
17620 * gold.h: Include <cstddef> and <sys/types.h>
17621 * options.h: Include <cstring>.
17622
ec531623
ILT
176232008-03-21 Ian Lance Taylor <iant@google.com>
17624
17625 * Added source code to GNU binutils.
752937aa 17626\f
b90efa5b 17627Copyright (C) 2008-2015 Free Software Foundation, Inc.
752937aa
NC
17628
17629Copying and distribution of this file, with or without modification,
17630are permitted in any medium without royalty provided the copyright
17631notice and this notice are preserved.
17632
17633Local Variables:
17634mode: change-log
17635left-margin: 8
17636fill-column: 74
17637version-control: never
17638End:
This page took 1.113245 seconds and 4 git commands to generate.