Update testsuite/pr18689.sh for older GCC
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
2bca0377
HS
12015-07-20 Han Shen <shenhan@google.com>
2
3 Fix arm elf header flags wrt hardfp bit.
4
5 * arm.cc (Target_arm::do_adjust_elf_header): Set flags into view.
6
f54f5e31
L
72015-07-20 H.J. Lu <hongjiu.lu@intel.com>
8
9 PR gold/18689
10 * layout.cc (Layout::layout): Clear the SHF_COMPRESSED flag bit
11 from input group section for relocatable link.
12 * testsuite/Makefile.am (check_SCRIPTS): Add pr18689.sh.
13 (check_DATA): Add pr18689.stdout.
14 (MOSTLYCLEANFILES): Add pr18689a.o pr18689b.o.
15 (pr18689.stdout): New rule.
16 (pr18689a.o): Likewise.
17 (pr18689b.o): Likewise.
18 (pr18689.o): Likewise.
19 * testsuite/pr18689.c: New file.
20 * testsuite/pr18689.sh: Likewise.
21 * testsuite/Makefile.in: Regenerated.
22
c20ceeb2
YW
232015-07-20 Yiran Wang <yiran@google.com>
24 Cary Coutant <ccoutant@gmail.com>
25
26 PR gold/15574
27 * resolve.cc (Symbol_table): Remove warning about references
28 from shared objects to hidden symbols.
29 * testsuite/Makefile.am (hidden_test): Add hidden_test.syms.
30 * testsuite/Makefile.in: Regenerate.
31 * testsuite/hidden_test.sh: Check dynamic symbol table; update
32 expected error messages.
33
19a7fe52
L
342015-07-14 H.J. Lu <hongjiu.lu@intel.com>
35
36 * compressed_output.cc (Output_compressed_section::set_final_data_size):
37 Make --compress-debug-sections=zlib the same as
38 --compress-debug-sections=zlib-gabi.
39 * testsuite/Makefile.am (flagstest_compress_debug_sections.check):
40 Expect ".debug_.*" with the SHF_COMPRESSED bit, instead of
41 ".zdebug_".
42 * testsuite/Makefile.in: Regenerated.
43
fb8b9dbc
L
442015-07-12 H.J. Lu <hongjiu.lu@intel.com>
45
46 PR gold/18322
47 * compressed_output.cc (zlib_compress): Add argument for
48 compression header size. Set header size to compression header
49 size if it isn't 0. Don't write out the zlib header here.
50 (Output_compressed_section::set_final_data_size): Support
51 zlib-gnu and zlib-gabi compressions. Pass compression header
52 size to zlib_compress and write out compression header. Set
53 the SHF_COMPRESSED bit for zlib-gabi compression. Otherwise
54 clear the SHF_COMPRESSED bit
55 * options.h (compress_debug_sections): Add zlib-gnu and
56 zlib-gabi.
57 * output.h (Output_section::set_flags): New.
58 * testsuite/Makefile.am (check_PROGRAMS): Add
59 flagstest_compress_debug_sections_none,
60 flagstest_compress_debug_sections_gnu and
61 flagstest_compress_debug_sections_gabi.
62 (check_DATA): Add flagstest_compress_debug_sections_none.stdout.
63 flagstest_compress_debug_sections.stdout,
64 flagstest_compress_debug_sections.cmp,
65 flagstest_compress_debug_sections.check,
66 flagstest_compress_debug_sections_gnu.stdout,
67 flagstest_compress_debug_sections_gnu.cmp,
68 flagstest_compress_debug_sections_gnu.check,
69 flagstest_compress_debug_sections_gabi.stdout,
70 flagstest_compress_debug_sections_gabi.cmp and
71 flagstest_compress_debug_sections_gabi.check.
72 (flagstest_compress_debug_sections_none): New.
73 (flagstest_compress_debug_sections_none.stdout): Likewise.
74 (flagstest_compress_debug_sections.stdout): Likewise.
75 (flagstest_compress_debug_sections.check): Likewise.
76 (flagstest_compress_debug_sections.cmp): Likewise.
77 (flagstest_compress_debug_sections_gnu): Likewise.
78 (flagstest_compress_debug_sections_gnu.stdout): Likewise.
79 (flagstest_compress_debug_sections_gnu.check): Likewise.
80 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
81 (flagstest_compress_debug_sections_gabi): Likewise.
82 (flagstest_compress_debug_sections_gabi.stdout): Likewise.
83 (flagstest_compress_debug_sections_gnu.check): Likewise.
84 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
85 * testsuite/Makefile.in: Regenerated.
86
48058663
L
872015-07-12 H.J. Lu <hongjiu.lu@intel.com>
88
89 PR gold/18321
90 * compressed_output.h (decompress_input_section): Add arguments
91 for ELF class, big endian and sh_flags.
92 * compressed_output.cc (decompress_input_section): Likewise.
93 Support the SHF_COMPRESSED section.
94 * dynobj.h (Dynobj): Add elfsize and is_big_endian member
95 functions.
96 * plugin.h (Pluginobj): Likewise.
97 * layout.cc (Layout::get_output_section_flags): Also clear the
98 SHF_COMPRESSED bit.
99 * object.h (Compressed_section_info): Add flag to store sh_flags.
100 (Object): Add pure virtual elfsize and is_big_endian member
101 functions.
102 * object.cc (need_decompressed_section): Don't skip the ".zdebug"
103 prefix here.
104 (build_compressed_section_map): Check SHF_COMPRESSED for
105 uncompressed size. Store sh_flags in Compressed_section_info.
106 Pass size, big_endian and sh_flags to decompress_input_section.
107 Skip the ".debug"/".zdebug" prefix when passing section name to
108 need_decompressed_section.
109 (Sized_relobj_file<size, big_endian>::do_find_special_section):
110 Don't check ".zdebug_*" sections.
111 (Object::decompressed_section_contents): Pass ELF class, big
112 endian and sh_flags to decompress_input_section.
113 * reloc.cc (Sized_relobj_file<size, big_endian>::write_sections):
114 Likewise.
115 * testsuite/Makefile.am (check_DATA): Add
116 debug_msg_cdebug_gabi.err and gdb_index_test_2_gabi.stdout.
117 (MOSTLYCLEANFILES): Add debug_msg_cdebug_gabi.err and
118 gdb_index_test_2_gabi.stdout.
119 (debug_msg_cdebug_gabi.o): New.
120 (odr_violation1_cdebug_gabi.o): Likewise.
121 (odr_violation2_cdebug_gabi.o): Likewise.
122 (debug_msg_cdebug_gabi.err): Likewise.
123 (check_SCRIPTS): Add gdb_index_test_2_gabi.sh.
124 (gdb_index_test_cdebug_gabi.o): Likewise.
125 (gdb_index_test_2_gabi): Likewise.
126 (gdb_index_test_2_gabi.stdout): Likewise.
127 * testsuite/gdb_index_test_2_gabi.sh: New file.
128 * testsuite/Makefile.in: Regenerated.
129
73854cdd
HS
1302015-07-09 Han Shen <shenhan@google.com>
131
132 Use "gold_info" instead of "gold_warning" for erratum fix.
133
134 * aarch64.cc (Target_aarch64::scan_erratum_843419_span): Use
135 'gold_info'.
136 (Target_aarch64::scan_erratum_835769_span): USe 'gold_info'.
137
61163dfa
HS
1382015-07-09 Han Shen <shenhan@google.com>
139
140 Drop missing symbol warning for arm/aarch64.
141
142 * aarch64.cc (AArch64_relobj::scan_errata): Drop missing symbol warning.
143 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Drop missing
144 symbol warning.
145
b91deca9
HS
1462015-07-07 Han Shen <shenhan@google.com>
147
148 Make gold aarch64 accept long form of mapping symbols.
149
150 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Make legal
151 of mapping symbols.
152
15162bef
DK
1532015-06-29 Doug Kwan <dougkwan@google.com>
154
155 * testsuite/arm_bl_out_of_range.s: Align stub table so that it appears
156 at address expected by test.
157 * testsuite/arm_cortex_a8_b.s: Ditto.
158 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
159 * testsuite/arm_cortex_a8_bl.s: Ditto.
160 * testsuite/arm_cortex_a8_blx.s: Ditto.
161 * testsuite/arm_cortex_a8_local.s: Ditto.
162 * testsuite/arm_fix_v4bx.s: Ditto.
163 * testsuite/arm_unaligned_reloc.s: Ditto.
164 * testsuite/thumb_bl_out_of_range.s: Ditto.
165 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
166 * testsuite/thumb_blx_out_of_range.s: Ditto.
b91deca9 167
56b06706
HS
1682015-06-29 Han Shen <shenhan@google.com>
169
170 Patch for erratum 843419 internal error.
171
b91deca9 172 * aarch64.cc (Erratum_stub::Insn_utilities): New typedef.
56b06706
HS
173 (Erratum_stub::update_erratum_insn): New method.
174 (Stub_table::relocate_stubs): Modified to place relocated insn.
175 (AArch64_relobj::fix_errata): Modified gold_assert.
176
2f0c79aa
HS
1772015-06-12 Han Shen <shenhan@google.com>
178
179 Fix erratum 835769.
180
181 * aarch64.cc (AArch64_insn_utilities::BYTES_PER_INSN): Move
182 defintion outside class definition.
183 (AArch64_insn_utilities::AARCH64_ZR): New static constant.
184 (AArch64_insn_utilities::aarch64_op31): New member.
185 (AArch64_insn_utilities::aarch64_ra): New member.
186 (AArch64_insn_utilities::aarch64_mac): New member.
187 (AArch64_insn_utilities::aarch64_mlxl): New member.
188 (ST_E_835769): New global enum member.
189 (Stub_table::relocate_stubs): Add 835769 handler.
190 (Stub_template_repertoire::Stub_template_repertoire): Install new
191 stub type.
192 (AArch64_relobj::scan_errata): This func is renamed from
193 scan_erratum_843419.
194 (AArch64_relobj::do_count_local_symbols): Add 835769 handler.
195 (AArch64_relobj::do_relocate_sections): Add 835769 handler.
196 (AArch64_relobj::scan_sections_for_stubs): Add 835769 handler.
197 (Target_aarch64::scan_erratum_835769_span): New method.
198 (Target_aarch64::create_erratum_stub): New method.
199 (Target_aarch64::is_erratum_835769_sequence): New method.
200 (Target_aarch64::scan_erratum_843419_sequence): Move part of the
201 code into create_erratum_stub.
202 * options.h (fix_cortex_a53_835769): New option.
203
5d7908e0
CC
2042015-06-11 Cary Coutant <ccoutant@gmail.com>
205
206 * aarch64.cc (Erratum_stub::STUB_ADDR_ALIGN): Move initialization
207 outside class body.
208 (Reloc_stub::STUB_ADDR_ALIGN): Likewise.
209
dd68f8fa
CC
2102015-06-11 Cary Coutant <ccoutant@gmail.com>
211
212 PR gold/17731
213 * layout.cc (corresponding_uncompressed_section_name): New function.
214 (Layout::choose_output_section): Call it.
215 * layout.h (corresponding_uncompressed_section_name): New function.
216 * script-sections.cc (Input_section_info::set_section_name): Check
217 for compressed debug section (.zdebug style).
218
a3a0c391
JY
2192015-06-11 Jing Yu <jingyu@google.com>
220
221 * testsuite/Makefile.am: Add -O0 for script_test_12 test.
222 * testsuite/Makefile.in: Regenerate.
223
970cdef2
DI
2242015-06-11 Davide Italiano <dccitaliano@gmail.com>
225
226 * gold.h (is_cident): Correct typo.
227
a48d0c12
HS
2282015-06-10 Han Shen <shenhan@google.com>
229 Patch for erratum-843419 (2 of 2 - fix erratum occurrences).
230
231 Now fixing for 843419 is fully functional.
232
233 The first part of the erratum fix CL is here -
234 https://sourceware.org/ml/binutils/2015-04/msg00229.html
235
236 * aarch64.cc(global enum): New constants representing stub types.
237 (Stub_template): New POD struct.
238 (Stub_template_repertoire): New class.
239 (Stub_base): New class.
240 (Erratum_stub): New class.
241 (Reloc_stub): Refactored to be a subclass of Stub_base.
242 (Reloc_stub::Stub_type): Removed.
243 (Reloc_stub::offset): Moved to Stub_base.
244 (Reloc_stub::set_offset): Moved to Stub_base.
245 (Reloc_stub::destination_address): Moved to Stub_base.
246 (Reloc_stub::set_destination_address): Moved to Stub_base.
247 (Reloc_stub::reset_destination_address): Moved to Stub_base.
248 (Reloc_stub::stub_type): Renamed and moved to Stub_base.
249 (Reloc_stub::stub_size): Renamed and moved to Stub_base.
250 (Reloc_stub::stub_insns): Renamed and moved to Stub_base.
251 (Reloc_stub::write): Moved to Stub_base.
252 (Reloc_stub::invalid_offset): Moved to Stub_base.
253 (Reloc_stub::invalid_address): Moved to Stub_base.
254 (Reloc_stub::stub_type_): Renamed and moved to Stub_base.
255 (Reloc_stub::stub_insns_): Moved to Stub_base.
256 (Reloc_stub::offset_): Moved to Stub_base.
257 (Reloc_stub::destination_address_): Moved to Stub_base.
258 (Stub_table::The_aarch64_relobj): New typedef.
259 (Stub_table::The_erratum_stub): New typedef.
260 (Stub_table::The_erratum_stub_less): New typedef.
261 (Stub_table::The_erratum_stub_set): New typedef.
262 (Stub_table::The_erratum_stub_set_iter): New typedef.
263 (Stub_table::empty): Added emptiness testing for erratum stubs.
264 (Stub_table::add_erratum_stub): New method to add an erratum stub.
265 (Stub_table::find_erratum_stub): New method.
266 (Stub_table::find_erratum_stubs_for_input_section): New method.
267 (Stub_table::erratum_stub_address): New method.
268 (Stub_table::update_date_size_changed_p): Modified to handle erratum stubs.
269 (Stub_table::do_addralign): Modified to handle erratum stubs.
270 (Stub_table::erratum_stubs_): New member.
271 (Stub_table::erratum_stub_size_): New member.
272 (Stub_table::relocate_stubs): Modified to handle erratum stubs.
273 (Stub_table::do_write): Modified to handle erratum stubs.
274 (AArch64_relobj::The_erratum_stub): New typedef.
275 (AArch64_relobj::Erratum_stub_set_iter): New typedef.
276 (AArch64_relobj::fix_errata): New method.
277 (Target_aarch64::The_reloc_stub_type): Removed.
278 (Target_aarch64::The_erratum_stub): New typede.
279 (AArch64_relocate_functions::construct_b): New method.
280
1e1b2efc
NC
2812015-06-08 Nick Clifton <nickc@redhat.com>
282
283 * po/fr.po: New French Translation.
284
b8cf5075
CC
2852015-06-07 Cary Coutant <ccoutant@gmail.com>
286
287 PR gold/18288
288 * resolve.cc (symbol_to_bits): Remove type parameter; adjust all
289 callers. Don't use STT_COMMON to check for common symbols.
290 (Symbol_table::resolve): Warn if relocatable object has STT_COMMON
291 symbol that's not in a common section.
292 * symtab.h (Symbol::is_common): Don't use STT_COMMON to check for
293 common symbols.
294
bdd2d2b7
CC
2952015-06-04 Cary Coutant <ccoutant@gmail.com>
296
297 PR gold/18200
298 * Makefile.am (diststuff): Add target.
299 * Makefile.in: Regenerate.
300
cd3c333f
CC
3012015-06-04 Cary Coutant <ccoutant@gmail.com>
302
303 PR gold/17498
304 * object.cc (Sized_relobj_file::do_count_local_symbols): Discard
305 temporary locals in merge sections.
306 * options.cc (General_options::parse_discard_all): New method.
307 (General_options::parse_discard_locals): New method.
308 (General_options::parse_discard_none): New method.
309 (General_options::General_options): Initialize discard_locals_.
310 * options.h (--discard-all): Convert to special option.
311 (--discard-locals): Likewise.
312 (--discard-none): New option.
313 (General_options::discard_all): New method.
314 (General_options::discard_locals): New method.
315 (General_options::discard_sec_merge): New method.
316 (General_options::Discard_locals): New enum.
317 (General_options::discard_locals_): New data member.
318
8086551f
CC
3192015-06-03 Cary Coutant <cary@google.com>
320
321 * script-sections.cc (Script_sections::Script_sections): Initialize
322 segments_created_.
323 (Script_sections::create_note_and_tls_segments): Set flag when
324 segments are created.
325 (Script_sections::expected_segment_count): Count PT_INTERP.
326 (Script_sections::attach_sections_using_phdrs_clause): Set flag when
327 segments are created.
328 * script-sections.h (Script_sections::segments_created_): New data
329 member.
330
374082df
CC
3312015-06-03 Cary Coutant <ccoutant@gmail.com>
332
333 PR gold/15370
334 * script-sections.cc
335 (Output_section_element_input::set_section_addresses): When there
336 are several patterns with no sort spec, put all sections in the same
337 bin.
338 * testsuite/Makefile.am (script_test_12): New testcase.
339 (script_test_12i): New testcase.
340 * testsuite/Makefile.in: Regenerate.
341 * testsuite/script_test_12.t: New test linker script.
342 * testsuite/script_test_12i.t: New test linker script.
343 * testsuite/script_test_12a.c: New test source file.
344 * testsuite/script_test_12b.c: New test source file.
345
775ed62e
CC
3462015-06-02 Cary Coutant <ccoutant@gmail.com>
347
348 * nacl.h (Sniff_file): Switch parameters to get_view to get an
349 aligned view.
350
9c7fe3c5
CC
3512015-06-03 Cary Coutant <ccoutant@gmail.com>
352
353 PR gold/17819
354 * gold.cc (queue_final_tasks): When --build-id=tree, queue a
355 separate task to schedule the build id computation.
356 * layout.cc (Hash_task::Hash_task): Remove build_id_blocker,
357 add Output_file and offset.
358 (Hash_task::run): Get and release the input views.
359 (Hash_task::is_runnable): Always return NULL (always runnable).
360 (Layout::queue_build_id_tasks): Remove.
361 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
362 parameters; use them instead of class members.
363 (Build_id_task_runner::run): New function.
364 (Close_task_runner::run): Pass array_of_hashes and size_of_hashes
365 to write_build_id.
366 * layout.h (Layout::queue_build_id_tasks): Remove.
367 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
368 parameters.
369 (Layout::array_of_hashes_): Remove.
370 (Layout::size_of_array_of_hashes_): Remove.
371 (Layout::input_view_): Remove.
372 (Build_id_task_runner): New class.
373 (Close_task_runner::Close_task_runner): Add array_of_hashes and
374 size_of_hashes parameters.
375 (Close_task_runner::array_of_hashes_): New data member.
376 (Close_task_runner::size_of_hashes_): New data member.
377 * testsuite/Makefile.am
378 (flagstest_compress_debug_sections_and_build_id_tree): New test.
379 * testsuite/Makefile.in: Regenerate.
380
400f8944
RÁE
3812015-06-01 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
382
383 * merge.cc (get_input_merge_map): Update for data structure change.
384 (get_or_make_input_merge_map): Update for data structure change.
385 * merge.h (Object_merge_map): Use a std::vector<std::pair>> instead of
386 a std::map. Remove first_shnum_, first_map_, second_shnum_, second_map_.
387
bbec1a5d
AM
3882015-05-16 Alan Modra <amodra@gmail.com>
389
390 * reloc.cc (Sized_relobj_file::find_functions): Use function_location.
391 * powerpc.cc (Target_powerpc::do_calls_non_split): New function.
392 (addi_12_1, addis_2_12, addis_12_1, cmpld_7_12_0): New constants.
393 (lis_0): Rename from lis_0_0.
394
efc6fa12
CC
3952015-04-29 Cary Coutant <cary@google.com>
396 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
397
398 * gc.h (Garbage_collection::is_section_garbage): Change Object*
399 to Relobj*.
400 (Garbage_collection::add_reference): Likewise.
401 (Garbage_collection::gc_process_relocs): Likewise. Don't push
402 object/shndx pair onto *secvec for dynamic objects. Don't follow
403 relocations pointing to dynamic objects for GC.
404 * icf.cc (Icf::find_identical_sections): Change Object* to Relobj*.
405 (Icf::unfold_section): Likewise.
406 (Icf::is_section_folded): Likewise.
407 (Icf::get_folded_section): Likewise.
408 * icf.h: (Icf::get_folded_section): Likewise.
409 (Icf::unfold_section): Likewise.
410 (Icf::is_section_folded): Likewise.
411 (Icf::section_has_function_pointers): Likewise.
412 (Icf::set_section_has_function_pointers): Likewise.
413 * object.h (Section_id): Likewise.
414 (Const_section_id): Likewise.
415 * output.cc (Output_section::update_section_layout): Likewise.
416 * output.h: (Output_section_lookup_maps::find_relaxed_input_section):
417 Likewise.
418 * plugin.cc (update_section_order): Likewise.
419 (unique_segment_for_sections): Likewise.
420 * powerpc.cc (Powerpc_relobj::add_reference): Likewise.
421 (Target_powerpc::do_gc_add_reference): Likewise.
422 (Target_powerpc::gc_process_relocs): Likewise.
423 (Target_powerpc::do_gc_add_reference): Likewise.
424 * symtab.cc (Symbol_table::is_section_folded): Likewise.
425 (Symbol_table::gc_mark_symbol): Likewise.
426 * symtab.h: (Symbol_table::is_section_folded): Likewise.
427 * target.h: (Sized_target::gc_add_reference): Likewise.
428 (Sized_target::do_gc_add_reference): Likewise.
429
f9d3ecaa
NC
4302015-04-29 Nick Clifton <nickc@redhat.com>
431
432 * po/fi.po: Updated Finnish translation.
433
faa2211d
AM
4342015-04-28 Alan Modra <amodra@gmail.com>
435
436 * powerpc.cc (Target_powerpc::do_dynsym_value): Use Address rather
437 than unsigned int for find_global_entry result temp. Compare
438 against invalid_address.
439 (Target_powerpc::do_plt_address_for_global): Likewise.
440 (Target_powerpc::Relocate::relocate): Likewise. Don't assert
441 on plt call stub existence for debug info. Do assert for plt
442 and global entry stub existence if an alloc section.
443
6ec65f28
AM
4442015-04-28 Alan Modra <amodra@gmail.com>
445
446 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't assert
447 on missing global entry stub due to bogus debug info.
448
7a2a1c79
HS
4492015-04-27 Han Shen <shenhan@google.com>
450
451 * options.h (--fix-cortex-a53-843419): Rename option.
452 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Use renamed
453 option.
454 (AArch64_relobj::scan_sections_for_stubs): Use renamed option.
455
cfbf0e3c
RÁE
4562015-04-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
457
458 PR gold/18327
459 * output.cc (Output_section::is_input_address_mapped): Assume a missing
460 entry is mapped.
461 * testsuite/Makefile.am: Add the eh_test test.
462 * testsuite/Makefile.in: Regenerate.
463 * testsuite/eh_test_a.cc: New test.
464 * testsuite/eh_test_b.cc: New test.
465
6ec65f28
AM
4662015-04-23 Sriraman Tallam <tmsriram@google.com>
467
a100d66f
ST
468 * options.h (--weak-unresolved-symbols): New option.
469 * symtab.cc (Symbol_table::sized_write_globals): Change symbol
470 binding to weak with new option.
471 * symtab.h (is_weak_undefined): Check for new option.
472 (is_strong_undefined): Check for new option.
473 * testsuite/Makefile.am (weak_unresolved_symbols_test): New test.
474 * testsuite/Makefile.in: Regenerate.
475 * testsuite/weak_unresolved_symbols_test.cc: New file.
476
4b889c30
IC
4772015-04-20 Ian Coolidge <icoolidge@google.com>
478
479 * symtab.cc (Symbol::should_add_dynsym_entry): Return true for
480 GNU_UNIQUE.
481
4277535c
RÁE
4822015-04-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
483
484 * gc.cc (Garbage_collection::do_transitive_closure): Use back and
485 push_back.
486 * gc.h (Garbage_collection): Use a std::vector instead of a std::queue.
487 * object.cc (Sized_relobj_file::do_layout): Use push_back.
488 * powerpc.cc (process_gc_mark): Use push_back.
489 (Target_powerpc::do_gc_mark_symbol): Use push_back.
490 * symtab.cc (Symbol_table::gc_mark_symbol): Use push_back.
491
7a2a1c79 4922015-04-16 Han Shen <shenhan@google.com>
5019d64a 493
6ec65f28
AM
494 * aarch64.cc (AArch64_insn_utilities): New utility class.
495 (AArch64_relobj::Mapping_symbol_position): New struct.
496 (AArch64_relobj::Mapping_symbol_info): New typedef.
497 (AArch64_relobj::do_count_local_symbols): New function overriding
498 parent's implementation.
499 (AArch64_relobj::mapping_symbol_info_): New member
500 (AArch64_relobj::scan_erratum_843419): New method.
501 (Target_aarch64::scan_erratum_843419_span): New method.
502 (Target_aarch64::is_erratum_843419_sequence): New method.
503 * options.h (fix_cortex_a53): New option.
5019d64a 504
a6a17750
CC
5052015-04-09 Cary Coutant <ccoutant@google.com>
506
507 * symtab.cc (Symbol::final_value_is_known): Check for TLS symbol
508 in a PIE link.
509 * testsuite/Makefile.am (tls_pie_test.sh): New test.
510 * testsuite/Makefile.in: Regenerate.
511 * testsuite/tls_pie_test.sh: New.
512
437ddf0c
CC
5132015-04-09 Cary Coutant <ccoutant@google.com>
514
515 * debug.h (DEBUG_LOCATION): New.
516 (DEBUG_ALL): Include DEBUG_LOCATION.
517 (debug_string_to_enum): Add DEBUG_LOCATION.
518 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Fix debug
519 output to print correct context.
520 (Sized_dwarf_line_info::do_addr2line): Add debug output. Return
521 up to 4 more locations at the beginning of the function.
522 * symtab.cc (Symbol_table::detect_odr_violations): Get canonical
523 result before sorting list of line numbers.
524 * testsuite/debug_msg.sh: Allow range of line numbers for
525 canonical results on optimized code.
526
24491327
HS
5272015-04-07 HC Yen <hc.yen@mediatek.com>
528
529 Add AArch32 support for gold linker.
530 gold/
531 * arm.cc: Add V8 arch combine table.
532
7fa5525f
RÁE
5332015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
534
535 * aarch64.cc (do_reloc_addend): Fix signature to match the parent one.
536
5368dcf2
RÁE
5372015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
538
539 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a call
540 to find by using the return value of insert.
541
9dbb4b02
RÁE
5422015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
543
544 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a copy
545 constructor call.
546
1fa29f10
IT
5472015-04-06 Ilya Tocar <ilya.tocar@intel.com>
548
549 PR gold/17641
550 * x86_64.cc (Target_x86_64::can_convert_mov_to_lea): New.
551 (Target_x86_64::Scan::local): Don't create GOT entry, when we
552 can convert mov to lea.
553 (Target_x86_64::Scan::global): Ditto.
554 (Target_x86_64::Relocate::relocate): Convert mov foo@GOTPCREL(%rip),
555 %reg to lea foo(%rip), %reg if possible.
556 * testsuite/Makefile.am (x86_64_mov_to_lea): New test.
557 * testsuite/x86_64_mov_to_lea1.s: New.
558 * testsuite/x86_64_mov_to_lea2.s: Ditto.
559 * testsuite/x86_64_mov_to_lea3.s: Ditto.
560 * testsuite/x86_64_mov_to_lea4.s: Ditto.
561 * testsuite/x86_64_mov_to_lea.sh: Ditto.
562
39f3de7c
L
5632015-04-02 H.J. Lu <hongjiu.lu@intel.com>
564
565 * configure: Regenerated.
566
c4fc4724
IT
5672015-04-01 Ilya Tocar <ilya.tocar@intel.com>
568
569 PR gold/17640
570 * i386.cc (Target_i386::can_convert_mov_to_lea): New.
571 (Target_i386::Scan::local): Don't create GOT entry, when we
572 can convert GOT to GOTOFF.
573 (Target_i386::Scan::global): Ditto.
574 (Target_i386::Relocate::relocate): Convert mov foo@GOT(%reg), %reg to
575 lea foo@GOTOFF(%reg), %reg if possible.
576 * testsuite/Makefile.am (i386_mov_to_lea): New test.
577 * testsuite/i386_mov_to_lea1.s: New.
578 * testsuite/i386_mov_to_lea2.s: Ditto.
579 * testsuite/i386_mov_to_lea3.s: Ditto.
580 * testsuite/i386_mov_to_lea4.s: Ditto.
581 * testsuite/i386_mov_to_lea5.s: Ditto.
582 * testsuite/i386_mov_to_lea.sh: Ditto.
583
918357b9
L
5842015-04-01 H.J. Lu <hongjiu.lu@intel.com>
585
586 * Makefile.am (ZLIB): New.
587 (ZLIBINC): Likewise.
588 (AM_CFLAGS): Add $(ZLIBINC).
589 (AM_CXXFLAGS): Likewise.
590 (ldadd_varldadd_var): Add $(ZLIB).
591 (incremental_dump_LDADD): Likewise.
592 (dwp_LDADD): Likewise.
593 * compressed_output.cc: Don't check HAVE_ZLIB_H to include
594 <zlib.h>.
595 (zlib_compress): Don't check HAVE_ZLIB_H.
596 (zlib_decompress): Likewise.
597 * options.h (compress_debug_sections): Likewise.
598 * configure.ac (AM_CONDITIONAL): Removed.
599 * testsuite/Makefile.am (ZLIB): New.
600 (LDADD): Add $(ZLIB).
601 Don't check HAVE_ZLIB.
602 * Makefile.in: Regenerated.
603 * config.in: Likewise.
604 * configure: Likewise.
605 * testsuite/Makefile.in: Likewise.
606
6b0ad2eb
JY
6072015-03-30 Jing Yu <jingyu@google.com>
608
609 * aarch64-reloc.def: New TLSLD_ADD_DTPREL_HI12,
610 TLSLD_ADD_DTPREL_LO12_NC.
611 * aarch64.cc (Target_aarch64::define_tls_base_symbol): Always let
612 _TLS_MODULE_BASE_ point to the start of tls segment.
613 (Target_aarch64::optimize_tls_reloc): Add cases for
614 R_AARCH64_TLSLD_ADD_DTPREL_HI12 and
615 R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
616 (Target_aarch64::Scan::local): Likewise.
617 (Target_aarch64::Scan::global): Likewise.
618 (Target_aarch64::Relocate::relocate): Likewise.
619 (Target_aarch64::Relocate::relocate_tls): Likewise. And remove
620 subtracting tls segment size from symbol value for TLSLD_*_DTPREL
621 relocations.
622
0916f9e7
RÁE
6232015-03-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
624
625 * merge.cc (Object_merge_map::add_mapping): call
626 Object_merge_map::Input_merge_map::add_mapping.
627 (Object_merge_map::Input_merge_map::add_mapping): New.
628 (Output_merge_data::do_add_input_section): Call
629 get_or_make_input_merge_map before a loop.
630 (Output_merge_string<Char_type>::finalize_merged_data): Call
631 get_or_make_input_merge_map before a loop.
632 * merge.h (Object_merge_map): Make Input_merge_map public.
633 * object.cc (Relobj::add_merge_mapping): Use get_or_create_merge_map.
634 (Relobj::get_or_create_merge_map): New.
635 * object.h (Relobj::get_or_create_merge_map): New.
636
282c9750
AM
6372015-03-24 Alan Modra <amodra@gmail.com>
638
639 PR 18147
640 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't report
641 relocation errors for branches to strong undefined symbols.
642
67f95b96
RÁE
6432015-03-23 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
644
645 * merge.cc (Object_merge_map::get_input_merge_map): Make it const.
646 (Object_merge_map::is_merge_section_for): Remove.
647 (Object_merge_map::find_merge_section): New.
648 * merge.h (Object_merge_map::is_merge_section_for): Remove.
649 (Object_merge_map::find_merge_section): New.
650 (Object_merge_map::get_input_merge_map): Add a const version.
651 * object.cc (Relobj::is_merge_section_for): Remove.
652 (Relobj::find_merge_section): New.
653 * object.h (Relobj::is_merge_section_for): Remove.
654 (Relobj::find_merge_section): New.
655 * output.cc
656 (Output_section::Input_section::is_merge_section_for): Remove.
657 (Output_section::add_merge_input_section): Don't call
658 add_merge_input_section.
659 (Output_section::find_merge_section): Return const. Use
660 object->find_merge_section.
661 (Output_section::build_lookup_maps): Don't build a map for
662 merge sections.
663 (Output_section::is_input_address_mapped): Return false if
664 section is not found.
665 (Output_section::find_starting_output_address): Use
666 find_merge_section instead of is_merge_section_for.
667 (Output_section::add_script_input_section): Don't build a map for
668 merge sections.
669 * output.h (Output_section_lookup_maps::merge_sections_by_id_): Remove.
670 (Output_section_lookup_maps::find_merge_section): Remove.
671 (Output_section_lookup_maps::add_merge_input_section) Remove.
672 (Output_section::find_merge_section): Return const.
673
152f7024
CC
6742015-03-22 Cary Coutant <cary@google.com>
675
676 PR gold/18106
677 * i386.cc (Target_i386::Relocate::tls_gd_to_ie): Fix support for
678 non-SIB form of lea, with nop after the call.
679
bccffdfd
CC
6802015-03-21 Cary Coutant <cary@google.com>
681
682 PR gold/14217
683 * output.cc (Output_segment::is_first_section_relro): Don't ignore
684 .tdata section.
685 (Output_segment::set_section_addresses): Don't align size of relro
686 segment for .tbss.
687
1c582fe7
CC
6882015-03-21 Cary Coutant <cary@google.com>
689
690 PR gold/18010
691 * stringpool.cc (Stringpool_template): Don't optimize if section
692 alignment is greater than sizeof(char).
693
410da591
CC
6942015-03-21 Cary Coutant <cary@google.com>
695
696 PR gold/18048
697 * script-c.h (script_include_directive): Add first_token parameter.
698 * script.cc (script_include_directive): Add first_token parameter, and
699 pass it to read_script_file.
700 * yyscript.y (PARSING_SECTIONS_BLOCK, PARSING_SECTION_CMDS)
701 (PARSING_MEMORY_DEF): New tokens.
702 (top): Add new productions for INCLUDE files.
703 (file_cmd): Replace file_or_sections_cmd with copy of its productions.
704 Pass PARSING_LINKER_SCRIPT to script_include_directive.
705 (section_block_cmd): Likewise; pass PARSING_SECTIONS_BLOCK.
706 (section_cmd): Pass PARSING_SECTION_CMDS.
707 (file_or_sections_cmd): Remove.
708 (memory_def): Pass PARSING_MEMORY_DEF.
709 * testsuite/Makefile.am (memory_test_2): New test.
710 * testsuite/Makefile.in: Regenerate.
711 * testsuite/memory_test_inc.t: New script file.
712 * testsuite/memory_test_inc_1.t.src: New script file.
713 * testsuite/memory_test_inc_2.t.src: New script file.
714 * testsuite/memory_test_inc_3.t.src: New script file.
715
0d5bbdb0
CC
7162015-03-21 Cary Coutant <cary@google.com>
717
718 * dwp.cc (Sized_relobj_dwo::do_section_contents): Delete.
719 (Sized_relobj_dwo::setup): Build compressed section map.
720 (Sized_relobj_dwo::do_decompressed_section_contents): Delete.
721 * dynobj.cc (Sized_dynobj::base_read_symbols): Build compressed
722 section map.
723 * object.cc (Sized_relobj_file::Sized_relobj_file): Remove
724 compressed_sections_ field.
725 (build_compressed_section_map): Take Object instead of
726 Sized_relobj_file parameter; add decompress_if_needed parameter.
727 (Sized_relobj_file::do_find_special_sections): Store compressed
728 section map in parent Object.
729 (Sized_relobj_file::do_decompressed_section_contents): Move
730 implementation to Object::decompressed_section_contents.
731 (Sized_relobj_file::do_discard_decompressed_sections): Move
732 implementation to Object::discard_decompressed_sections.
733 * object.h (build_compressed_section_map): Declare.
734 (Object::Object): Add compressed_sections_ field.
735 (Object::section_is_compressed): Move implementation here.
736 (Object::decompressed_section_contents): De-virtualize.
737 (Object::discard_decompressed_sections): De-virtualize.
738 (Object::do_section_is_compressed): Delete.
739 (Object::do_decompressed_section_contents): Delete.
740 (Object::set_compressed_sections): New method.
741 (Object::compressed_sections): New method.
742 (Object::compressed_sections_): New data member.
743 (Compressed_section_info, Compressed_section_map): Move to top of file.
744 (Sized_relobj_file::do_section_is_compressed): Delete.
745 (Sized_relobj_file::do_decompressed_section_contents): Delete.
746 (Sized_relobj_file::do_discard_decompressed_sections): Delete.
747 (Sized_relobj_file::compressed_sections_): Move to Object class.
748
bd9e0d46
CC
7492015-03-21 Cary Coutant <ccoutant@google.com>
750
751 PR gold/18152
752 * gold.cc (queue_middle_tasks): Finalize .eh_frame after laying out
753 deferred objects.
754
943c8b43
CC
7552015-03-11 Cary Coutant <ccoutant@google.com>
756
757 * options.cc (General_options::finalize): Don't allow -z relro
758 with incremental linking.
759 * testsuite/Makefile.am (incremental_test): Add -z norelro.
760 (incremental_test_2): Likewise.
761 (incremental_test_3): Likewise.
762 (incremental_test_4): Likewise.
763 (incremental_test_5): Likewise.
764 (incremental_test_6): Likewise.
765 (incremental_copy_test): Likewise.
766 (incremental_common_test_1): Likewise.
767 (incremental_comdat_test_1): Likewise.
768 * testsuite/Makefile.in: Regenerate.
769
e1663197
CC
7702015-03-09 Cary Coutant <ccoutant@google.com>
771
772 PR gold/14675
773 * ehframe.cc (Eh_frame::add_ehframe_input_section): Change return type;
774 return enum indicating whether .eh_frame section is empty, optimizable,
775 unrecognized, or an end marker. Adjust explicit instantiations.
776 * ehframe.h (Eh_frame::Eh_frame_section_disposition): New enum type.
777 (Eh_frame::add_ehframe_input_section): Change return type.
778 * gold.cc (queue_middle_tasks): Call Layout::finalize_eh_frame_section.
779 * layout.cc (Layout::layout_eh_frame): Don't add optimized sections
780 to the .eh_frame output section until we see the end marker.
781 (Layout::finalize_eh_frame_section): New.
782 * layout.h: (Layout::finalize_eh_frame_section): New.
783
beb8418f
L
7842015-03-05 H.J. Lu <hongjiu.lu@intel.com>
785
786 * output.cc (Relobj::initialize_input_to_output_map<size>):
787 Remove typename on elfcpp::Elf_types<size>::Elf_Addr.
788
48c73428
CC
7892015-03-04 Cary Coutant <ccoutant@google.com>
790
791 * parameters.cc (Parameters::set_target_once): Call
792 Target::select_as_default_target just once from here...
793 (set_parameters_target): ...instead of from here.
794
7952015-03-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
dbe40a88
RÁE
796
797 * ehframe.cc (Cie::set_output_offset): Pass in and use a
798 Output_section_data instead of a Merge_map.
799 (Eh_frame::Eh_frame): Don't initialize merge_map_.
800 (Eh_frame::read_cie): Use add_merge_mapping instead of
801 Merge_map::add_mapping.
802 (Eh_frame::read_fde): Ditto.
803 (Eh_frame::set_final_data_size): Use this instead of this->merge_map_.
804 (Eh_frame::do_output_offset): Use merge_output_offset istead of
805 merge_map_->get_output_offset.
806 (Eh_frame::do_is_merge_section_for): Delete.
807 * ehframe.h (Fde::add_mapping): Pass in and use a Output_section_data
808 instead of a Merge_map.
809 (Cie::set_output_offset): Pass in a Output_section_data instead of a
810 Merge_map.
811 (Eh_frame::do_is_merge_section_for): Delete.
812 (Eh_frame::merge_map_): Delete.
813 * merge.cc (Object_merge_map::get_or_make_input_merge_map): Pass in
814 and use a Output_section_data instead of a Merge_map.
815 (Object_merge_map::add_mapping): Ditto.
816 (Object_merge_map::get_output_offset): Remove the merge_map argument.
817 (Object_merge_map::is_merge_section_for): Pass in and use a
818 Output_section_data instead of a Merge_map.
819 (Merge_map): Delete.
820 (Output_merge_base::do_output_offset): Use merge_output_offset instead
821 of merge_map_.get_output_offset.
822 (Output_merge_base::do_is_merge_section_for): Delete.
823 (Output_merge_data::do_add_input_section): Use
824 object->add_merge_mapping instead of add_mapping.
825 (Output_merge_string<Char_type>::finalize_merged_data): Ditto.
826 * merge.h (Merge_map): Delete forward declaration.
827 (Object_merge_map::add_mapping): Pass in and use a Output_section_data
828 instead of a Merge_map.
829 (Object_merge_map::get_output_offset): Remove the merge_map argument.
830 (Object_merge_map::is_merge_section_for): Pass in and use a
831 Output_section_data instead of a Merge_map.
832 (Input_merge_map::Object_merge_map::merge_map): Replace with
833 output_data.
834 (Object_merge_map::get_or_make_input_merge_map): Pass in and use a
835 Output_section_data instead of a Merge_map.
836 (Merge_map): Delete.
837 (Output_merge_base::Output_merge_base): Don't initialize merge_map_.
838 (Output_merge_base::do_is_merge_section_for): Delete.
839 (Output_merge_base::add_mapping): Delete.
840 (Output_merge_base::merge_map_): Delete.
841 * object.cc (Relobj::initialize_input_to_output_map): New.
842 (Relobj::initialize_input_to_output_map): New.
843 (Relobj::merge_output_offset): New.
844 (Relobj::is_merge_section_for): New.
845 (Relobj::initialize_input_to_output_map): Instantiate for 32 and 64
846 bits.
847 * object.h (Relobj::merge_map): Delete.
848 (initialize_input_to_output_map): New.
849 (set_merge_map): Delete.
850 (add_merge_mapping): New.
851 (merge_output_offset): New.
852 (is_merge_section_for): New.
853 * output.cc (Output_section::Input_section::is_merge_section_for):
854 Use object->is_merge_section_for.
855 * output.h (Output_section_data::is_merge_section_for): Delete.
856 (Output_section_data::do_is_merge_section_for): Delete.
857 * reloc.cc (Merged_symbol_value<size>::initialize_input_to_output_map):
858 Use object->initialize_input_to_output_map.
859 (Merged_symbol_value<size>::value_from_output_section): Use
860 object->merge_output_offset.
861
48c73428 8622015-03-02 Peter Collingbourne <pcc@google.com>
2c7b626c
CC
863 Cary Coutant <ccoutant@google.com>
864
865 * output.cc (Output_section::add_merge_input_section): Do not
866 attempt to merge sections with an entsize of 0.
867
48c73428 8682015-03-02 Khem Raj <raj.khem@gmail.com>
5b07cd84
CC
869
870 * attributes.h (class Output_attributes_section_data ): Add
871 do_print_to_mapfile function.
872
ec86f434
AM
8732015-02-24 Alan Modra <amodra@gmail.com>
874
875 PR 18010
876 * powerpc.cc (Powerpc_relocate_functions::addr16_ds): Always
877 complain if value is not a multiple of four.
878 (Target_powerpc::Relocate::relocate): Correct handling of
879 R_POWERPC_GOT_TPREL16 and R_POWERPC_GOT_TPREL16_LO for ppc64.
880
be66981e
L
8812015-02-21 H.J. Lu <hongjiu.lu@intel.com>
882
883 * configure.ac (default_size): Set to 32 for x32.
884 * configure: Regenerated.
885
e3ee8ed4
AM
8862015-02-18 Alan Modra <amodra@gmail.com>
887
888 PR 17954
889 * powerpc.cc (Global_symbol_visitor_opd::operator()): Set default
890 visibility.
891
3a935c6c
RÁE
8922015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
893
894 * gc.h (Garbage_collection::add_reference): Don't use find.
895
e0a1e121
RÁE
8962015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
897
898 * object.cc (write_local_symbols): avoid std::vector copy.
899
45a4fb1a
RÁE
9002015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
901
902 * merge.cc (get_output_offset): Use upper_bound instead of lower_bound.
903
2d9afefe
MW
9042015-02-09 Mark Wielaard <mjw@redhat.com>
905
906 * gdb-index.cc (Gdb_index_info_reader::visit_top_die): Recognize
907 DW_LANG_Fortran03 and DW_LANG_Fortran08.
908
e9c1bdad
CC
9092015-02-16 Cary Coutant <ccoutant@google.com>
910
911 PR gold/13577
912 PR gold/16992
913 * layout.cc (Layout::finish_dynamic_section): Don't set DT_SYMBOLIC or
914 DF_SYMBOLIC if --dynamic-list option is used.
915 * options.cc (General_options::finalize): --dynamic-list is not
916 mutually exclusive with -Bsymbolic.
917 * symtab.h (Symbol::is_preemptible): Don't exclude dynamic symbols not
918 listed in --dynamic-list.
919 * testsuite/Makefile.am (dynamic_list_lib2.so): Add
920 -Bsymbolic-functions.
921 * testsuite/Makefile.in: Regenerate.
922
0ed4b0bf
CC
9232015-02-16 Cary Coutant <ccoutant@google.com>
924
925 PR gold/17971
926 * incremental.cc: Remove redundant include of "output.h".
927
1a920511
JY
9282015-02-12 Jing Yu <jingyu@google.com>
929
930 * aarch64-reloc.def (TLSLE_MOVW_TPREL_G2, TLSLE_MOVW_TPREL_G1,
931 TLSLE_MOVW_TPREL_G1_NC, TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC,):
932 New relocation.
933 * aarch64.cc (Target_aarch64::Scan::local): Add cases for new
934 TLSLE_MOVW_* relocations.
935 (Target_aarch64::Scan::global): Likewise.
936 (Target_aarch64::Relocate::relocate): Likewise.
937 (Target_aarch64::Relocate::relocate_tls): Add cases and handlings
938 for new TLSLE_MOVW_* relocations.
939
07f107f3
WN
9402015-02-11 Will Newton <will.newton@linaro.org>
941
942 PR gold/13321
943 * arm.cc (Target_arm::make_plt_section): Create an ARM
944 state mapping symbol at the start of the PLT.
945
e051a5b5
L
9462015-02-09 H.J. Lu <hongjiu.lu@intel.com>
947
948 * testsuite/Makefile.am (two_file_shared_2_pic_1_test_DEPENDENCIES):
949 Replace two_file_shared_2.so with two_file_shared_1.so.
950 * testsuite/Makefile.in: Regenerated.
951
dddcc5b9
AM
9522015-02-09 Alan Modra <amodra@gmail.com>
953
954 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add libweak_undef_2.a,
955 plugin_test_thin.a and defsym_test.
956 * testsuite/Makefile.in: Regenerate.
957
b39b8b9d
RÁE
9582015-02-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
959
960 * merge.cc (do_add_input_section): Combine loop epilogue into main loop
961 body.
962
b66d1c52
CC
9632015-02-04 Peter Collingbourne <pcc@google.com>
964
965 * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve
966 forwarding symbols when computing symbol resolution info for plugins.
967 * plugin.h (Plugin_manager::symtab): New method.
968 (Pluginobj::get_symbol_resolution_info): Add symtab parameter.
969
23081de0
CC
9702015-02-03 Cary Coutant <ccoutant@google.com>
971 Peter Collingbourne <pcc@google.com>
972
973 PR gold/15660
974 * archive.cc (Thin_archive_object_unlocker): New class.
975 (Archive::include_member): Unlock external members of thin archives.
976 * testsuite/Makefile.am (plugin_test_1): Rename .syms files.
977 (plugin_test_2): Likewise.
978 (plugin_test_3): Likewise.
979 (plugin_test_4): Likewise.
980 (plugin_test_5): Likewise.
981 (plugin_test_6): Likewise.
982 (plugin_test_7): Likewise.
983 (plugin_test_8): Likewise.
984 (plugin_test_9): Likewise.
985 (plugin_test_10): Likewise.
986 (plugin_test_11): New test case.
987 * testsuite/Makefile.in: Regenerate.
988 * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms
989 file to decide whether to claim file.
990 (all_symbols_read_hook): Likewise.
991 * testsuite/plugin_test_1.sh: Adjust expected output.
992 * testsuite/plugin_test_2.sh: Likewise.
993 * testsuite/plugin_test_3.sh: Likewise.
994 * testsuite/plugin_test_6.sh: Likewise.
995 * testsuite/plugin_test_tls.sh: Likewise.
996 * testsuite/plugin_test_11.sh: New testcase.
997
9982015-02-03 Cary Coutant <ccoutant@google.com>
999
1000 * descriptors.cc (Descriptors::open): Set artificially-low limit for
1001 file descriptors when debugging enabled. Add debug output.
1002 (Descriptors::release): Add debug output.
1003 (Descriptors::close_some_descriptor): Likewise.
1004 (Descriptors::close_all): Likewise.
1005 * fileread.cc (File_read::lock): Likewise.
1006 (File_read::unlock): Likewise.
1007
24dd5808
CC
10082015-02-02 Cary Coutant <ccoutant@google.com>
1009
1010 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
1011 executable output file.
1012
fa89cc82
HS
10132015-01-22 Han Shen <shenhan@google.com>
1014
1015 * arm.cc (Target_arm::Target_arm): Add initialization for new members.
1016 (Target_arm::do_plt_address_for_global): New method.
1017 (Target_arm::do_plt_address_for_local): New method.
1018 (Target_arm::rel_irelative_section): New method.
1019 (Target_arm::make_data_plt): Add more parameters for plt ctor.
1020 (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
1021 (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
1022 (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
1023 (Target_arm::Scan::check_non_pic): Add ifunc support.
1024 (Target_arm::Scan::local): Add ifunc support.
1025 (Target_arm::Scan::global): Add ifunc support.
1026 (Target_arm::make_plt_section): New method.
1027 (Target_arm::make_plt_entry): Change to call to make_plt_section.
1028 (Target_arm::make_local_ifunc_plt_entry): New method.
1029 (Target_arm::got_irelative_): New member.
1030 (Target_arm::rel_irelative_): New member.
1031 (Target_arm::got_section): Add creation for got_irelative_.
1032 (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
1033 (Target_arm::Relocate::relocate): Properly set local ifunc address.
1034 (Target_arm::do_dynsym_value): Properly set global ifunc address.
1035 (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
1036 (Output_data_plt_arm::IRelative_data): New type.
1037 (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
1038 (Output_data_plt_arm::add_entry): Add more parameters.
1039 (Output_data_plt_arm::add_relocation): New method.
1040 (Output_data_plt_arm::add_local_ifunc_entry): New method.
1041 (Output_data_plt_arm::rel_irelative): New method.
1042 (Output_data_plt_arm::entry_count): Modified.
1043 (Output_data_plt_arm::address_for_global): New method.
1044 (Output_data_plt_arm::address_for_local): New method.
23081de0 1045gold/
fa89cc82
HS
1046 (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
1047 (Output_data_plt_arm::insert_irelative_data): New method.
1048 (Output_data_plt_arm::irelative_rel_): New member.
1049 (Output_data_plt_arm::got_): New member.
1050 (Output_data_plt_arm::got_irelative_): New member.
1051 (Output_data_plt_arm::irelative_count_): New member.
1052 (Output_data_plt_arm::IRelative_data_vec): New typedef.
1053 (Output_data_plt_arm::irelative_data_vec_): New member.
1054 (Output_data_plt_arm::do_write): Write out irelative entries.
1055 (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
1056 more parameters to ctor.
1057 (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
1058 more parameters to ctor.
1059 * output.h (Output_data_reloc::add_local_relative): New method.
1060 * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
1061
0f81d3f0
AM
10622015-01-29 Alan Modra <amodra@gmail.com>
1063
1064 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
1065 and GOT_TLSGD to LE optimization.
1066
65d92137
CC
10672015-01-28 Cary Coutant <ccoutant@google.com>
1068
1069 * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
1070 for undef TLS symbols.
1071 (Target_x86_64::Relocate::relocate_tls): Likewise.
1072 (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
1073
5485698a
CC
10742015-01-25 Cary Coutant <ccoutant@google.com>
1075
1076 * output.cc (Output_segment::set_section_addresses): Fix calculation
1077 of size of relro segment.
1078
b01a4b04
AM
10792015-01-22 Alan Modra <amodra@gmail.com>
1080
1081 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
1082 condition for need of ifunc plt entry.
1083 (Target_powerpc::Scan::global <got relocs>): Likewise.
1084
3d0064a9
CC
10852015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1086
1087 * mips.cc (reloc_high): Add r_sym.
1088 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
1089 reloc_high constructor.
1090 (Mips_relocate_functions::relgot16_local): Likewise.
1091 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
1092 r_type to decide whether LO16 matches HI16.
1093 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
1094 rello16 and relgot16_local.
1095
a5cd8f05
CC
10962015-01-09 Cary Coutant <ccoutant@google.com>
1097
1098 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
1099 unless alignment is larger than page size.
1100
4fc1b9d4
L
11012015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1102 Cary Coutant <ccoutant@google.com>
1103
1104 PR gold/17729
1105 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
1106 (DEFAULT_TARGET_X32): Set for x32.
1107 * x86_64.cc (cmp_insn_32): New.
1108 (lea_r10_insn_32): Likewise.
1109 (lea_r11_insn_32): Likewise.
1110 (cmp_insn_64): Likewise.
1111 (lea_r10_insn_64): Likewise.
1112 (lea_r11_insn_64): Likewise.
1113 (Target_x86_64<size>::do_calls_non_split): Handle x32.
1114 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
1115 (check_DATA): Add split_x32 files.
1116 (split_x32_[1234n].o): New targets.
1117 (split_x32_[124]): New targets.
1118 (split_x32_[1234r].stdout): New targets.
1119 * testsuite/split_x32.sh: New file.
1120 * testsuite/split_x32_1.s: Likewise.
1121 * testsuite/split_x32_2.s: Likewise.
1122 * testsuite/split_x32_3.s: Likewise.
1123 * testsuite/split_x32_4.s: Likewise.
1124 * testsuite/split_x32_n.s: Likewise.
1125 * configure: Regenerated.
1126 * testsuite/Makefile.in: Likewise.
1127
e749cab8
L
11282015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1129
1130 PR gold/17809
1131 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
1132 x32.
1133
af759df0
AM
11342015-01-02 Alan Modra <amodra@gmail.com>
1135
1136 * version.cc (print_version): Just print current year.
1137 * dwp.cc (print_version): Likewise.
1138
b90efa5b
AM
11392015-01-01 Alan Modra <amodra@gmail.com>
1140
1141 Update year range in copyright notice of all files.
1142
f12d1e8a
AM
11432014-12-25 Alan Modra <amodra@gmail.com>
1144
1145 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
1146 new enums.
1147 (Target_arm::merge_object_attributes, ): Likewise.
1148
5c294fee
TG
11492014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
1150
1151 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
1152 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
1153 AEABI_VFP_args_vfp to check that.
1154 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
1155 value and replace hardcoded values by enum values.
1156
e30880c2
CC
11572014-12-22 Cary Coutant <ccoutant@google.com>
1158
1159 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
1160
bd040da1
L
11612014-12-20 H.J. Lu <hongjiu.lu@intel.com>
1162
1163 PR gold/14608
1164 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
1165 to "return i * i * 3;".
1166
e02a4046
CC
11672014-12-16 Cary Coutant <ccoutant@google.com>
1168
1169 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
1170 (Mapfile::print_output_data): Use current_data_size() to avoid
1171 assert for sections requiring postprocessing; if address is not valid,
1172 print 0.
1173 (Mapfile::print_output_section): Use current_data_size(); print note
1174 that addresses and sizes are before compression.
1175
add6016b
L
11762014-12-14 H.J. Lu <hongjiu.lu@intel.com>
1177
1178 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1179 Cast current_group_size to unsigned long when reporting error.
1180
0bf32ea9
JY
11812014-12-10 Jing Yu <jingyu@google.com>
1182
1183 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
1184 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
1185 Update error message.
1186 (Target_aarch64::do_relax): Use absolute value of option
1187 stub_group_size. Replace local variable with class member
1188 stub_group_size_.
1189
cbcb23fa
AM
11902014-12-04 Alan Modra <amodra@gmail.com>
1191
1192 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
1193 addend of PLTREL24 reloc when not generating a plt stub. Make
1194 max_branch_offset an "Address".
fbad6518 1195 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
cbcb23fa
AM
1196 (Target_powerpc::Relocate::relocate): Likewise.
1197
1611bc4a
AM
11982014-12-04 Alan Modra <amodra@gmail.com>
1199
1200 PR 17670
1201 * symtab.cc (Symbol::set_undefined): Remove assertion.
1202 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1203 on symbols defined in discarded sections, instead return false.
1204 Rearrange params, update all callers.
1205 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
1206 branches to syms in discarded sections.
1207 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
1208 undefined and flag as discarded.
1209 (Target_powerpc::Relocate::relocate): Localize variable.
1210
4759c34e
L
12112014-12-03 H.J. Lu <hongjiu.lu@intel.com>
1212
1213 PR gold/17675
1214 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
1215 * testsuite/Makefile.in: Regenerated.
1216
1f98a074
AM
12172014-12-03 Alan Modra <amodra@gmail.com>
1218
1219 PR 17566
1220 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
1221 when adding dynamic relocations against section symbols.
1222
fb257835
DI
12232014-12-01 Dimitry Ivanov <dimitry@google.com>
1224
1225 * layout.cc (Layout::finish_dynamic_section): When '-z global'
1226 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
1227 * options.h (General_options): New -z option (global).
1228
d8e60314
CC
12292014-12-01 Cary Coutant <ccoutant@google.com>
1230
1231 PR gold/17578
1232 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
1233 is given.
1234 (Layout::create_executable_stack_info): Warn when -z noexecstack is
1235 given but some inputs require executable stack.
1236
982bbd97
CC
12372014-11-26 Cary Coutant <ccoutant@google.com>
1238
1239 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
1240 .debug_str_offsets; strip .debug_gnu_pubnames and
1241 .debug_gnu_pubtypes.
1242 (lines_only_debug_sections): Strip all four new sections.
1243
bb779192
HS
12442014-11-26 Jing Yu <jingyu@google.com>
1245
1246 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
1247 register to be x0 when to relax TLSDESC_LD64_LO12.
1248
a3e60ddb
AM
12492014-11-26 Alan Modra <amodra@gmail.com>
1250
1251 * powerpc.cc (struct Stub_table_owner): New.
1252 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
1253 unsigned int vector. Update all references.
1254 (powerpc_relobj::set_stub_table): Take an unsigned int param
1255 rather than a Stub_table. Update callers.
1256 (Powerpc_relobj::clear_stub_table): New function.
1257 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
1258 stub_group_size_ vars.
1259 (Target_powerpc::new_stub_table): Delete.
1260 (max_branch_delta): New function, extracted from..
1261 (Target_powerpc::Relocate::relocate): ..here..
1262 (Target_powerpc::Branch_info::make_stub): ..and here. Return
1263 status on whether stub created successfully.
1264 (Stub_control::Stub_control): Add "no_size_errors" param. Move
1265 default sizing to..
1266 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
1267 reduce on relax failure.
1268 (Target_powerpc::group_sections): Add "no_size_errors" param.
1269 Use stub_group_size_. Set up group info in a temp vector,
1270 before building Stub_table vector. Account for input sections
1271 possibly already converted to relaxed sections.
1272 (Stub_table::init): Delete. Merge into..
1273 (Stub_table::Stub_table): ..here.
1274 (Stub_table::can_reach_stub): New function.
1275 (Stub_table::add_plt_call_entry): Add "from" parameter and
1276 return true iff stub could be reached.
1277 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
1278 param too.
1279 (Stub_table::clear_stubs): Add "all" param.
1280
a20605cf
AM
12812014-11-26 Alan Modra <amodra@gmail.com>
1282
1283 * powerpc.cc (Stub_control::set_output_and_owner): New function.
1284 (Target_powerpc::group_sections): Use it.
1285
43b64deb
CC
12862014-11-25 Cary Coutant <ccoutant@google.com>
1287
1288 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
1289 (Binary_to_elf::write_symbol): Add st_size parameter.
1290 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
1291
c924eb67
CC
12922014-11-25 Cary Coutant <ccoutant@google.com>
1293
1294 PR gold/17639
1295 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
1296 (Sized_relobj_file::do_layout): Handle deferred sections properly
1297 during GC pass 1. Don't add reloc sections to deferred list twice.
1298 * object.h (Sized_relobj_file::is_deferred_layout): New function.
1299 (Sized_relobj_file::is_deferred_layout_): New data member.
1300
9d585188
L
13012014-11-21 H.J. Lu <hongjiu.lu@intel.com>
1302
1303 PR gold/17619
1304 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
1305 Check PC-relative offset overflow in PLT entry.
1306
3ffaac20
AM
13072014-11-21 Alan Modra <amodra@gmail.com>
1308
1309 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
1310 for undefined weaks.
1311
0cfb0717
AM
13122014-11-20 Alan Modra <amodra@gmail.com>
1313
1314 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
1315 from --stub-group-size parameter divided by 1024.
1316 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
1317 template parameter. Update all uses.
1318 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
1319 has_stub_value. Set for long branches. Don't report overflow for
1320 branch to undefined weak symbols. Print info message on
1321 overflowing branch to stub.
1322
f9dffbf0
AM
13232014-11-20 Alan Modra <amodra@gmail.com>
1324
1325 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
1326
e88ba8d5
L
13272014-11-13 H.J. Lu <hongjiu.lu@intel.com>
1328
1329 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
1330 entry for R_X86_64_GOTPLT64.
1331 (Target_x86_64<size>::Relocate::relocate): Update comments for
1332 R_X86_64_GOTPLT64.
1333
d37ffe25
ED
13342014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
1335
1336 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
1337 * plugin.h: add lock definition
1338
9726c3c1
HS
13392014-10-29 Han Shen <shenhan@google.com>
1340 Jing Yu <jingyu@google.com>
1341
1342 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
1343 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1344 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
1345 Symbol::TLS_REF.
1346 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
1347 method.
1348 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
1349 (Target_aarch64::tls_ld_to_le): New method.
1350 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
1351 for 64bit targets.
1352 (Output_data_plt_aarch64::irelative_rel_): New data member.
1353 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
1354 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
1355 (Output_data_plt_aarch64::add_relocation): New method.
1356 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
1357 offset. Add got_irelative size to got size.
1358 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
1359 type string with the new typename.
1360 (AArch64_relocate_functions::update_adr): Replace parameter x with
1361 immed.
1362 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
1363 (AArch64_relocate_functions::reloc_common): New method.
1364 (AArch64_relocate_funcsions::rela_general): Extract common part out
1365 into reloc_common method.
1366 (AArch64_relocate_functions::rela_general): Likewise.
1367 (AArch64_relocate_functions::pcrela_general): Likewise.
1368 (AArch64_relocate_functions::adr): New method.
1369 (AArch64_relocate_functions::adrp): Calculate immed before calling
1370 update_adr.
1371 (AArch64_relocate_functions::adrp): Likewise.
1372 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
1373 comparing x to 0. Calculate immed from ~x when x < 0.
1374 (Target_aarch64::optimize_tls_reloc): Add new cases for
1375 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1376 TLSLD_MOVW_DTPREL_G0_NC.
1377 (Target_aarch64::possible_function_pointer_reloc): Implement this
1378 method.
1379 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
1380 comment.
1381 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
1382 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1383 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1384 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
1385 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1386 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1387 (Target_aarch64::make_plt_entry): Call add_entry with two more
1388 parameters.
1389 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1390 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
1391 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1392 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1393 (Target_aarch64::Relocate::relocate_tls): Add cases for
1394 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1395 TLSLD_MOVW_DTPREL_G0_NC.
1396 * testsuite/icf_safe_so_test.cc: Correct test comment.
1397 * testsuite/icf_safe_test.sh: Add AArch64 arch.
1398
80272b8c
AM
13992014-10-22 Alan Modra <amodra@gmail.com>
1400
1401 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
1402 thread_starter.
1403
998a69f4
AS
14042014-10-18 Andreas Schwab <schwab@linux-m68k.org>
1405
1406 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
1407
aed56ec5
CC
14082014-10-17 Cary Coutant <ccoutant@google.com>
1409
1410 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1411 Add "typename" keyword.
1412
bb779192 14132014-10-15 Han Shen <shenhan@google.com>
83a01957
HS
1414 Jing Yu <jingyu@google.com>
1415
1416 Patch for gold aarch64 backend to support relaxation.
1417 * aarch64-reloc.def: Change format.
1418 * aarch64.cc (class Reloc_stub): New class.
1419 (class Stub_table): New class.
1420 (class AArch64_relobj): New class.
1421 (class AArch64_input_section): New class.
1422 (class AArch64_output_section): New class.
1423 (Target_aarch64::new_stub_table): New method.
1424 (Target_aarch64::new_aarch64_input_section): New method.
1425 (Target_aarch64::find_aarch64_input_section): New method.
1426 (Target_aarch64::scan_section_for_stubs): New method.
1427 (Target_aarch64::scan_reloc_section_for_stubs): New method.
1428 (Target_aarch64::relocate_stub): New method.
1429 (Target_aarch64::current_target): New method.
1430 (Target_aarch64::do_make_elf_object): New method.
1431 (Target_aarch64::do_may_relax): New method.
1432 (Target_aarch64::do_relax): New method.
1433 (Target_aarch64::group_sections): New method.
1434 (Target_aarch64::scan_reloc_for_stub): New method.
1435 (Target_aarch64::do_make_output_section): New method.
1436 (Target_aarch64::stub_tables_): New data member.
1437 (Target_aarch64::aarch64_input_section_map_): New data member.
1438 (AArch64_relocate_functions::maybe_apply_stub): New method.
1439
db4c9594
CC
14402014-09-30 Cary Coutant <ccoutant@google.com>
1441
1442 PR gold/17432
1443 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
1444
cd6da036
KC
14452014-09-30 Kito Cheng <kito@0xlab.org>
1446
1447 PR gold/13597
1448 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
1449 hash table before sysv-style hash table.
1450
5f772412
ST
14512014-09-29 Sriraman Tallam <tmsriram@google.com>
1452
1453 * options.h (--pic-executable): Add negative to alias to -no-pie.
1454
5efeedf6
CC
14552014-09-26 Cary Coutant <ccoutant@google.com>
1456
1457 PR gold/16773
1458 * object.cc (Sized_relobj_file): Compute value of section symbols
1459 for TLS sections the same as TLS symbols.
1460
1707f183
CC
14612014-09-25 Cary Coutant <ccoutant@google.com>
1462
1463 PR gold/17432
1464 * resolve.cc (Symbol_table::resolve): Override common placeholder
1465 symbols, but adjust sizes.
1466 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
1467 symbols to common lists.
1468
00cac886
AM
14692014-09-24 Alan Modra <amodra@gmail.com>
1470
1471 * po/POTFILES.in: Regenerate.
1472
635aa30e
CC
14732014-09-23 Taiju Tsuiki <tzik@google.com>
1474 Cary Coutant <ccoutant@google.com>
1475
71b9b91b 1476 PR gold/14860
635aa30e
CC
1477 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
1478 on input_sections_blocker.
1479 * layout.cc (Write_sections_task::locks): Unblock
1480 input_sections_blocker_.
1481 * layout.h (Write_sections_task::Write_sections_task): Add
1482 input_sections_blocker.
1483 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
1484 to DEPENDENCIES.
1485 * testsuite/Makefile.in: Regenerate.
1486
c0c71592
RÁE
14872014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1488
1489 * testsuite/Makefile.am (plugin_test_10): New test.
1490 * testsuite/Makefile.in: Regenerate
1491 * testsuite/plugin_common_test_2.c (c1): Align to 8.
1492 * testsuite/plugin_test_10.sh: New file.
1493
6168c2a1
RÁE
14942014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1495
1496 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
1497 * resolve.cc (Symbol_table::resolve): Don't override common symbols
1498 during the replacement phase.
1499
3a531937
JY
15002014-09-17 Han Shen <shenhan@google.com>
1501 Jing Yu <jingyu@google.com>
1502
1503 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
1504 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
1505 * aarch64.cc (Target_aarch64): Add data members
1506 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
1507 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
1508 constructor.
1509 (Target_aarch64::do_reloc_symbol_index): New method.
1510 (Target_aarch64::do_reloc_addend): New method.
1511 (Target_aarch64::add_tlsdesc_info): New method.
1512 (Target_aarch64::do_dynsym_value): New method.
1513 (Target_aarch64::do_make_data_plt): Add new parameters: got,
1514 got_irelative. Pass them to Output_data_plt_aarch64_standard.
1515 (Target_aarch64::make_data_plt): Add new parameters: got,
1516 got_irelative. Pass them to do_make_data_plt.
1517 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
1518 (Target_aarch64::Relocate:tls_gd_to_le): New method.
1519 (Target_aarch64::Relocate:tls_ie_to_le): New method.
1520 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
1521 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
1522 (Target_aarch64::got_tlsdesc_section): New method.
1523 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1524 (Target_aarch64::define_tls_base_symbol): New method.
1525 (Target_aarch64::reserve_tlsdesc_entries): New method.
1526 (Target_aarch64::got_mod_index_entry): New method.
1527 (Target_aarch64::rela_tlsdesc_section): New method.
1528 (Target_aarch64::rela_irelative_section): New method.
1529 (Target_aarch64::Tlsdesc_info): New struct.
1530 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
1531 relocations and tlsdesc relocations.
1532 (Target_aarch64::optimize_tls_reloc): Implement method.
1533 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
1534 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
1535 in constructor.
1536 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
1537 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
1538 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
1539 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
1540 (Output_data_plt_aarch64::rela_tlsdesc): New method.
1541 (Output_data_plt_aarch64::rela_irelative): New method.
1542 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
1543 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
1544 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
1545 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
1546 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
1547 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
1548 (Output_data_plt_aarch64_standard): New member variables:
1549 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
1550 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
1551 New parameter: got, got_irelative.
1552 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
1553 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
1554 (Output_data_plt_aarch64::do_write): Replace got_address with
1555 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
1556 (AArch64_relocate_functions::update_movnz): New method.
1557 (AArch64_relocate_functions): Correct format.
1558 (AArch64_relocate_functions::movnz): New method.
1559 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
1560 before the switch. Add new cases to switch.
00cac886 1561 Check ie_to_le relaxation on tlsie relocations. Add code handling
3a531937
JY
1562 tlsgd tlsdesc cases.
1563 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
1564 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
1565 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
1566 Call reloc_name_in_error_message to print unsupported reloc.
1567 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
1568 make_data_plt.
1569 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
1570 relocs. Fill in some more dynamic tags.
1571 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
1572 Skip call tls_get_addr when tlsgd is relaxed.
1573 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
1574 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
1575 tlsdesc->ie relaxation.
1576
62661c93
SS
15772014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1578
1579 * mips.cc (Target_mips_nacl): New class.
1580 (Target_selector_mips_nacl): New class.
1581 (target_selector_mips32): Rename from target_selector_mips32be and use
1582 Target_selector_mips_nacl instead of Target_selector_mips.
1583 (target_selector_mips32el): Rename from target_selector_mips32 and use
1584 Target_selector_mips_nacl instead of Target_selector_mips.
1585 (target_selector_mips64): Rename from target_selector_mips64be and use
1586 Target_selector_mips_nacl instead of Target_selector_mips.
1587 (target_selector_mips64el): Rename from target_selector_mips64 and use
1588 Target_selector_mips_nacl instead of Target_selector_mips.
1589 (Target_mips::mips_info): Add const attribute.
1590
54674d38
CC
15912014-09-02 Cary Coutant <ccoutant@google.com>
1592
1593 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
1594 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
1595 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
1596 (Sized_incr_dynobj::do_section_name): Likewise.
1597 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
1598 (Sized_incr_dynobj::do_section_name): Likewise.
1599 * object.h (Object::section_name): Likewise.
1600 (Object::do_section_name): Likewise.
1601 (Sized_relobj_file::do_section_name): Likewise.
1602 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
1603 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
1604
9860cbcf
CC
16052014-09-02 Cary Coutant <ccoutant@google.com>
1606
1607 PR gold/17005
1608 * ehframe.cc (Fde::write): Add output_offset parameter.
1609 (Cie::write): Likewise.
1610 (Eh_frame::set_final_data_size): Account for offset within output
1611 section.
1612 (Eh_frame::do_sized_write): Likewise.
1613 * ehframe.h (Fde::write): Add output_offset parameter.
1614 (Cie::write): Likewise.
1615 * output.cc (Output_section::Input_section_sort_entry): Remove
1616 section_has_name_; add output_section_name parameter. Use
1617 output section name for non-input sections.
1618 (Output_section::Input_section_sort_entry::section_has_name): Remove.
1619 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
1620 (Output_section::Input_section_sort_compare): Remove logic for
1621 sections without names.
1622 (Output_section::Input_section_sort_init_fini_compare): Likewise.
1623 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
1624 Likewise.
1625 (Output_section::Input_section_sort_section_name_compare): Likewise.
1626
8e33481e
HS
16272014-08-29 Han Shen <shenhan@google.com>
1628 Jing Yu <jingyu@google.com>
1629
1630 * aarch64-reloc-property.cc
1631 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
1632 reference reloc property in the table.
1633 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
1634 3 other entries.
1635 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
1636 2 new overloaded methods.
1637 (Output_data_got_aarch64::do_write): Add code to write out
1638 static relocs.
1639 (class Output_data_got_aarch64::Static_reloc): New class to wrap
1640 static relocs.
1641 (Output_data_got_aarch64::static_relocs): New vector to
1642 hold static relocs.
1643 (Target_aarch64::TCB_SIZE): New const static memeber.
1644 (Target_aarch64::tcb_size): New method.
1645 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
1646 (Target_aarch64::Relocate::relocate_tls): New method.
1647 (Target_aarch64::Scan::local): Add code handling new reloc types.
1648 (Target_aarch64::Scan::global): Add code handling new reloc types.
1649
81233653
ST
16502014-08-13 Sriraman Tallam <tmsriram@google.com>
1651
1652 * options.h (-no-pie): Add option.
1653
9363c7c3
JY
16542014-08-08 Jing Yu <jingyu@google.com>
1655 Han Shen <shenhan@google.com>
1656
1657 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
1658 (DEFFILES): add aarch64-reloc.def.
1659 (TARGETSOURCES): Add aarch64-reloc-property.cc.
1660 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
1661 * Makefile.in: Regenerate.
1662 * aarch64-reloc-property.cc: New file.
1663 * aarch64-reloc-property.h: New file.
1664 * aarch64-reloc.def: New file.
1665 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
1666 with tab to make the format consistent.
1667 (Output_data_got_aarch64::symbol_table_): New method.
1668 (Target_aarch64::do_plt_address_for_global): New method.
1669 (Target_aarch64::do_plt_address_for_local): New method.
1670 (Target_aarch64::do_select_as_default_target): New method.
1671 (Target_aarch64::do_make_data_plt): New method.
1672 (Target_aarch64::make_data_plt): New method.
1673 (Output_data_plt_aarch64::has_irelative_section): New method.
1674 (Output_data_plt_aarch64::address_for_global): New method.
1675 (Output_data_plt_aarch64::address_for_local): New method.
1676 (Output_data_plt_aarch64::irelative_rel_): New parameter.
1677 (Output_data_plt_aarch64::add_entry): Implement contents.
1678 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
1679 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
1680 the got_pov entry to plt0.
1681 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
1682 Implement contents.
1683 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
1684 (AArch64_howto): New struct.
1685 (aarch64_howto[]): New static const array.
1686 (AArch64_relocate_functions): New class.
1687 (Target_aarch64::Scan::get_reference_flags): Remove method.
1688 (Target_aarch64::Scan::local): Implement to support a few relocations.
1689 (Target_aarch64::Scan::global): Implement to support a few relocations.
1690 (Target_aarch64::make_plt_section): Implement contents.
1691 (Target_aarch64::make_plt_entry): Implement contents.
1692 (Target_aarch64::do_finalize_sections): Implement contents.
1693 (Target_aarch64::Relocate::relocate): Implement a few relocations.
1694 (Target_aarch64::relocate_section): Implement contents.
1695
ad9fe6c1
AM
16962014-08-06 Alan Modra <amodra@gmail.com>
1697
1698 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
1699
7cd4e5b7
AM
17002014-08-06 Alan Modra <amodra@gmail.com>
1701
1702 PR 13227
1703 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
1704
5ad9b0a7
ST
17052014-07-21 Sriraman Tallam <tmsriram@google.com>
1706
1707 * object.cc (Relobj::is_section_name_included): Add
7c16d96e 1708 ".rodata.nptl_version" to not garbage collect this section.
5ad9b0a7 1709
e051745c
CC
17102014-07-08 Cary Coutant <ccoutant@google.com>
1711
1712 * expression.cc (struct Expression::Expression_eval_info): Add
1713 new fields type_pointer, vis_pointer, and nonvis_pointer.
1714 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
1715 nonvis_pointer parameters. Adjust all calls.
1716 (Symbol_expression::value): Update type, visibility, and nonvis bits
1717 in caller.
1718 * script.cc (Symbol_assignment::sized_finalize): Update type,
1719 visibility, and remaining st_other bits for new symbol.
1720 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
1721 vis_pointer, and nonvis_pointer parameters.
1722 * symtab.h (Symbol::set_type): New method.
1723
1724 * testsuite/Makefile.am (defsym_test): New test.
1725 * testsuite/Makefile.in: Regenerate.
1726 * testsuite/defsym_test.c: New file.
1727 * testsuite/defsym_test.sh: New file.
1728
f35c4853
CC
17292014-07-08 Cary Coutant <ccoutant@google.com>
1730
1731 PR gold/15639
1732 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
1733 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
1734 (Sized_dynobj::base_read_symbols): ...new method.
1735 * object.h (Sized_relobj_file::base_read_symbols): New method.
1736 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
1737 (Sized_relobj_file::base_read_symbols): ...new method.
1738 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
1739 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
1740 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
1741
2900af2d
AM
17422014-07-04 Alan Modra <amodra@gmail.com>
1743
1744 * po/POTFILES.in: Regenerate.
1745
053a4d68
JY
17462014-07-02 Jing Yu <jingyu@google.com>
1747
1748 * aarch64.cc: New file
1749 * Makefile.am (TARGETSOURCES): Add aarch64.cc
1750 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
1751 * Makefile.in: Regenerate.
1752 * configure.tgt: Add entries for aarch64*.
1753 * configure.ac: Likewise.
1754 * configure: Likewise.
1755
7b549045
AM
17562014-06-27 Alan Modra <amodra@gmail.com>
1757
1758 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
1759
cb818dbf
CC
17602014-06-24 Cary Coutant <ccoutant@google.com>
1761
1762 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
1763 sections.
1764 (Dwo_file::sized_read_unit_index): Likewise.
1765
9810d34d
SS
17662014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1767
1768 * mips.cc: New file.
1769 * Makefile.am (TARGETSOURCES): Add mips.cc
1770 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
1771 * configure.tgt: Add entries for mips*.
1772 * configure.ac: Likewise.
1773 * Makefile.in: Regenerate.
1774 * configure: Likewise.
1775
9baa787b
CC
17762014-06-09 Cary Coutant <ccoutant@google.com>
1777
1778 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
1779 unit_length is within section bounds.
1780
8f89af0a
CC
17812014-06-09 Cary Coutant <ccoutant@google.com>
1782
1783 PR gold/16980
1784 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
1785 map.
1786
a47622ac
AM
17872014-06-07 Alan Modra <amodra@gmail.com>
1788
1789 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
1790
4320c691
CC
17912014-06-06 Cary Coutant <ccoutant@google.com>
1792
1793 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
1794 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
1795 (Dwarf_pubnames_table::read_header): Likewise.
1796 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
1797 .debug_gnu_pubtypes.
1798
270c9937
JB
17992014-06-05 Joel Brobecker <brobecker@adacore.com>
1800
1801 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
1802 * Makefile.in, configure: Regenerate.
1803
397998fc
AM
18042014-06-03 Alan Modra <amodra@gmail.com>
1805
1806 * powerpc.cc (addis_12_2): Define.
1807 (Stub_table::do_write): Support fusion on ELFv2 stubs.
1808
61f5c66f
AM
18092014-06-03 Alan Modra <amodra@gmail.com>
1810
1811 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
1812 st_other output.
1813
f6971787
AM
18142014-06-02 Alan Modra <amodra@gmail.com>
1815
1816 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
1817 Only ignore relocs on ELFv1.
1818 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
1819
f6fb8322
CC
18202014-05-30 Cary Coutant <ccoutant@google.com>
1821
1822 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
1823 * testsuite/Makefile.in: Regenerate.
1824 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
1825
c23dd342
L
18262014-05-27 H.J. Lu <hongjiu.lu@intel.com>
1827
1828 PR gold/16945
1829 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
1830 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
1831
5fe7ffdc
AM
18322014-05-15 Alan Modra <amodra@gmail.com>
1833
1834 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
1835 Compare FDE contents with DW_CFA_nop rather than 0.
1836
a82bef93
ST
18372014-05-13 Sriraman Tallam <tmsriram@google.com>
1838
1839 * symtab.h (may_need_copy_reloc): Remove check for position independent
1840 code.
1841 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
1842 position independence before pc absolute may_need_copy_reloc call.
1843 Add check for executable output befor pc relative may_need_copy_reloc
1844 call.
1845 * i386.cc: Ditto.
1846 * arm.cc: Ditto.
1847 * sparc.cc: Ditto.
1848 * tilegx.cc: Ditto.
1849 * powerpc.cc: Add check for no position independence before
1850 may_need_copy_reloc calls.
1851 * testsuite/pie_copyrelocs_test.cc: New file.
1852 * testsuite/pie_copyrelocs_shared_test.cc: New file.
1853 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 1854 * Makefile.in: Regenerate.
a82bef93 1855
53c66605
ML
18562014-05-08 Martin Liška <mliska@suse.cz>
1857
1858 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
1859
57b2284c
CC
18602014-05-06 Cary Coutant <ccoutant@google.com>
1861
1862 PR gold/16900
1863 * i386.cc (Output_data_got_plt_i386): New class.
1864 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
1865 parameter. Change all callers.
1866 (Output_data_plt_i386::layout_): Remove.
1867 (Output_data_plt_i386::got_plt_): Change type.
1868 (Target_i386::got_plt_): Change type. Change all references.
1869 (Target_i386::got_section): Create instance of new class.
1870 (Output_data_got_plt_i386::do_write): New function.
1871 * x86_64.cc (Output_data_got_plt_x86_64): New class.
1872 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
1873 parameter. Change all callers.
1874 (Output_data_plt_x86_64::layout_): Remove.
1875 (Output_data_plt_x86_64::got_plt_): Change type.
1876 (Target_x86_64::got_plt_): Change type. Change all references.
1877 (Target_x86_64::got_section): Create instance of new class.
1878 (Output_data_got_plt_x86_64::do_write): New function.
1879 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
1880 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
1881 class.
1882
6b97515d 18832014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 1884
6b97515d
CC
1885 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
1886 if we have pubnames/pubtypes.
1887
d1bddd3c
CC
18882014-05-02 Cary Coutant <ccoutant@google.com>
1889
5fe7ffdc
AM
1890 * defstd.cc (in_segment): Define __ehdr_start here...
1891 * layout.cc (Layout::finalize): ...Instead of here. Set the
1892 output segment when known.
1893 * resolve.cc (Symbol::override_base_with_special): Remember
1894 the original binding.
1895 * symtab.cc (Symbol::set_output_segment): New function.
1896 (Symbol::set_undefined): New function.
1897 * symtab.h (Symbol::is_weak_undefined): Check original undef
1898 binding.
1899 (Symbol::is_strong_undefined): New function.
1900 (Symbol::set_output_segment): New function.
1901 (Symbol::set_undefined): New function.
1902 * target-reloc.h (is_strong_undefined): Remove.
1903 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
1904 Check for hidden undefs.
1905 (relocate_section): Call Symbol::is_strong_undefined.
1906
1907 * testsuite/Makefile.am (ehdr_start_test_1)
1908 (ehdr_start_test_2, ehdr_start_test_3)
1909 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
1910 * testsuite/Makefile.in: Regenerate.
1911 * testsuite/ehdr_start_def.cc: New source file.
1912 * testsuite/ehdr_start_test.cc: New source file.
1913 * testsuite/ehdr_start_test.t: New linker script.
1914 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 1915
7849f6d8
CC
19162014-04-23 Cary Coutant <ccoutant@google.com>
1917
bf2cc635 1918 PR gold/16870
7849f6d8
CC
1919 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
1920
99fd8cff
CC
19212014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1922
1923 * layout.cc (Layout::include_section): Allow a target to decide
1924 whether to include a section.
1925 * target.h (Target::should_include_section): New function.
1926 (Target::do_should_include_section): New function.
1927
91f43acd
CC
19282014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1929
1930 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
1931 inline into ...
1932 (Copy_relocs::emit): ... here.
1933 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
1934 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
1935 (Copy_reloc_entry::entries_): Change from private to protected.
1936
c4eb27e1
ST
19372014-04-02 Sriraman Tallam <tmsriram@google.com>
1938
1939 * icf.cc (get_section_contents): Replace copies of reloc
1940 vectors with const references.
1941
ae447ddd
CC
19422014-04-02 Cary Coutant <ccoutant@google.com>
1943
1944 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
1945 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
1946 * configure: Regenerate.
1947 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
1948 -fno-use-linker-plugin.
1949 (LINK1, CXXLINK1): Add it to the link command.
1950 * testsuite/Makefile.in: Regenerate.
1951
fa47fa92
AM
19522014-03-12 Alan Modra <amodra@gmail.com>
1953
1954 * Makefile.in: Regenerate.
1955
9b12c500
CC
19562014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1957
1958 * symtab.h (Symbol::set_nonvis): New function.
1959
beacaa96
CC
19602014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1961
1962 * symtab.cc (Sized_symbol<32>::init_output_data):
1963 Instantiate the template.
1964 (Sized_symbol<64>::init_output_data): Likewise.
1965
800d9823
CC
19662014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1967
1968 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
1969 adjust dynamic symbol value.
1970 * target.h (Target::adjust_dyn_symbol): New function.
1971 (Target::do_adjust_dyn_symbol): New function.
1972
918fc1f8 19732014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 1974
918fc1f8
CC
1975 * output.cc (Output_data_dynamic::Dynamic_entry::write):
1976 Get the value of DYNAMIC_CUSTOM dynamic entry.
1977 * output.h (Output_data_dynamic::add_custom): New function.
1978 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
1979 dynamic entry.
1980 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
1981 * target.h (Target::dynamic_tag_custom_value): New function.
1982 (Target::do_dynamic_tag_custom_value): New function.
1983
98ff9231
CC
19842014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1985
1986 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
1987 dynsym indexes.
1988 * target.h (Target::has_custom_set_dynsym_indexes): New function.
1989 (Target::do_has_custom_set_dynsym_indexes): New function.
1990 (Target::set_dynsym_indexes): New function.
1991 (Target::do_set_dynsym_indexes): New function.
1992
b80eed39
AM
19932014-03-07 Alan Modra <amodra@gmail.com>
1994
1995 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
1996 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
1997 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
1998 (Powerpc_relocate_functions::has_overflow_bitfield,
1999 overflowed): Use the above.
2000 (Target_powerpc::Relocate::relocate): Correct overflow checking
2001 for a number of relocations. Modify overflow test for 16-bit
2002 fields in instructions to signed/unsigned according to whether
2003 the field takes a signed or unsigned value.
2004
4b95cf5c
AM
20052014-03-05 Alan Modra <amodra@gmail.com>
2006
2007 Update copyright years.
2008
45965137
AM
20092014-03-05 Alan Modra <amodra@gmail.com>
2010
2011 * powerpc.cc (Target_powerpc::Scan::local, global): Support
2012 R_PPC64_ADDR64_LOCAL.
2013 (Target_powerpc::Relocate::relocate): Likewise.
2014
2c80b753
AM
20152014-03-03 Alan Modra <amodra@gmail.com>
2016
2017 * dwp.cc (print_version): Update copyright year to current.
2018
c1c69e83
AM
20192014-02-10 Alan Modra <amodra@gmail.com>
2020
2021 * po/gold.pot: Regenerate.
2022
dd0c4e70
CC
20232014-02-06 Cary Coutant <ccoutant@google.com>
2024
2025 Fix problem where -u is ignored when a weak undef is seen.
2026
2027 * archive.cc (Library_base::should_include_member): Reorder
2028 code to check for -u option if a weak undef has already been seen.
2029 * testsuite/Makefile.am (weak_undef_test_2): New test case.
2030 * testsuite/Makefile.in: Regenerate.
2031 * testsuite/weak_undef_file3.cc: New file.
2032 * testsuite/weak_undef_file4.cc: New file.
2033 * testsuite/weak_undef_test_2.cc: New file.
2034
1a221d3d
CC
20352014-02-05 Cary Coutant <ccoutant@google.com>
2036
2037 Fix issues with gold undefined symbol diagnostics.
2038
2039 PR binutils/15435
2040 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
2041 check to here.
2042 * target-reloc.h (is_strong_undefined): New function.
2043 (relocate_section): Move undef vtable symbol check from here.
2044 Check for is_strong_undefined.
2045
e889f0a4 20462014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 2047
e889f0a4
CC
2048 Fix problems with the --dynamic-list option.
2049
2050 PR gold/13577
2051 * options.cc (General_options::parse_dynamic_list):
2052 Set have_dynamic_list_.
2053 (General_options::General_options): Initialize have_dynamic_list_.
2054 (General_options::finalize): Turn off -Bsymbolic and
2055 -Bsymbolic-functions if --dynamic-list provided.
2056 * options.h (General_options::have_dynamic_list): New function.
2057 (General_options::have_dynamic_list_): New data member.
2058 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
2059 correctly.
5fe7ffdc 2060
e889f0a4
CC
2061 PR gold/16530
2062 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
2063 in --dynamic-list, mark it.
5fe7ffdc 2064
e889f0a4
CC
2065 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
2066 (dynamic_list_2): New test case.
2067 * testsuite/Makefile.in: Regenerate.
2068 * testsuite/dynamic_list_2.cc: New file.
2069 * testsuite/dynamic_list_2.t: New file.
2070 * testsuite/dynamic_list_lib1.cc: New file.
2071 * testsuite/dynamic_list_lib2.cc: New file.
2072 * testsuite/gc_dynamic_list_test.c: New file.
2073 * testsuite/gc_dynamic_list_test.sh: New file.
2074 * testsuite/gc_dynamic_list_test.t: New file.
2075
ec673e64
CC
20762014-01-28 Cary Coutant <ccoutant@google.com>
2077
2078 Add .gdb_index version 7 support.
2079
2080 * gold/dwarf_reader.cc: include <utility> (for make_pair).
2081 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
2082 debug sections.
2083 (Dwarf_ranges_table::read_ranges_table): Likewise.
2084 (Dwarf_pubnames_table::read_section): Check for GNU-style
2085 sections, and for compressed debug sections.
2086 (Dwarf_pubnames_table::read_header): Compute end address of table.
2087 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
2088 for end of list by offset, not by offset == 0.
2089 (Dwarf_info_reader::do_read_string_table): Check for compressed
2090 debug sections.
2091 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2092 Initialize new data members.
2093 (Dwarf_pubnames_table::next_name): return flag_byte.
2094 (Dwarf_pubnames_table::end_of_table_): New data member.
2095 (Dwarf_pubnames_table::is_gnu_style_): New data member.
2096 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
2097 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
2098 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
2099 read skeleton type unit DIEs.
2100 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
2101 (Gdb_index::do_write): Write flag_byte.
2102 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
2103 (Gdb_index::Cu_vector): Store flags along with cu indexes.
2104 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
2105 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
2106
221fd5d5
L
21072014-01-08 H.J. Lu <hongjiu.lu@intel.com>
2108
2109 * version.cc (print_version): Update copyright year to 2014.
2110
6c09fb0b
ILT
21112013-12-19 Dimitry Andric <dimitry@andric.com>
2112
2113 * stringpool.cc (Stringpool_template::reserve): Add
2114 HAVE_UNORDERED_MAP case.
2115 * stringpool.cc (Stringpool_template::print_stats): Likewise.
2116
8356f2d0
CC
21172013-12-18 Cary Coutant <ccoutant@google.com>
2118
2119 * configure.ac: Check for <unordered_set> and <unordered_map>.
2120 * config.in: Regenerate.
2121 * configure: Regenerate.
2122 * system.h: Use <unordered_set> and <unordered_map> if available.
2123
f2c7d7ee
RM
21242013-12-10 Roland McGrath <mcgrathr@google.com>
2125
2126 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
2127 with $(INSTALL_PROGRAM_ENV).
2128 * Makefile.in: Regenerate.
2129
6632e8cc
CC
21302013-11-22 Cary Coutant <ccoutant@google.com>
2131
2132 * configure.ac: Add check for which library is needed for
2133 dlopen.
2134 * configure: Regenerate.
2135
0c075858
CC
21362013-11-22 Cary Coutant <ccoutant@google.com>
2137
2138 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
2139 assembler.
2140 * testsuite/Makefile.in: Regenerate.
2141
f49fe902
L
21422013-11-17 H.J. Lu <hongjiu.lu@intel.com>
2143
2144 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
2145 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
2146 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
2147 (Target_x86_64<size>::Scan::local): Likewise.
2148 (Target_x86_64<size>::Scan::global): Likewise.
2149 (Target_x86_64<size>::Relocate::relocate): Likewise.
2150 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
2151 Likewise.
2152 (Target_x86_64<size>::Scan::check_non_pic(): Handle
2153 R_X86_64_PC32_BND.
2154
2155 * testsuite/Makefile.am (check_PROGRAMS): Add
2156 exception_x86_64_bnd_test.
2157 (exception_x86_64_bnd_test_SOURCES): New macro.
2158 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
2159 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
2160 (exception_x86_64_bnd_test_LDADD): Likewise.
2161 (exception_x86_64_bnd_1.o): New rule.
2162 (exception_x86_64_bnd_2.o): Likewise.
2163 * testsuite/Makefile.in: Regenerated.
2164
9055360d
AM
21652013-11-15 Alan Modra <amodra@gmail.com>
2166
2167 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
2168 accessor.
2169 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
2170 Only call ppc64_local_entry_offset for 64-bit. Restrict
2171 symval_for_branch lookup to ELFv1.
2172 (Stub_table::add_plt_call_entry): Use unsigned int off.
2173 (Output_data_glink::Address, invalid_address): New.
2174 (Output_data_glink::add_eh_frame): Move out of line. Add
2175 support for ELFv2.
2176 (Output_data_glink::add_global_entry, find_global_entry,
2177 global_entry_address): New functions.
2178 (Output_data_glink::global_entry_stubs_, end_branch_table_,
2179 ge_size): New variables.
2180 (Output_data_glink::set_final_data_size): Add global entry
2181 stub sizing.
2182 (Output_data_glink::do_write): Write global entry stubs.
2183 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
2184 parameter. Return true for ELFv2. Adjust callers.
2185 (Target_powerpc::Scan::local, global): Restrict opd lookup to
2186 ELFv1. Similarly for ifunc and dynamic relocation processing
2187 specific to ELFv1. Recognize that symbols are defined on
2188 their plt entries for ELFv2.
2189 (Target_powerpc::symval_for_branch): Assert if called for
2190 ELFv2 or ppc32.
2191 (Target_powerpc::Relocate::relocate): Use global entry plt
2192 stub for symbol value if such exists on ELFv2.
2193 (Target_powerpc::Relocate::relocate): Don't call
2194 symval_for_branch when ELFv2. Do adjust for local entry
2195 offset when ELFv2.
2196 (Target_powerpc::do_dynsym_value): Set symbols to global entry
2197 plt stub for ELFv2.
2198 (Target_powerpc::do_plt_address_for_global): Similarly.
2199
cafdd569
CC
22002013-11-14 Cary Coutant <ccoutant@google.com>
2201
2202 Revert patch -- this did not fix the problem, and there is
2203 no race there.
2204
2205 2013-11-14 Cary Coutant <ccoutant@google.com>
2206
2207 PR gold/14860
2208 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2209 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2210 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2211 updating fde_offsets_.
2212 (Eh_frame_hdr::lock_): New data member.
2213
94e49e16
CC
22142013-11-14 Cary Coutant <ccoutant@google.com>
2215
2216 * dwp.cc (Dwo_file_entry): New type.
2217 (File_list): Use Dwo_file_entry.
2218 (Dwo_file::verify): New function.
2219 (Dwo_file::verify_dwo_list): New function.
2220 (Dwo_file::sized_verify_dwo_list): New function.
2221 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
2222 list.
2223 (Dwp_options): New enum type.
2224 (dwp_options): Add --verify-only.
2225 (usage): Likewise.
2226 (main): Likewise.
2227 * dwp.h (gold_info): Add declaration.
2228
7cdd7d57
CC
22292013-11-14 Cary Coutant <ccoutant@google.com>
2230
2231 PR gold/14860
2232 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2233 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2234 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2235 updating fde_offsets_.
2236 (Eh_frame_hdr::lock_): New data member.
2237
1d946cb3
CC
22382013-11-06 Cary Coutant <ccoutant@google.com>
2239
2240 PR gold/15758
2241 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
2242 before reloc sections.
2243
4f65b40e
AM
22442013-11-04 Alan Modra <amodra@gmail.com>
2245
2246 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
2247 (Symbol::needs_dynamic_reloc): Test new flag.
2248 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
2249 (Target_powerpc::Scan::get_reference_flags): Add target param.
2250 Return FUNC_DESC_ABI for 64-bit ELFv1.
2251 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
2252 call.
2253 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
2254 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
2255
908794a9
CC
22562013-10-31 Cary Coutant <ccoutant@google.com>
2257
2258 Restore support for dwp v2 DWARF package file format.
2259
2260 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2261 tu_length parameter. Adjust all callers.
2262 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2263 * dwp.cc: Include dwarf.h.
2264 (Section_bounds): New struct type.
2265 (Unit_set): New struct type.
2266 (Dwo_file::Dwo_file): Initialize new data member.
2267 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2268 Combine and rename to...
2269 (Dwo_file::read_unit_index): ...this.
2270 (Dwo_file::sized_read_compunit_index)
2271 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2272 (Dwo_file::sized_read_unit_index): ...this.
2273 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2274 parameters; add section_id parameter.
2275 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2276 (Dwo_file::add_unit_set): ...this.
2277 (Dwo_file::shndx_map_): Remove.
2278 (Dwo_file::sect_offsets_): New data member.
2279 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2280 (Dwp_output_file::add_section): Rename to...
2281 (Dwp_output_file::add_contribution): ...this.
2282 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2283 (Dwp_output_file::add_tu_set): Likewise.
2284 (Dwp_output_file::Contribution): New type.
2285 (Dwp_output_file::Section::contributions): New data member.
2286 (Dwp_output_file::Cu_or_tu_set): Remove.
2287 (Dwp_output_file::Section::Section): New ctor.
2288 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2289 (Dwp_output_file::Dwp_index::Section_table): New type.
2290 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2291 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2292 parameter.
2293 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2294 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2295 (Dwp_output_file::Dwp_index::section_table): New member function.
2296 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2297 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2298 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2299 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2300 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2301 (Dwp_output_file::Dwp_index::section_table_): New data member.
2302 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2303 (Dwp_output_file::add_output_section): New member function.
2304 (Dwp_output_file::write_new_section): New member function.
2305 (Dwp_output_file::write_contributions): New member function.
2306 (Dwp_output_file::section_id_map_): New data member.
2307 (class Dwo_id_info_reader): Remove.
2308 (class Unit_reader): New class.
2309 (get_dwarf_section_name): New function.
2310 (Dwo_file::read_executable): Adjust initializations of class data.
2311 (Dwo_file::read): Add support for v2 package file format.
2312 (Dwo_file::read_unit_index): Likewise.
2313 (Dwo_file::sized_read_unit_index): Likewise.
2314 (Dwo_file::copy_section): Likewise.
2315 (Dwo_file::add_unit_set): Likewise.
2316 (Dwp_output_file::add_output_section): Likewise.
2317 (Dwp_output_file::add_contribution): Likewise.
2318 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2319 for empty slot.
2320 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2321 file format.
2322 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2323 slot.
2324 (Dwp_output_file::initialize): Remove unused function.
2325 (Dwp_output_file::finalize): Add support for v2 package file format.
2326 (Dwp_output_file::write_index): Likewise.
2327 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2328 function prototype.
2329
2500c017
CC
23302013-10-31 Cary Coutant <ccoutant@google.com>
2331
2332 * configure.ac: Fix check for -fmerge-constants.
2333 * configure.ac: Regenerate.
2334
dd0845d7
RM
23352013-10-30 Roland McGrath <mcgrathr@google.com>
2336
2337 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
2338 Correct 9-byte nop sequence to match what the assembler generates.
2339
b4f7960d
AM
23402013-10-30 Alan Modra <amodra@gmail.com>
2341
2342 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
2343 ppc64_local_entry_offset, ppc64_local_entry_offset,
2344 do_read_symbols): New functions.
2345 (Powerpc_relobj::e_flags_, st_other_): New vars.
2346 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
2347 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
2348 (Powerpc_relobj::e_flags_): New var.
2349 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
2350 and adjust for ELFv2.
2351 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
2352 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
2353 (Powerpc_dynobj::do_find_special_sections): Likewise.
2354 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
2355 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
2356 to ELFv2 local entry.
2357 (Target_powerpc::do_relax): No thread safe barriers needed for
2358 ELFv2.
2359 (Output_data_plt_powerpc::initial_plt_entry_size_,
2360 plt_entry_size): Delete. Replace all uses with
2361 first_plt_entry_offset() and plt_entry_size().
2362 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
2363 reserved_size parm. Update callers.
2364 (Output_data_plt_powerpc::entry_count): Update.
2365 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
2366 and use Target_powerpc::first_plt_entry_offset().
2367 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
2368 rename to plt_entry_size.
2369 (Output_data_plt_powerpc::add_ifunc_entry,
2370 add_local_ifunc_entry): Adjust reloc for ELFv2.
2371 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
2372 (glink_eh_frame_fde_64v2): New.
2373 (Stub_table::plt_call_size): Support ELFv2 sizing.
2374 (Output_data_glink::add_eh_frame): Use the new FDE.
2375 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
2376 (Stub_table::do_write): Write ELFv2 stubs and glink.
2377 (Target_powerpc::Relocate::relocate): Replaces nop after call
2378 with ld 2,24(1) and adjust local offset destination for ELFv2.
2379
f9c6b907
AM
23802013-10-30 Alan Modra <amodra@gmail.com>
2381
2382 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
2383 (Target_powerpc::Scan::global, local): Likewise.
2384 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
2385 on all ppc64 @h and @ha relocs.
2386
e84fe78f
AM
23872013-10-14 Alan Modra <amodra@gmail.com>
2388
2389 * output.h (Output_data_got::add_constant): Tidy.
2390 (Output_data_got::add_constant_pair): New function.
2391 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
2392 methods used so as to first call reserve_ent().
2393
679e4abf
RM
23942013-10-11 Roland McGrath <mcgrathr@google.com>
2395
44dcb735
RM
2396 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
2397 add_got_entry and add_got_entry_pair.
2398
13323c49
RM
2399 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
2400 (HAVE_PUBNAMES): Likewise.
2401 * configure: Regenerate.
2402
1496b446
RM
2403 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
2404 * testsuite/Makefile.in: Regenerate.
2405
cc84c10b
RM
2406 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
2407 Remove const from declaration.
2408 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
2409 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
2410 * output.h (Output_file_header): Remove const from member target_
2411 and corresponding constructor argument.
2412 * output.cc (Output_file_header::Output_file_header): Update prototype.
2413 (Output_file_header::do_sized_write): Use this->target_ in place
2414 of parameters()->target().
2415
52f66a2c
RM
2416 * testsuite/undef_symbol.cc (Foo::get_a): New method.
2417
2b64b551
RM
2418 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
2419 * configure: Regenerate.
2420 * Makefile.in: Regenerate.
2421 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
2422 * testsuite/merge_string_literals_2.c: Likewise.
2423 * testsuite/Makefile.am
2424 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
2425 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
2426 literal -fmerge-constants.
2427 * testsuite/Makefile.in: Regenerate.
2428
43819297
RM
2429 * i386.cc (Target_i386): Remove unused member dynbss_.
2430 * arm.cc (Target_arm): Likewise.
2431 * powerpc.cc (Target_powerpc): Likewise.
2432 * sparc.cc (Target_sparc): Likewise.
2433 * tilegx.cc (Target_tilegx): Likewise.
2434 * x86_64.cc (Target_x86_64): Likewise.
2435 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
2436 type_signature_, type_offset_.
2437 * plugin.h (Plugin_hook): Remove unused member layout_.
2438 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
2439 mapfile_.
2440 (Read_member): Remove unused members input_objects_, symtab_,
2441 mapfile_, layout_.
2442 (Check_library): Remove unused member symtab_.
2443 * archive.h (Lib_group): Remove unused member lib_.
2444 * archive.cc (Lib_group::Lib_group): Update initializer.
2445 * incremental.h (Incremental_binary): Remove unused member target_.
2446 (Incremental_script_entry): Removed unused member script_.
2447 * layout.h (Write_symbols_task): Remove unused member input_objects_.
2448 * icf.h (Icf): Remove unused member num_tracked_relocs.
2449
39d9ead7
RM
2450 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
2451 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
2452 its only use.
2453 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
2454
679e4abf
RM
2455 * archive.h: Use struct rather than class for forward declaration
2456 of Read_symbols_data.
2457
54de2ea6
CC
24582013-10-07 Cary Coutant <ccoutant@google.com>
2459
2460 PR gold/16010
2461 * testsuite/Makefile.am (icf_test): Fix dependencies.
2462 (icf_safe_test): Likewise.
2463 (icf_safe_so_test): Likewise.
2464 (large_symbol_alignment): Add empty _LDADD rule.
2465 * testsuite/Makefile.in: Regenerate.
2466
b14016f0
L
24672013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
2468
2469 PR gold/15927
2470 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
2471 relocation for R_X86_64_32 on x32.
2472
eb426534
RM
24732013-08-27 Roland McGrath <mcgrathr@google.com>
2474
2475 * output.cc (Output_segment::set_section_addresses): Take new
2476 Target* argument. If target->isolate_execinstr() and the segment
2477 is executable and starts at a target->abi_pagesize() boundary,
2478 pad its end out to a target->abi_pagesize() boundary with code fill.
2479 * output.h (Output_segment::set_section_addresses): Update decl.
2480 * layout.h (Layout::check_output_data_for_reset_values): Take new
2481 argument RELAX_OUTPUTS.
2482 (Layout): New member relax_output_list_.
2483 (Layout::add_relax_output): New method.
2484 * layout.cc (Layout::Layout): Update constructor.
2485 (Layout::reset_relax_output): New method.
2486 (Layout::clean_up_after_relaxation): Call it.
2487 (Layout::prepare_for_relaxation): Update caller.
2488 (Layout::set_segment_offsets): Update callers of set_section_addresses.
2489 Call reset_relax_output before re-processing segments for
2490 isolate_execinstr case.
2491 (Layout::write_data): Handle relax_output_list_.
2492 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
2493 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
2494
9aff4b7a
NC
24952013-08-23 Yuri Chornoivan <yurchor@ukr.net>
2496
2497 PR binutils/15834
2498 * object.h: Fix typos.
2499
93f8221c
RM
25002013-08-16 Roland McGrath <mcgrathr@google.com>
2501
2502 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
2503 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
2504
e44c3715
CC
25052013-08-07 Cary Coutant <ccoutant@google.com>
2506
2507 Revert support for v2 DWP files:
2508
2509 2013-03-01 Cary Coutant <ccoutant@google.com>
2510
2511 Add dwp support for v2 DWARF package file format.
2512 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2513 tu_length parameter. Adjust all callers.
2514 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2515 * dwp.cc: Include dwarf.h.
2516 (Section_bounds): New struct type.
2517 (Unit_set): New struct type.
2518 (Dwo_file::Dwo_file): Initialize new data member.
2519 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2520 Combine and rename to...
2521 (Dwo_file::read_unit_index): ...this.
2522 (Dwo_file::sized_read_compunit_index)
2523 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2524 (Dwo_file::sized_read_unit_index): ...this.
2525 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2526 parameters; add section_id parameter.
2527 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2528 (Dwo_file::add_unit_set): ...this.
2529 (Dwo_file::shndx_map_): Remove.
2530 (Dwo_file::sect_offsets_): New data member.
2531 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2532 (Dwp_output_file::add_section): Rename to...
2533 (Dwp_output_file::add_contribution): ...this.
2534 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2535 (Dwp_output_file::add_tu_set): Likewise.
2536 (Dwp_output_file::Contribution): New type.
2537 (Dwp_output_file::Section::contributions): New data member.
2538 (Dwp_output_file::Cu_or_tu_set): Remove.
2539 (Dwp_output_file::Section::Section): New ctor.
2540 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2541 (Dwp_output_file::Dwp_index::Section_table): New type.
2542 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2543 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2544 parameter.
2545 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2546 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2547 (Dwp_output_file::Dwp_index::section_table): New member function.
2548 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2549 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2550 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2551 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2552 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2553 (Dwp_output_file::Dwp_index::section_table_): New data member.
2554 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2555 (Dwp_output_file::add_output_section): New member function.
2556 (Dwp_output_file::write_new_section): New member function.
2557 (Dwp_output_file::write_contributions): New member function.
2558 (Dwp_output_file::section_id_map_): New data member.
2559 (class Dwo_id_info_reader): Remove.
2560 (class Unit_reader): New class.
2561 (get_dwarf_section_name): New function.
2562 (Dwo_file::read_executable): Adjust initializations of class data.
2563 (Dwo_file::read): Add support for v2 package file format.
2564 (Dwo_file::read_unit_index): Likewise.
2565 (Dwo_file::sized_read_unit_index): Likewise.
2566 (Dwo_file::copy_section): Likewise.
2567 (Dwo_file::add_unit_set): Likewise.
2568 (Dwp_output_file::add_output_section): Likewise.
2569 (Dwp_output_file::add_contribution): Likewise.
2570 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2571 for empty slot.
2572 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2573 file format.
2574 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2575 slot.
2576 (Dwp_output_file::initialize): Remove unused function.
2577 (Dwp_output_file::finalize): Add support for v2 package file format.
2578 (Dwp_output_file::write_index): Likewise.
2579 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2580 function prototype.
2581
c6905c28
CC
25822013-07-31 Cary Coutant <ccoutant@google.com>
2583
2584 * object.cc (Sized_relobj::do_output_section_address): New function.
2585 (Sized_relobj): Instantiate explicitly.
2586 * object.h (Object::output_section_address): New function.
2587 (Object::do_output_section_address): New function.
2588 (Sized_relobj::do_output_section_address): New function.
2589 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
2590
25912013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 2592 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
2593
2594 * parameters.cc (Parameters::entry): Return target-specific entry
2595 symbol name.
2596 * target.h (Target::entry_symbol_name): New function.
2597 (Target_info::entry_symbol_name): New data member.
2598
2599 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
2600 * i386.cc (Target_i386::i386_info): Likewise.
2601 (Target_i386_nacl::i386_nacl_info): Likewise.
2602 * sparc.cc (Target_sparc::sparc_info): Likewise.
2603 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
2604 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
2605 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
2606 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
2607
234d4ab8
SA
26082013-07-22 Sterling Augustine <saugustine@google.com>
2609
2610 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
2611 Convert parameter shndx to local variable. Add parameters symtab
2612 and symtab_size. Scan over section names. Find relocation
2613 section corresponding to current section. Create and initialize
2614 reloc_mapper_ and reloc_type_.
2615 (Dwarf_pubnames_table::read_header): Add assertion. Change
2616 unit_length to off_t. Initialize member unit_length_. Fill in field
2617 cu_offset_.
2618 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2619 Initialize new fields unit_length_ and cu_offset_.
2620 (Dwarf_pubnames_table::read_section): Update prototype.
2621 (Dwarf_pubnames_table::cu_offset): New member function.
2622 (Dwarf_pubnames_table::subsection_size): Likewise.
2623 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
2624 New fields.
2625 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
2626 member functions public.
2627 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
2628 Update comment. Rework logic. Move repeated parts to...
2629 (Gdb_index_info_reader::read_pubtable): ...here. New function.
2630 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
2631 pubtypes_table_, and stmt_list_offset.
2632 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2633 Gdb_index::find_pubtype_offset,
2634 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
2635 (Gdb_index::pubnames_read): Update prototype and rework logic.
2636 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
2637 Forward declare.
2638 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2639 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
2640 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
2641 Gdb_index::map_pubtable_to_dies):
2642 Declare functions.
2643 (Gdb_index::pubnames_read): Update declaration.
2644 (Gdb_index::Pubname_offset_map): New type.
2645 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
2646 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
2647 Gdb_index::stmt_list_offset): Declare.
2648 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
2649 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
2650 Gdb_index::pubtypes_offset_): Remove.
2651
a3ed37d8
RM
26522013-07-19 Roland McGrath <mcgrathr@google.com>
2653
2654 * options.h (General_options): Add -Trodata-segment option.
2655 * parameters.cc (Parameters::check_rodata_segment): New function.
2656 (Parameters::set_target_once): Call it.
2657 * parameters.h (Parameters): Declare it (private member function).
2658 * layout.cc (load_seg_unusable_for_headers): New function, broken
2659 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
2660 then validate rodata segment rather than text segment.
2661 (relaxation_loop_body): Call that.
2662 (is_text_segment): New function. Don't admit a non-executable
2663 segment if TARGET->isolate_execinstr().
2664 (set_segment_offsets): Call it. Honor -Trodata-segment option.
2665
eb5b4ded
CC
26662013-07-15 Shawn Landden <shawnlandden@gmail.com>
2667
2668 PR gold/15070
2669 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
2670 * nacl.h (Sniff_file::View::View): Request aligned view.
2671
4d5effb9
CC
26722013-07-11 Cary Coutant <ccoutant@google.com>
2673
2674 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
2675 correct BRLT entry size.
2676
ba8ca3e7
AM
26772013-07-03 Alan Modra <amodra@gmail.com>
2678
2679 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
2680 comment.
2681
267257d2
CC
26822013-07-01 Cary Coutant <ccoutant@google.com>
2683
2684 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
2685 reloc_type_.
2686 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
2687 (Dwarf_ranges_table::lookup_reloc): New function.
2688 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
2689 reloc_type_.
2690 (Dwarf_ranges_table::lookup_reloc): New function.
2691 (Dwarf_ranges_table::reloc_type_): New data member.
2692
06f30c9d
CC
26932013-06-27 Jing Yu <jingyu@google.com>
2694
2695 PR gold/15662
2696 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
2697 function.
2698 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
2699 (Target_powerpc::do_relax): Call the above.
2700
a2d7bf59
AM
27012013-06-27 Cary Coutant <ccoutant@google.com>
2702
2703 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
2704 on garbage collected .opd section.
2705
27062013-06-27 Alan Modra <amodra@gmail.com>
2707
2708 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
2709 is non-zero.
2710 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
2711 (Target_powerpc::do_function_location): Likewise for loc->shndx.
2712
32364e50
CC
27132013-06-14 Cary Coutant <ccoutant@google.com>
2714
2715 * resolve.cc (Symbol::override_base): Don't override st_type
2716 from plugin placeholder symbols.
2717 (Symbol_table::resolve): Likewise.
2718 (Symbol_table::should_override): Don't complain about TLS mismatch
2719 if the TO symbol is a plugin placeholder.
2720 * testsuite/Makefile.am (plugin_test_tls): New test.
2721 * testsuite/Makefile.in: Regenerate.
2722 * testsuite/plugin_test_tls.sh: New test script.
2723 * testsuite/two_file_test_2_tls.cc: New test source.
2724 * testsuite/two_file_test_tls.cc: New test source.
2725
7fb47cc9
CC
27262013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
2727
2728 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
2729 the maximum segment alignment is larger than the page size.
2730 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
2731 correctly aligns the symbols with large alignemnt.
2732 * testsuite/Makefile.in: Regenerate.
2733 * testsuite/large_symbol_alignment.cc: New file.
2734
6934001a
CC
27352013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
2736 Sriraman Tallam <tmsriram@google.com>
2737
2738 * options.h (sort_section): New option.
2739 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
2740 Rename from Input_section_sort_section_name_special_ordering_compare.
2741 (Input_section_sort_section_name_compare): New struct.
2742 * output.cc (Output_section::Input_section_sort_section_name_compare::
2743 operator()): New function.
2744 (Output_section::sort_attached_input_sections): Use new sort function
2745 for .text if --sort-section=name is specified.
2746 * layout.cc (Layout::make_output_section):
2747 Add sorting by name when --sort-section=name is specified.
2748 * testsuite/Makefile.am (text_section_grouping): Test option
2749 --sort-section=name.
2750 * testsuite/Makefile.in: Regenerate.
2751 * testsuite/section_sorting_name.cc: New file.
2752 * testsuite/section_sorting_name.sh: New file.
2753
93acabad
CC
27542013-05-21 Cary Coutant <ccoutant@google.com>
2755
2756 * symtab.h (Symbol::is_cxx_vtable): New function.
2757 * target-reloc.h (relocate_section): Check for vtable symbol.
2758 * testsuite/Makefile.am (missing_key_func.sh): New test case.
2759 * testsuite/Makefile.in: Regenerate.
2760 * testsuite/missing_key_func.cc: New test source.
2761 * testsuite/missing_key_func.sh: New test script.
2762
60e8b3fc
CC
27632013-05-21 Cary Coutant <ccoutant@google.com>
2764
2b64b551
RM
2765 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
2766 type of enclosing symbol.
2767 (Relocate_info::location): Check symbol type when describing symbol.
2768 * object.h (Symbol_location_info): Remove unused line_number;
2769 add enclosing_symbol_type.
2770 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 2771
9df9de2c
CC
27722013-05-13 Cary Coutant <ccoutant@google.com>
2773
2b64b551
RM
2774 * configure.ac: Export DEFAULT_TARGET.
2775 * configure: Regenerate.
2776 * Makefile.in: Regenerate.
2777 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
2778 * testsuite/Makefile.in: Regenerate.
2779 * testsuite/debug_msg.sh: Delete duplicate tests.
2780 Don't check undef_int error message match for powerpc where the
2781 source file and line number aren't available.
9df9de2c 2782
bbc5ae17
RM
27832013-05-10 Roland McGrath <mcgrathr@google.com>
2784
2785 * options.h (General_options): Add --rosegment-gap option.
2786 * options.cc (finalize): --rosegment-gap implies --rosegment.
2787 * layout.cc (set_segment_offsets): Let user option override
2788 target->rosegment_gap().
2789
0c6e6c39
RM
27902013-05-10 Roland McGrath <mcgrathr@google.com>
2791
2792 * options.h (General_options): Remove leading space from help
2793 messages for -nostdlib and --rosegment.
2794
cde7cb01
MR
27952013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
2796
2797 PR ld/15365
2798 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
2799
f31ae5b8
AM
28002013-05-03 Alan Modra <amodra@gmail.com>
2801
2802 * merge.cc (Output_merge_string::do_add_input_section): Correct
2803 scan for number of strings. Rename vars to avoid shadowing.
2804 Include missing terminator in input_size_.
2805
d3a7cd45
L
28062013-05-01 H.J. Lu <hongjiu.lu@intel.com>
2807
2808 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
2809 Restore empty string handling.
2810
6ad3daba
CC
28112013-05-01 Cary Coutant <ccoutant@google.com>
2812
2813 * stringpool.cc (Stringpool_template::new_key_offset): Fix
2814 uninitialized warning.
2815
e31908b6
CC
28162013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
2817
2818 * output.cc (Output_section::add_merge_input_section): Allow
2819 to merge sections if the alignment is more than character size.
2820 * merge.h (Output_merge_string::Output_merge_string): Remove
2821 assert.
2822 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
2823 only not-null strings. Check the alignment of strings.
2824 * stringpool.h
2825 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
2826 alignment as the argument.
2827 (Stringpool_template<Stringpool_char>::addralign_): New class member.
2828 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
2829 Align non-zero length strings according to the addralign_.
2830 (Stringpool_template<Stringpool_char>::set_string_offsets):
2831 Updating offsets according to the given alignment.
2832 * testsuite/Makefile.am (text_section_grouping): Test if string
2833 literals are getting merged.
2834 * testsuite/Makefile.in: Regenerate.
2835 * testsuite/merge_string_literals_1.c: New file.
2836 * testsuite/merge_string_literals_2.c: Ditto.
2837 * testsuite/merge_string_literals.sh: Ditto.
2838
0e804863
ILT
28392013-04-26 Ian Lance Taylor <iant@google.com>
2840
2841 * target-reloc.h (relocate_section): If the reloc offset is out of
2842 range, pass VIEW as NULL to relocate.relocate.
2843 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
2844 * i386.cc (Target_i386::Relocate::relocate): Likewise.
2845 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
2846 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
2847 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
2848 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
2849
e7c5ea40
CC
28502013-04-26 Geoff Pike <gpike@chromium.org>
2851
2852 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
2853 * layout.cc (Hash_task): New class.
2854 (Layout::queue_build_id_tasks): New function.
2855 (Layout::write_build_id): Handle single-thread portion of build ID
2856 computation. (In some cases, all of it is single-threaded.) Replace
2857 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
2858 functionality in fewer lines of code.
2859 * layout.h (Layout::queue_build_id_tasks): New function declaration.
2860 * options.h (General_options): make "--build-id" default to tree
2861 rather than sha1. Add two new options related to --build-id=tree:
2862 --build-id-chunk-size-for-treehash and
2863 --build-id-min-file-size-for-treehash.
2864 * Makefile.am: add testing of --build-id=tree and related new options
2865 (these tests will be invoked by "make check").
2866 * Makefile.in: Regenerate.
2867
49926cd0
AM
28682013-04-25 Alan Modra <amodra@gmail.com>
2869
2870 * configure.tgt: Add powerpcle and powerpc64le.
2871
a4034750
AM
28722013-04-22 Alan Modra <amodra@gmail.com>
2873
2874 PR gold/15355
2875 * layout.cc (Layout::segment_precedes): Allow more than one
2876 segment with the same type and flags.
2877
e79c84aa
CC
28782013-04-15 Cary Coutant <ccoutant@google.com>
2879
2880 * layout.cc (Layout::set_relocatable_section_offsets): Don't
2881 allocate space in file for BSS sections.
2882
2199fbe7
CC
28832013-04-15 Cary Coutant <ccoutant@google.com>
2884
2885 * script-sections.cc (Orphan_output_section): Reset address
2886 to zero after each orphaned section for relocatable links.
2887
502e8a84
CC
28882013-04-15 Cary Coutant <ccoutant@google.com>
2889
a4034750
AM
2890 * symtab.cc (Symbol_table::sized_write_globals): Subtract
2891 section starting address for relocatable link.
2892 * testsuite/Makefile.am (script_test_11): New test.
2893 * testsuite/Makefile.in: Regenerate.
2894 * testsuite/script_test_11.c: New source file.
2895 * testsuite/script_test_11.t: New linker script.
502e8a84 2896
0cfdc767
AM
28972013-04-13 Alan Modra <amodra@gmail.com>
2898
2899 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
2900 owner when sections are not adjacent and exceed group size.
2901 (Target_powerpc::group_sections): Handle corner case.
2902 (Target_powerpc::Branch_info::make_stub): Handle case where
2903 stub table doesn't exist due to branches in non-exec sections.
2904 (Target_powerpc::Relocate::relocate): Likewise.
2905
6830ee24
AM
29062013-04-11 Alan Modra <amodra@gmail.com>
2907
2908 PR gold/15354
2909 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
2910 .branch_lt to match bfd ld. Adjust comments throughout file.
2911
54a3d865
ILT
29122013-04-04 Ian Lance Taylor <iant@google.com>
2913
2914 GCC PR c++/56840
2915 * object.cc (do_layout_deferred_sections): Handle .eh_frame
2916 sections before checking whether they are included in the link.
2917
9993ba11
ST
29182013-03-29 Sriraman Tallam <tmsriram@google.com>
2919
2920 * archive.cc (Archive::get_elf_object_for_member): Create the elf
2921 object before calling the plugin claim_file handler. Pass the elf
2922 object of the archive to the plugin. Delete the elf object if the
2923 plugin claims the file.
2924
ebacd51e
AM
29252013-03-21 Alan Modra <amodra@gmail.com>
2926
2927 * layout.cc (Layout::set_segment_offsets): Accept writable .text
2928 segment when omagic.
2929
117be58f
AM
29302013-03-21 Alan Modra <amodra@gmail.com>
2931
2932 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
2933 comparison warning.
2934 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
2935 uninitialized" warning.
2936
32e2b61d
AM
29372013-03-20 Alan Modra <amodra@gmail.com>
2938
2939 * symtab.h (Symbol::clear_version): New function.
2940 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
2941 is_needed by weak references. Clear version for symbols defined
2942 in as-needed objects that are not needed.
2943
b3ccdeb5
AM
29442013-03-15 Alan Modra <amodra@gmail.com>
2945
2946 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
2947 static and public. Add report_err param. Return false for data refs.
2948 (Target_powerpc::rela_dyn_section): New overloaded function.
2949 (Target_powerpc::plt_, iplt_): Elucidate.
2950 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
2951 (Output_data_plt_powerpc::do_write): Don't write .iplt.
2952 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
2953 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
2954 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
2955 push_branch and make_plt_entry for ifunc syms when
2956 reloc_needs_plt_for_ifunc.
2957 (Target_powerpc::Relocate::relocate): Don't use plt entry value
2958 for ifunc unless reloc_needs_plt_for_ifunc.
2959
ad3d8a2f
AM
29602013-03-15 Alan Modra <amodra@gmail.com>
2961
2962 * gc.h (gc_process_relocs): Don't look through function descriptors.
2963 * icf.cc (get_section_contents): Do so here instead.
2964
4d9aa155
AM
29652013-03-13 Alan Modra <amodra@gmail.com>
2966
2967 * powerpc.cc (is_branch_reloc): Forward declare.
2968 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
2969 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
2970 false for 64-bit, true for 32-bit non-branch relocs.
2971 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
2972 * testsuite/Makefile.am (icf_test): Use linker map file instead of
2973 nm output.
2974 (icf_safe_test): Generate linker map file as well as nm output.
2975 (icf_safe_so_test): Likewise.
2976 * testsuite/Makefile.in: Regenerate.
2977 * testsuite/icf_test.sh: Parse linker map file to determine
2978 section folding.
2979 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
2980 * testsuite/icf_safe_so_test.sh: Likewise.
2981 (X86_32_or_ARM_specific_safe_fold): Merge into..
2982 (arch_specific_safe_fold): ..this.
2983 (X86_64_specific_safe_fold): Delete unused function.
2984
57420c20
AM
29852013-03-12 Alan Modra <amodra@gmail.com>
2986
2987 * gc.h (gc_process_relocs): Look through function descriptors
2988 to determine shndx, symvalue and addend used by ICF. Tidy
2989 variable duplication.
2990
dc3714f3
AM
29912013-03-11 Alan Modra <amodra@gmail.com>
2992
2993 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
2994 * layout.cc (Layout_task_runner::run): ..to here.
2995 * symtab.h (struct Symbol_location): Extract from..
2996 (class Symbol_table): ..here.
2997 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
2998 * target.h (class Target): Add function_location and
2999 do_function_location functions.
3000 (class Sized_target): Add do_function_location.
3001 * object.h (class Sized_relobj_file): Move find_shdr..
3002 (class Object): ..to here.
3003 * object.cc: Likewise. Update to suit. Instantiate.
3004 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
3005 * powerpc.cc (class Powerpc_dynobj): New.
3006 (Target_powerpc::do_function_location): New function.
3007 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
3008 (Powerpc_dynobj::do_read_symbols): New function.
3009 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
3010
956b03bb
ILT
30112013-03-08 Ian Lance Taylor <iant@google.com>
3012
3013 * options.cc (General_options::string_to_object_format): Accept
3014 "default".
3015
4bead2d5
AM
30162013-03-08 Alan Modra <amodra@gmail.com>
3017
3018 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
3019 pointer to Post_fde.
3020 (struct Post_fde): Move definition to here..
3021 * ehframe.cc (struct Post_fde): ..from here.
3022 (Cie::write): Don't alloc Post_fde.
3023 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
3024
02e60bf7
AM
30252013-03-07 Alan Modra <amodra@gmail.com>
3026
3027 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
3028 relocation referencing .LC0.
3029 * testsuite/discard_locals_test.sh: Remove FIXMEs.
3030
8343f03a
AM
30312013-03-07 Alan Modra <amodra@gmail.com>
3032
3033 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
3034 always_inline. Add assembly for powerpc to avoid GOT.
3035
3366d57c
AM
30362013-03-07 Alan Modra <amodra@gmail.com>
3037
3038 * testsuite/script_test_10.sh: Don't test .bss section
3039 header number.
3040
6c77229c
AM
30412013-03-06 Alan Modra <amodra@gmail.com>
3042
3043 * powerpc.cc (class Powerpc_relobj): Move some member functions.
3044 (Target_powerpc::symval_for_branch): Add symtab param. Update
3045 all callers. Handle folded sections.
3046 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
3047 to Powerpc_relobj.
3048 (Global_symbol_visitor_opd::operator()): Likewise.
3049
a39e4af6
AM
30502013-03-04 Alan Modra <amodra@gmail.com>
3051
3052 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
3053 * testsuite/Makefile.in: Regenerate.
3054
d5834edb
CC
30552013-03-01 Cary Coutant <ccoutant@google.com>
3056
3057 Add dwp support for v2 DWARF package file format.
3058 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
3059 tu_length parameter. Adjust all callers.
3060 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
3061 * dwp.cc: Include dwarf.h.
3062 (Section_bounds): New struct type.
3063 (Unit_set): New struct type.
3064 (Dwo_file::Dwo_file): Initialize new data member.
3065 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
3066 Combine and rename to...
3067 (Dwo_file::read_unit_index): ...this.
3068 (Dwo_file::sized_read_compunit_index)
3069 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
3070 (Dwo_file::sized_read_unit_index): ...this.
3071 (Dwo_file::copy_section): Remove section_name, is_str_offsets
3072 parameters; add section_id parameter.
3073 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
3074 (Dwo_file::add_unit_set): ...this.
3075 (Dwo_file::shndx_map_): Remove.
3076 (Dwo_file::sect_offsets_): New data member.
3077 (Dwp_output_file::Dwp_output_file): Initialize new data members.
3078 (Dwp_output_file::add_section): Rename to...
3079 (Dwp_output_file::add_contribution): ...this.
3080 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
3081 (Dwp_output_file::add_tu_set): Likewise.
3082 (Dwp_output_file::Contribution): New type.
3083 (Dwp_output_file::Section::contributions): New data member.
3084 (Dwp_output_file::Cu_or_tu_set): Remove.
3085 (Dwp_output_file::Section::Section): New ctor.
3086 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
3087 (Dwp_output_file::Dwp_index::Section_table): New type.
3088 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
3089 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
3090 parameter.
3091 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
3092 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
3093 (Dwp_output_file::Dwp_index::section_table): New member function.
3094 (Dwp_output_file::Dwp_index::section_table_end): New member function.
3095 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
3096 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
3097 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
3098 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
3099 (Dwp_output_file::Dwp_index::section_table_): New data member.
3100 (Dwp_output_file::Dwp_index::section_mask_): New data member.
3101 (Dwp_output_file::add_output_section): New member function.
3102 (Dwp_output_file::write_new_section): New member function.
3103 (Dwp_output_file::write_contributions): New member function.
3104 (Dwp_output_file::section_id_map_): New data member.
3105 (class Dwo_id_info_reader): Remove.
3106 (class Unit_reader): New class.
3107 (get_dwarf_section_name): New function.
3108 (Dwo_file::read_executable): Adjust initializations of class data.
3109 (Dwo_file::read): Add support for v2 package file format.
3110 (Dwo_file::read_unit_index): Likewise.
3111 (Dwo_file::sized_read_unit_index): Likewise.
3112 (Dwo_file::copy_section): Likewise.
3113 (Dwo_file::add_unit_set): Likewise.
3114 (Dwp_output_file::add_output_section): Likewise.
3115 (Dwp_output_file::add_contribution): Likewise.
3116 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
3117 for empty slot.
3118 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
3119 file format.
3120 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
3121 slot.
3122 (Dwp_output_file::initialize): Remove unused function.
3123 (Dwp_output_file::finalize): Add support for v2 package file format.
3124 (Dwp_output_file::write_index): Likewise.
3125 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
3126 function prototype.
3127
a68a081d
CC
31282013-03-01 Cary Coutant <ccoutant@google.com>
3129
3130 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
3131 function into class definition in header file.
3132 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
3133 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
3134 New function.
3135 (Dwarf_info_reader::check_buffer): Move here from .cc file.
3136
9d5781f8
AM
31372013-02-28 Alan Modra <amodra@gmail.com>
3138
3139 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
3140 * target.cc (Target::do_plt_fde_location): New function.
3141 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
3142 accessor function, and constructor param.
3143 (struct Post_fde, Post_fdes): Declare.
3144 (Cie::write): Add post_fdes param.
3145 * ehframe.cc (Fde::write): Use plt_fde_location.
3146 (struct Post_fde): Define.
3147 (Cie::write): Stash FDEs added post merge mapping.
3148 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
3149 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
3150 (Eh_frame::do_sized_write): Arrange to write post map FDES after
3151 other FDEs.
3152 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
3153 (Target_powerpc::has_glink): New function.
3154 (Target_powerpc::do_relax): Add eh_frame info for stubs.
3155 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
3156 glink_eh_frame_fde_32, default_fde): New data.
3157 (Stub_table::eh_frame_added_): New var.
3158 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
3159 Make const.
3160 (Stub_table::add_eh_frame): New function.
3161 (Output_data_glink::add_eh_frame): New function.
3162 (Target_powerpc::make_glink_section): Call add_eh_frame.
3163
214383dd
ILT
31642013-02-15 Ian Lance Taylor <iant@google.com>
3165
3166 * options.h (DEFINE_uint64_alias): Define.
3167 (class General_options): Add -Ttext-segment as an alias for
3168 -Ttext.
3169
91c2b899
AM
31702013-02-15 Alan Modra <amodra@gmail.com>
3171
3172 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
3173 (Stub_table::do_write): ..here, two places.
3174 (Stub_table::plt_call_size): Use it here too.
3175
20e2a8aa
ILT
31762013-02-11 Ian Lance Taylor <iant@google.com>
3177
3178 * descriptors.cc (Descriptors::close_all): New function.
3179 * descriptors.h (class Descriptors): Declare close_all.
3180 (close_all_descriptors): New inline function.
3181 * plugin.cc: Include "descriptors.h".
3182 (Plugin_manager::cleanup): Call close_all_descriptors.
3183
8952bc69
AM
31842013-02-06 Alan Modra <amodra@gmail.com>
3185
3186 * README: Update coding style link.
3187
29bd8b6b
CC
31882013-01-28 Cary Coutant <ccoutant@google.com>
3189
a4034750
AM
3190 * dwp.cc (File_list): New typedef.
3191 (Dwo_name_info_reader): New class.
3192 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
3193 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
3194 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
3195 (Dwo_file::read_executable): New function.
3196 (Dwo_file::read): Move common setup code to ...
3197 (Dwo_file::make_object): ... here.
3198 (dwp_options): Add --exec/-e.
3199 (usage): Likewise.
3200 (main): Likewise.
29bd8b6b 3201
c6ac678d
ST
32022013-01-24 Sriraman Tallam <tmsriram@google.com>
3203
3204 * layout.cc (Layout::layout): Check for option text_reorder.
3205 (Layout::make_output_section): Ditto.
3206 * options.h (text_reorder): New option.
3207 * output.cc (Input_section_sort_compare): Remove special ordering
3208 of section names.
3209 (Output_section::
3210 Input_section_sort_section_name_special_ordering_compare::
3211 operator()): New function.
3212 (Output_section::sort_attached_input_sections): Use new sort function
3213 for .text.
3214 * output.h (Input_section_sort_section_name_special_ordering_compare):
3215 New struct.
3216 * testsuite/Makefile.am (text_section_grouping): Test option
3217 --no-text-reorder
3218 * testsuite/Makefile.in: Regenerate.
3219 * testsuite/text_section_grouping.sh: Check order of functions without
3220 default text reordering.
3221
50701cc1
MF
32222013-01-18 Mike Frysinger <vapier@gentoo.org>
3223
3224 * options.h (General_options): Change default to true for new_dtags.
3225
b1b00fcc
MF
32262013-01-18 Mike Frysinger <vapier@gentoo.org>
3227
3228 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
3229 when enable_new_dtags is false. Only add DT_RUNPATH when
3230 enable_new_dtags is true.
3231
ec5b8187
AM
32322013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
3233
3234 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
3235 used in declaration and definition consistent.
3236 (Target_powerpc::symval_for_branch): Ditto.
3237
a880d4c4
ST
32382013-01-16 Sriraman Tallam <tmsriram@google.com>
3239
3240 * testsuite/plugin_final_layout.cc: Fix comment.
3241
7c381248
ST
32422013-01-16 Sriraman Tallam <tmsriram@google.com>
3243
3244 * layout.cc (Layout::layout): Do not do default sorting for
3245 text sections when section ordering is specified.
3246 (make_output_section): Ditto.
3247 * testsuite/plugin_final_layout.cc: Name the function sections
3248 to catch reordering issues.
3249
e2458743
AM
32502013-01-15 Alan Modra <amodra@gmail.com>
3251
3252 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
3253 plt-thread-safe.
3254
431ed302
AM
32552013-01-15 Alan Modra <amodra@gmail.com>
3256
3257 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
3258 * testsuite/Makefile.in: Regenerate.
3259
0ec6429b
AM
32602013-01-14 Alan Modra <amodra@gmail.com>
3261
3262 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
3263 * testsuite/Makefile.in: Regenerate.
3264
0bf402d5
ILT
32652013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
3266
36af3926 3267 PR bfd/14430
0bf402d5
ILT
3268 Fix mingw gold build with plugins enabled
3269 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
3270 * configure.ac: Export DLOPEN_LIBS and add headers check.
3271 * plugin.cc: Handle non-dlfcn case.
3272 * Makefile.in: Regenerate.
3273 * config.in: Regenerate.
3274 * configure: Regenerate.
3275 * testsuite/Makefile.in: Regenerate.
3276
9e9143bc
ST
32772013-01-09 Sriraman Tallam <tmsriram@google.com>
3278
3279 * output.h (sort_attached_input_sections): Change to be public.
3280 * script-sections.cc
3281 (Output_section_definition::set_section_addresses): Sort
3282 attached input sections according to section order before linker
3283 script assigns section addresses.
3284 (Orphan_output_section::set_section_addresses): Sort
3285 attached input sections according to section order before linker
3286 script assigns section addresses.
3287 * Makefile.am (final_layout.sh): Use a simple linker script to
3288 check if section ordering still works.
3289 * Makefile.in: Regenerate.
3290
679af368
ILT
32912013-01-09 Ben Cheng <bccheng@google.com>
3292
3293 * arm.cc (Target_arm::attributes_accept_div): New function.
3294 (Target_arm::attributes_forbid_div): New function.
3295 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
3296 attribute using the same new functions as what bfd/elf32_arm.c
3297 does.
3298
3136a00e
CC
32992013-01-07 Cary Coutant <ccoutant@google.com>
3300
3301 PR gold/14993
3302 * output.cc (Output_section::add_input_section): For incremental
3303 updates, don't track input sections that are allocated from patch
3304 space.
3305
f2a6224b
L
33062013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3307 Ian Lance Taylor <iant@google.com>
3308
3309 PR gold/14897
3310 * configure.ac (--enable-ld): Removed.
3311 (install_as_default): Set to yes only for --enable-gold=default
3312 or --disable-ld.
3313 * configure: Regenerated.
3314
4f46f626
L
33152013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3316
3317 * options.h (General_options): Add -fuse-ld= for GCC linker
3318 option compatibility.
3319
26e4ef59
CC
33202013-01-04 Cary Coutant <ccoutant@google.com>
3321
3322 * configure.ac: Fix typo restoring CXXFLAGS.
3323 * configure: Regenerate.
3324
3d587466
CC
33252013-01-04 Cary Coutant <ccoutant@google.com>
3326
4f46f626
L
3327 * testsuite/Makefile.am (CXXLINK_S): New macro.
3328 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
3329 * testsuite/Makefile.in: Regenerate.
3d587466 3330
44db6695
L
33312013-01-02 H.J. Lu <hongjiu.lu@intel.com>
3332
3333 * version.cc (print_version): Update copyright year to 2013.
3334
edcac0c1
ILT
33352012-12-20 Ian Lance Taylor <iant@google.com>
3336
3337 * layout.cc (Layout::special_ordering_of_input_section): New
3338 function.
3339 (Layout::layout): If input section requires special ordering, must
3340 sort input sections.
3341 (Layout::make_output_section): May sort .text input sections.
3342 (Layout::is_section_name_prefix_grouped): Remove.
3343 * layout.h (class Layout): Declare
3344 special_ordering_of_input_section. Don't declare
3345 is_section_name_prefix_grouped.
3346 * output.cc (Output_section::add_input_section): Revert last
3347 change.
3348 (Output_section::Input_section_sort::match_file_name): Don't crash
3349 if called on output section data.
3350 (Output_section::Input_section_sort_compare): Sort based on
3351 special ordering.
3352 (Output_section::Input_section_sort_section_order_index_compare):
3353 Revert last patch.
3354 (Output_section::sort_attached_input_sections): Likewise.
3355
28f2a4ac
ST
33562012-12-18 Sriraman Tallam <tmsriram@google.com>
3357
edcac0c1 3358 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
3359 * layout.h (Layout::is_section_name_prefix_grouped): New function.
3360 * output.cc (Output_section::add_input_section): Check if section
3361 name contains special prefix. Keep input sections to sort such
3362 sections.
3363 (Output_section::Input_section_sort_section_order_index_compare
3364 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
3365 (Output_section::sort_attached_input_sections): Add condition to
3366 Input_section_entry constructor call.
28f2a4ac
ST
3367 * testsuite/Makefile.am (text_section_grouping): New test.
3368 * testsuite/Makefile.in: Regenerate.
3369 * testsuite/text_section_grouping.cc: New file.
3370 * testsuite/text_section_grouping.sh: New file.
3371
5bf135a7
NC
33722012-12-17 Nick Clifton <nickc@redhat.com>
3373
3374 * Makefile.am: Add copyright notice.
3375 * NEWS: Likewise.
3376 * README: Likewise.
3377 * configure.ac: Likewise.
3378 * ftruncate.c: Likewise.
3379 * Makefile.in: Regenerate.
3380
59965708
CC
33812012-12-14 Cary Coutant <ccoutant@google.com>
3382
a4034750
AM
3383 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
3384 --no-as-needed flag.
3385 (exception_separate_shared_12_test): Likewise.
3386 (incremental_copy_test): Likewise.
3387 * testsuite/Makefile.in: Regenerate.
59965708 3388
2a77e2ab
CC
33892012-12-14 Cary Coutant <ccoutant@google.com>
3390
3391 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
3392 (Dwp_output_file::Dwp_index::enter_set): Add assert.
3393
e3deeb9c
AM
33942012-12-12 Alan Modra <amodra@gmail.com>
3395
3396 * powerpc.cc (class Track_tls): New.
3397 (class Relocate, class Scan): Inherit Track_tls.
3398 (Target_powerpc::Scan::local, global): Track tls optimization
3399 and avoid creating plt entry for __tls_get_addr if all uses
3400 are optimized away.
3401 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
3402
d8f5a274
AM
34032012-12-12 Alan Modra <amodra@gmail.com>
3404
3405 * options.h (General_options): Add --toc-sort/--no-toc-sort.
3406 Replace no_toc_optimize with toc_optimize.
3407 * output.h (Output_section::input_sections): Provide non-const variant.
3408 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
3409 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
3410 accessors.
3411 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
3412 (class Sort_toc_sections): New.
3413 (Target_powerpc::do_finalize_sections): Sort toc sections.
3414 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
3415
4c8a1de1
RM
34162012-12-10 Roland McGrath <mcgrathr@google.com>
3417
3418 * testsuite/binary_unittest.cc (read_all): New function.
3419 (Sized_binary_test): Use it instead of ::read.
3420 * fileread.cc (do_read): Don't assume pread always reads the whole
3421 amount in a single call.
3422
edc27beb
AM
34232012-12-10 Alan Modra <amodra@gmail.com>
3424
3425 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
3426 Set EM_PPC64 or EM_PPC here.
3427 (Target_selector_powerpc::do_recognize): Delete.
3428
906b9150
AM
34292012-12-10 Alan Modra <amodra@gmail.com>
3430
3431 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
3432 stub_table_.
3433 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
3434
418c15ae
RM
34352012-12-07 Roland McGrath <mcgrathr@google.com>
3436
3437 * testsuite/binary_unittest.cc (Sized_binary_test):
3438 Use open_descriptor rather than ::open.
3439
decdd3bc
AM
34402012-12-07 Alan Modra <amodra@gmail.com>
3441
3442 * powerpc.cc (Stub_table::do_write): Delete redundant Address
3443 typedef and invalid_address constant.
3444 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
3445 instantiate constants.
3446
db399005
ILT
34472012-12-06 Roland McGrath <mcgrathr@google.com>
3448
3449 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
3450 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
3451 * aclocal.m4: Regenerate.
3452 * configure: Regenerate.
3453 * Makefile.in: Regenerate.
3454 * testsuite/Makefile.in: Regenerate.
3455
aba6bc71
AM
34562012-12-07 Alan Modra <amodra@gmail.com>
3457
3458 * options.h (General_options): Add no_toc_optimize.
3459 * powerpc.cc (ok_lo_toc_insn): New function.
3460 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
3461
9e69ed50
AM
34622012-12-06 Alan Modra <amodra@gmail.com>
3463
3464 * options.h (General_options): Add plt_align, plt_static_chain,
3465 plt_thread_safe. Update stub_group_size help text.
3466 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
3467 for new plt_thread_safe_ var.
3468 (use_plt_offset): Correct comments.
3469 (Target_powerpc::do_relax): Look for thread creation symbols to
3470 determine default plt_thread_safe value. Clear plt call stubs
3471 as well as branch stubs each iteration.
3472 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
3473 insn constants.
3474 (l, hi, ha, write_insn): Move earlier.
3475 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
3476 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
3477 plt stubs too.
3478 (Stub_table::update_size): Adjust.
3479 (Stub_table::prev_size, set_prev_size): Delete.
3480 (Stub_table::stub_align): Let --plt-align affect result.
3481 (Stub_table::plt_call_size): Calculate sizes for various stubs.
3482 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
3483 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
3484 (Stub_table::do_write): Support more stub variants.
3485
f43ba157
AM
34862012-12-04 Alan Modra <amodra@gmail.com>
3487
3488 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
3489 (Target_powerpc::do_define_standard_symbols): New function.
3490
34171bc5
AM
34912012-12-03 Alan Modra <amodra@gmail.com>
3492
3493 * output.h: Formatting, whitespace.
3494
dc9589e9 34952012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
3496
3497 * layout.h (Layout::get_executable_sections): Declare.
3498 * layout.cc (Layout::get_executable_sections): New function.
3499 * arm.cc (Target_arm::group_sections): Use it.
3500 (Arm_output_section::group_sections): Delete now redundant test.
3501 * output.cc (Output_reloc::Output_reloc): Add is_relative.
3502 param to handle relative relocs.
3503 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
3504 (Output_data_reloc::add_absolute): Adjust.
3505 (Output_data_reloc::add_relative): New function.
3506 (Output_data::reset_data_size): New function.
3507 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
3508 (Output_section::set_addralign): New function.
3509 (Output_section::checkpoint_set_addralign): New function.
3510 (Output_section::clear_section_offsets_need_adjustment): New function.
3511 (Output_section::input_sections): Make public.
3512 * powerpc.cc (class Output_data_brlt_powerpc): New.
3513 (class Stub_table, class Stub_control): New.
3514 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
3515 stub_table_, set_stub_table, stub_table): New vectors and accessor
3516 functions.
3517 (Target_powerpc::do_may_relax, do_relax, push_branch,
3518 new_stub_table, stub_tables, brlt_section, group_sections,
3519 add_branch_lookup_table, find_branch_lookup_table,
3520 write_branch_lookup_table, make_brlt_section): New functions.
3521 (Target_powerpc::struct Sort_sections, class Branch_info): New.
3522 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
3523 branch_info_): New vars.
3524 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
3525 make call stubs here.
3526 (Output_data_glink): Remove all call stub handling from this class.
3527 (Target_powerpc::Scan::local, global): Save interesting branch
3528 relocs and relocs for ifunc. Adjust calls to plt entry functions.
3529 (Target_powerpc::do_finalize_sections): Only make reg save/restore
3530 functions on final link.
3531 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
3532 Handle long branch destinations too.
3533 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
3534 do_plt_address_for_local): Adjust lookup of plt call stubs.
3535
627b30b7
AM
35362012-11-30 Alan Modra <amodra@gmail.com>
3537
3538 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
3539 relocs against protected symbols when building 32-bit shared libs.
3540
40b469d7
AM
35412012-11-30 Alan Modra <amodra@gmail.com>
3542
3543 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
3544 param. Call got_section() to make .got. Update all callers
3545 and their callers and so on.
3546
bb66a627
AM
35472012-11-30 Alan Modra <amodra@gmail.com>
3548
3549 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
3550 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
3551 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
3552 value if it already exists.
3553
d2cf1c6c
L
35542012-11-19 H.J. Lu <hongjiu.lu@intel.com>
3555
3556 PR gold/14858
3557 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
3558
edccdf7c
RM
35592012-11-14 Roland McGrath <mcgrathr@google.com>
3560
3561 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
3562 than bfc instruction for data sandboxing.
3563
6febeb74
AM
35642012-11-08 Alan Modra <amodra@gmail.com>
3565
3566 * po/POTFILES.in: Regenerate.
3567
0a6f1bf2
AM
35682012-11-05 Alan Modra <amodra@gmail.com>
3569
3570 * configure.ac: Apply 2012-09-10 change to config.in here.
3571 * configure: Regenerate.
3572
26a4e9cb
AM
35732012-11-05 Alan Modra <amodra@gmail.com>
3574
3575 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
3576 (struct Opd_ent): Use "Address" rather than "Offset".
3577 (Output_data_got_powerpc::got_base_offset): Return Valtype.
3578 (Target_powerpc::got_section): Make public.
3579 (Target_powerpc::scan_relocs): Move code setting symbols..
3580 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
3581 Create _SDA_BASE_ only when referenced.
3582
cc928013
RM
35832012-11-02 Roland McGrath <mcgrathr@google.com>
3584
3585 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
3586 from last change.
3587
50ed5eb1
RM
35882012-11-01 Roland McGrath <mcgrathr@google.com>
3589
62fe925a
RM
3590 * target.h (Sized_target::relocate_relocs): Use Elf_Off
3591 for offset_in_output_section parameter.
3592 (Sized_target::relocate_special_relocatable): Likewise.
3593 * arm.cc (Target_arm::relocate_relocs): Likewise.
3594 (Target_arm::relocate_special_relocatable): Likewise.
3595 * i386.cc (Target_i386::relocate_relocs): Likewise.
3596 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
3597 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
3598 * target-reloc.h (relocate_relocs): Likewise.
3599 * testsuite/testfile.cc (Target_test): Likewise.
3600 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
3601 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
3602
3603 * system.h: Move inclusion of <clocale> to after <libintl.h> in
3604 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
3605
3606 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
3607 parameter, which is unused in the [!F_SETFD] case.
3608
50ed5eb1
RM
3609 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
3610 SYMNDX to off_t before comparing it to this->data_size().
3611 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
3612 * incremental.cc (Output_section_incremental_inputs::do_write):
3613 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
3614
2cadc0bf
RM
3615 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
3616
3bfcb652
NC
36172012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
3618
3619 * gold.cc (Target_arm::do_adjust_elf_header): Add the
3620 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
3621 in EABI_VER5.
3622
c1a8d56e
CC
36232012-10-29 Cary Coutant <ccoutant@google.com>
3624
3625 * dwp.cc (usage): Add file and exit status parameters;
3626 add --help and --version options.
3627 (print_version): New function.
3628 (main): Add --help and --version options.
3629
b2490a7b
L
36302012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3631
3632 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
3633 final_layout_sequence.txt.
3634 * testsuite/Makefile.in: Regenerated.
3635
aa543512
L
36362012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3637
3638 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
3639 COMPILE generated by automake.
3640 (LINK1): Likewise.
3641 (CXXCOMPILE1): Likewise.
3642 (CXXLINK1): Likewise.
3643 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
3644 (LINK): Likewise.
3645 (CXXCOMPILE): Likewise.
3646 (CXXLINK): Likewise.
3647 * testsuite/Makefile.in: Regenerated.
3648
d361fafb
L
36492012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3650
3651 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
3652 on bad fwrite return.
3653
598c7410
L
36542012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3655
3656 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
3657 on val.
3658
35c813e2
CC
36592012-10-23 Cary Coutant <ccoutant@google.com>
3660
3661 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
3662 * testsuite/Makefile.in: Regenerate.
3663 * testsuite/dwp_test.h: New source file.
3664 * testsuite/dwp_test_1.cc: New source file.
3665 * testsuite/dwp_test_1.s: New source file.
3666 * testsuite/dwp_test_1.sh: New source file.
3667 * testsuite/dwp_test_1b.cc: New source file.
3668 * testsuite/dwp_test_1b.s: New source file.
3669 * testsuite/dwp_test_2.cc: New source file.
3670 * testsuite/dwp_test_2.s: New source file.
3671 * testsuite/dwp_test_2.sh: New source file.
3672 * testsuite/dwp_test_main.cc: New source file.
3673 * testsuite/dwp_test_main.s: New source file.
3674
77429909
CC
36752012-10-23 Cary Coutant <ccoutant@google.com>
3676
3677 * dwp.h: New header file.
3678 * dwp.cc: New source file.
3679 * gold.h: Move shared declarations to system.h.
3680 * system.h: New header file.
3681 * Makefile.am: Add dwp.
3682 * Makefile.in: Regenerate.
3683
ed5d6712
CC
36842012-10-23 Cary Coutant <ccoutant@google.com>
3685
3686 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
3687 Dwarf_info_reader::read_from_pointer.
3688 (Dwarf_pubnames_table::read_header): Likewise.
3689 (Dwarf_pubnames_table::next_name): Likewise.
3690 (Dwarf_die::read_attributes): Likewise.
3691 (Dwarf_die::skip_attributes): Likewise.
3692 (Dwarf_info_reader::read_from_pointer): New function template.
3693 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
3694 (Dwarf_pubnames_table): Likewise.
3695 (Dwarf_info_reader::read_from_pointer): New function template.
3696 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
3697 Dwarf_pubnames_table ctor.
3698
8787852d
CC
36992012-10-23 Cary Coutant <ccoutant@google.com>
3700
3701 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
3702 abbrev_shndx.
3703 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
3704 abbrev_shndx_.
3705 (Dwarf_info_reader::set_abbrev_shndx): New method.
3706 (Dwarf_info_reader::abbrev_shndx_): New data member.
3707
9fc236f3
CC
37082012-10-23 Cary Coutant <ccoutant@google.com>
3709
3710 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
3711 from object, not parameters.
3712 (Dwarf_info_reader::parse): Likewise.
3713 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
3714 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
3715 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
3716 methods.
3717
effe8365
CC
37182012-10-23 Cary Coutant <ccoutant@google.com>
3719
3720 * fileread.cc (Input_file::Input_file): New constructor.
3721 * fileread.h (class Input_file): Add new constructor.
3722
1698990d
AM
37232012-10-18 Alan Modra <amodra@gmail.com>
3724
3725 PR gold/14727
3726 * object.cc (Relobj::is_section_name_included): Also match
3727 .sdata personality section.
3728
168a4726
AM
37292012-10-18 Alan Modra <amodra@gmail.com>
3730
3731 * target-reloc.h (class Default_comdat_behavior): New, package up..
3732 (get_comdat_behaviour): ..this.
3733 (relocate_section): Add Relocate_comdat_behavior template arg,
3734 adjust code to suit.
3735 * arm.cc (Target_arm::relocate_section): Adjust to suit.
3736 (Target_arm::scan_reloc_section): Likewise.
3737 * i386.cc (Target_i386::relocate_section): Likewise.
3738 * sparc.cc (Target_sparc::relocate_section): Likewise.
3739 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
3740 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
3741 * powerpc.cc (class Relocate_comdat_behavior): New.
3742 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
3743 gold::relocate_section with new template arg.
3744
acc276d8
AM
37452012-10-18 Alan Modra <amodra@gmail.com>
3746
3747 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
3748 dynamic relocs for GOT_TPREL got entries, without symbol if
3749 resolving locally.
3750 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
3751 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
3752 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
3753
e10f9870
AM
37542012-10-17 Alan Modra <amodra@gmail.com>
3755
3756 PR gold/14726
3757 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
3758
ae034989
ST
37592012-10-16 Sriraman Tallam <tmsriram@google.com>
3760
3761 * layout.cc (Layout::include_section): Keep sections marked
3762 SHF_EXCLUDE when doing relocatable links.
3763
f3a0ed29
AM
37642012-10-16 Alan Modra <amodra@gmail.com>
3765
3766 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
3767 (Target_powerpc::do_finalize_sections): Call it.
3768 (Output_data_save_res): New class and supporting functions.
3769 (Target_powerpc::symval_for_branch): Only look up .opd entry for
3770 normal symbols defined in object files.
3771
c6de8ed4
AM
37722012-10-12 Alan Modra <amodra@gmail.com>
3773
3774 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
3775 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
3776 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
3777 section if scan_opd_relocs not yet called.
3778 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
3779
03e25981
AM
37802012-10-12 Alan Modra <amodra@gmail.com>
3781
3782 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
3783 add_local_ifunc_entry): Revert last change.
3784 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
3785
c9824451
AM
37862012-10-05 Alan Modra <amodra@gmail.com>
3787
3788 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
3789 do_plt_address_for_global): New functions.
3790 (Output_data_got_powerpc::do_write): Don't segfault when linking
3791 statically.
3792 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
3793 add_local_ifunc_entry): Return true on adding entry..
3794 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
3795 glink->add_entry call. Remove unused symtab param. Adjust calls.
3796 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
3797 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
3798 set up symbols here.
3799 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
3800 syms here. Do so even when no .iplt. Don't segfault when linking
3801 statically.
3802 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
3803 new variants without reloc param.
3804 (Glink_sym_ent::Glink_sym_ent): Likewise.
3805 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
3806 reloc when refs will resolve to plt call stub.
3807 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
3808 R_PPC_PLTREL24 to resolve locally.
3809 (Target_powerpc::Scan::global): Correct ifunc handling.
3810 (Target_powerpc::Relocate::relocate): Correct local sym glink
3811 lookup. Don't destroy "value" when we have a plt call stub,
3812 and when checking plt call validity.
3813 (Target_powerpc::do_dynsym_value): Simplify.
3814
19fec8c1
AM
38152012-10-05 Alan Modra <amodra@gmail.com>
3816
3817 * i386.cc (Output_data_plt_i386::address_for_global,
3818 address_for_local): Add plt offset to returned value. Adjust uses.
3819 * sparc.cc (Output_data_plt_sparc::address_for_global,
3820 address_for_local): Likewise.
3821 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
3822 address_for_local): Likewise.
3823 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
3824 address_for_local): Likewise.
3825 * target.h (Target::plt_address_for_global, plt_address_for_local):
3826 Update comment.
3827 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
3828 (Output_data_got::Got_entry::write): Nor here.
3829 * output.h: Comment fix.
3830
e867b647
WL
38312012-10-02 Jiong Wang <jiwang@tilera.com>
3832
3833 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
3834 global_offset_table_ value for larget got.
3835 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
3836
e5d5f5ed
AM
38372012-09-29 Alan Modra <amodra@gmail.com>
3838
3839 * powerpc.cc (Target_powerpc::iplt_): New output section.
3840 (Target_powerpc::iplt_section, make_iplt_section,
3841 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
3842 (Target_powerpc::make_plt_entry): Handle ifunc syms.
3843 Target_powerpc::plt_entry_count): Count iplt entries too.
3844 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
3845 reloc section in constructor. New params.
3846 (Target_powerpc::make_plt_section): Create reloc section here instead.
3847 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
3848 functions.
3849 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
3850 (Output_data_glink::add_entry, find_entry): New functions to
3851 deal with local syms.
3852 (Glink_sym_ent): Add support for local syms.
3853 (Output_data_glink::do_write): Handle ifunc plt entries.
3854 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3855 (Target_powerpc::Scan::local, global): Handle ifunc syms.
3856 (Target_powerpc::Relocate::relocate): Likewise.
3857 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
3858
ec4dbad3
AM
38592012-09-25 Alan Modra <amodra@gmail.com>
3860
3861 * object.h (Sized_relobj_file::adjust_local_symbol,
3862 do_adjust_local_symbol): New functions.
3863 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
3864 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
3865 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
3866 and irregular opd entry spacing.
3867 (Powerpc_relobj::do_read_relocs): Add opd size checks.
3868 (Global_symbol_visitor_opd): New functor.
3869 (Target_powerpc::do_finalize_sections): Omit global symbols defined
3870 on deleted opd entries.
3871
5c0b3823
WL
38722012-09-15 Jiong Wang <jiwang@tilera.com>
3873
3874 * tilegx.cc: New file.
3875 * Makefile.am (TARGETSOURCES): Add tilegx.cc
3876 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
3877 * configure.tgt: Add entries for tilegx*.
3878 * configure.ac: Likewise.
3879 * Makefile.in: Rebuild.
3880 * configure: Likewise.
3881 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
3882 tilegx.
3883
bfdfa4cd
AM
38842012-09-13 Alan Modra <amodra@gmail.com>
3885
3886 * target-reloc.h (scan_relocs): Call scan.local for relocs
3887 against symbols in discarded sections. Pass is_discarded
3888 param.
3889 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
3890 Add is_discarded param.
3891 * powerpc (Target_powerpc::Scan::local): Likewise. Use
3892 is_discarded to flag opd entry as discarded. Don't emit dyn
3893 relocs on such entries.
3894 (Target_powerpc::Scan::global): Similarly detect and handle
3895 such opd entries.
3896 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
3897 opd_ent_. Update all uses.
3898 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
3899 (Target_powerpc::relocate_section): Zero out discarded opd
3900 entry relocs.
3901
d77a0555
ILT
39022012-09-12 Ian Lance Taylor <iant@google.com>
3903
3904 PR gold/14570
3905 * output.cc: Rename Output_data_got template parameter from size
3906 to got_size for all functions. Compile all variants of
3907 Output_data_got.
3908 (Output_data_got::Got_entry::write): Correct use of size for
3909 symbol value. Use local_is_tls rather than casting to
3910 Sized_relobj_file.
3911 * object.h (class Object): Add local_is_tls and do_local_is_tls.
3912 (class Sized_relobj_file): Add do_local_is_tls.
3913 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
3914
815a1205
AM
39152012-09-11 Alan Modra <amodra@gmail.com>
3916
3917 PR gold/14566
3918 * layout.cc (Layout::set_segment_offsets): When using
3919 common-page-size alignment, ensure we are on a new max-page-size
3920 page.
3921 * output.cc (Output_segment::set_section_addresses): Use
3922 abi_pagesize, not common_pagesize for relro boundary.
3923 (Output_segment::set_offset): Likewise.
3924
bd73a62d
AM
39252012-09-11 Alan Modra <amodra@gmail.com>
3926
3927 * output.h (Output_data_got::add_global_tls, add_local_tls,
3928 add_local_tls_pair): New functions.
3929 (Output_data_got::add_local_pair_with_rel): Remove second
3930 reloc param. Expand comment.
3931 (Output_data_got::Got_entry): Rename use_plt_offset_ to
3932 use_plt_or_tls_offset_, similarly for constructor param.
3933 (Output_data_got::Got_entry::write): Add got_index param.
3934 * output.cc (Output_data_got::add_global_tls, add_local_tls,
3935 add_local_tls_pair): New functions.
3936 (Output_data_got::Got_entry::write): Handle tls symbols
3937 with use_plt_or_tls_offset_ set specially.
3938 (Output_data_got::add_local_pair_with_rel): Only one reloc.
3939 (Output_data_got::do_write): Replace iterator with index, pass
3940 index to entry write function.
3941 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
3942 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
3943 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
3944 call.
3945 * i386.cc (Target_i386::Scan::local): Likewise.
3946 * sparc.cc (Target_sparc::Scan::local): Likewise.
3947 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
3948 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
3949 do_tls_offset_for_global): New functions.
3950 (Target_powerpc::Scan::local): Correct TLS relocations and got
3951 entry values.
3952 (Target_powerpc::Scan::global): Don't emit unnecessary
3953 dynamic relocations on TLS GOT entries.
3954
00716ab1
AM
39552012-09-10 Matthias Klose <doko@ubuntu.com>
3956
3957 * config.in: Disable sanity check for kfreebsd.
3958
c891b3f9
SA
39592012-09-10 Sterling Augustine <saugustine@google.com>
3960
3961 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
3962 (Gdb_index::pubtypes_read): New parameter.
3963 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
3964 to calls.
3965 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
3966 pubtypes_object_.
3967
e81fea4d
AM
39682012-09-09 Alan Modra <amodra@gmail.com>
3969
3970 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
3971 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
3972 * gc.h (gc_process_relocs): Call target gc_add_reference.
3973 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
3974 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
3975 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
3976 unnecessary cast.
3977 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
3978 to cater for when we don't need code offset. Update use.
3979 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
3980 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
3981 set_opd_valid): New functions.
3982 (Target_powerpc::do_gc_add_reference): New function.
3983 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
3984 stashed refs.
3985 (Target_powerpc::do_gc_mark_symbol): New function.
3986
d2d60eef
CC
39872012-09-06 Cary Coutant <ccoutant@google.com>
3988
3989 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
3990 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
3991 (Dwarf_die::skip_attributes): Likewise.
3992 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
3993 * testsuite/gdb_index_test.cc (inline_func_1): New function.
3994 (main): Call it.
3995 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
3996
32ed4573
L
39972012-09-05 H.J. Lu <hongjiu.lu@intel.com>
3998
3999 * testsuite/script_test_3.t: Add .got.plt output section
4000 statement.
4001 * testsuite/script_test_4.t: Likewise.
4002
f4baf0d4
AM
40032012-09-05 Alan Modra <amodra@gmail.com>
4004
4005 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
4006 update all uses and lose "enum" when using type.
4007
864a1b56
AM
40082012-09-05 Alan Modra <amodra@gmail.com>
4009
4010 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
4011 * configure: Regenerate.
4012 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
4013 (plugin_final_layout.stdout): Likewise.
4014 (memory_test): Set page sizes to 0x1000.
4015 * testsuite/Makefile.in: Regenerate.
4016 * testsuite/discard_locals_test.sh: Add FIXME comment.
4017 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
4018 * testsuite/pr14265.t: Add .got output section statement.
4019 * testsuite/script_test_2.t: Likewise.
4020 * testsuite/script_test_3.t: Likewise.
4021 * testsuite/script_test_4.t: Likewise.
4022 * testsuite/script_test_5.t: Likewise.
4023 * testsuite/script_test_6.t: Likewise.
4024 * testsuite/script_test_7.t: Likewise.
4025 * testsuite/script_test_9.t: Likewise.
4026
3ea0a085
AM
40272012-09-05 Alan Modra <amodra@gmail.com>
4028
4029 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
4030 (Powerpc_relocate_functions::Status): New typedef.
4031 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4032 (Target_powerpc::Scan::local): Handle REL64.
4033 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
4034 for REL32 and REL64.
4035 (Target_powerpc::symval_for_branch): New function, extracted from..
4036 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
4037 checks. Report overflow errors.
4038
7404fe1b
AM
40392012-09-05 Alan Modra <amodra@gmail.com>
4040
4041 * object.h (Sized_relobj_file::emit_relocs): Delete.
4042 (Sized_relobj_file::emit_relocs_reltype): Delete.
4043 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
4044 relocate_relocs for --emit-relocs.
4045 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
4046 * output.h: Update comment.
4047 (Output_segment::first_section): New function.
4048 (Output_segment::first_section_load_address): Use first_section.
4049 * output.cc (Output_segment::first_section): New function extracted..
4050 (Output_segment::first_section_load_address): ..from here. Delete.
4051 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
4052 * target.h (Sized_target::relocate_for_relocatable): Likewise.
4053 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
4054 adjust call to target.h function.
4055 * i386.cc (Target_i386): Likewise.
4056 * sparc.cc (Target_sparc): Likewise.
4057 * x86_64.cc (Target_x86_64): Likewise.
4058 * powerpc.cc (Target_powerpc): Likewise.
4059 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
4060 first tls section has section symbol for optimised local dynamic
4061 output relocs.
4062 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
4063 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
4064 optimised tls code.
4065 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
4066 Rename to relocate_relocs. Update error message.
4067
957564c9
AS
40682012-09-04 Andreas Schwab <schwab@linux-m68k.org>
4069
4070 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
4071 --just-symbols.
4072
dd93cd0a
AM
40732012-08-31 Alan Modra <amodra@gmail.com>
4074
4075 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
4076 (Powerpc_relobj::toc_base_offset): New stub function.
4077 (Target_powerpc): Add tp_offset, dtp_offset. Rename
4078 got_mod_index_offset to tlsld_got_offset. Update all refs.
4079 (Target_powerpc::Relocate::enum skip_tls): New.
4080 (Target_powerpc::call_tls_get_addr_): New var.
4081 (Target_powerpc::is_branch_reloc): Move to file scope.
4082 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
4083 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
4084 New functions.
4085 (Target_powerpc::enum Got_type): Delete old values, add new ones.
4086 (powerpc_info): Correct common_pagesize for ppc64.
4087 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
4088 (Powerpc_relocate_functions): Add overflow check enums and functions.
4089 Add non-shift version of rela, rela_ua. Delete all rel public
4090 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
4091 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
4092 addr16_ha3, addr14 functions.
4093 (Output_data_got_powerpc::add_constant_pair): New function.
4094 (Output_data_got_powerpc::got_base_offset): Likewise.
4095 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
4096 (instruction constants): Sort, add some more.
4097 (Output_data_glink::do_write): Add and use Address typedef. Use
4098 object->toc_base_offset() stub for 64-bit.
4099 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
4100 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4101 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
4102 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
4103 Always treat .opd relocs as against locally defined symbol.
4104 Correct condition for RELATIVE relocs.
4105 (Target_powerpc::do_finalize_sections): Test for NULL sections.
4106 (Target_powerpc::Relocate::relocate): Use plt call stub as value
4107 for 32-bit syms with a plt entry. Correct ppc64 toc base
4108 calculations. Handle TLS relocs, and more. Add overflow
4109 checking and adjust for Powerpc_relocate_functions changes.
4110 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
4111 Reinstate --emit-relocs code with FIXME.
4112
a1373b60
AM
41132012-08-30 Alan Modra <amodra@gmail.com>
4114
4115 * layout.cc (Layout::set_segment_offsets): Set p_align to
4116 abi_pagesize, not common_pagesize.
4117 (Layout::relaxation_loop_body): Similarly use abi_pagesize
4118 to determine whether file header can go in segment.
4119
703d02da
AM
41202012-08-30 Alan Modra <amodra@gmail.com>
4121
4122 * output.h (Output_reloc::Output_reloc <output section>): Add
4123 is_relative param. Adjust calls.
4124 (Output_reloc::add_output_section_relative): New functions.
4125 * output.cc (Output_reloc::Output_reloc <output section>): Handle
4126 is_relative.
4127 (Output_reloc::symbol_value): Handle SECTION_CODE.
4128
16164a6b
ST
41292012-08-24 Sriraman Tallam <tmsriram@google.com>
4130
4131 * gold.cc (queue_middle_tasks): Call layout again when unique
4132 segments for sections is desired.
4133 * layout.cc (Layout::Layout): Initialize new members.
4134 (Layout::get_output_section_flags): New function.
4135 (Layout::choose_output_section): Call get_output_section_flags.
4136 (Layout::layout): Make output section for mapping to a unique segment.
4137 (Layout::insert_section_segment_map): New function.
4138 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 4139 output sections marked so.
16164a6b
ST
4140 (Layout::segment_precedes): Check for unique segments when sorting.
4141 * layout.h (Layout::Unique_segment_info): New struct.
4142 (Layout::Section_segment_map): New typedef.
4143 (Layout::insert_section_segment_map): New function.
4144 (Layout::get_output_section_flags): New function.
4145 (Layout::is_unique_segment_for_sections_specified): New function.
4146 (Layout::set_unique_segment_for_sections_specified): New function.
4147 (Layout::unique_segment_for_sections_specified_): New member.
4148 (Layout::section_segment_map_): New member.
4149 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
4150 Rename is_gc_pass_one to is_pass_one.
4151 Rename is_gc_pass_two to is_pass_two.
4152 Rename is_gc_or_icf to is_two_pass.
4153 Check for which pass based on whether symbols data is present.
4154 Make it two pass when unique segments for sections is desired.
4155 * output.cc (Output_section::Output_section): Initialize new
4156 members.
4157 * output.h (Output_section::is_unique_segment): New function.
4158 (Output_section::set_is_unique_segment): New function.
4159 (Output_section::is_unique_segment_): New member.
4160 (Output_section::extra_segment_flags): New function.
4161 (Output_section::set_extra_segment_flags): New function.
4162 (Output_section::extra_segment_flags_): New member.
4163 (Output_section::segment_alignment): New function.
4164 (Output_section::set_segment_alignment): New function.
4165 (Output_section::segment_alignment_): New member.
4166 (Output_segment::Output_segment): Initialize is_unique_segment_.
4167 (Output_segment::is_unique_segment): New function.
4168 (Output_segment::set_is_unique_segment): New function.
4169 (Output_segment::is_unique_segment_): New member.
4170 * plugin.cc (allow_unique_segment_for_sections): New function.
4171 (unique_segment_for_sections): New function.
4172 (Plugin::load): Add new functions to transfer vector.
4173 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
4174 * Makefile.in: Regenerate.
4175 * testsuite/plugin_final_layout.sh: Check if unique segment
4176 functionality works.
4177 * testsuite/plugin_section_order.c (onload): Check if new interfaces
4178 are available.
4179 (allow_unique_segment_for_sections): New global.
4180 (unique_segment_for_sections): New global.
4181 (claim_file_hook): Call allow_unique_segment_for_sections.
4182 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 4183
1e2bee4f
CC
41842012-08-22 Cary Coutant <ccoutant@google.com>
4185
4186 * layout.cc (Layout::include_section): Don't assert on GROUP
4187 sections with --emit-relocs.
4188
1d5dfe78
CC
41892012-08-21 Cary Coutant <ccoutant@google.com>
4190
4191 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
4192 if --export-dynamic-symbol names an undef symbol.
4193
c9269dff
AM
41942012-08-18 Alan Modra <amodra@gmail.com>
4195
4196 * powerpc.cc: Formatting and white space.
4197 (Powerpc_relobj): Rename got2_section_ to special_.
4198 Add opd_ent_shndx_ and opd_ent_off_ vectors.
4199 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
4200 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
4201 (Target_powerpc): Add Address typedef and invalid_address. Use
4202 throughout.
4203 (Target_powerpc::is_branch_reloc): New function.
4204 (Powerpc_relocate_functions): Add Address typedef, use throughout.
4205 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
4206 for dst_mask, value and addend.
4207 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
4208 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
4209 (Output_data_glink::do_write): Correct toc base. Don't try to use
4210 uint16_t for 24-bit offset. Use get_output_section_offset and
4211 check return.
4212 (Target_powerpc::Scan::local): Handle more relocs.
4213 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
4214 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
4215 Plug in toc restoring insn after plt calls. Translate branches
4216 to function descriptor symbols to corresponding entry point.
4217 (Target_powerpc::relocate_for_relocatable): Check return from
4218 get_output_section_offset.
4219 * symtab.h: Comment typo.
4220
b1759dce
ILT
42212012-08-14 Ian Lance Taylor <iant@google.com>
4222
4223 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
4224 unsupported_relocal_local to call unsupported_reloc_global.
4225
b9b2ae8b
NC
42262012-08-14 Nick Clifton <nickc@redhat.com>
4227
4228 PR ld/14265
4229 * script-sections.cc (Sections_element::output_section_name): Add
4230 keep return parameter.
4231 (Output_section_element::match_name): Add keep return parameter.
4232 Return the value of the keep_ member.
4233 * script-sections.h (class Output_section): Update
4234 output_section_name prototype.
4235 * layout.cc (Layout::keep_input_section): New public member
4236 function.
4237 (Layout::choose_output_section): Pass keep parameter to
4238 output_section_name.
4239 * layout.h (class Layout): Add keep_input_section.
4240 * object.cc (Sized_relobj_file::do_layout): Check for kept input
4241 sections.
4242 * testsuite/Makefile.am: Add a test.
4243 * testsuite/Makefile.in: Regenerate.
4244 * testsuite/pr14265.c: Source file for the test.
4245 * testsuite/pr14265.t: Linker script for the test.
4246 * testsuite/pr14265.sh: Shell script for the test.
4247
921b5322
AM
42482012-08-14 Alan Modra <amodra@gmail.com>
4249
4250 * target.h (Target::output_section_name): New function.
4251 (Target::do_output_section_name): New function.
4252 * layout.cc (Layout::choose_output_section): Call the above.
4253 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
4254
6ce78956
AM
42552012-08-14 Alan Modra <amodra@gmail.com>
4256
4257 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
4258 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
4259 for replace_constant call.
4260 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
4261 (Output_data_glink::do_print_to_mapfile): New function.
4262 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
4263 (Target_powerpc::Relocate::relocate): Likewise.
4264
d1a8cabd
AM
42652012-08-14 Alan Modra <amodra@gmail.com>
4266
4267 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
4268 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
4269 (Output_data_glink::add_entry,find_entry): Remove shndx param.
4270 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
4271 all references to shndx_. Handle special case for R_PPC_PLTREL24
4272 here.
4273 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
4274 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
4275 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
4276 here.
4277 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
4278 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
4279
d83ce4e3
AM
42802012-08-12 Alan Modra <amodra@gmail.com>
4281
4282 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
4283 (glink insn constants): Use uint32_t.
4284 (Output_data_glink::add_entry): Use insert, not [] operator.
4285
cf43a2fe
AM
42862012-08-11 Alan Modra <amodra@gmail.com>
4287
4288 * object.h (Sized_relobj_file::find_shdr): New function.
4289 (Sized_relobj_file::find_special_sections): New function.
4290 * object.cc (Sized_relobj_file::find_shdr): New function.
4291 (Sized_relobj_file::find_eh_frame): Use find_shdr.
4292 (Sized_relobj_file::find_special_sections): New function, split out..
4293 (Sized_relobj_file::do_read_symbols): ..from here.
4294 * output.h (Output_data_got::replace_constant): New function.
4295 (Output_data_got::num_entries): New function.
4296 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
4297 (Output_data_got::got_offset): Protected rather than private.
4298 (Output_data_got::replace_got_entry): New function.
4299 * output.cc (Output_data_got::replace_got_entry): New function.
4300 * powerpc.cc (class Powerpc_relobj): New.
4301 (class Powerpc_relocate_functions): Delete all psymval variants or
4302 convert to value,addend type. Delete pcrela, pcrela_unaligned.
4303 Implement _ha functions using corresponding _hi function.
4304 (Powerpc_relobj::find_special_sections): New function.
4305 (Target_powerpc::do_make_elf_object): New function.
4306 (class Output_data_got_powerpc): New.
4307 (class Output_data_glink): New.
4308 (class Powerpc_scan_relocatable_reloc): New.
4309 Many more changes througout file.
4310
3c892704
NC
43112012-08-09 Nick Clifton <nickc@redhat.com>
4312
4313 * po/vi.po: Updated Vietnamese translation.
4314
82435b3b
ILT
43152012-08-07 Ian Lance Taylor <iant@google.com>
4316
4317 * layout.cc (Layout::add_target_dynamic_tags): If
4318 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
4319 plt_rel.
4320
a6dc81d2
NC
43212012-07-30 Nick Clifton <nickc@redhat.com>
4322
4323 * po/gold.pot: Updated template.
4324 * po/es.po: Updated Spanish translation.
4325
f1415016
CC
43262012-07-18 Cary Coutant <ccoutant@google.com>
4327
4328 PR gold/14344
4329 * configure.ac: Add check for -gpubnames support.
4330 * configure: Regenerate.
4331 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
4332 support; force -gno-pubnames.
4333 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
4334 support.
4335 (gdb_index_test_4): New test.
4336 * testsuite/Makefile.in: Regenerate.
4337 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
4338 * testsuite/gdb_index_test_2.sh: Likewise.
4339 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
4340 * testsuite/gdb_index_test_4.sh: New script.
4341 * testsuite/gdb_index_test_comm.sh: New script with common code;
4342 don't look for space after colon.
4343
b7fd7c37
ST
43442012-07-16 Sriraman Tallam <tmsriram@google.com>
4345
4346 * gold.cc (queue_middle_tasks): Update function order only after
4347 deferred objects due to plugins are processed.
4348
1f3212db
ILT
43492012-07-11 Ian Lance Taylor <iant@google.com>
4350
4351 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
4352 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
4353 (Target_arm::scan_reloc_for_stub): Likewise.
4354 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
4355 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
4356 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
4357 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
4358 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
4359
81c82a68
ILT
43602012-07-10 Dodji Seketeli <dodji@redhat.com>
4361 Ian Lance Taylor <iant@google.com>
4362
4363 PR gold/14309
4364 * configure.ac: Test whether std::tr1::hash<off_t> works.
4365 * gold.h: Add a specialization for std::tr1::hash<off_t> if
4366 needed.
4367 * output.h (class Output_fill): Add virtual destructor.
4368 * configure, config.in: Rebuild.
4369
eabc84f4
RM
43702012-06-22 Roland McGrath <mcgrathr@google.com>
4371
4372 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
4373
370e30b6
RÁE
43742012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
4375
4376 * plugin.cc (Plugin::load): Handle position independent executables.
4377
fb1b895d
CC
43782012-06-06 Cary Coutant <ccoutant@google.com>
4379
4380 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
4381 add .debug_macro.
4382 (lines_only_debug_sections): Likewise.
4383 (gdb_fast_lookup_sections): New static array.
4384 (is_gdb_debug_section): Rename formal parameter.
4385 (is_lines_only_debug_section): Likewise.
4386 (is_gdb_fast_lookup_section): New function.
4387 (Layout::include_section): Check for ".zdebug_" prefix; pass
4388 section name suffix to is_gdb_debug_section, et al.; check for
4389 fast-lookup sections when building .gdb_index.
4390 * options.h (--strip-debug-gdb): Update GDB version number.
4391
7c0640fa
CC
43922012-06-06 Cary Coutant <ccoutant@google.com>
4393
4394 * configure.ac: Add check for fallocate.
4395 * configure: Regenerate.
4396 * config.in: Regenerate.
4397
4398 * options.h (class General_options): Add --mmap-output-file and
4399 --posix-fallocate options.
4400 * output.cc: (posix_fallocate): Remove; replace with...
4401 (gold_fallocate): New function.
4402 (Output_file::map_no_anonymous): Call gold_fallocate.
4403 (Output_file::map): Check --mmap-output-file option.
4404
2a49eb69
DK
44052012-06-05 Jing Yu <jingyu@google.com>
4406
4407 * gold.h (textdomain): Add do {} to empty while(0).
4408 (bindtextdomain): Likewise.
4409
fad072ac
CC
44102012-06-04 Cary Coutant <ccoutant@google.com>
4411
4412 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
4413 has_dynsym_index.
4414
8cc69fb6
ST
44152012-05-25 Sriraman Tallam <tmsriram@google.com>
4416
4417 * symtab.cc (Symbol_table::define_special_symbol):
4418 Initialize *poldsym to prevent uninitialized variable errors.
4419
1be75daa
CC
44202012-05-23 Cary Coutant <ccoutant@google.com>
4421
4422 * layout.cc (Layout::section_name_mapping): Add rules to handle
4423 exact match on .data.rel.ro.local or .data.rel.ro.
4424 (Layout::output_section_name): Check for exact matches.
4425
9b689de0
CC
44262012-05-23 Cary Coutant <ccoutant@google.com>
4427
4428 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
4429 more carefully.
4430
b24fdbf5
CC
44312012-05-22 Cary Coutant <ccoutant@google.com>
4432
4433 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
4434 object before exporting symbol.
4435
e550e1a2
L
44362012-05-21 H.J. Lu <hongjiu.lu@intel.com>
4437
4438 * testsuite/tls_test.cc: Include "config.h" first.
4439 * testsuite/tls_test_c.c: Likewise.
4440
df7b86aa
NC
44412012-05-17 Daniel Richard G. <skunk@iskunk.org>
4442 Nick Clifton <nickc@redhat.com>
4443
4444 PR 14072
4445 * configure.in: Add check that sysdep.h has been included before
4446 any system header files.
4447 * configure: Regenerate.
4448 * config.in: Regenerate.
4449
1007b503
CC
44502012-05-14 Cary Coutant <ccoutant@google.com>
4451
4452 * layout.cc (Layout::make_output_section): Mark .tdata section
4453 as RELRO.
4454 * testsuite/relro_test.cc: Add a TLS variable.
4455
fd885f3a
L
44562012-05-10 H.J. Lu <hongjiu.lu@intel.com>
4457
4458 PR gold/14091
4459 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
4460 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
4461 R_X86_64_64.
4462
80f5885c
CC
44632012-05-08 Cary Coutant <ccoutant@google.com>
4464
4465 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
4466 (lines_only_debug_sections): Likewise.
4467
2e702c99
RM
44682012-05-02 Roland McGrath <mcgrathr@google.com>
4469
4470 * nacl.cc: New file.
4471 * nacl.h: New file.
4472 * Makefile.am (CCFILES, HFILES): Add them.
4473 * Makefile.in: Regenerate.
4474 * i386.cc (Output_data_plt_i386_nacl): New class.
4475 (Output_data_plt_i386_nacl_exec): New class.
4476 (Output_data_plt_i386_nacl_dyn): New class.
4477 (Target_i386_nacl): New class.
4478 (Target_selector_i386_nacl): New class.
4479 (target_selector_i386): Use it instead of Target_selector_i386.
4480 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
4481 (Target_x86_64_nacl): New class.
4482 (Target_selector_x86_64_nacl): New class.
4483 (target_selector_x86_64, target_selector_x32): Use it instead of
4484 Target_selector_x86_64.
4485 * arm.cc (Output_data_plt_arm_nacl): New class.
4486 (Target_arm_nacl): New class.
4487 (Target_selector_arm_nacl): New class.
4488 (target_selector_arm, target_selector_armbe): Use it instead of
4489 Target_selector_arm.
4490
4491 * target-select.cc (select_target): Take new Input_file* and off_t
4492 arguments, pass them on to recognize method of selector.
4493 * object.cc (make_elf_sized_object): Update caller.
4494 * parameters.cc (parameters_force_valid_target): Likewise.
4495 * incremental.cc (make_sized_incremental_binary): Likewise.
4496 * target-select.h: Update decl.
4497 (Target_selector::recognize): Take new Input_file* argument,
4498 pass it on to do_recognize.
4499 (Target_selector::do_recognize): Take new Input_file* argument.
4500 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
4501 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
4502 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
4503 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
4504
4505 * target.h (Target::Target_info): New members isolate_execinstr
4506 and rosegment_gap.
4507 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
4508 * arm.cc (Target_arm::arm_info): Update initializer.
4509 * i386.cc (Target_i386::i386_info): Likewise.
4510 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
4511 * sparc.cc (Target_sparc::sparc_info): Likewise.
4512 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
4513 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
4514 * layout.cc (Layout::attach_allocated_section_to_segment):
4515 Take new const Target* argument. If target->isolate_execinstr(), act
4516 like --rosegment.
4517 (Layout::find_first_load_seg): Take new const Target* argument;
4518 if target->isolate_execinstr(), reject PF_X segments.
4519 (Layout::relaxation_loop_body): Update caller.
4520 (Layout::set_segment_offsets): If target->isolate_execinstr(),
4521 reset file offset to zero when we hit LOAD_SEG, and then do a second
4522 loop over the segments before LOAD_SEG to reassign offsets after
4523 addresses have been determined. Handle target->rosegment_gap().
4524 (Layout::attach_section_to_segment): Take new const Target* argument;
4525 pass it to attach_allocated_section_to_segment.
4526 (Layout::make_output_section): Update caller.
4527 (Layout::attach_sections_to_segments): Take new const Target* argument;
4528 pass it to attach_section_to_segment.
4529 * gold.cc (queue_middle_tasks): Update caller.
4530 * layout.h (Layout): Update method decls with new arguments.
4531
4532 * arm.cc (Target_arm::Target_arm): Take optional argument for the
4533 Target_info pointer to use.
4534 (Target_arm::do_make_data_plt): New virtual method.
4535 (Target_arm::make_data_plt): New method that calls it.
4536 (Target_arm::make_plt_entry): Use it.
4537 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
4538 for the section alignment.
4539 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
4540 method.
4541 (Output_data_plt_arm::first_plt_entry_offset): Call it.
4542 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
4543 method.
4544 (Output_data_plt_arm::get_plt_entry_size): Call it.
4545 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
4546 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
4547 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
4548 method.
4549 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
4550 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
4551 method instead of sizeof(plt_entry).
4552 (Output_data_plt_arm::add_entry): Likewise.
4553 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
4554 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
4555 than static method.
4556 (Target_arm::plt_entry_size): Likewise.
4557 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
4558 Move to ...
4559 (Output_data_plt_arm_standard): ... here, new class.
4560 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
4561 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
4562 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
4563
4564 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
4565 Take additional argument for the PLT entry size.
4566 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
4567 Use get_plt_entry_size method rather than plt_entry_size variable.
4568 (Output_data_plt_x86_64::reserve_slot): Likewise.
4569 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
4570 (Output_data_plt_x86_64::add_entry): Likewise.
4571 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
4572 (Output_data_plt_x86_64::address_for_global): Likewise.
4573 (Output_data_plt_x86_64::address_for_local): Likewise.
4574 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4575 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
4576 Make method non-static.
4577 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
4578 method.
4579 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
4580 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
4581 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
4582 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
4583 virtual method.
4584 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
4585 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
4586 virtual method.
4587 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
4588 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
4589 virtual method.
4590 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
4591 (Output_data_plt_x86_64::plt_entry_size)
4592 (Output_data_plt_x86_64::first_plt_entry)
4593 (Output_data_plt_x86_64::plt_entry)
4594 (Output_data_plt_x86_64::tlsdesc_plt_entry)
4595 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
4596 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
4597 (Output_data_plt_x86_64_standard): ... here, new class.
4598 (Target_x86_64::Target_x86_64): Take optional argument for the
4599 Target_info pointer to use.
4600 (Target_x86_64::do_make_data_plt): New virtual method.
4601 (Target_x86_64::make_data_plt): New method to call it.
4602 (Target_x86_64::init_got_plt_for_update): Use that.
4603 Call this->plt_->add_eh_frame method here.
4604 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
4605 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
4606 rather than static method.
4607 (Target_x86_64::plt_entry_size): Likewise.
4608 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
4609 rather than plt_entry_size variable. Move guts of PLT filling to...
4610 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
4611 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
4612 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
4613
4614 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
4615 additional argument for the section alignment.
4616 Don't do add_eh_frame_for_plt here.
4617 (Output_data_plt_i386::first_plt_entry_offset): Make the method
4618 non-static. Use get_plt_entry_size method rather than plt_entry_size
4619 variable.
4620 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
4621 method.
4622 (Output_data_plt_i386::get_plt_entry_size): Call it.
4623 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
4624 (Output_data_plt_i386::add_eh_frame): New method to call it.
4625 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
4626 method.
4627 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
4628 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
4629 method.
4630 (Output_data_plt_i386::fill_plt_entry): New method to call it.
4631 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
4632 method instead of plt_entry_size.
4633 (Output_data_plt_i386::plt_entry_size)
4634 (Output_data_plt_i386::plt_eh_frame_fde_size)
4635 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
4636 (Output_data_plt_i386_standard): ... here, new class.
4637 (Output_data_plt_i386_exec): New class.
4638 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
4639 (Output_data_plt_i386_exec::first_plt_entry): ... here.
4640 (Output_data_plt_i386::exec_plt_entry): Move to ...
4641 (Output_data_plt_i386_exec::plt_entry): ... here.
4642 (Output_data_plt_i386_dyn): New class.
4643 (Output_data_plt_i386::first_plt_entry): Move to ...
4644 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
4645 (Output_data_plt_i386::dyn_plt_entry): Move to ...
4646 (Output_data_plt_i386_dyn::plt_entry): ... here.
4647 (Target_i386::Target_i386): Take optional argument for the Target_info
4648 pointer to use.
4649 (Target_i386::do_make_data_plt): New virtual method.
4650 (Target_i386::make_data_plt): New method to call it.
4651 (Target_i386::make_plt_section): Use that.
4652 Call this->plt_->add_eh_frame method here.
4653 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
4654 rather than plt_entry_size variable.
4655 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
4656 (Output_data_plt_i386::address_for_local): Likewise.
4657 (Output_data_plt_i386::do_write): Likewise.
4658 Move guts of PLT filling to...
4659 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
4660 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
4661 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
4662 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
4663
b9b9f2ee
CC
46642012-05-01 Cary Coutant <ccoutant@google.com>
4665
4666 * dwarf_reader.cc (Dwarf_die::read_attributes)
4667 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
4668 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
4669 * reduced_debug_output.cc
4670 (Output_reduced_debug_info_section::get_die_end): Remove
4671 DW_FORM_GNU_ref_index. Add default case.
4672
57923f48
MW
46732012-04-26 Mark Wielaard <mjw@redhat.com>
4674
4675 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
4676 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
4677 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
4678 DW_AT_high_pc as offset from DW_AT_low_pc.
4679
4680 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
4681 * testsuite/Makefile.in: Regenerate.
4682 * testsuite/gdb_index_test_3.c: New test source file.
4683 * testsuite/gdb_index_test_3.sh: New test source file.
4684
2c54b4f4
ILT
46852012-04-25 Ian Lance Taylor <iant@google.com>
4686
4687 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
4688 pointer.
4689 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
4690 as a class, not a struct.
4691 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
4692 (Target_arm::apply_cortex_a8_workaround): Likewise.
4693 * gc.h: Declare Reloc_types as a struct, not a class.
4694 * object.h: Declare Symbols_data as a struct.
4695 * reloc.h: Declare Read_relocs_data as a struct.
4696 * target.h: Declare Relocate_info as a struct.
4697
a5a5f7a3
DM
46982012-04-24 David S. Miller <davem@davemloft.net>
4699
4700 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
4701 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
4702 and R_SPARC_WPLT30.
4703
f038d496
CC
47042012-04-24 Cary Coutant <ccoutant@google.com>
4705
4706 * incremental-dump.cc (find_input_containing_global): Replace
4707 magic number with symbolic constant.
4708 (dump_incremental_inputs): Update version number.
4709 * incremental.cc (Output_section_incremental_inputs): Update version
4710 number; import symbolic constants from Incremental_inputs_reader.
4711 (Incremental_inputs::create_data_sections): Align relocations
4712 section correctly for 64-bit targets.
4713 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
4714 constants; add padding.
4715 (Output_section_incremental_inputs::write_header): Add assert for
4716 header_size.
4717 (Output_section_incremental_inputs::write_input_files): Add assert
4718 for input_entry_size.
4719 (Output_section_incremental_inputs::write_info_blocks): Add padding;
4720 add assert for object_info_size, input_section_entry_size,
4721 global_sym_entry_size.
4722 * incremental.h (Incremental_inputs_reader): Add symbolic constants
4723 for data structure sizes; use them.
4724 (Incremental_input_entry_reader): Import symbolic constants from
4725 Incremental_inputs_reader; use them.
4726
a4d85145
DM
47272012-04-23 David S. Miller <davem@davemloft.net>
4728
4729 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
4730 and elf_flags_set_.
4731 (Target_sparc::Target_sparc): Initialize new fields.
4732 (Target_sparc::do_make_elf_object): New function.
4733 (Target_sparc::do_adjust_elf_header): New function.
4734
1d509098
CC
47352012-04-23 Cary Coutant <ccoutant@google.com>
4736
4737 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
4738 CU range table of gdb index.
4739
7ebeff7f
DM
47402012-04-20 David S. Miller <davem@davemloft.net>
4741
4742 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
4743 instead of false.
4744
13cf9988
DM
47452012-04-16 David S. Miller <davem@davemloft.net>
4746
2a1079e8
DM
4747 * sparc.cc (Target_sparc::got_address): New function.
4748 (Sparc_relocate_functions::gdop_hix22): New function.
4749 (Sparc_relocate_functions::gdop_lox10): New function.
4750 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
4751 relocs.
4752 (Target_sparc::Scan::local): Likewise if the global symbol is not
4753 preemptible and is not IFUNC.
4754 (Target_sparc::Relocate::relocate): Perform GOTDATA code
4755 transformations for local and non-preemptible non-IFUNC global
4756 symbols.
4757
0bc964fc
DM
4758 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
4759 writing out 64-bit part of ranges.
4760
661d7a80
DM
4761 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
4762 -fpic and -fpie respectively.
4763 * Makefile.in: Regenerate.
4764
8c2bf391
DM
4765 * sparc.cc (class Target_sparc): Add rela_ifunc_.
4766 (Target_sparc::Target_sparc): Initialize new field.
4767 (Target_sparc::do_plt_section_for_global): New function.
4768 (Target_sparc::do_plt_section_for_local): New function.
4769 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
4770 (Target_sparc::make_plt_section): New function, broken out of
4771 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
4772 (Target_sparc::make_plt_entry): Call make_plt_section.
4773 (Target_sparc::make_local_ifunc_plt_entry): New function.
4774 (Target_sparc::rela_ifunc_section): New function.
4775 (Target_sparc::plt_section): Remove const.
4776 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
4777 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
4778 and ifunc_count_ fields.
4779 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
4780 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
4781 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
4782 (Output_data_plt_sparc::rela_ifunc): New function.
4783 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
4784 (Output_data_plt_sparc::has_ifunc_section): New function.
4785 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
4786 (Output_data_plt_sparc::address_for_global): New function.
4787 (Output_data_plt_sparc::address_for_local): New function.
4788 (Output_data_plt_sparc::plt_index_to_offset): New function.
4789 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
4790 and entry_count.
4791 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
4792 entry_count.
4793 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
4794 R_SPARC_JMP_IREL to switch.
4795 (Target_sparc::Scan::check_non_pic): Likewise.
4796 (Target_sparc::Scan::local): Handle IFUNC symbols.
4797 (Target_sparc::Scan::local): Likewise.
4798 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
4799 and plt_address_for_local.
4800 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
4801 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
4802
13cf9988
DM
4803 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
4804 (class Output_data_reloc): Adjust calls to Output_reloc_type.
4805 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
4806 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
4807 global relocs too.
4808 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
4809 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
4810 calls.
4811 * sparc.cc (Target_sparc::Scan::global): Likewise.
4812 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4813
31821be0
CC
48142012-04-16 Cary Coutant <ccoutant@google.com>
4815
4816 * archive.cc (Library_base::should_include_member): Check for
4817 --export-dynamic-symbol.
4818 * options.h (class General_options): Add --export-dynamic-symbol.
4819 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
4820 --export-dynamic-symbol.
4821 (Symbol_table::gc_mark_undef_symbols): Likewise.
4822 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
4823
2615994e
DM
48242012-04-12 David S. Miller <davem@davemloft.net>
4825
4826 * sparc.cc (Reloc::wdisp10): New relocation method.
4827 (Reloc::h34): Likewise.
4828 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
4829 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
4830 R_SPARC_WDISP10.
4831 (Target_sparc::Scan::local): Likewise.
4832 (Target_sparc::Scan::global): Likewise.
4833 (Target_sparc::Relocate::relocate): Likewise.
4834
6782735d
CC
48352012-04-09 Cary Coutant <ccoutant@google.com>
4836
4837 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
4838 low_pc == 0.
4839
8c7a0b00
ILT
48402012-04-06 Ian Lance Taylor <iant@google.com>
4841
4842 * timer.cc: #include <unistd.h>.
4843
58797674
RM
48442012-04-06 Roland McGrath <mcgrathr@google.com>
4845
4846 * configure.in (AC_CHECK_HEADERS): Add locale.h.
4847 * config.in: Regenerate.
4848 * configure: Regenerate.
4849
44350750
NC
48502012-04-05 Nick Clifton <nickc@redhat.com>
4851
4852 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
4853 (AM_LC_MESSAGES): Add.
4854 * aclocal.m4: Regenerate.
4855 * config.in: Regenerate.
4856 * configure: Regenerate.
4857
c1027032
CC
48582012-03-21 Cary Coutant <ccoutant@google.com>
4859
4860 * Makefile.am: Add gdb-index.cc, gdb-index.h.
4861 * Makefile.in: Regenerate.
4862 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
4863 (Sized_elf_reloc_mapper::symbol_section): New function.
4864 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
4865 (make_elf_reloc_mapper): New function.
4866 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
4867 (Dwarf_abbrev_table::do_read_abbrevs): New function.
4868 (Dwarf_abbrev_table::do_get_abbrev): New function.
4869 (Dwarf_ranges_table::read_ranges_table): New function.
4870 (Dwarf_ranges_table::read_range_list): New function.
4871 (Dwarf_pubnames_table::read_section): New function.
4872 (Dwarf_pubnames_table::read_header): New function.
4873 (Dwarf_pubnames_table::next_name): New function.
4874 (Dwarf_die::Dwarf_die): New function.
4875 (Dwarf_die::read_attributes): New function.
4876 (Dwarf_die::skip_attributes): New function.
4877 (Dwarf_die::set_name): New function.
4878 (Dwarf_die::set_linkage_name): New function.
4879 (Dwarf_die::attribute): New function.
4880 (Dwarf_die::string_attribute): New function.
4881 (Dwarf_die::int_attribute): New function.
4882 (Dwarf_die::uint_attribute): New function.
4883 (Dwarf_die::ref_attribute): New function.
4884 (Dwarf_die::child_offset): New function.
4885 (Dwarf_die::sibling_offset): New function.
4886 (Dwarf_info_reader::check_buffer): New function.
4887 (Dwarf_info_reader::parse): New function.
4888 (Dwarf_info_reader::do_parse): New function.
4889 (Dwarf_info_reader::do_read_string_table): New function.
4890 (Dwarf_info_reader::lookup_reloc): New function.
4891 (Dwarf_info_reader::get_string): New function.
4892 (Dwarf_info_reader::visit_compilation_unit): New function.
4893 (Dwarf_info_reader::visit_type_unit): New function.
4894 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
4895 Sized_elf_reloc_mapper.
4896 (Sized_dwarf_line_info::symbol_section): Remove function.
4897 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
4898 (Sized_dwarf_line_info::read_line_mappings): Remove object
4899 parameter, adjust callers.
4900 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
4901 * dwarf_reader.h: Include <sys/types.h>.
4902 (class Track_relocs): Remove forward declaration.
4903 (class Elf_reloc_mapper): New class.
4904 (class Sized_elf_reloc_mapper): New class.
4905 (class Dwarf_abbrev_table): New class.
4906 (class Dwarf_range_list): New class.
4907 (class Dwarf_ranges_table): New class.
4908 (class Dwarf_pubnames_table): New class.
4909 (class Dwarf_die): New class.
4910 (class Dwarf_info_reader): New class.
4911 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
4912 (Sized_dwarf_line_info::symbol_section): Remove member function.
4913 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
4914 base class.
4915 * gdb-index.cc: New source file.
4916 * gdb-index.h: New source file.
4917 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
4918 and .debug_types sections, call Layout::add_to_gdb_index.
4919 (Sized_relobj_incr::do_section_name): Implement.
4920 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
4921 return type; Implement.
4922 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
4923 return type.
4924 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
4925 parameter list and return type.
4926 (Sized_incr_dynobj::do_section_contents): Likewise.
4927 * layout.cc: Include gdb-index.h.
4928 (Layout::Layout): Initialize gdb_index_data_.
4929 (Layout::init_fixed_output_section): Check for .gdb_index section.
4930 (Layout::add_to_gdb_index): New function. Instantiate.
4931 * layout.h: Add forward declaration for class Gdb_index.
4932 (Layout::add_to_gdb_index): New member function.
4933 (Layout::gdb_index_data_): New data member.
4934 * main.cc: Include gdb-index.h.
4935 (main): Print statistics for gdb index.
4936 * object.cc (Object::section_contents): Move code into
4937 do_section_contents.
4938 (need_decompressed_section): Check for sections needed when building
4939 gdb index.
4940 (build_compressed_section_map): Likewise.
4941 (Sized_relobj_file::do_read_symbols): Need local symbols when building
4942 gdb index.
4943 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
4944 sections; call Layout::add_to_gdb_index.
4945 (Sized_relobj_file::do_decompressed_section_contents): Call
4946 do_section_contents directly.
4947 * object.h (Object::do_section_contents): Adjust parameter list and
4948 return type.
4949 (Object::do_decompressed_section_contents): Call do_section_contents
4950 directly.
4951 (Sized_relobj_file::do_section_contents): Adjust parameter list and
4952 return type.
4953 * options.h (class General_options): Add --gdb-index option.
4954 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
4955 list and return type.
4956 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
4957 * reloc.h (Track_relocs::checkpoint): New function.
4958 (Track_relocs::reset): New function.
4959
4960 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
4961 New test cases.
4962 * testsuite/Makefile.in: Regenerate.
4963 * testsuite/gdb_index_test.cc: New test source file.
4964 * testsuite/gdb_index_test_1.sh: New test source file.
4965 * testsuite/gdb_index_test_2.sh: New test source file.
4966
647f1574
DK
49672012-03-19 Doug Kwan <dougkwan@google.com>
4968
4969 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 4970 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
4971 __exidx_start and __exidx_end. Make symbol table parameter
4972 anonymous as it is not used.
4973 * gold.cc (queue_middle_tasks): Call target hook to define any
4974 target-specific symbols.
4975 * target.h (Target::define_standard_symbols): New method.
4976 (Target::do_define_standard_symbols): Same.
4977 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
4978 * testsuite/Makefile.in: Regenerate.
4979 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
4980 and __exidx_end.
4981 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
4982 relocations are generated for __exidx_start and __exidx_end.
4983
7c6109da
DK
49842012-03-16 Doug Kwan <dougkwan@google.com>
4985
4986 * testsuite/Makefile.am: Disable test initpri3b.
4987 * testsuite/Makefile.in: Regenerate.
4988
7b8957f8
DK
49892012-03-15 Doug Kwan <dougkwan@google.com>
4990
4991 * arm.cc (Target_arm::got_section): Make .got section read-only
4992 if -z now is given.
4993
14dc9ef7
ILT
49942012-03-15 Ian Lance Taylor <iant@google.com>
4995
4996 PR gold/13850
4997 * layout.cc (Layout::make_output_section): Correctly mark
4998 SHT_INIT_ARRAY, et. al., as relro.
4999
fa40b62a
DK
50002012-03-14 Doug Kwan <dougkwan@google.com>
5001
5002 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
5003 dynamic relocations for protected symbols in shared objects.
5004
fd325007
ILT
50052012-03-13 Ian Lance Taylor <iant@google.com>
5006
5007 * resolve.cc (Symbol_table::resolve): When merging common symbols,
5008 keep the larger alignment.
5009
e8dd54e1
CC
50102012-03-12 Cary Coutant <ccoutant@google.com>
5011
5012 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
5013 handling of DW_LNE_define_file.
5014
feb5f3b0
CC
50152012-03-12 Cary Coutant <ccoutant@google.com>
5016
5017 * reduced_debug_output.cc
5018 (Output_reduced_debug_info_section::get_die_end): Add new FORM
5019 codes to switch.
5020
a1fb4256
CC
50212012-02-29 Cary Coutant <ccoutant@google.com>
5022
5023 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
5024
5dd8762a
CC
50252012-02-29 Cary Coutant <ccoutant@google.com>
5026
5027 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
5028 Call Object::decompressed_section_contents.
5029 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
5030 New dtor.
5031 (Sized_dwarf_line_info::buffer_start_): New data member.
5032 * merge.cc (Output_merge_data::do_add_input_section): Call
5033 Object::decompressed_section_contents.
5034 (Output_merge_string::do_add_input_section): Likewise.
5035 * object.cc (need_decompressed_section): New function.
5036 (build_compressed_section_map): Decompress sections needed later.
5037 (Sized_relobj_file::do_decompressed_section_contents): New function.
5038 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5039 * object.h (Object::decompressed_section_contents): New function.
5040 (Object::discard_decompressed_sections): New function.
5041 (Object::do_decompressed_section_contents): New function.
5042 (Object::do_discard_decompressed_sections): New function.
5043 (Compressed_section_info): New type.
5044 (Compressed_section_map): Include decompressed section contents.
5045 (Sized_relobj_file::do_decompressed_section_contents): New function.
5046 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5047
7b5de7ee
CC
50482012-02-16 Cary Coutant <ccoutant@google.com>
5049
5050 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
5051 * testsuite/Makefile.in: Regenerate.
5052
f9fa4a63
CC
50532012-02-14 Cary Coutant <ccoutant@google.com>
5054
5055 * options.cc (General_options::finalize): Disallow -pie and -static.
5056
2c175ebc
DK
50572012-02-03 Doug Kwan <dougkwan@google.com>
5058
5059 * arm.cc (Arm_relocate_functions::abs8,
5060 Arm_relocate_functions::abs16): Use
5061 Bits::has_signed_unsigned_overflow32.
5062 (Arm_relocate_functions::thm_abs8): Correct range of
5063 overflow check.
5064 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
5065 in assertions.
5066
90cff06f
DK
50672012-02-02 Doug Kwan <dougkwan@google.com>
5068
5069 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
5070 position independent outputs, not just shared objects.
5071
63887f3d
L
50722012-01-30 H.J. Lu <hongjiu.lu@intel.com>
5073
5074 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
5075 * configure: Regenerated.
5076
bef2b434
ILT
50772012-01-27 Ian Lance Taylor <iant@google.com>
5078
5079 * reloc.h (Bits): New class with static functions, copied from
5080 namespace utils in arm.cc.
5081 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
5082 instead.
5083
c335b55d
L
50842012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5085
5086 * incremental.cc (write_info_blocks): Correct relocation offset.
5087
41194d9f
L
50882012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5089
5090 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
5091 (Relocate::tls_gd_to_le): Likewise.
5092
1bae613c
L
50932012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5094
5095 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
5096
24482ca0
L
50972012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5098
5099 * configure.ac: Check if -mcmodel=medium works.
5100 * configure: Regenerated.
5101
c2c7840a
CC
51022012-01-24 Cary Coutant <ccoutant@google.com>
5103
5104 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
5105 definition and ...
5106 (read_unsigned_LEB_128_x): ... this new function.
5107 (read_signed_LEB_128): Replaced with inline definition and ...
5108 (read_signed_LEB_128_x): ... this new function.
5109 * int_encoding.h (read_unsigned_LEB_128_x): New function.
5110 (read_unsigned_LEB_128): Add inline definition.
5111 (read_signed_LEB_128_x): New function.
5112 (read_signed_LEB_128): Add inline definition.
5113 * testsuite/Makefile.am (leb128_unittest): New unit test.
5114 * testsuite/Makefile.in: Regenerate.
5115 * testsuite/leb128_unittest.cc: New unit test.
5116
833de760 51172012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
5118
5119 PR gold/13617
5120 * i386.cc (Target_i386::do_code_fill): When using a jmp
5121 instruction, pad with nop instructions.
5122 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5123
618d6666
L
51242012-01-22 H.J. Lu <hongjiu.lu@intel.com>
5125
5126 * x86_64.cc (gc_process_relocs): Add typename on types used in
5127 template.
5128 (scan_relocs): Likewise.
5129 (relocate_section): Likewise.
5130 (apply_relocation): Likewise.
5131
3660ff06
L
51322012-01-10 H.J. Lu <hongjiu.lu@intel.com>
5133
5134 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
5135 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
5136 under x32.
5137
fc51264f
L
51382012-01-09 H.J. Lu <hongjiu.lu@intel.com>
5139
5140 * x86_64.cc: Initial support for x32.
5141
dd74ae06
CC
51422012-01-03 Cary Coutant <ccoutant@google.com>
5143
5144 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
5145 Use abstract base class for GOT.
5146 * gold/output.h (class Output_data_got_base): New abstract base class.
5147 (class Output_data_got): Derive from new base class, adjust ctors.
5148 (Output_data_got::reserve_slot): Make virtual; rename to
5149 do_reserve_slot; Adjust callers.
5150 * gold/target.h (Sized_target::init_got_plt_for_update): Return
5151 pointer to abstract base class.
5152 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
5153
83896202
ILT
51542011-12-18 Ian Lance Taylor <iant@google.com>
5155
5156 * object.h (Relobj::local_symbol_value): New function.
5157 (Relobj::local_plt_offset): New function.
5158 (Relobj::local_has_got_offset): New function.
5159 (Relobj::local_got_offset): New function.
5160 (Relobj::set_local_got_offset): New function.
5161 (Relobj::do_local_symbol_value): New pure virtual function.
5162 (Relobj::do_local_plt_offset): Likewise.
5163 (Relobj::do_local_has_got_offset): Likewise.
5164 (Relobj::do_local_got_offset): Likewise.
5165 (Relobj::do_set_local_got_offset): Likewise.
5166 (Sized_relobj::do_local_has_got_offset): Rename from
5167 local_has_got_offset.
5168 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
5169 (Sized_relobj::do_set_local_got_offset): Rename from
5170 set_local_got_offset.
5171 (Sized_relobj_file::do_local_plt_offset): Rename from
5172 local_plt_offset.
5173 (Sized_relobj_file::do_local_symbol_value): New function.
5174 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
5175 local_plt_offset.
5176 * output.cc (Output_data_got::Got_entry::write): Change object to
5177 Relobj. Use local_symbol_value.
5178 (Output_data_got::add_global_with_rel): Change rel_dyn to
5179 Output_data_reloc_generic*. Use add_global_generic.
5180 (Output_data_got::add_global_with_rela): Remove. Change all
5181 callers to use add_global_with_rel.
5182 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
5183 Output_data_reloc_generic*. Use add_global_generic.
5184 (Output_data_got::add_global_pair_with_rela): Remove. Change all
5185 callers to use add_global_pair_with_rel.
5186 (Output_data_got::add_local): Change object to Relobj*.
5187 (Output_data_got::add_local_plt): Likewise.
5188 (Output_data_got::add_local_with_rel): Change object to Relobj*,
5189 change rel_dyn to Output_data_reloc_generic*. Use
5190 add_local_generic.
5191 (Output_data_got::add_local_with_rela): Remove. Change all
5192 callers to use all_local_with_rel.
5193 (Output_data_got::add_local_pair_with_rel): Change object to
5194 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
5195 add_output_section_generic.
5196 (Output_data_got::add_local_pair_with_rela): Remove. Change all
5197 callers to use add_local_pair_with_rel.
5198 (Output_data_got::reserve_local): Change object to Relobj*.
5199 * output.h: (class Output_data_reloc_generic): Add pure virtual
5200 declarations for add_global_generic, add_local_generic,
5201 add_output_section_generic.
5202 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
5203 functions for Output_data_reloc_generic. Update declarations for
5204 changes listed in output.cc.
5205 (class Output_data_got): Change template parameter to got_size.
5206 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
5207 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
5208 function.
5209 (Sized_relobj_incr::do_local_plt_offset): New function.
5210 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
5211 add_global_generic.
5212
76677ad0
CC
52132011-12-17 Cary Coutant <ccoutant@google.com>
5214
5215 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
5216 * resolve.cc (Symbol_table::resolve): Likewise.
5217 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
5218 arrays.
5219 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5220
8b8dd8d5
ILT
52212011-12-16 Ian Lance Taylor <iant@google.com>
5222
5223 * output.h (Output_data_reloc_generic::add): Only call
5224 add_dynamic_reloc if this is a dynamic reloc section.
5225
d55525b9
L
52262011-12-15 H.J. Lu <hongjiu.lu@intel.com>
5227
5228 PR gold/13505
5229 * target-reloc.h (apply_relocation): Replace <64, false> with
5230 <size, big_endian>.
5231
ff81c7c1
NC
52322011-11-25 Nick Clifton <nickc@redhat.com>
5233
5234 * po/it.po: New Italian translation.
5235
628f39be
SA
52362011-11-17 Sterling Augustine <saugustine@google.com>
5237
5238 * script.cc (script_include_directive): Implement.
5239 (read_script_file): New local variables name and search_path. Update
5240 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
5241 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
5242 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
5243
98ef3ea4
SA
52442011-11-11 Sterling Augustine <saugustine@google.com>
5245
5246 * yyscript.y (section_cmd): Add support for INCLUDE directive.
5247 (file_or_sections_cmd): Likewise.
5248
f4a8b6d7
DK
52492011-11-11 Doug Kwan <dougkwan@google.com>
5250
5251 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
5252 if --just-symbols is given.
5253
29ab395d
DK
52542011-11-10 Doug Kwan <dougkwan@google.com>
5255
5256 PR gold/13362
5257 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
5258 when processing data relocs.
5259 * reloc.h (Relocate_functions::rel_unaligned): New method.
5260 (Relocate_functions::pcrel_unaligned): Ditto.
5261 (Relocate_functions::rel32_unaligned): Ditto.
5262 (Relocate_functions::pcrel32_unaligned): Ditto.
5263
2c339f71
DK
52642011-11-09 Doug Kwan <dougkwan@google.com>
5265
5266 PR gold/13362
5267 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
5268 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
5269 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
5270 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5271 (Relocate_functions::rel_unaligned): New.
5272 (Relocate_functions::rel32_unaligned): New.
5273 * target-reloc.h (relocate_for_relocatable): Add code to handle
5274 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5275 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
5276 arm_unaligned_reloc_r): New targets.
5277 * testsuite/Makefile.in: Regenerate.
5278 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
5279 linking.
5280
3f3cddf1
ILT
52812011-11-02 Ian Lance Taylor <iant@google.com>
5282
5283 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
5284 NATIVE_LINKER.
5285 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
5286 * options.cc (General_options::finalize): Use library search path
5287 from configure script if specified. If not native and no sysroot,
5288 only search TOOLLIBDIR.
5289 * options.h (Search_directory::Search_directory): Change name to
5290 const std::string&.
5291 (General_options::add_to_library_path_with_sysroot): Change arg to
5292 const std::string&.
5293 * configure, Makefile.in, config.in: Rebuild.
5294
a8e2273b
ILT
52952011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5296
5297 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
5298 we are working around the ARM1176 Erratum.
5299 * options.h (General_options::fix_arm1176): Add option.
5300 * testsuite/Makefile.am: Add testcases, and keep current ones
5301 working.
5302 * testsuite/Makefile.in: Regenerate.
5303 * testsuite/arm_fix_1176.s: New file.
5304 * testsuite/arm_fix_1176.sh: Likewise.
5305
cd6eab1c
ILT
53062011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5307
5308 * arm.cc (Target_arm::Target_arm): Remove initialisation of
5309 may_use_blx_.
5310 (Target_arm::may_use_blx): Remove method.
5311 (Target_arm::set_may_use_blx): Likewise.
5312 (Target_arm::may_use_v4t_interworking): New method.
5313 (Target_arm::may_use_v5t_interworking): Likewise.
5314 (Target_arm::may_use_blx_): Remove member variable.
5315 (Arm_relocate_functions::arm_branch_common): Check for v5T
5316 interworking.
5317 (Arm_relocate_functions::thumb_branch_common): Likewise.
5318 (Reloc_stub::stub_type_for_reloc): Likewise.
5319 (Target_arm::do_finalize_sections): Correct interworking checks.
5320 * testsuite/Makefile.am: Add new tests.
5321 * testsuite/Makefile.in: Regenerate.
5322 * testsuite/arm_farcall_arm_arm.s: New test.
5323 * testsuite/arm_farcall_arm_arm.sh: Likewise.
5324 * testsuite/arm_farcall_arm_thumb.s: Likewise.
5325 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
5326 * testsuite/arm_farcall_thumb_arm.s: Likewise.
5327 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
5328 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
5329 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
5330
286adcf4
CC
53312011-10-31 Cary Coutant <ccoutant@google.com>
5332
5333 PR gold/13023
5334 * expression.cc (Expression::eval_with_dot): Add
5335 is_section_dot_assignment parameter.
5336 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
5337 absolute and assigning to dot within a section.
5338 * script-sections.cc
5339 (Output_section_element_assignment::set_section_addresses): Pass
5340 dot_section to set_if_absolute.
5341 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
5342 as is_section_dot_assignment flag to eval_with_dot.
5343 (Output_section_element_dot_assignment::set_section_addresses):
5344 Likewise.
5345 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
5346 parameter. Also set value if relative to dot_section; set the
5347 symbol's output_section.
5348 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
5349 parameter. Adjust all callers.
5350 (Expression::eval_maybe_dot): Likewise.
5351 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
5352 Adjust all callers.
5353 * testsuite/script_test_2.t: Test assignment of an absolute value
5354 to dot within an output section element.
5355
9634ed06
CC
53562011-10-31 Cary Coutant <ccoutant@google.com>
5357
5358 * options.h (class General_options): Add --[no-]gnu-unique options.
5359 * symtab.cc (Symbol_table::sized_write_globals): Convert
5360 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
5361
de4101c7
CC
53622011-10-31 Cary Coutant <ccoutant@google.com>
5363
5364 PR gold/13359
5365 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
5366 unnecessary assertion.
5367 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
5368
7257cc92
ST
53692011-10-31 Sriraman Tallam <tmsriram@google.com>
5370
5371 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5372 gc_mark_symbol.
5373 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5374 gc_mark_symbol.
5375 Change to just keep the section associated with symbol.
5376 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
5377 they are externally visible and --export-dynamic is turned on.
5378 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
5379
bfc34b3f
ILT
53802011-10-19 Ian Lance Taylor <iant@google.com>
5381
5382 PR gold/13163
5383 * script-sections.cc
5384 (Output_section_element_dot_assignment::needs_output_section): New
5385 function.
5386
ea0d8c47
ILT
53872011-10-19 Ian Lance Taylor <iant@google.com>
5388
5389 PR gold/13204
5390 * layout.cc (Layout::segment_precedes): Don't assert failure if a
5391 --section-start option was seen.
5392 * options.h (General_options::any_section_start): New function.
5393
abd242a9
DM
53942011-10-18 David S. Miller <davem@davemloft.net>
5395
5396 PR binutils/13301
5397 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
5398 member to track relocation locations that have moved during TLS
5399 reloc optimizations.
5400 (Target_sparc::Relocate::Relocate): Initialize to NULL.
5401 (Target_sparc::Relocate::relocate): Adjust view down by 4
5402 bytes if it matches reloc_adjust_addr_.
5403 (Target_sparc::Relocate::relocate_tls): Always move the
5404 __tls_get_addr call delay slot instruction forward 4 bytes when
5405 performing relaxation.
5406
bab9090f
CC
54072011-10-18 Cary Coutant <ccoutant@google.com>
5408
5409 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
5410 (Output_file::map_no_anonymous): Check for non-zero
5411 return code from posix_fallocate.
5412
f7c5b166
CC
54132011-10-17 Cary Coutant <ccoutant@google.com>
5414
5415 PR gold/13245
5416 * plugin.cc (is_visible_from_outside): Check for symbols
5417 referenced from dynamic objects.
5418 * resolve.cc (Symbol_table::resolve): Don't count references
5419 from dynamic objects as references from real ELF files.
5420 * testsuite/plugin_test_2.sh: Adjust expected result.
5421
b490c0bb
CC
54222011-10-17 Cary Coutant <ccoutant@google.com>
5423
5424 * gold.cc: Include timer.h.
5425 (queue_middle_tasks): Stamp time.
5426 (queue_final_tasks): Likewise.
5427 * main.cc (main): Store timer in parameters. Print timers
5428 for each pass.
5429 * parameters.cc (Parameters::Parameters): Initialize timer_.
5430 (Parameters::set_timer): New function.
5431 (set_parameters_timer): New function.
5432 * parameters.h (Parameters::set_timer): New function.
5433 (Parameters::timer): New function.
5434 (Parameters::timer_): New data member.
5435 (set_parameters_timer): New function.
5436 * timer.cc (Timer::stamp): New function.
5437 (Timer::get_pass_time): New function.
5438 * timer.h (Timer::stamp): New function.
5439 (Timer::get_pass_time): New function.
5440 (Timer::pass_times_): New data member.
5441
f475cf7b
CC
54422011-10-17 Cary Coutant <ccoutant@google.com>
5443
5444 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
5445 task for members of lib groups.
5446
cdd7e244
CC
54472011-10-17 Cary Coutant <ccoutant@google.com>
5448
5449 PR gold/13288
4f95c8b4 5450 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
5451 (File_read::make_view): Move bounds check (replace with assert)...
5452 (File_read::find_or_make_view): ... to here.
5453
dfb45471
CC
54542011-10-12 Cary Coutant <ccoutant@google.com>
5455
4f95c8b4 5456 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
5457 ::read returns less than requested size.
5458
53bbcc1b
CC
54592011-10-10 Cary Coutant <ccoutant@google.com>
5460
4f95c8b4 5461 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
5462 Initialize defined_count_.
5463 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
5464 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
5465 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
5466 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
5467 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 5468 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
5469 member.
5470 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 5471 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
5472 Return zeroes instead of internal error.
5473
397b129b
CC
54742011-10-10 Cary Coutant <ccoutant@google.com>
5475
5476 PR gold/13249
4f95c8b4 5477 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 5478 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 5479 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
5480 (Output_reloc::type_): Adjust size of bit field.
5481 (Output_reloc::use_plt_offset_): New bit field.
5482 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
5483 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
5484 flag. Adjust all callers.
4f95c8b4 5485 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
5486 creating RELATIVE relocations.
5487
d5698657
NC
54882011-10-10 Nick Clifton <nickc@redhat.com>
5489
5490 * po/es.po: Updated Spanish translation.
5491 * po/fi.po: Updated Finnish translation.
5492
6a59a5c2
DN
54932011-10-03 Diego Novillo <dnovillo@google.com>
5494
5495 * options.cc (parse_uint): Fix dereference of RETVAL.
5496
f0558624
ST
54972011-09-29 Sriraman Tallam <tmsriram@google.com>
5498
5499 * layout.h (section_order_map_): New member.
5500 (get_section_order_map): New member function.
5501 * output.cc (Output_section::add_input_section): Check for patterns
5502 only when --section-ordering-file is specified.
5503 * gold.cc (queue_middle_tasks): Delay updating order of sections till
5504 output_sections have been formed.
5505 * layout.cc (Layout_Layout): Initialize section_order_map_.
5506 * plugin.cc (update_section_order): Store order in order_map. Do not
5507 update the order.
5508 * testsuite/Makefile.am: Add test case for plugin_final_layout.
5509 * testsuite/Makefile.in: Regenerate.
5510 * testsuite/plugin_section_order.c: New file.
5511 * testsuite/plugin_final_layout.cc: New file.
5512 * testsuite/plugin_final_layout.sh: New file.
5513
a7dac153
CC
55142011-09-29 Cary Coutant <ccoutant@google.com>
5515
4f95c8b4 5516 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 5517 Check for NULL.
4f95c8b4 5518 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
5519 symbols during incremental update.
5520 (Symbol_table::add_from_dynobj): Likewise.
5521
eebd87a5
ILT
55222011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5523 Ian Lance Taylor <iant@google.com>
5524
5525 * symtab.cc (Symbol_table::define_special_symbol): Always
5526 canonicalize version string.
5527
403a3331
CC
55282011-09-26 Cary Coutant <ccoutant@google.com>
5529
4f95c8b4
CC
5530 * gold.cc (queue_initial_tasks): Move option checks ...
5531 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
5532 some options; make others fatal.
5533
235061c2
CC
55342011-09-26 Cary Coutant <ccoutant@google.com>
5535
5536 gcc PR lto/47247
5537 * plugin.cc (get_symbols_v2): New function.
5538 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
5539 (is_referenced_from_outside): New function.
5540 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
5541 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
5542 (get_symbols): Pass version parameter.
5543 (get_symbols_v2): New function.
5544 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
5545 parameter.
5546 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
5547 (onload): Add LDPT_GET_SYMBOLS_V2.
5548 (all_symbols_read_hook): Use get_symbols_v2; check for
5549 LDPR_PREVAILING_DEF_IRONLY_EXP.
5550 * testsuite/plugin_test_3.sh: Update expected results.
5551
dc87f620
ILT
55522011-09-23 Simon Baldwin <simonb@google.com>
5553
5554 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
5555 configuration options.
5556 * configure: Regenerate.
5557 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
5558 * Makefile.in: Regenerate.
5559 * testsuite/Makefile.in: Regenerate.
5560
a8279f82
ST
55612011-09-19 Sriraman Tallam <tmsriram@google.com>
5562
5563 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
5564
0c9350c8
CC
55652011-09-19 Cary Coutant <ccoutant@google.com>
5566
5567 * incremental.cc (can_incremental_update): Fix typo in comment.
5568 * incremental.h (can_incremental_update): Likewise.
5569
aa06ae28
CC
55702011-09-18 Cary Coutant <ccoutant@google.com>
5571
5572 * incremental.cc (can_incremental_update): New function.
5573 * incremental.h (can_incremental_update): New function.
5574 * layout.cc (Layout::init_fixed_output_section): Call it.
5575 (Layout::make_output_section): Don't allow patch space in .eh_frame.
5576 * object.cc (Sized_relobj_file::do_layout): Call
5577 can_incremental_update.
5578
ebb300b2
CC
55792011-09-13 Cary Coutant <ccoutant@google.com>
5580
5581 * configure.ac: Check for glibc support for gnu_indirect_function
5582 support with static linking, setting automake conditional
5583 IFUNC_STATIC.
5584 * Makefile.in: Regenerate.
5585 * configure: Regenerate.
5586
5587 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
5588 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
5589 for IFUNC_STATIC.
5590 * testsuite/Makefile.in: Regenerate.
5591
1206d0d5
CC
55922011-09-13 Cary Coutant <ccoutant@google.com>
5593
5594 * incremental.cc (Sized_relobj_incr::do_layout): Call
5595 report_comdat_group for kept comdat sections.
5596 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
5597 * testsuite/Makefile.in: Regenerate.
5598 * testsuite/incr_comdat_test_1.cc: New source file.
5599 * testsuite/incr_comdat_test_2_v1.cc: New source file.
5600 * testsuite/incr_comdat_test_2_v2.cc: New source file.
5601 * testsuite/incr_comdat_test_2_v3.cc: New source file.
5602
40b29874
ILT
56032011-09-13 Ian Lance Taylor <iant@google.com>
5604
5605 * object.cc (Sized_relobj_file::do_layout): Remove unused local
5606 variable external_symbols_offset.
5607
1b045aac
ILT
56082011-09-12 Ian Lance Taylor <iant@google.com>
5609
5610 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
5611 triggered if object has no symbols.
5612
24c6c55a
DM
56132011-09-09 David S. Miller <davem@davemloft.net>
5614
5615 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
5616 (Output_fill_debug_line::do_write): Likewise.
5617
66570254
CC
56182011-08-29 Cary Coutant <ccoutant@google.com>
5619
5620 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
5621 casts to match formatting specs.
5622 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
5623
8ea8cd50
CC
56242011-08-26 Cary Coutant <ccoutant@google.com>
5625
5626 * layout.cc (Free_list::allocate): Provide guarantee of minimum
5627 remaining hole size when allocating.
5628 (Layout::make_output_section): Set fill methods for debug sections.
5629 * layout.h (Free_list::Free_list_node): Move from private to
5630 public.
5631 (Free_list::set_min_hole_size): New function.
5632 (Free_list::begin, Free_list::end): New functions.
5633 (Free_list::min_hole_): New data member.
5634 * output.cc: Include dwarf.h.
5635 (Output_fill_debug_info::do_minimum_hole_size): New function.
5636 (Output_fill_debug_info::do_write): New function.
5637 (Output_fill_debug_line::do_minimum_hole_size): New function.
5638 (Output_fill_debug_line::do_write): New function.
5639 (Output_section::Output_section): Initialize new data member.
5640 (Output_section::set_final_data_size): Ensure patch space is larger
5641 than minimum hole size.
5642 (Output_section::do_write): Fill holes in debug sections.
5643 * output.h (Output_fill): New class.
5644 (Output_fill_debug_info): New class.
5645 (Output_fill_debug_line): New class.
5646 (Output_section::set_free_space_fill): New function.
5647 (Output_section::free_space_fill_): New data member.
5648 * testsuite/Makefile.am (incremental_test_3): Add
5649 --incremental-patch option.
5650 (incremental_test_4): Likewise.
5651 (incremental_test_5): Likewise.
5652 (incremental_test_6): Likewise.
5653 (incremental_copy_test): Likewise.
5654 (incremental_common_test_1): Likewise.
5655 * testsuite/Makefile.in: Regenerate.
5656
7cf80422
NC
56572011-08-26 Nick Clifton <nickc@redhat.com>
5658
5659 * po/es.po: Updated Spanish translation.
5660
c3f7b0e5
CC
56612011-08-01 Cary Coutant <ccoutant@google.com>
5662
5663 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
5664 * gold/testsuite/Makefile.in: Regenerate.
5665 * gold/testsuite/justsyms_exec.c: New source file.
5666 * gold/testsuite/justsyms_lib.c: New source file.
5667
9590bf25
CC
56682011-08-01 Cary Coutant <ccoutant@google.com>
5669
5670 * layout.cc (Layout::set_segment_offsets): Don't realign text
5671 segment if -Ttext was specified.
5672 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
5673 file type.
5674 * object.h (Sized_relobj_file::e_type): New function.
5675 (Sized_relobj_file::e_type_): New data member.
5676 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
5677 base address for ET_EXEC files.
5678 * target.cc (Target::do_make_elf_object_implementation): Allow
5679 ET_EXEC files with --just-symbols option.
5680
dcd8d12e
CC
56812011-07-28 Cary Coutant <ccoutant@google.com>
5682
5683 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
5684 Add thread_number parameter.
5685 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
5686 * workqueue-threads.cc
5687 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
5688 current thread if its thread number is greater than desired thread
5689 count.
5690 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
5691 Add thread_number parameter.
5692 (Workqueue::should_cancel_thread): Likewise.
5693 (Workqueue::find_runnable_or_wait): Pass thread_number to
5694 should_cancel_thread.
5695 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
5696 parameter.
5697
804eb480
ST
56982011-07-22 Sriraman Tallam <tmsriram@google.com>
5699
5700 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
5701 only after checking if it cannot be forced local.
5702 * symtab.h (is_externally_visible): Check if the symbol is not forced
5703 local.
5704
f1ddb600
ILT
57052011-07-15 Ian Lance Taylor <iant@google.com>
5706
5707 * options.h (class General_options): Add --print-output-format.
5708 Move -EL next to -EB, for better --help output.
5709 * target-select.cc: Include <cstdio>, "options.h", and
5710 "parameters.h".
5711 (Target_selector::do_target_bfd_name): New function.
5712 (print_output_format): New function.
5713 * target-select.h (class Target_selector): Update declarations.
5714 (Target_selector::target_bfd_name): New function.
5715 (print_output_format): Declare.
5716 * main.cc: Include "target-select.h".
5717 (main): Handle --print-output-format.
5718 * gold.cc: Include "target-select.h".
5719 (queue_initial_tasks): Handle --print-output-format when there are
5720 no input files.
5721 * parameters.cc (parameters_force_valid_target): Give a better
5722 error message if -EB/-EL does not match target.
5723 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
5724 function.
5725
7d172687
ILT
57262011-07-15 Ian Lance Taylor <iant@google.com>
5727
5728 * i386.cc (class Output_data_plt_i386): Add layout_ field.
5729 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
5730 (Output_data_plt_i386::do_write): Write address of .dynamic
5731 section to first entry in .got.plt section.
5732 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
5733 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
5734 Initialize layout_.
5735 (Output_data_plt_x86_64::do_write): Write address of .dynamic
5736 section to first entry in .got.plt section.
5737 * layout.h (Layout::dynamic_section): New function.
5738
e9552f7e
ST
57392011-07-13 Sriraman Tallam <tmsriram@google.com>
5740
5741 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
5742 to claim_file call.
5743 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
5744 input_section_position_, and input_section_glob_.
5745 (read_layout_from_file): Call function section_ordering_specified.
5746 * layout.h (is_section_ordering_specified): New function.
5747 (section_ordering_specified): New function.
5748 (section_ordering_specified_): New boolean member.
5749 * main.cc(main): Call load_plugins after layout object is defined.
5750 * output.cc (Output_section::add_input_section): Use
5751 function section_ordering_specified to check if section ordering is
5752 needed.
5753 * output.cc (Output_section::add_relaxed_input_section): Use
5754 function section_ordering_specified to check if section ordering is
5755 needed.
5756 (Output_section::update_section_layout): New function.
5757 (Output_section::sort_attached_input_sections): Check if input section
5758 must be reordered.
5759 * output.h (Output_section::update_section_layout): New function.
5760 * plugin.cc (get_section_count): New function.
5761 (get_section_type): New function.
5762 (get_section_name): New function.
5763 (get_section_contents): New function.
5764 (update_section_order): New function.
58797674 5765 (allow_section_ordering): New function.
e9552f7e
ST
5766 (Plugin::load): Add the new interfaces to the transfer vector.
5767 (Plugin_manager::load_plugins): New parameter.
5768 (Plugin_manager::all_symbols_read): New parameter.
5769 (Plugin_manager::claim_file): New parameter. Save the elf object for
5770 unclaimed objects.
5771 (Plugin_manager::get_elf_object): New function.
5772 (Plugin_manager::get_view): Change to directly use the bool to check
5773 if get_view is called from claim_file_hook.
5774 * plugin.h (input_objects): New function
5775 (Plugin__manager::load_plugins): New parameter.
5776 (Plugin_manager::claim_file): New parameter.
5777 (Plugin_manager::get_elf_object): New function.
5778 (Plugin_manager::in_claim_file_handler): New function.
5779 (Plugin_manager::in_claim_file_handler_): New member.
5780 (layout): New function.
5781 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
5782 handler with an extra parameter. Make the elf object before calling
5783 claim_file handler.
5784 * testsuite/plugin_test.c (get_section_count): New function pointer.
5785 (get_section_type): New function pointer.
5786 (get_section_name): New function pointer.
5787 (get_section_contents): New function pointer.
5788 (update_section_order): New function pointer.
5789 (allow_section_ordering): New function pointer.
5790 (onload): Check if the new interfaces exist.
5791
9446efde
ILT
57922011-07-13 Ian Lance Taylor <iant@google.com>
5793
5794 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
5795 relro section.
5796 * x86_64.cc (Target_x86_64::got_section): Likewise.
5797 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
5798 (relro_now_test_SOURCES): New variable.
5799 (relro_now_test_DEPENDENCIES): New variable.
5800 (relro_now_test_LDFLAGS): New variable.
5801 (relro_now_test_LDADD): New variable.
5802 (relro_now_test.so): New target.
5803 * testsuite/Makefile.in: Rebuild.
5804
07aa62f2
ILT
58052011-07-12 Ian Lance Taylor <iant@google.com>
5806
5807 PR gold/12980
5808 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
5809 GLOB_DAT relocation rather than a RELATIVE relocation for a
5810 protected symbol when creating a shared library.
5811 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
5812 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
5813 * testsuite/protected_main_1.cc (main): Test that protected
5814 function has same address.
5815
e2153196
ILT
58162011-07-11 Ian Lance Taylor <iant@google.com>
5817
5818 PR gold/12979
5819 * options.h (class General_options): Add -Bgroup.
5820 * options.cc (General_options::finalize): If -Bgroup is set,
5821 default to --unresolved-symbols=report-all.
5822 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
5823 * target-reloc.h (issue_undefined_symbol_error): Handle
5824 --unresolved-symbols=report-all.
5825
6daf5215
ILT
58262011-07-08 Ian Lance Taylor <iant@google.com>
5827
5828 PR gold/11985
5829 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
5830 if linker script discards key sections.
5831 (Layout::create_dynamic_symtab): Likewise.
5832 (Layout::assign_local_dynsym_offsets): Likewise.
5833 (Layout::sized_create_version_sections): Likewise.
5834 (Layout::create_interp): Likewise.
5835 (Layout::finish_dynamic_section): Likewise.
5836 (Layout::set_dynamic_symbol_size): Likewise.
5837
beabb2c6
ILT
58382011-07-08 Ian Lance Taylor <iant@google.com>
5839
5840 PR gold/12386
5841 * options.h (class General_options): Add --unresolved-symbols.
5842 * target-reloc.h (issue_undefined_symbol_error): Check
5843 --unresolved-symbols. Add comments.
5844
9c16daf1
ILT
58452011-07-08 Ian Lance Taylor <iant@google.com>
5846
5847 * testsuite/odr_violation2.cc (Ordering::operator()): Make
5848 expression more complex.
5849
191f1a2d
ILT
58502011-07-08 Ian Lance Taylor <iant@google.com>
5851
5852 PR gold/11317
5853 * target-reloc.h (issue_undefined_symbol_error): New inline
5854 function, broken out of relocate_section.
5855 (relocate_section): Call issue_undefined_symbol_error.
5856 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
5857 there is no TLS segment if we are about to issue an undefined
5858 symbol error.
5859 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
5860
62855347
ILT
58612011-07-08 Ian Lance Taylor <iant@google.com>
5862
5863 PR gold/12279
5864 * resolve.cc (Symbol_table::should_override): Add fromtype
5865 parameter. Change all callers. Give error when linking together
5866 TLS and non-TLS symbol.
5867 (Symbol_table::should_override_with_special): Add fromtype
5868 parameter. Change all callers.
5869 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
5870 there is no TLS segment if we have reported some errors.
5871 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
5872
67181c72
ILT
58732011-07-08 Ian Lance Taylor <iant@google.com>
5874
5875 PR gold/12372
5876 * target.h (Target::plt_address_for_global): New function.
5877 (Target::plt_address_for_local): New function.
5878 (Target::plt_section_for_global): Remove.
5879 (Target::plt_section_for_local): Remove.
5880 (Target::do_plt_address_for_global): New virtual function.
5881 (Target::do_plt_address_for_local): New virtual function.
5882 (Target::do_plt_section_for_global): Remove.
5883 (Target::do_plt_section_for_local): Remove.
5884 (Target::register_global_plt_entry): Add Symbol_table and Layout
5885 parameters.
5886 * output.cc (Output_data_got::Got_entry::write): Use
5887 plt_address_for_global and plt_address_for_local.
5888 * layout.cc (Layout::add_target_dynamic_tags): Use size and
5889 address of output section.
5890 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
5891 got_irelative_, and irelative_count_ fields. Update
5892 declarations.
5893 (Output_data_plt_i386::has_irelative_section): New function.
5894 (Output_data_plt_i386::entry_count): Add irelative_count_.
5895 (Output_data_plt_i386::set_final_data_size): Likewise.
5896 (class Target_i386): Add got_irelative_ and rel_irelative_
5897 fields. Update declarations.
5898 (Target_i386::Target_i386): Initialize new fields.
5899 (Target_i386::do_plt_address_for_global): New function replacing
5900 do_plt_section_for_global.
5901 (Target_i386::do_plt_address_for_local): New function replacing
5902 do_plt_section_for_local.
5903 (Target_i386::got_section): Create got_irelative_.
5904 (Target_i386::rel_irelative_section): New function.
5905 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
5906 fields. Don't define __rel_iplt_{start,end}.
5907 (Output_data_plt_i386::add_entry): Add symtab and layout
5908 parameters. Change all callers. Use different PLT and GOT for
5909 IFUNC symbols.
5910 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
5911 layout parameters. Change all callers. Use different PLT and
5912 GOT.
5913 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
5914 (Output_data_plt_i386::rel_irelative): New function.
5915 (Output_data_plt_i386::address_for_global): New function.
5916 (Output_data_plt_i386::address_for_local): New function.
5917 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
5918 IRELATIVE GOT when changing IFUNC GOT entries.
5919 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
5920 reloc.
5921 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
5922 if we didn't create an IRELATIVE GOT.
5923 (Target_i386::Relocate::relocate): Use plt_address_for_global and
5924 plt_address_for_local.
5925 (Target_i386::do_dynsym_value): Use plt_address_for_global.
5926 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
5927 got_irelative_, and irelative_count_ fields. Update
5928 declarations.
5929 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
5930 Initialize new fields. Remove symtab parameter. Change all
5931 callers.
5932 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
5933 irelative_count_.
5934 (Output_data_plt_x86_64::has_irelative_section): New function.
5935 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
5936 (class Target_x86_64): Add got_irelative_ and rel_irelative_
5937 fields. Update declarations.
5938 (Target_x86_64::Target_x86_64): Initialize new fields.
5939 (Target_x86_64::do_plt_address_for_global): New function replacing
5940 do_plt_section_for_global.
5941 (Target_x86_64::do_plt_address_for_local): New function replacing
5942 do_plt_section_for_local.
5943 (Target_x86_64::got_section): Create got_irelative_.
5944 (Target_x86_64::rela_irelative_section): New function.
5945 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
5946 all callers. Don't create __rel_iplt_{start,end}.
5947 (Output_data_plt_x86_64::add_entry): Add symtab and layout
5948 parameters. Change all callers. Use different PLT and GOT for
5949 IFUNC symbols.
5950 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
5951 layout parameters. Change all callers. Use different PLT and
5952 GOT.
5953 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
5954 parameters. Change all callers. Use different PLT and GOT for
5955 IFUNC symbols.
5956 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
5957 (Output_data_plt_x86_64::rela_irelative): New function.
5958 (Output_data_plt_x86_64::address_for_global): New function.
5959 (Output_data_plt_x86_64::address_for_local): New function.
5960 (Output_data_plt_x86_64::set_final_data_size): Likewise.
5961 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
5962 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
5963 (Target_x86_64::register_global_plt_entry): Add symtab and layout
5964 parameters.
5965 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
5966 reloc.
5967 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
5968 symbols if we didn't create an IRELATIVE GOT.
5969 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
5970 plt_address_for_local.
5971 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
5972 * testsuite/ifuncvar1.c: New test file.
5973 * testsuite/ifuncvar2.c: New test file.
5974 * testsuite/ifuncvar3.c: New test file.
5975 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
5976 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
5977 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
5978 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
5979 * testsuite/Makefile.in: Rebuild.
5980
33c15b45
CC
59812011-07-07 Cary Coutant <ccoutant@google.com>
5982
5983 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
5984 (two_file_test_1_ndebug.o): Likewise.
5985 (two_file_test_1b_ndebug.o): Likewise.
5986 (two_file_test_2_ndebug.o): Likewise.
5987 (two_file_test_main_ndebug.o): Likewise.
5988 (incremental_test_2): Link with no-debug versions.
5989
f48b5fb7
CC
59902011-07-06 Cary Coutant <ccoutant@google.com>
5991
5992 * gold/incremental.cc
5993 (Output_section_incremental_inputs::write_info_blocks): Check for
5994 hidden and internal symbols.
5995
221597a5
CC
59962011-07-06 Cary Coutant <ccoutant@google.com>
5997
5998 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
5999 Check disposition for startup file.
6000 (Incremental_inputs::report_command_line): Ignore
6001 --incremental-startup-unchanged option.
6002 * options.cc (General_options::parse_incremental_startup_unchanged):
6003 New function.
6004 (General_options::General_options): Initialize new data member.
6005 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
6006 (General_options): Add --incremental-startup-unchanged option.
6007 (General_options::incremental_startup_disposition): New function.
6008 (General_options::incremental_startup_disposition_): New data member.
6009
e24719f6
CC
60102011-07-06 Cary Coutant <ccoutant@google.com>
6011
6012 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
6013 input file index to Script_info ctor.
6014 (Sized_incremental_binary::do_file_has_changed): Find the
6015 command-line argument for files named in scripts.
6016 * incremental.h (Script_info::Script_info): New ctor
6017 with input file index.
6018 (Script_info::input_file_index): New function.
6019 (Script_info::input_file_index_): New data member.
6020 (Incremental_binary::get_library): Add const.
6021 (Incremental_binary::get_script_info): Add const.
6022 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
6023 * testsuite/Makefile.am (incremental_test_5): New test case.
6024 (incremental_test_6): New test case.
6025 * testsuite/Makefile.in: Regenerate.
6026
8f7c81e8
CC
60272011-07-06 Cary Coutant <ccoutant@google.com>
6028
6029 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
6030 debug output when command lines differ.
6031
9fbd3822
CC
60322011-07-06 Cary Coutant <ccoutant@google.com>
6033
6034 * incremental.cc (Incremental_inputs::report_command_line): Ignore
6035 --incremental-patch option.
6036 * layout.cc (Free_list::allocate): Extend allocation beyond original
6037 end if enabled.
6038 (Layout::make_output_section): Mark sections that should get
6039 patch space.
6040 * options.cc (parse_percent): New function.
6041 * options.h (parse_percent): New function.
6042 (DEFINE_percent): New macro.
6043 (General_options): Add --incremental-patch option.
6044 * output.cc (Output_section::Output_section): Initialize new data
6045 members.
6046 (Output_section::add_input_section): Print section name when out
6047 of patch space.
6048 (Output_section::add_output_section_data): Likewise.
6049 (Output_section::set_final_data_size): Add patch space when
6050 doing --incremental-full.
6051 (Output_section::do_reset_address_and_file_offset): Remove patch
6052 space.
6053 (Output_segment::set_section_list_addresses): Print debug output
6054 only if --incremental-update.
6055 * output.h (Output_section::set_is_patch_space_allowed): New function.
6056 (Output_section::is_patch_space_allowed_): New data member.
6057 (Output_section::patch_space_): New data member.
6058 * parameters.cc (Parameters::incremental_full): New function.
6059 * parameters.h (Parameters::incremental_full): New function
6060 * testsuite/Makefile.am (incremental_test_2): Add test for
6061 --incremental-patch option.
6062 * testsuite/Makefile.in: Regenerate.
6063 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
6064 (t18): Remove function body.
6065
f6cccc2c
DK
60662011-07-05 Doug Kwan <dougkwan@google.com>
6067
6068 PR gold/12771
6069 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
6070 Arm_Address type for relocation result.
6071 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
6072 overflow check.
6073 (Arm_relocate_functions::abs32): Use unaligned access.
6074 (Arm_relocate_functions::rel32): Ditto.
6075 (Arm_relocate_functions::prel31): Ditto.
6076 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
6077 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
6078 static data relocations.
6079 * testsuite/Makefile.in: Regnerate.
6080 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
6081
28a13fec
ILT
60822011-07-05 Ian Lance Taylor <iant@google.com>
6083
6084 PR gold/12392
6085 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
6086 symbols if necessary.
6087 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6088
24d47b34
ILT
60892011-07-05 Ian Lance Taylor <iant@google.com>
6090
6091 PR gold/12952
6092 * resolve.cc (Symbol::override_base_with_special): Simply override
6093 version with special symbol version, ignoring previous version.
6094
41f9cbbe
ILT
60952011-07-05 Ian Lance Taylor <iant@google.com>
6096
6097 * object.cc (Sized_relobj_file::include_section_group): Add
6098 information to comment about signature location.
6099
886288f1
ILT
61002011-07-02 Ian Lance Taylor <iant@google.com>
6101
6102 PR gold/12957
6103 * options.h (class General_options): Add -f and -F.
6104 * options.cc (General_options::finalize): Fatal error if -f/-F
6105 are used without -shared.
6106 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
6107
ae3a6d4f
ILT
61082011-07-02 Ian Lance Taylor <iant@google.com>
6109
6110 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
6111
21131061
ILT
61122011-07-01 Ian Lance Taylor <iant@google.com>
6113
6114 PR gold/12525
6115 PR gold/12952
6116 * resolve.cc (Symbol::override_base_with_special): Don't override
6117 the version if the overriding symbol has a different name.
6118 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
6119 all callers. If we give an error about an undefined version,
6120 define the base version if necessary.
6121 * dynobj.h (class Versions): Update declaration.
6122 * testsuite/weak_alias_test_5.cc: New file.
6123 * testsuite/weak_alias_test.script: New file.
6124 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
6125 and versioned_alias have the right value, and call t2.
6126 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
6127 weak_alias_test_5.so.
6128 (weak_alias_test_LDADD): Likewise.
6129 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
6130 * testsuite/Makefile.in: Rebuild.
6131
611062c0
ILT
61322011-07-01 Ian Lance Taylor <iant@google.com>
6133
6134 PR gold/12525
6135 * options.h (class General_options): Support -z notext.
6136 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
6137 -Wl,-z,notext.
6138 (two_file_shared_nonpic.so): Likewise.
6139 (two_file_shared_mixed.so): Likewise.
6140 (two_file_shared_mixed_1.so): Likewise.
6141 (weak_undef_lib_nonpic.so): Likewise.
6142 (alt/weak_undef_lib_nonpic.so): Likewise.
6143 (tls_test_shared_nonpic.so): Likewise.
6144 * testsuite/Makefile.in: Rebuild.
6145
328c7c2f
ILT
61462011-07-01 Ian Lance Taylor <iant@google.com>
6147
6148 PR gold/12525
6149 * configure.ac: Test whether static linking works, setting
6150 the automake conditional HAVE_STATIC.
6151 * testsuite/Makefile.am: Disable tests using -static if
6152 HAVE_STATIC is not true.
6153 * configure, testsuite/Makefile.in: Rebuild.
6154
02d7cd44
ILT
61552011-07-01 Ian Lance Taylor <iant@google.com>
6156
6157 PR gold/12525
6158 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
6159 Assert if we see DW_EH_PE_indirect.
6160 * target.h (Target::ehframe_datarel_base): New function.
6161 (Target::do_ehframe_datarel_base): New target function.
6162 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
6163 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
6164 function.
6165
07a60597
ILT
61662011-07-01 Ian Lance Taylor <iant@google.com>
6167
6168 PR gold/12571
6169 * options.h (class General_options): Add
6170 --ld-generated-unwind-info.
6171 * ehframe.cc (Fde::write): Add address parameter. Change all
6172 callers. If associated with PLT, fill in address and size.
6173 (Cie::set_output_offset): Only add merge mapping if there is an
6174 object.
6175 (Cie::write): Add address parameter. Change all callers.
6176 (Eh_frame::add_ehframe_for_plt): New function.
6177 * ehframe.h (class Fde): Update declarations. Move shndx_ and
6178 input_offset_ fields into union u_, with new plt field.
6179 (Fde::Fde): Adjust for new union field.
6180 (Fde::Fde) [Output_data version]: New constructor.
6181 (Fde::add_mapping): Only add merge mapping if there is an object.
6182 (class Cie): Update declarations.
6183 (class Eh_frame): Declare add_ehframe_for_plt.
6184 * layout.cc (Layout::layout_eh_frame): Break out code into
6185 make_eh_frame_section, and call it.
6186 (Layout::make_eh_frame_section): New function.
6187 (Layout::add_eh_frame_for_plt): New function.
6188 * layout.h (class Layout): Update declarations.
6189 * merge.cc (Merge_map::add_mapping): Add assertion.
6190 * i386.cc: Include "dwarf.h".
6191 (class Output_data_plt_i386): Make first_plt_entry,
6192 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
6193 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6194 and plt_eh_frame_fde.
6195 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
6196 boundary. Call add_eh_frame_for_plt if appropriate.
6197 * x86_64.cc: Include "dwarf.h".
6198 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
6199 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
6200 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6201 and plt_eh_frame_fde.
6202 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
6203 appropriate.
6204
14788a3f
ILT
62052011-06-29 Ian Lance Taylor <iant@google.com>
6206
6207 PR gold/12629
6208 * object.cc (Sized_relobj_file::layout_section): Change shdr
6209 parameter to be const.
6210 (Sized_relobj_file::layout_eh_frame_section): New function, broken
6211 out of do_layout.
6212 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
6213 appropriate. Call layout_eh_frame_section.
6214 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
6215 sections.
6216 * object.h (class Sized_relobj_file): Update declarations.
6217
6c21fce1
ILT
62182011-06-29 Ian Lance Taylor <iant@google.com>
6219
37e41b03 6220 PR gold/12652
6c21fce1
ILT
6221 * script.cc (Token::integer_value): Accept trailing M/m/K/k
6222 modifier.
6223 (Lex::gather_token): Accept trailing M/m/K/k for integers.
6224
4d5e4e62
ILT
62252011-06-29 Ian Lance Taylor <iant@google.com>
6226
6227 PR gold/12675
6228 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
6229 SHT_X86_64_UNWIND.
6230 * layout.cc (Layout::layout_eh_frame): Likewise.
6231
886f533a
ILT
62322011-06-29 Ian Lance Taylor <iant@google.com>
6233
6234 PR gold/12695
6235 * layout.cc (Layout::symtab_section_shndx): New function.
6236 * layout.h (class Layout): Declare symtab_section_shndx.
6237 * output.cc (Output_section::write_header): Call it.
6238
f3ae1b28
ILT
62392011-06-29 Ian Lance Taylor <iant@google.com>
6240
6241 PR gold/12818
6242 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
6243 symbols which are not used in a relocation.
6244
aecf301f
ILT
62452011-06-28 Ian Lance Taylor <iant@google.com>
6246
6247 PR gold/12898
6248 * layout.cc (Layout::segment_precedes): Don't crash if a linker
6249 script create indistinguishable segments.
6250 (Layout::set_segment_offsets): Use stable_sort when sorting
6251 segments. Pass this to Compare_segments constructor.
6252 * layout.h (class Layout): Make segment_precedes non-static.
6253 (class Compare_segments): Change from struct to class. Add
6254 layout_ field. Add constructor.
6255 * script-sections.cc
6256 (Script_sections::attach_sections_using_phdrs_clause): Rename
6257 local orphan to is_orphan. Don't report failure to put empty
6258 section in segment. On attachment failure, report name of
6259 section, and attach to first PT_LOAD segment.
6260
03ef7571
ILT
62612011-06-28 Ian Lance Taylor <iant@google.com>
6262
6263 PR gold/12934
6264 * target-select.cc (Target_selector::Target_selector): Add
6265 emulation parameter. Change all callers.
6266 (select_target_by_bfd_name): Rename from select_target_by_name.
6267 Change all callers.
6268 (select_target_by_emulation): New function.
6269 (supported_emulation_names): New function.
6270 * target-select.h (class Target_selector): Add emulation_ field.
6271 Update declarations.
6272 (Target_selector::recognize_by_bfd_name): Rename from
6273 recognize_by_name. Change all callers.
6274 (Target_selector::supported_bfd_names): Rename from
6275 supported_names. Change all callers.
6276 (Target_selector::recognize_by_emulation): New function.
6277 (Target_selector::supported_emulations): New function.
6278 (Target_selector::emulation): New function.
6279 (Target_selector::do_recognize_by_bfd_name): Rename from
6280 do_recognize_by_name. Change all callers.
6281 (Target_selector::do_supported_bfd_names): Rename from
6282 do_supported_names. Change all callers.
6283 (Target_selector::do_recognize_by_emulation): New function.
6284 (Target_selector::do_supported_emulations): New function.
6285 (select_target_by_bfd_name): Change name in declaration.
6286 (select_target_by_emulation): Declare.
6287 (supported_emulation_names): Declare.
6288 * parameters.cc (parameters_force_valid_target): Try to find
6289 target based on emulation from -m option.
6290 * options.h (class General_options): Change doc string for -m.
6291 * options.cc (help): Print emulations.
6292 (General_options::parse_V): Likewise.
6293 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
6294 Add emulation parameter. Change all callers.
6295
200b2bb9
ILT
62962011-06-28 Ian Lance Taylor <iant@google.com>
6297
6298 * target.h (class Target): Add osabi_ field.
6299 (Target::osabi): New function.
6300 (Target::set_osabi): New function.
6301 (Target::Target): Initialize osabi_.
6302 (Target::do_adjust_elf_header): Make pure virtual.
6303 (Sized_target::do_adjust_elf_header): Declare.
6304 * target.cc (Sized_target::do_adjust_elf_header): New function.
6305 (class Sized_target): Instantiate all versions.
6306 * freebsd.h (class Target_freebsd): Remove.
6307 (Target_selector_freebsd::do_recognize): Call set_osabi on
6308 Target.
6309 (Target_selector_freebsd::do_recognize_by_name): Likewise.
6310 (Target_selector_freebsd::set_osabi): Remove.
6311 * i386.cc (class Target_i386): Inherit from Sized_target rather
6312 than Target_freebsd.
6313 * x86_64.cc (class Target_x86_64): Likewise.
6314
b3ce541e
ILT
63152011-06-28 Ian Lance Taylor <iant@google.com>
6316
6317 * target.h (Target::can_check_for_function_pointers): Rewrite.
6318 Make non-virtual.
6319 (Target::can_icf_inline_merge_sections): Likewise.
6320 (Target::section_may_have_icf_unsafe_poineters): Likewise.
6321 (Target::Target_info): Add can_icf_inline_merge_sections field.
6322 (Target::do_can_check_for_function_pointers): New virtual
6323 function.
6324 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
6325 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
6326 from can_check_for_function_pointers, move in file.
6327 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
6328 section_may_have_icf_unsafe_poineters, move in file.
6329 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
6330 * i386.cc (Target_i386::do_can_check_for_function_pointers):
6331 Rename from can_check_for_function_pointers, move in file.
6332 (Target_i386::can_icf_inline_merge_sections): Remove.
6333 (Target_i386::i386_info): Initialize
6334 can_icf_inline_merge_sections.
6335 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
6336 Initialize can_icf_inline_merge_sections.
6337 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
6338 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
6339 Rename from can_check_for_function_pointers, move in file.
6340 (Target_x86_64::can_icf_inline_merge_sections): Remove.
6341 (Target_x86_64::x86_64_info): Initialize
6342 can_icf_inline_merge_sections.
6343 * testsuite/testfile.cc (Target_test::test_target_info):
6344 Likewise.
6345 * icf.cc (get_section_contents): Correct formatting.
6346
6d1c4efb
ILT
63472011-06-27 Ian Lance Taylor <iant@google.com>
6348
6349 * symtab.cc (Symbol::versioned_name): New function.
6350 (Symbol_table::add_to_final_symtab): Use versioned_name when
6351 appropriate.
6352 (Symbol_table::sized_write_symbol): Likewise.
6353 * symtab.h (class Symbol): Declare versioned_name.
6354 * stringpool.h (class Stringpool_template): Add variant of add
6355 which takes a std::basic_string.
6356 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
6357 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
6358 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
6359 (ver_test_12.o): New target.
6360 * testsuite/Makefile.in: Rebuild.
6361
57eb9b50
DK
63622011-06-27 Doug Kwan <dougkwan@google.com>
6363
6364 * arm.cc (Arm_relocate_functions::thm_jump8,
6365 Arm_relocate_functions::thm_jump11): Use a wider signed
6366 type to compute offset.
6367 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
6368 arm_thm_jump8.
6369 * testsuite/Makefile.in: Regenerate.
6370 * testsuite/arm_branch_in_range.sh: Check test results of
6371 arm_thm_jump11 and arm_thm_jump8.
6372 * testsuite/arm_thm_jump11.s: New test source file.
6373 * testsuite/arm_thm_jump11.t: New linker script.
6374 * testsuite/arm_thm_jump8.s: New test source file.
6375 * testsuite/arm_thm_jump8.t: New linker script.
6376
487b39df
ILT
63772011-06-24 Ian Lance Taylor <iant@google.com>
6378
6379 * layout.cc: Include "object.h".
6380 (ctors_sections_in_init_array): New static variable.
6381 (Layout::is_ctors_in_init_array): New function.
6382 (Layout::layout): Add entry to ctors_sections_in_init_array if
6383 appropriate.
6384 * layout.h (class Layout): Declare is_ctors_in_init_array.
6385 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
6386 is_ctors_reverse_view is set.
6387 (Sized_relobj_file::write_sections): Add layout parameter. Change
6388 all callers. Set is_ctors_reverse_view field of View_size.
6389 (Sized_relobj_file::reverse_words): New function.
6390 * object.h (Sized_relobj_file::View_size): Add
6391 is_ctors_reverse_view field.
6392 (class Sized_relobj_file): Update declarations.
6393 * testsuite/initpri3.c: New test.
6394 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
6395 initpri3b.
6396 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
6397 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
6398 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
6399 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
6400 * testsuite/Makefile.in: Rebuild.
6401
472076e4
CC
64022011-06-24 Cary Coutant <ccoutant@google.com>
6403
6404 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
6405 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
6406 (debug_msg_cdebug.err): New targets.
6407 * testsuite/Makefile.in: Regenerate.
6408 * testsuite/debug_msg.sh: Check output of link with compressed debug.
6409 Fix checks for link with shared library.
6410
a60af0db
DK
64112011-06-24 Doug Kwan <dougkwan@google.com>
6412
6413 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
6414 skip empty text sections.
6415 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
6416
5393d741
ILT
64172011-06-22 Ian Lance Taylor <iant@google.com>
6418
6419 PR gold/12910
6420 * options.h (class General_options): Add --ctors-in-init-array.
6421 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
6422 friends as SHT_PROGBITS for merging sections.
6423 (Layout::layout): Remove special handling of .init_array and
6424 friends. Don't sort if doing relocatable link. Sort for .ctors
6425 and .dtors if ctors_in_init_array.
6426 (Layout::make_output_section): Force correct section types for
6427 .init_array and friends. Don't sort if doing relocatable link,
6428 Don't sort .ctors and .dtors if ctors_in_init_array.
6429 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
6430 (Layout::output_section_name): Add relobj parameter. Change all
6431 callers. Handle .ctors. and .dtors. in code rather than table.
6432 Handle .ctors and .dtors if ctors_in_init_array.
6433 (Layout::match_file_name): New function, moved from output.cc.
6434 * layout.h (class Layout): Update declarations.
6435 * output.cc: Include "layout.h".
6436 (Input_section_sort_entry::get_priority): New function.
6437 (Input_section_sort_entry::match_file_name): Just call
6438 Layout::match_file_name.
6439 (Output_section::Input_section_sort_init_fini_compare::operator()):
6440 Handle .ctors and .dtors. Sort by explicit priority rather than
6441 by name.
6442 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
6443 * testsuite/initpri2.c: New test.
6444 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
6445 (check_PROGRAMS): Add initpri2.
6446 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
6447 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
6448 * configure, testsuite/Makefile.in: Rebuild.
6449
e1f74f98
ILT
64502011-06-19 Ian Lance Taylor <iant@google.com>
6451
6452 PR gold/12880
6453 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
6454 .interp section to a PT_INTERP segment even if we have seen a
6455 --dynamic-linker option. Don't do it if we have seen a PHDRS
6456 clause in a linker script.
6457 (Layout::finalize): Don't create a .interp section if we've
6458 already create a PT_INTERP segment.
6459 (Layout::create_interp): Always call choose_output_section (revert
6460 patch of 2011-06-17). Don't create PT_INTERP segment.
6461 * script-sections.cc
6462 (Script_sections::create_note_and_tls_segments): Add a .interp
6463 section to a PT_INTERP segment even if we have seen a
6464 --dynamic-linker option.
6465
766f91bb
ILT
64662011-06-18 Ian Lance Taylor <iant@google.com>
6467
6468 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
6469 merely because a non-PT_LOAD segment has a dynamic reloc.
6470
0d212c3a
ILT
64712011-06-18 Ian Lance Taylor <iant@google.com>
6472
6473 * layout.cc (Layout::finish_dynamic_section): Don't create
6474 DT_FLAGS entry if not needed.
6475
911a5072
ILT
64762011-06-18 Ian Lance Taylor <iant@google.com>
6477
6478 PR gold/12745
6479 * layout.cc (Layout::layout_eh_frame): Correct handling of
6480 writable .eh_frame section.
6481
534b4e5f
ILT
64822011-06-17 Ian Lance Taylor <iant@google.com>
6483
6484 PR gold/12893
6485 * resolve.cc (Symbol_table::resolve): Don't give an error if a
6486 symbol is redefined with the exact same object and value.
6487
10b4f102
ILT
64882011-06-17 Ian Lance Taylor <iant@google.com>
6489
6490 PR gold/12880
6491 * layout.h (class Layout): Add interp_segment_ field.
6492 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
6493 (Layout::attach_allocated_section_to_segment): If making shared
6494 library, put .interp section in PT_INTERP segment.
6495 (Layout::finalize): Also call create_interp if -dynamic-linker
6496 option was used.
6497 (Layout::create_interp): Assert that there is no PT_INTERP
6498 segment. If not using a SECTIONS clause, use make_output_section.
6499 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
6500 * script-sections.cc
6501 (Script_sections::create_note_and_tls_segments): If making shared
6502 library, put .interp section in PT_INTERP segment.
6503
a29b0dad
ILT
65042011-06-17 Ian Lance Taylor <iant@google.com>
6505
e588ea8d
ILT
6506 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
6507 when making a shared library.
6508
65092011-06-17 Ian Lance Taylor <iant@google.com>
6510
6511 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
6512 parameter. Change all callers. Don't issue warning about PC32
6513 against locally defined symbol.
a29b0dad 6514
9d3b0698
ILT
65152011-06-16 Ian Lance Taylor <iant@google.com>
6516
6517 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
6518 occurs in same object.
6519
85b0f90c
AM
65202011-06-14 Alan Modra <amodra@gmail.com>
6521
6522 * po/POTFILES.in: Regenerate.
6523
a94907d9
ILT
65242011-06-09 Ian Lance Taylor <iant@google.com>
6525
6526 * script-sections.cc
6527 (Orphan_output_section::set_section_addresses): For a relocatable
6528 link set address to 0.
6529
4fb3a1c3
CC
65302011-06-09 Cary Coutant <ccoutant@google.com>
6531
6532 PR gold/12804
6533 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
6534 used with --compress-debug-sections.
6535 * gold/object.cc (Sized_relobj_file::do_layout): Report
6536 uncompressed size of compressed input sections.
6537
61220854
CC
65382011-06-08 Cary Coutant <ccoutant@google.com>
6539
6540 PR gold/12804
6541 * testsuite/two_file_test_2_v1.cc: Change initialization of
6542 v2 to keep it in .data.
6543
e6455dfb
CC
65442011-06-07 Cary Coutant <ccoutant@google.com>
6545
6546 * common.cc (Symbol_table::do_allocate_commons_list): Call
6547 gold_fallback.
6548 * errors.cc (Errors::fatal): Adjust call to gold_exit.
6549 (Errors::fallback): New function.
6550 (gold_fallback): New function.
6551 * errors.h (Errors::fallback): New function.
6552 * gold.cc (gold_exit): Change status parameter to enum; adjust
6553 all callers.
6554 (queue_initial_tasks): Call gold_fallback.
6555 * gold.h: Include cstdlib.
6556 (Exit_status): New enum type.
6557 (gold_exit): Change status parameter to enum.
6558 (gold_fallback): New function.
6559 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
6560 (Layout::create_symtab_sections): Likewise.
6561 (Layout::create_shdrs): Likewise.
6562 * main.cc (main): Adjust call to gold_exit.
6563 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
6564 (Output_data_got::add_got_entry_pair): Likewise.
6565 (Output_section::add_input_section): Likewise.
6566 (Output_section::add_output_section_data): Likewise.
6567 (Output_segment::set_section_list_addresses): Likewise.
6568 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
6569
fb0e076f
CC
65702011-06-07 Cary Coutant <ccoutant@google.com>
6571
6572 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
6573 for incremental links.
6574 * output.cc (Output_segment::set_section_list_addresses): Remove
6575 FIXME and test for TLS or BSS.
6576
a5ee4d5d
CC
65772011-06-07 Cary Coutant <ccoutant@google.com>
6578
6579 * testsuite/Makefile.am: Add incremental_copy_test,
6580 incremental_common_test_1.
6581 * testsuite/Makefile.in: Regenerate.
6582 * testsuite/common_test_1_v1.c: New source file.
6583 * testsuite/common_test_1_v2.c: New source file.
6584 * testsuite/copy_test_v1.cc: New source file.
6585
5146f448
CC
65862011-06-07 Cary Coutant <ccoutant@google.com>
6587
6588 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
6589 update, allocate common from bss section's free list.
6590 * incremental-dump.cc (dump_incremental_inputs): Print flag for
6591 linker-defined symbols.
6592 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
6593 Skip GOT and PLT entries that are no longer referenced.
6594 (Output_section_incremental_inputs::write_info_blocks): Mark
6595 linker-defined symbols.
6596 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
6597 * output.cc (Output_section::allocate): New function.
6598 * output.h (Output_section::allocate): New function.
6599 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
6600 linker-defined symbols.
6601 (Symbol::override_base_with_special): Copy is_predefined_ flag.
6602 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
6603 (Symbol::init_base_output_data): Likewise.
6604 (Symbol::init_base_output_segment): Likewise.
6605 (Symbol::init_base_constant): Likewise.
6606 (Sized_symbol::init_output_data): Likewise.
6607 (Sized_symbol::init_output_segment): Likewise.
6608 (Sized_symbol::init_constant): Likewise.
6609 (Symbol_table::do_define_in_output_data): Likewise.
6610 (Symbol_table::do_define_in_output_segment): Likewise.
6611 (Symbol_table::do_define_as_constant): Likewise.
6612 * symtab.h (Symbol::is_predefined): New function.
6613 (Symbol::init_base_output_data): Add is_predefined parameter.
6614 (Symbol::init_base_output_segment): Likewise.
6615 (Symbol::init_base_constant): Likewise.
6616 (Symbol::is_predefined_): New data member.
6617 (Sized_symbol::init_output_data): Add is_predefined parameter.
6618 (Sized_symbol::init_output_segment): Likewise.
6619 (Sized_symbol::init_constant): Likewise.
6620 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
6621
26d3c67d
CC
66222011-06-07 Cary Coutant <ccoutant@google.com>
6623
6624 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
6625 instead of emit_copy_reloc.
6626 (Copy_relocs::emit_copy_reloc): Refactor.
6627 (Copy_relocs::make_copy_reloc): New function.
6628 (Copy_relocs::add_copy_reloc): Remove.
6629 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
6630 section.
6631 (Copy_relocs::make_copy_reloc): New function.
6632 (Copy_relocs::add_copy_reloc): Remove.
6633 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
6634 unchanged input files.
6635 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
6636 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
6637 Reserve BSS space for COPY relocations.
6638 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6639 (Output_section_incremental_inputs::write_info_blocks): Record
6640 whether a symbol is copied from a shared object.
6641 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
6642 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
6643 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
6644 (Incremental_input_entry_reader::get_output_symbol_index): Add
6645 is_copy parameter.
6646 (Incremental_binary::emit_copy_relocs): New function.
6647 (Incremental_binary::do_emit_copy_relocs): New function.
6648 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6649 new data member.
6650 (Sized_incremental_binary::add_copy_reloc): New function.
6651 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6652 (Sized_incremental_binary::Copy_reloc): New struct.
6653 (Sized_incremental_binary::Copy_relocs): New typedef.
6654 (Sized_incremental_binary::copy_relocs_): New data member.
6655 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
6656 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
6657 * target.h (Sized_target::emit_copy_reloc): New function.
6658 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
6659
7cdb37d9
CC
66602011-06-02 Cary Coutant <ccoutant@google.com>
6661
6662 PR gold/12163
6663 * gold/archive.cc (Archive::Archive): Initialize new data member.
6664 (Archive::include_all_members): Return if archive has already been
6665 included.
6666 * gold/archive.h (Archive::include_all_members_): New data member.
6667
cc643b88
NC
66682011-06-02 Nick Clifton <nickc@redhat.com>
6669
6670 * dynobj.h: Fix spelling mistake in comment.
6671 * output.cc: Likewise.
6672
f62a3ca7 66732011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 6674 Asier Llano
f62a3ca7
DK
6675
6676 PR gold/12826
cc643b88 6677 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
6678 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
6679 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
6680 redundant arm_exidx_test.so.
6681 * testsuite/Makefile.in: Regenerate.
6682 (check_SCRIPTS): Add pr12826.sh
6683 (check_DATA): Add pr12826.stdout
6684 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
6685 * testsuite/pr12826.sh: New file.
6686 * testsuite/pr12826_1.s: Ditto.
6687 * testsuite/pr12826_1.s: Ditto.
6688
8dbe1edc
ILT
66892011-05-30 Ian Lance Taylor <iant@google.com>
6690
6691 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
6692 sections.
6693
c49875be
ILT
66942011-05-29 Ian Lance Taylor <iant@google.com>
6695
6696 PR gold/12804
6697 * testsuite/Makefile.am: Use different file name for two_file_test
6698 temporary file for each incremental test.
6699 * testsuite/Makefile.in: Rebuild.
6700
69d53f7a
ILT
67012011-05-29 Ian Lance Taylor <iant@google.com>
6702
6703 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
6704 binary input file is empty.
6705
41d0ab5f
ILT
67062011-05-27 Ian Lance Taylor <iant@google.com>
6707
6708 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
6709 (ver_test_9.so): Likewise.
6710 * testsuite/Makefile.in: Rebuild.
6711
89d8a36b
CC
67122011-05-26 Cary Coutant <ccoutant@google.com>
6713
6714 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
6715 * incremental.cc (Incremental_inputs::report_input_section): Fix
6716 comment, indentation.
6717 (Incremental_inputs::report_comdat_group): New function.
6718 (Output_section_incremental_inputs::set_final_data_size): Adjust size
6719 of data for incremental input file entry.
6720 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
6721 group count, COMDAT group signatures.
6722 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
6723 an unchanged input file.
6724 * incremental.h (Incremental_object_entry::Incremental_object_entry):
6725 Initialize new data member.
6726 (Incremental_object_entry::add_comdat_group): New function.
6727 (Incremental_object_entry::get_comdat_group_count): New function.
6728 (Incremental_object_entry::get_comdat_signature_key): New function.
6729 (Incremental_object_entry::groups_): New data member.
6730 (Incremental_inputs::report_comdat_group): New function.
6731 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
6732 data for incremental input file entry.
6733 (Incremental_input_entry_reader::get_comdat_group_count): New function.
6734 (Incremental_input_entry_reader::get_input_section): Adjust size of
6735 data for incremental input file entry.
6736 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
6737 (Incremental_input_entry_reader::get_comdat_group_signature): New
6738 function.
6739 * object.cc (Sized_relobj::include_section_group): Report kept
6740 COMDAT groups for incremental links.
6741
1706a06f
ILT
67422011-05-24 David Meyer <pdox@google.com>
6743
6744 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
6745 with name parameter. Add found_name parameter.
6746 * fileread.cc (Input_file::find_file): Adjust code accordingly.
6747 * dirsearch.h (class Dirsearch): Update declaration.
6748
a10ae760
ILT
67492011-05-24 Ian Lance Taylor <iant@google.com>
6750
6751 * archive.cc (Library_base::should_include_member): Pull in object
6752 from archive if it defines the entry symbol.
6753 * parameters.cc (Parameters::entry): New function.
6754 * parameters.h (class Parameters): Declare entry.
6755 * output.h (class Output_file_header): Remove entry_ field.
6756 * output.cc (Output_file_header::Output_file_header): Remove entry
6757 parameter. Change all callers.
6758 (Output_file_header::entry): Use parameters->entry.
6759 * gold.cc (queue_middle_tasks): Likewise.
6760 * plugin.cc (Plugin_hook::run): Likewise.
6761
aa92d6ed
CC
67622011-05-24 Cary Coutant <ccoutant@google.com>
6763
6764 * gold.cc (queue_initial_tasks): Pass incremental base filename
6765 to Output_file::open_base_file; don't print error message.
6766 * incremental-dump.cc (main): Adjust call to
6767 Output_file::open_for_modification.
6768 * incremental-dump.cc (main): Likewise.
6769 * incremental.cc (Incremental_inputs::report_command_line):
6770 Ignore --incremental-base option when comparing command lines.
6771 Ignore parameter when given as separate argument.
6772 * options.h (class General_options): Add --incremental-base.
6773 * output.cc (Output_file::Output_file):
6774 (Output_file::open_base_file): Add base_name and writable parameters;
6775 read base file into new file; print error message here.
6776 (Output_file::map_no_anonymous): Add writable parameter; adjust all
6777 callers.
6778 * output.h (Output_file::open_for_modification): Rename to...
6779 (Output_file::open_base_file): ...this; add base_name and
6780 writable parameters; adjust all callers.
6781 (Output_file::map_no_anonymous): Add writable parameter; adjust all
6782 callers.
6783 * testsuite/Makefile.am (incremental_test_4): Test
6784 --incremental-base.
6785 * testsuite/Makefile.in: Regenerate.
6786
2eedd706
CC
67872011-05-24 Cary Coutant <ccoutant@google.com>
6788
6789 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
6790 incremental_test_4.
6791 * testsuite/Makefile.in: Regenerate.
6792 * testsuite/two_file_test_1_v1.cc: New test source file.
6793 * testsuite/two_file_test_1b_v1.cc: New test source file.
6794 * testsuite/two_file_test_2_v1.cc: New test source file.
6795
0f1c85a6
CC
67962011-05-24 Cary Coutant <ccoutant@google.com>
6797
6798 * dynobj.h (Dynobj::do_dynobj): New function.
6799 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
6800 flag and soname for shared objects.
6801 * incremental.cc (Incremental_inputs::report_object): Make
6802 either Incremental_object_entry or Incremental_dynobj_entry; add
6803 soname to string table.
6804 (Incremental_inputs::report_input_section): Add assertion.
6805 (Output_section_incremental_inputs::set_final_data_size): Adjust
6806 type of input file entry for shared libraries; adjust size of
6807 shared library info entry.
6808 (Output_section_incremental_inputs::write_input_files): Write
6809 as_needed flag for shared libraries.
6810 (Output_section_incremental_inputs::write_info_blocks): Adjust type
6811 of input file entry for shared libraries; write soname.
6812 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
6813 soname from incremental info.
6814 * incremental.h (enum Incremental_input_flags): Add
6815 INCREMENTAL_INPUT_AS_NEEDED.
6816 (Incremental_input_entry::Incremental_input_entry): Initialize new
6817 data member.
6818 (Incremental_input_entry::set_as_needed): New function.
6819 (Incremental_input_entry::as_needed): New function.
6820 (Incremental_input_entry::do_dynobj_entry): New function.
6821 (Incremental_input_entry::as_needed_): New data member.
6822 (Incremental_object_entry::Incremental_object_entry): Don't check
6823 for shared library.
6824 (Incremental_object_entry::do_type): Likewise.
6825 (class Incremental_dynobj_entry): New class.
6826 (Incremental_input_entry_reader::as_needed): New function.
6827 (Incremental_input_entry_reader::get_soname): New function.
6828 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
6829 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
6830 size of shared library info entry.
58797674 6831 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
6832 incremental link when adding DT_NEEDED entries.
6833 * object.h (Object::Object): Initialize new data member.
6834 (Object::dynobj): New function.
6835 (Object::set_as_needed): New function.
6836 (Object::as_needed): New function.
6837 (Object::do_dynobj): New function.
6838 (Object::as_needed_): New data member.
6839
6fa2a40b
CC
68402011-05-24 Cary Coutant <ccoutant@google.com>
6841
6842 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
6843 info; adjust display of GOT entries.
6844 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
6845 vector of input objects; remove file_status_.
6846 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
6847 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
6848 got_plt reader; call target hooks to reserve GOT entries.
6849 (Output_section_incremental_inputs::set_final_data_size): Adjust size
6850 of input file info header and GOT info entry.
6851 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
6852 relocation info.
6853 (Got_plt_view_info::got_descriptor): Remove.
6854 (Got_plt_view_info::sym_index): New data member.
6855 (Got_plt_view_info::input_index): New data member.
6856 (Local_got_offset_visitor::visit): Write input file index.
6857 (Global_got_offset_visitor::visit): Write 0 for input file index.
6858 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
6859 with sym_index and input_index.
6860 (Output_section_incremental_inputs::write_got_plt): Adjust size of
6861 incremental info GOT entry; replace got_descriptor with input_index.
6862 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
6863 map from input file index to object.
6864 (Sized_relobj_incr::do_layout): Replace direct data member reference
6865 with accessor function.
6866 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
6867 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
6868 Adjust size of input file info header.
6869 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
6870 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
6871 (Incremental_input_entry_reader::get_input_section): Adjust size of
6872 input file info header.
6873 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
6874 of incremental info GOT entry.
6875 (Incremental_got_plt_reader::get_got_desc): Remove.
6876 (Incremental_got_plt_reader::get_got_symndx): New function.
6877 (Incremental_got_plt_reader::get_got_input_index): New function.
6878 (Sized_incremental_binary::Sized_incremental_binary): Remove
6879 file_status_; add input_objects_.
6880 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
6881 (Sized_incremental_binary::set_file_is_unchanged): Remove.
6882 (Sized_incremental_binary::file_is_unchanged): Remove.
6883 (Sized_incremental_binary::set_input_object): New function.
6884 (Sized_incremental_binary::input_object): New function.
6885 (Sized_incremental_binary::file_status_): Remove.
6886 (Sized_incremental_binary::input_objects_): New data member.
6887 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
6888 references.
6889 (Sized_relobj_incr::invalid_address): Move to base class.
6890 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
6891 class.
6892 (Sized_relobj_incr::do_output_section_offset): Likewise.
6893 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
6894 (Sized_relobj_incr::section_offsets_): Likewise.
6895 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
6896 function.
6897 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
6898 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
6899 with accessor function.
6900 (Sized_relobj_file::do_layout): Likewise.
6901 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
6902 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
6903 (Sized_relobj_file::compute_final_local_value): Replace refs to
6904 section_offsets_ with accessor function.
6905 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
6906 * object.h (Relobj::Relobj): Initialize new data members.
6907 (Relobj::add_dyn_reloc): New function.
6908 (Relobj::first_dyn_reloc): New function.
6909 (Relobj::dyn_reloc_count): New function.
6910 (Relobj::first_dyn_reloc_): New data member.
6911 (Relobj::dyn_reloc_count_): New data member.
6912 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
6913 references.
6914 (Sized_relobj::Address): New typedef.
6915 (Sized_relobj::invalid_address): Move here from child class.
6916 (Sized_relobj::Sized_relobj): Initialize new data members.
6917 (Sized_relobj::sized_relobj): New function.
6918 (Sized_relobj::is_output_section_offset_invalid): Move here from
6919 child class.
6920 (Sized_relobj::get_output_section_offset): Likewise.
6921 (Sized_relobj::local_has_got_offset): Likewise.
6922 (Sized_relobj::local_got_offset): Likewise.
6923 (Sized_relobj::set_local_got_offset): Likewise.
6924 (Sized_relobj::do_for_all_local_got_entries): Likewise.
6925 (Sized_relobj::clear_got_offsets): New function.
6926 (Sized_relobj::section_offsets): Move here from child class.
6927 (Sized_relobj::do_output_section_offset): Likewise.
6928 (Sized_relobj::do_set_section_offset): Likewise.
6929 (Sized_relobj::Local_got_offsets): Likewise.
6930 (Sized_relobj::local_got_offsets_): Likewise.
6931 (Sized_relobj::section_offsets_): Likewise.
6932 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
6933 references.
6934 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
6935 class.
6936 (Sized_relobj_file::sized_relobj): New function
6937 (Sized_relobj_file::local_has_got_offset): Move to base class.
6938 (Sized_relobj_file::local_got_offset): Likewise.
6939 (Sized_relobj_file::set_local_got_offset): Likewise.
6940 (Sized_relobj_file::get_output_section_offset): Likewise.
6941 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
6942 (Sized_relobj_file::do_output_section_offset): Likewise.
6943 (Sized_relobj_file::do_set_section_offset): Likewise.
6944 (Sized_relobj_file::Local_got_offsets): Likewise.
6945 (Sized_relobj_file::local_got_offsets_): Likewise.
6946 (Sized_relobj_file::section_offsets_): Likewise.
6947 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
6948 (all constructors).
6949 (set_needs_dynsym_index): Convert relobj to derived class pointer.
6950 (Output_reloc::get_symbol_index): Likewise.
6951 (Output_reloc::local_section_offset): Likewise.
6952 (Output_reloc::get_address): Likewise.
6953 (Output_reloc::symbol_value): Likewise.
6954 (Output_data_got::reserve_slot): Move to class definition.
6955 (Output_data_got::reserve_local): New function.
6956 (Output_data_got::reserve_slot_for_global): Remove.
6957 (Output_data_got::reserve_global): New function.
6958 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
6959 (all constructors, two instantiations).
6960 (Output_reloc::get_relobj): New function (two instantiations).
6961 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
6962 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
6963 (Output_data_reloc::add_global): Adjust type of relobj.
6964 (Output_data_reloc::add_global_relative): Likewise.
6965 (Output_data_reloc::add_symbolless_global_addend): Likewise.
6966 (Output_data_reloc::add_local): Likewise.
6967 (Output_data_reloc::add_local_relative): Likewise.
6968 (Output_data_reloc::add_symbolless_local_addend): Likewise.
6969 (Output_data_reloc::add_local_section): Likewise.
6970 (Output_data_reloc::add_output_section): Likewise.
6971 (Output_data_reloc::add_absolute): Likewise.
6972 (Output_data_reloc::add_target_specific): Likewise.
6973 (Output_data_got::reserve_slot): Move definition here.
6974 (Output_data_got::reserve_local): New function.
6975 (Output_data_got::reserve_global): New function.
6976 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
6977 section_offsets_ with accessor function.
6978 (Sized_relobj_file::write_sections): Likewise.
6979 (Sized_relobj_file::do_relocate_sections): Likewise.
6980 * target.h (Sized_target::reserve_local_got_entry): New function.
6981 (Sized_target::reserve_global_got_entry): New function.
6982 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
6983 (Target_x86_64::reserve_global_got_entry): New function.
6984 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
6985
4829d394
CC
69862011-05-23 Cary Coutant <ccoutant@google.com>
6987
6988 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
6989 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
6990 bit when checking got_type.
6991 * incremental.cc (Sized_incremental_binary::setup_readers):
6992 Store symbol table and string table locations; initialize bit vector
6993 of file status flags.
6994 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
6995 unchanged files.
6996 (Sized_incremental_binary::do_process_got_plt): New function.
6997 (Sized_incremental_binary::get_symtab_view): Use stored locations.
6998 (Output_section_incremental_inputs::set_final_data_size): Record
6999 file index for each input file.
7000 (Output_section_incremental_inputs::write_got_plt): Store file index
7001 instead of input entry offset for each GOT entry.
7002 * incremental.h
7003 (Incremental_input_entry::Incremental_input_entry): Initialize new
7004 data member.
7005 (Incremental_input_entry::set_offset): Store file index.
7006 (Incremental_input_entry::get_file_index): New function.
7007 (Incremental_input_entry::file_index_): New data member.
7008 (Incremental_binary::process_got_plt): New function.
7009 (Incremental_binary::do_process_got_plt): New function.
7010 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7011 data members.
7012 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
7013 (Sized_incremental_binary::set_file_is_unchanged): New function.
7014 (Sized_incremental_binary::file_is_unchanged): New function.
7015 (Sized_incremental_binary::do_process_got_plt): New function.
7016 (Sized_incremental_binary::file_status_): New data member.
7017 (Sized_incremental_binary::main_symtab_loc_): New data member.
7018 (Sized_incremental_binary::main_strtab_loc_): New data member.
7019 * output.cc (Output_data_got::Got_entry::write): Add case
7020 RESERVED_CODE.
7021 (Output_data_got::add_global): Call add_got_entry.
7022 (Output_data_got::add_global_plt): Likewise.
7023 (Output_data_got::add_global_with_rel): Likewise.
7024 (Output_data_got::add_global_with_rela): Likewise.
7025 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
7026 (Output_data_got::add_global_pair_with_rela): Likewise.
7027 (Output_data_got::add_local): Call add_got_entry.
7028 (Output_data_got::add_local_plt): Likewise.
7029 (Output_data_got::add_local_with_rel): Likewise.
7030 (Output_data_got::add_local_with_rela): Likewise.
7031 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
7032 (Output_data_got::add_local_pair_with_rela): Likewise.
7033 (Output_data_got::reserve_slot): New function.
7034 (Output_data_got::reserve_slot_for_global): New function.
7035 (Output_data_got::add_got_entry): New function.
7036 (Output_data_got::add_got_entry_pair): New function.
7037 (Output_section::add_output_section_data): Edit FIXME.
7038 * output.h
7039 (Output_section_data_build::Output_section_data_build): New
7040 constructor with size parameter.
7041 (Output_data_space::Output_data_space): Likewise.
7042 (Output_data_got::Output_data_got): Initialize new data member; new
7043 constructor with size parameter.
7044 (Output_data_got::add_constant): Call add_got_entry.
7045 (Output_data_got::reserve_slot): New function.
7046 (Output_data_got::reserve_slot_for_global): New function.
7047 (class Output_data_got::Got_entry): Add RESERVED_CODE.
7048 (Output_data_got::add_got_entry): New function.
7049 (Output_data_got::add_got_entry_pair): New function.
7050 (Output_data_got::free_list_): New data member.
7051 * target.h (Sized_target::init_got_plt_for_update): New function.
7052 (Sized_target::register_global_plt_entry): New function.
7053 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
7054 Initialize new data member; call init; add constructor with PLT count.
7055 (Output_data_plt_x86_64::init): New function.
7056 (Output_data_plt_x86_64::add_relocation): New function.
7057 (Output_data_plt_x86_64::reserve_slot): New function.
7058 (Output_data_plt_x86_64::free_list_): New data member.
7059 (Target_x86_64::init_got_plt_for_update): New function.
7060 (Target_x86_64::register_global_plt_entry): New function.
7061 (Output_data_plt_x86_64::add_entry): Allocate from free list for
7062 incremental updates.
7063 (Output_data_plt_x86_64::add_relocation): New function.
7064 * testsuite/object_unittest.cc (Object_test): Set default options.
7065
ec69d6da
ILT
70662011-05-16 Ian Lance Taylor <iant@google.com>
7067
7068 * options.h (class General_options): Make -i a synonym for -r.
7069
732e31de
ILT
70702011-05-16 Ian Lance Taylor <iant@google.com>
7071
7072 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
7073
403676b5
CC
70742011-05-10 Cary Coutant <ccoutant@google.com>
7075
7076 * object.cc (Sized_relobj::do_count_local_symbols): Check for
7077 strip_all (-s).
7078
5b7b7d6e
ILT
70792011-05-06 Ian Lance Taylor <iant@google.com>
7080
7081 * layout.cc (Layout::layout): If the output section flags change,
7082 update the ordering.
7083
f0f9babf
CC
70842011-04-25 Cary Coutant <ccoutant@google.com>
7085
7086 * incremental-dump.cc (dump_incremental_inputs): Print local
7087 symbol info for each input file.
7088 * incremental.cc
7089 (Output_section_incremental_inputs::set_final_data_size): Add local
7090 symbol info to input file entries in incremental info.
7091 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7092 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
7093 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
7094 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
7095 implementation.
7096 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
7097 (Sized_incr_relobj::do_relocate): Write the local symbols.
7098 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
7099 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
7100 Adjust size of input file header.
7101 (Incremental_inputs_reader::get_local_symbol_offset): New function.
7102 (Incremental_inputs_reader::get_local_symbol_count): New function.
7103 (Incremental_inputs_reader::get_input_section): Adjust size of input
7104 file header.
7105 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
7106 (Sized_incr_relobj::This): New typedef.
7107 (Sized_incr_relobj::sym_size): New const data member.
7108 (Sized_incr_relobj::Local_symbol): New struct.
7109 (Sized_incr_relobj::do_output_local_symbol_count): New function.
7110 (Sized_incr_relobj::do_local_symbol_offset): New function.
7111 (Sized_incr_relobj::local_symbol_count_): New data member.
7112 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
7113 (Sized_incr_relobj::local_symbol_index_): New data member.
7114 (Sized_incr_relobj::local_symbol_offset_): New data member.
7115 (Sized_incr_relobj::local_dynsym_offset_): New data member.
7116 (Sized_incr_relobj::local_symbols_): New data member.
7117 * object.h (Relobj::output_local_symbol_count): New function.
7118 (Relobj::local_symbol_offset): New function.
7119 (Relobj::do_output_local_symbol_count): New function.
7120 (Relobj::do_local_symbol_offset): New function.
7121 (Sized_relobj::do_output_local_symbol_count): New function.
7122 (Sized_relobj::do_local_symbol_offset): New function.
7123
d0a9ace3
ILT
71242011-04-22 Vladimir Simonov <sv@sw.ru>
7125
7126 * descriptors.cc (set_close_on_exec): New function.
7127 (Descriptors::open): Use set_close_on_exec.
7128 * output.cc (S_ISLNK): Define if not defined.
7129
94a3fc8b
CC
71302011-04-22 Cary Coutant <ccoutant@google.com>
7131
7132 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
7133 global symbol map.
7134 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7135 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
7136 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
7137 relocations.
7138 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
7139 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
7140 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
7141 * incremental.h
7142 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
7143 function.
7144 (Incremental_binary::apply_incremental_relocs): New function.
7145 (Incremental_binary::do_apply_incremental_relocs): New function.
7146 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7147 data member.
7148 (Sized_incremental_binary::add_global_symbol): New function.
7149 (Sized_incremental_binary::global_symbol): New function.
7150 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7151 (Sized_incremental_binary::symbol_map_): New data member.
7152 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
7153 * target.h (Sized_target::apply_relocation): New function.
7154 * target-reloc.h (apply_relocation): New function.
7155 * x86_64.cc (Target_x86_64::apply_relocation): New function.
7156
c87e4302
DK
71572011-04-22 Doug Kwan <dougkwan@google.com>
7158
7159 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
7160 flag of a SHT_ARM_EXIDX section.
2e702c99 7161 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
7162 * testsuite/Makefile.in: Regenerate.
7163 * testsuite/arm_exidx_test.s: New file.
7164 * testsuite/arm_exidx_test.sh: Same.
7165
e7782cf6
CC
71662011-04-20 Cary Coutant <ccoutant@google.com>
7167
7168 PR gold/12689
7169 * archive.h (Incremental_archive_entry::Archive_member):
7170 Initialize arg_serial_ (second constructor).
7171
308ecdc7
ILT
71722011-04-17 Ian Lance Taylor <iant@google.com>
7173
7174 * object.cc (Relocate_info::location): Simplify location string.
7175 * errors.cc (Errors::error_at_location): Don't print program
7176 name.
7177 (Errors::warning_at_location): Likewise.
7178 (Errors::undefined_symbol): Likewise.
7179 * testsuite/debug_msg.sh: Update accordingly.
7180
bec5b579
CC
71812011-04-14 Cary Coutant <ccoutant@google.com>
7182
7183 * gold/layout.cc (Layout::symtab_section_offset): New function.
7184 * gold/layout.h (Layout::symtab_section_offset): New function.
7185 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
7186
88597d34
ILT
71872011-04-12 Ian Lance Taylor <iant@google.com>
7188
7189 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
7190 with MREMAP_MAYMOVE.
7191 * output.h (class Output_file): Add map_is_allocated_ field.
7192 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
7193 not available, provide stubs. If mremap is not available, #define
7194 it to gold_mremap.
7195 (MREMAP_MAYMOVE): Define if not defined.
7196 (Output_file::Output_file): Initialize map_is_allocated_.
7197 (Output_file::resize): Check map_is_allocated_.
7198 (Output_file::map_anonymous): If mmap fails, use malloc.
7199 (Output_file::unmap): Don't do anything for an anonymous map.
7200 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
7201 is not available, provide stubs.
7202 (File_read::View::~View): Use free rather than delete[].
7203 (File_read::make_view): Use malloc rather than new[]. If mmap
7204 fails, use malloc.
7205 (File_read::find_or_make_view): Use malloc rather than new[].
7206 * gold.h: Remove HAVE_REMAP code.
7207 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
7208 exists. Rename mremap to gold_mremap. If mmap is not available
7209 don't do anything.
7210 * configure, config.in: Rebuild.
7211
11e361bc
ILT
72122011-04-11 Ian Lance Taylor <iant@google.com>
7213
7214 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
7215 initialize local variable v.
7216
cdc29364
CC
72172011-04-11 Cary Coutant <ccoutant@google.com>
7218
7219 * archive.cc (Archive::include_member): Adjust call to
7220 report_object.
7221 (Add_archive_symbols::run): Track argument serial numbers.
7222 (Lib_group::include_member): Likewise.
7223 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
7224 * archive.h (Incremental_archive_entry::Archive_member):
7225 Initialize arg_serial_.
7226 (Archive_member::arg_serial_): New data member.
7227 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
7228 (Sized_dynobj::do_add_symbols): Track symbols when doing an
7229 incremental link.
7230 (Sized_dynobj::do_for_all_local_got_entries): New function.
7231 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
7232 function.
7233 * fileread.cc (get_mtime): New function.
7234 * fileread.h (get_mtime): New function.
7235 * gold.cc (queue_initial_tasks): Check for incremental update.
7236 (process_incremental_input): New function.
7237 (queue_middle_tasks): Don't force valid target for incremental
7238 update.
7239 * incremental-dump.cc (find_input_containing_global): Adjust
7240 size of symbol info entry.
7241 (dump_incremental_inputs): Dump argument serial number and
7242 in_system_directory flag; bias shndx by 1; print symbol names
7243 when dumping per-file symbol lists; use new symbol info readers.
7244 * incremental.cc
7245 (Output_section_incremental_inputs:update_data_size): New function.
7246 (Sized_incremental_binary::setup_readers): Setup input readers
7247 for each input file; build maps for files added from libraries
7248 and scripts.
7249 (Sized_incremental_binary::check_input_args): New function.
7250 (Sized_incremental_binary::do_check_inputs): Build map of argument
7251 serial numbers to input arguments.
7252 (Sized_incremental_binary::do_file_has_changed): Rename
7253 do_file_is_unchanged to this; compare file modification times.
7254 (Sized_incremental_binary::do_init_layout): New function.
7255 (Sized_incremental_binary::do_reserve_layout): New function.
7256 (Sized_incremental_binary::do_get_input_reader): Remove.
7257 (Sized_incremental_binary::get_symtab_view): New function.
7258 (Incremental_checker::can_incrementally_link_output_file): Remove.
7259 (Incremental_inputs::report_command_line): Exclude --debug options.
7260 (Incremental_inputs::report_archive_begin): Add parameter; track
7261 argument serial numbers; don't put input file entry for archive
7262 before archive members.
7263 (Incremental_inputs::report_archive_end): Put input file entry
7264 for archive after archive members.
7265 (Incremental_inputs::report_object): Add parameter; track argument
7266 serial numbers and in_system_directory flag.
7267 (Incremental_inputs::report_script): Add parameter; track argument
7268 serial numbers.
7269 (Output_section_incremental_inputs::set_final_data_size): Adjust
7270 size of symbol info entry; check for forwarding symbols.
7271 (Output_section_incremental_inputs::write_input_files): Write
7272 in_system_directory flag and argument serial number.
7273 (Output_section_incremental_inputs::write_info_blocks): Map section
7274 indices between incremental info and original input file; store
7275 input section index for each symbol.
7276 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
7277 change operator() to visit().
7278 (class Global_got_offset_visitor): Likewise.
7279 (class Global_symbol_visitor_got_plt):
7280 (Output_section_incremental_inputs::write_got_plt): Use new visitor
7281 classes.
7282 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
7283 (Sized_incr_relobj::do_read_symbols): New function.
7284 (Sized_incr_relobj::do_layout): New function.
7285 (Sized_incr_relobj::do_layout_deferred_sections): New function.
7286 (Sized_incr_relobj::do_add_symbols): New function.
7287 (Sized_incr_relobj::do_should_include_member): New function.
7288 (Sized_incr_relobj::do_for_all_global_symbols): New function.
7289 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
7290 (Sized_incr_relobj::do_section_size): New function.
7291 (Sized_incr_relobj::do_section_name): New function.
7292 (Sized_incr_relobj::do_section_contents): New function.
7293 (Sized_incr_relobj::do_section_flags): New function.
7294 (Sized_incr_relobj::do_section_entsize): New function.
7295 (Sized_incr_relobj::do_section_address): New function.
7296 (Sized_incr_relobj::do_section_type): New function.
7297 (Sized_incr_relobj::do_section_link): New function.
7298 (Sized_incr_relobj::do_section_info): New function.
7299 (Sized_incr_relobj::do_section_addralign): New function.
7300 (Sized_incr_relobj::do_initialize_xindex): New function.
7301 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
7302 (Sized_incr_relobj::do_read_relocs): New function.
7303 (Sized_incr_relobj::do_gc_process_relocs): New function.
7304 (Sized_incr_relobj::do_scan_relocs): New function.
7305 (Sized_incr_relobj::do_count_local_symbols): New function.
7306 (Sized_incr_relobj::do_finalize_local_symbols): New function.
7307 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
7308 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
7309 (Sized_incr_relobj::do_relocate): New function.
7310 (Sized_incr_relobj::do_set_section_offset): New function.
7311 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
7312 (Sized_incr_dynobj::do_read_symbols): New function.
7313 (Sized_incr_dynobj::do_layout): New function.
7314 (Sized_incr_dynobj::do_add_symbols): New function.
7315 (Sized_incr_dynobj::do_should_include_member): New function.
7316 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
7317 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
7318 (Sized_incr_dynobj::do_section_size): New function.
7319 (Sized_incr_dynobj::do_section_name): New function.
7320 (Sized_incr_dynobj::do_section_contents): New function.
7321 (Sized_incr_dynobj::do_section_flags): New function.
7322 (Sized_incr_dynobj::do_section_entsize): New function.
7323 (Sized_incr_dynobj::do_section_address): New function.
7324 (Sized_incr_dynobj::do_section_type): New function.
7325 (Sized_incr_dynobj::do_section_link): New function.
7326 (Sized_incr_dynobj::do_section_info): New function.
7327 (Sized_incr_dynobj::do_section_addralign): New function.
7328 (Sized_incr_dynobj::do_initialize_xindex): New function.
7329 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
7330 (make_sized_incremental_object): New function.
7331 (Incremental_library::copy_unused_symbols): New function.
7332 (Incremental_library::do_for_all_unused_symbols): New function.
7333 * incremental.h (enum Incremental_input_flags): New type.
7334 (class Incremental_checker): Remove.
7335 (Incremental_input_entry::Incremental_input_entry): Add argument
7336 serial number.
7337 (Incremental_input_entry::arg_serial): New function.
7338 (Incremental_input_entry::set_is_in_system_directory): New function.
7339 (Incremental_input_entry::is_in_system_directory): New function.
7340 (Incremental_input_entry::arg_serial_): New data member.
7341 (Incremental_input_entry::is_in_system_directory_): New data member.
7342 (class Script_info): Move here from script.h.
7343 (Script_info::Script_info): Add filename parameter.
7344 (Script_info::filename): New function.
7345 (Script_info::filename_): New data member.
7346 (Incremental_script_entry::Incremental_script_entry): Add argument
7347 serial number.
7348 (Incremental_object_entry::Incremental_object_entry): Likewise.
7349 (Incremental_object_entry::add_input_section): Build list of input
7350 sections with map to original shndx.
7351 (Incremental_object_entry::get_input_section_index): New function.
7352 (Incremental_object_entry::shndx_): New data member.
7353 (Incremental_object_entry::name_key_): Rename; adjust all refs.
7354 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
7355 (Incremental_archive_entry::Incremental_archive_entry): Add argument
7356 serial number.
7357 (Incremental_inputs::report_archive_begin): Likewise.
7358 (Incremental_inputs::report_object): Likewise.
7359 (Incremental_inputs::report_script): Likewise.
7360 (class Incremental_global_symbol_reader): New class.
7361 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
7362 and store flags and input file type.
7363 (Incremental_input_entry_reader::arg_serial): New function.
7364 (Incremental_input_entry_reader::type): Extract type from flags.
7365 (Incremental_input_entry_reader::is_in_system_directory): New function.
7366 (Incremental_input_entry_reader::get_input_section_count): Call
7367 accessor function for type.
7368 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
7369 function for type; adjust size of global symbol entry.
7370 (Incremental_input_entry_reader::get_global_symbol_count): Call
7371 accessor function for type.
7372 (Incremental_input_entry_reader::get_object_count): Likewise.
7373 (Incremental_input_entry_reader::get_object_offset): Likewise.
7374 (Incremental_input_entry_reader::get_member_count): Likewise.
7375 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
7376 (Incremental_input_entry_reader::get_member_offset): Likewise.
7377 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
7378 (Incremental_input_entry_reader::Global_symbol_info): Remove.
7379 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
7380 (Incremental_input_entry_reader::get_global_symbol_reader): New
7381 function.
7382 (Incremental_input_entry_reader::get_output_symbol_index): New
7383 function.
7384 (Incremental_input_entry_reader::type_): Remove.
7385 (Incremental_input_entry_reader::flags_): New data member.
7386 (Incremental_inputs_reader::input_file_offset): New function.
7387 (Incremental_inputs_reader::input_file_index): New function.
7388 (Incremental_inputs_reader::input_file): Call input_file_offset.
7389 (Incremental_inputs_reader::input_file_at_offset): New function.
7390 (Incremental_relocs_reader::get_r_type): Reformat.
7391 (Incremental_relocs_reader::get_r_shndx): Reformat.
7392 (Incremental_relocs_reader::get_r_offset): Reformat.
7393 (Incremental_relocs_reader::data): New function.
7394 (Incremental_binary::Incremental_binary): Initialize new data members.
7395 (Incremental_binary::check_inputs): Add cmdline parameter.
7396 (Incremental_binary::file_is_unchanged): Remove.
7397 (Input_reader::arg_serial): New function.
7398 (Input_reader::get_unused_symbol_count): New function.
7399 (Input_reader::get_unused_symbol): New function.
7400 (Input_reader::do_arg_serial): New function.
7401 (Input_reader::do_get_unused_symbol_count): New function.
7402 (Input_reader::do_get_unused_symbol): New function.
7403 (Incremental_binary::input_file_count): New function.
7404 (Incremental_binary::get_input_reader): Change signature to use
7405 index instead of filename.
7406 (Incremental_binary::file_has_changed): New function.
7407 (Incremental_binary::get_input_argument): New function.
7408 (Incremental_binary::get_library): New function.
7409 (Incremental_binary::get_script_info): New function.
7410 (Incremental_binary::init_layout): New function.
7411 (Incremental_binary::reserve_layout): New function.
7412 (Incremental_binary::output_file): New function.
7413 (Incremental_binary::do_check_inputs): New function.
7414 (Incremental_binary::do_file_is_unchanged): Remove.
7415 (Incremental_binary::do_file_has_changed): New function.
7416 (Incremental_binary::do_init_layout): New function.
7417 (Incremental_binary::do_reserve_layout): New function.
7418 (Incremental_binary::do_input_file_count): New function.
7419 (Incremental_binary::do_get_input_reader): Change signature.
7420 (Incremental_binary::input_args_map_): New data member.
7421 (Incremental_binary::library_map_): New data member.
7422 (Incremental_binary::script_map_): New data member.
7423 (Sized_incremental_binary::Sized_incremental_binary): Initialize
7424 new data members.
7425 (Sized_incremental_binary::output_section): New function.
7426 (Sized_incremental_binary::inputs_reader): Add const.
7427 (Sized_incremental_binary::symtab_reader): Add const.
7428 (Sized_incremental_binary::relocs_reader): Add const.
7429 (Sized_incremental_binary::got_plt_reader): Add const.
7430 (Sized_incremental_binary::get_symtab_view): New function.
7431 (Sized_incremental_binary::Inputs_reader): New typedef.
7432 (Sized_incremental_binary::Input_entry_reader): New typedef.
7433 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
7434 (Sized_incremental_binary::do_file_is_unchanged): Remove.
7435 (Sized_incremental_binary::do_file_has_changed): New function.
7436 (Sized_incremental_binary::do_init_layout): New function.
7437 (Sized_incremental_binary::do_reserve_layout): New function.
7438 (Sized_input_reader::Inputs_reader): Remove.
7439 (Sized_input_reader::Input_entry_reader): Remove.
7440 (Sized_input_reader::do_arg_serial): New function.
7441 (Sized_input_reader::do_get_unused_symbol_count): New function.
7442 (Sized_input_reader::do_get_unused_symbol): New function.
7443 (Sized_incremental_binary::do_input_file_count): New function.
7444 (Sized_incremental_binary::do_get_input_reader): Change signature;
7445 use index instead of filename.
7446 (Sized_incremental_binary::section_map_): New data member.
7447 (Sized_incremental_binary::input_entry_readers_): New data member.
7448 (class Sized_incr_relobj): New class.
7449 (class Sized_incr_dynobj): New class.
7450 (make_sized_incremental_object): New function.
7451 (class Incremental_library): New class.
7452 * layout.cc (Free_list::num_lists): New static data member.
7453 (Free_list::num_nodes): New static data member.
7454 (Free_list::num_removes): New static data member.
7455 (Free_list::num_remove_visits): New static data member.
7456 (Free_list::num_allocates): New static data member.
7457 (Free_list::num_allocate_visits): New static data member.
7458 (Free_list::init): New function.
7459 (Free_list::remove): New function.
7460 (Free_list::allocate): New function.
7461 (Free_list::dump): New function.
7462 (Free_list::print_stats): New function.
7463 (Layout_task_runner::run): Resize output file for incremental updates.
7464 (Layout::Layout): Initialize new data members.
7465 (Layout::set_incremental_base): New function.
7466 (Layout::init_fixed_output_section): New function.
7467 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
7468 incremental updates.
7469 (Layout::create_gold_note): Do not create gold note section for
7470 incremental updates.
7471 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
7472 for incremental updates.
7473 (Layout::set_section_offsets): For incremental updates, allocate space
7474 from free list.
7475 (Layout::create_symtab_sections): Layout with offsets relative to
7476 start of section; for incremental updates, allocate space from free
7477 list.
7478 (Layout::create_shdrs): For incremental updates, allocate space from
7479 free list.
7480 (Layout::finish_dynamic_section): For incremental updates, do not
7481 check --as-needed (fixed in subsequent patch).
7482 * layout.h (class Free_list): New class.
7483 (Layout::set_incremental_base): New function.
7484 (Layout::incremental_base): New function.
7485 (Layout::init_fixed_output_section): New function.
7486 (Layout::allocate): New function.
7487 (Layout::incremental_base_): New data member.
7488 (Layout::free_list_): New data member.
7489 * main.cc (main): Print Free_list statistics.
7490 * object.cc (Relobj::finalize_incremental_relocs): Add
7491 clear_counts parameter; clear counts only when clear_counts is set.
7492 (Sized_relobj::Sized_relobj): Initialize new base class.
7493 (Sized_relobj::do_layout): Don't report special sections.
7494 (Sized_relobj::do_for_all_local_got_entries): New function.
7495 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
7496 symtab_off to all symbol table offsets.
7497 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
7498 * object.h (class Got_offset_list): Move to top of file.
7499 (Object::Object): Allow case where input_file == NULL.
7500 (Object::~Object): Likewise.
7501 (Object::input_file): Assert that input_file != NULL.
7502 (Object::lock): Allow case where input_file == NULL.
7503 (Object::unlock): Likewise.
7504 (Object::is_locked): Likewise.
7505 (Object::token): Likewise.
7506 (Object::release): Likewise.
7507 (Object::is_incremental): New function.
7508 (Object::get_mtime): New function.
7509 (Object::for_all_local_got_entries): New function.
7510 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
7511 (Object::set_is_in_system_directory): New function.
7512 (Object::is_in_system_directory): New function.
7513 (Object::do_is_incremental): New function.
7514 (Object::do_get_mtime): New function.
7515 (Object::do_for_all_local_got_entries): New function.
7516 (Object::is_in_system_directory_): New data member.
7517 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
7518 (class Sized_relobj_base): New class.
7519 (class Sized_relobj): Derive from Sized_relobj_base.
7520 (class Sized_relobj::Symbols): Redeclare from base class.
7521 (class Sized_relobj::local_got_offset_list): Remove.
7522 (class Sized_relobj::Output_sections): Redeclare from base class.
7523 (class Sized_relobj::do_for_all_local_got_entries): New function.
7524 (class Sized_relobj::write_local_symbols): Add offset parameter.
7525 (class Sized_relobj::local_symbol_offset_): Update comment.
7526 (class Sized_relobj::local_dynsym_offset_): Update comment.
7527 * options.cc (Input_arguments::add_file): Remove const.
7528 * options.h (Input_file_argument::Input_file_argument):
7529 Initialize arg_serial_ (all constructors).
7530 (Input_file_argument::set_arg_serial): New function.
7531 (Input_file_argument::arg_serial): New function.
7532 (Input_file_argument::arg_serial_): New data member.
7533 (Input_arguments::Input_arguments): Initialize file_count_.
7534 (Input_arguments::add_file): Remove const.
7535 (Input_arguments::number_of_input_files): New function.
7536 (Input_arguments::file_count_): New data member.
7537 (Command_line::number_of_input_files): Call
7538 Input_arguments::number_of_input_files.
7539 * output.cc (Output_segment_headers::Output_segment_headers):
7540 Set current size.
7541 (Output_section::Input_section::current_data_size): New function.
7542 (Output_section::Output_section): Initialize new data members.
7543 (Output_section::add_input_section): Don't do merge sections for
7544 an incremental link; allocate space from free list for an
7545 incremental update.
7546 (Output_section::add_output_section_data): Allocate space from
7547 free list for an incremental update.
7548 (Output_section::update_data_size): New function.
7549 (Output_section::set_fixed_layout): New function.
7550 (Output_section::reserve): New function.
7551 (Output_segment::set_section_addresses): Remove const.
7552 (Output_segment::set_section_list_addresses): Remove const; allocate
7553 space from free list for an incremental update.
7554 (Output_segment::set_offset): Adjust size of RELRO segment for an
7555 incremental update.
7556 * output.h (Output_data::current_data_size): Move here from
7557 child classes.
7558 (Output_data::pre_finalize_data_size): New function.
7559 (Output_data::update_data_size): New function.
7560 (Output_section_headers::update_data_size): new function.
7561 (Output_section_data_build::current_data_size): Move to Output_data.
7562 (Output_data_strtab::update_data_size): New function.
7563 (Output_section::current_data_size): Move to Output_data.
7564 (Output_section::set_fixed_layout): New function.
7565 (Output_section::has_fixed_layout): New function.
7566 (Output_section::reserve): New function.
7567 (Output_section::update_data_size): New function.
7568 (Output_section::has_fixed_layout_): New data member.
7569 (Output_section::free_list_): New data member.
7570 (Output_segment::set_section_addresses): Remove const.
7571 (Output_segment::set_section_list_addresses): Remove const.
7572 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
7573 New function.
7574 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
7575 New function.
7576 * readsyms.cc (Read_symbols::do_read_symbols): Add library
7577 parameter when calling Add_symbols constructor; store argument
7578 serial number for members of a lib group.
7579 (Add_symbols::locks): Allow case where token == NULL.
7580 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
7581 (Read_member::~Read_member): New function.
7582 (Read_member::is_runnable): New function.
7583 (Read_member::locks): New function.
7584 (Read_member::run): New function.
7585 (Check_script::~Check_script): New function.
7586 (Check_script::is_runnable): New function.
7587 (Check_script::locks): New function.
7588 (Check_script::run): New function.
7589 (Check_library::~Check_library): New function.
7590 (Check_library::is_runnable): New function.
7591 (Check_library::locks): New function.
7592 (Check_library::run): New function.
7593 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
7594 (Add_symbols::library_): New data member.
7595 (class Read_member): New class.
7596 (class Check_script): New class.
7597 (class Check_library): New class.
7598 * reloc.cc (Read_relocs::is_runnable): Allow case where
7599 token == NULL.
7600 (Read_relocs::locks): Likewise.
7601 (Scan_relocs::locks): Likewise.
7602 (Relocate_task::locks): Likewise.
7603 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
7604 to clear counters.
7605 (Sized_relobj::incremental_relocs_scan): Fix comment.
7606 (Sized_relobj::do_relocate): Pass output file offset to
7607 write_local_symbols.
7608 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
7609 from class declaration.
7610 * script.cc (read_input_script): Allocate Script_info; pass
7611 argument serial number to report_script.
7612 * script.h (class Script_info): Move to incremental.h.
7613 * symtab.cc (Symbol_table::add_from_incrobj): New function.
7614 * symtab.h (Symbol_table::add_from_incrobj): New function.
7615 (Symbol_table::set_file_offset): New function.
7616
b961d0d7
CC
76172011-04-05 Cary Coutant <ccoutant@google.com>
7618
7619 * incremental-dump.cc (dump_incremental_inputs): Change signature
7620 to take a Sized_incremental_binary; change caller. Use readers
7621 in Sized_incremental_binary.
7622 * incremental.cc
7623 (Sized_incremental_binary::find_incremental_inputs_sections):
7624 Rename do_find_incremental_inputs_sections to this.
7625 (Sized_incremental_binary::setup_readers): New function.
7626 (Sized_incremental_binary::do_check_inputs): Check
7627 has_incremental_info_ flag; move setup code to setup_readers;
7628 use input readers.
7629 (Sized_incremental_binary::do_file_is_unchanged): New function.
7630 (Sized_incremental_binary::do_get_input_reader): New function.
7631 * incremental.h (class Incremental_binary): Move to end of file.
7632 (Incremental_binary::file_is_unchanged): New function.
7633 (Incremental_binary::do_file_is_unchanged): New function.
7634 (Incremental_binary::Input_reader): New class.
7635 (Incremental_binary::get_input_reader): New function.
7636 (class Sized_incremental_binary): Move to end of file.
7637 (Sized_incremental_binary::Sized_incremental_binary): Setup the
7638 input section reader classes.
7639 (Sized_incremental_binary::has_incremental_info): New function.
7640 (Sized_incremental_binary::inputs_reader): New function.
7641 (Sized_incremental_binary::symtab_reader): New function.
7642 (Sized_incremental_binary::relocs_reader): New function.
7643 (Sized_incremental_binary::got_plt_reader): New function.
7644 (Sized_incremental_binary::do_file_is_unchanged): New function.
7645 (Sized_incremental_binary::Sized_input_reader): New class.
7646 (Sized_incremental_binary::get_input_reader): New function.
7647 (Sized_incremental_binary::find_incremental_inputs_sections):
7648 Rename do_find_incremental_inputs_sections to this.
7649 (Sized_incremental_binary::setup_readers): New function.
7650 (Sized_incremental_binary::has_incremental_info_): New data member.
7651 (Sized_incremental_binary::inputs_reader_): New data member.
7652 (Sized_incremental_binary::symtab_reader_): New data member.
7653 (Sized_incremental_binary::relocs_reader_): New data member.
7654 (Sized_incremental_binary::got_plt_reader_): New data member.
7655 (Sized_incremental_binary::current_input_file_): New data member.
7656
a869183f
PP
76572011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
7658
7659 PR gold/12640
7660 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
7661 violation.
7662
76632011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
7664
7665 * archive.cc (Archive::include_member): Adjust call to report_object.
7666 (Add_archive_symbols::run): Add script_info to call to
7667 report_archive_begin.
7668 (Lib_group::include_member): Adjust call to report_object.
7669 (Add_lib_group_symbols::run): Adjust call to report_object.
7670 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
7671 blocks. Add object count for script input files.
7672 * incremental.cc (Incremental_inputs::report_archive_begin): Add
7673 script_info parameter; change all callers.
7674 (Incremental_inputs::report_object): Add script_info parameter;
7675 change all callers.
7676 (Incremental_inputs::report_script): Store backpointer to
7677 incremental info entry.
7678 (Output_section_incremental_inputs::set_final_data_size): Record
7679 additional information for scripts.
7680 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7681 * incremental.h (Incremental_script_entry::add_object): New function.
7682 (Incremental_script_entry::get_object_count): New function.
7683 (Incremental_script_entry::get_object): New function.
7684 (Incremental_script_entry::objects_): New data member; adjust
7685 constructor.
7686 (Incremental_inputs::report_archive_begin): Add script_info parameter.
7687 (Incremental_inputs::report_object): Add script_info parameter.
7688 (Incremental_inputs_reader::get_object_count): New function.
7689 (Incremental_inputs_reader::get_object_offset): New function.
7690 * options.cc (Input_arguments::add_file): Return reference to
7691 new input argument.
7692 * options.h (Input_argument::set_script_info): New function.
7693 (Input_argument::script_info): New function.
7694 (Input_argument::script_info_): New data member; adjust all
7695 constructors.
7696 (Input_file_group::add_file): Return reference to new input argument.
7697 (Input_file_lib::add_file): Likewise.
7698 (Input_arguments::add_file): Likewise.
7699 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
7700 * script.cc (Parser_closure::Parser_closure): Add script_info
7701 parameter; adjust all callers.
7702 (Parser_closure::script_info): New function.
7703 (Parser_closure::script_info_): New data member.
7704 (read_input_script): Report scripts earlier to incremental info.
7705 (script_add_file): Set script_info in Input_argument.
7706 (script_add_library): Likewise.
7707 * script.h (Script_options::Script_info): Rewrite class.
7708
a869183f 77092011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
7710
7711 * archive.cc (Library_base::should_include_member): Move
7712 method here from class Archive.
7713 (Archive::Archive): Initialize base class.
7714 (Archive::should_include_member): Move to base class.
7715 (Archive::do_for_all_unused_symbols): New function.
7716 (Add_archive_symbols::run): Remove redundant access to
7717 incremental_inputs.
7718 (Lib_group::Lib_group): Initialize base class.
7719 (Lib_group::do_filename): New function.
7720 (Lib_group::include_member): Pass pointer to Lib_group to
7721 report_object.
7722 (Lib_group::do_for_all_unused_symbols): New function.
7723 (Add_lib_group_symbols::run): Report archive information for
7724 incremental links.
7725 * archive.h (class Library_base): New base class.
7726 (class Archive): Derive from Library_base.
7727 (Archive::filename): Move to base class.
7728 (Archive::set_incremental_info): Likewise.
7729 (Archive::incremental_info): Likewise.
7730 (Archive::Should_include): Likewise.
7731 (Archive::should_include_member): Likewise.
7732 (Archive::Armap_entry): Remove.
7733 (Archive::Unused_symbol_iterator): Remove.
7734 (Archive::unused_symbols_begin): Remove.
7735 (Archive::unused_symbols_end): Remove.
7736 (Archive::do_filename): New function.
7737 (Archive::do_get_mtime): New function.
7738 (Archive::do_for_all_unused_symbols): New function.
7739 (Archive::task_): Move to base class.
7740 (Archive::incremental_info_): Likewise.
7741 (class Lib_group): Derive from Library_base.
7742 (Lib_group::do_filename): New function.
7743 (Lib_group::do_get_mtime): New function.
7744 (Lib_group::do_for_all_unused_symbols): New function.
7745 (Lib_group::task_): Move to base class.
7746 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
7747 function.
7748 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
7749 function.
7750 * incremental.cc (Incremental_inputs::report_archive_begin):
7751 Use Library_base; call library's get_mtime; add incremental inputs
7752 entry before members.
7753 (class Unused_symbol_visitor): New class.
7754 (Incremental_inputs::report_archive_end): Use Library_base; use
7755 visitor class to record unused symbols; don't add incremental inputs
7756 entry after members.
7757 (Incremental_inputs::report_object): Use Library_base.
7758 * incremental.h
7759 (Incremental_archive_entry::Incremental_archive_entry): Remove
7760 unused Archive parameter.
7761 (Incremental_inputs::report_archive_begin): Use Library_base.
7762 (Incremental_inputs::report_archive_end): Likewise.
7763 (Incremental_inputs::report_object): Likewise.
7764 * object.cc (Sized_relobj::do_for_all_global_symbols): New
7765 function.
7766 * object.h (Object::for_all_global_symbols): New function.
7767 (Object::do_for_all_global_symbols): New function.
7768 (Sized_relobj::do_for_all_global_symbols): New function.
7769 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
7770 function.
7771 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
7772 function.
7773
61ab3e40
ILT
77742011-03-27 Ian Lance Taylor <iant@google.com>
7775
7776 * archive.cc (Archive::interpret_header): Return -1 if something
7777 goes wrong. Change callers accordingly.
7778
30e1f9e6
CC
77792011-03-25 Cary Coutant <ccoutant@google.com>
7780
7781 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
7782 * testsuite/Makefile.in: Regenerate.
7783
9370ce59 77842011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
7785
7786 * plugin.cc (get_view): New.
7787 (Plugin::load): Pass get_view to the plugin.
7788 (Plugin_manager::get_view): New.
7789
9312bb0a
ILT
77902011-03-21 Ian Lance Taylor <iant@google.com>
7791
7792 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 7793 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 7794
7e12ba9e
ST
77952011-03-21 Sriraman Tallam <tmsriram@google.com>
7796
7797 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
7798 Change == to -eq.
7799 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
7800 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
7801 Change == to -eq.
7802 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
7803 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
7804
fd7a005d
ILT
78052011-03-14 Ian Lance Taylor <iant@google.com>
7806
7807 * script-sections.cc (Sort_output_sections::script_compare):
7808 Rename from is_before, change return type.
7809 (Sort_output_sections::operator()): Adjust accordingly.
7810
ed16fd1b
ILT
78112011-03-11 Jeffrey Yasskin <jyasskin@google.com>
7812
7813 PR gold/12572
7814 * testsuite/odr_violation2.cc: Add comment to make all error line
7815 numbers double digits.
7816 * testsuite/debug_msg.sh: Adjust expected errors.
7817
71ff8986
ILT
78182011-03-09 Jeffrey Yasskin <jyasskin@google.com>
7819
7820 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
7821 but mark earlier ones as non-canonical
7822 (offset_to_iterator): Update search target and example
7823 (do_addr2line): Return extra lines in a vector*
7824 (format_file_lineno): Extract from do_addr2line
7825 (one_addr2line): Add vector* out-param
7826 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
7827 when a lineno entry appeared last for its instruction
7828 (Dwarf_line_info): Add vector* out-param
7829 * object.cc (Relocate_info): Pass NULL for the vector* out-param
7830 * symtab.cc (Odr_violation_compare): Include the lineno in the
7831 comparison again.
7832 (linenos_from_loc): New. Combine the canonical line for an
7833 address with its other lines.
7834 (True_if_intersect): New. Helper functor to make
7835 std::set_intersection a query.
7836 (detect_odr_violations): Compare sets of lines instead of just
7837 one line for each function. This became less deterministic, but
7838 has fewer false positives.
7839 * symtab.h: Declarations.
7840 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
7841 mix an optimized and non-optimized object in the same binary
7842 (odr_violation2.so): Same.
7843 * testsuite/Makefile.in: Regenerate from Makefile.am.
7844 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
7845 * testsuite/debug_msg.sh: Update line numbers and add
7846 assertions.
7847 * testsuite/odr_violation1.cc: Use OdrDerived, in a
7848 non-optimized context.
7849 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
7850 isn't inlined, and use OdrDerived in an optimized context.
7851 * testsuite/odr_header1.h: Defines OdrDerived, where
7852 optimization will change the
7853 first-instruction-in-the-destructor's file and line number.
7854 * testsuite/odr_header2.h: Defines OdrBase.
7855
a19fefdc
ILT
78562011-03-09 Ian Lance Taylor <iant@google.com>
7857
7858 * fileread.cc (File_read::clear_views): Don't delete the whole
7859 file view.
7860
ecb351e9
ILT
78612011-03-08 Ian Lance Taylor <iant@google.com>
7862
7863 PR gold/12525
7864 * fileread.cc: #include <climits>.
7865 (GOLD_IOV_MAX): Define.
7866 (File_read::read_multiple): Limit number of entries by iov_max.
7867 * fileread.h (class File_read): Always set max_readv_entries to
7868 128.
7869
b821d13c
ILT
78702011-03-07 Ian Lance Taylor <iant@google.com>
7871
7872 PR gold/12525
7873 * options.h (class General_options): Add -dy and -dn.
7874
89243142
CC
78752011-03-02 Cary Coutant <ccoutant@google.com>
7876
7877 * testsuite/script_test_9.t: Add TLS segment.
7878
d0773f31
ILT
78792011-03-02 Simon Baldwin <simonb@google.com>
7880
7881 * configure.ac: Add check for gnu_indirect_function support in
7882 the toolchain building binutils.
7883 * configure: Rebuild.
7884
9370ce59 78852011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
7886
7887 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
7888 plugin only symbols.
7889 (Symbol_table::sized_finalize_symbol) Mark symbol only present
7890 in plugin files as not needed in the symbol table.
7891
4cf7a849
ST
78922011-02-11 Sriraman Tallam <tmsriram@google.com>
7893
7894 * output.cc (Output_section::add_input_section): Delay fill
7895 generation for section ordering.
7896
b578bd7d
ILT
78972011-02-09 Ian Lance Taylor <iant@google.com>
7898
7899 PR gold/12316
7900 * object.h (class Sized_relobj): Remove clear_local_symbols.
7901 * reloc.cc (Sized_relobj::do_relocate): Don't call
7902 clear_local_symbols.
7903
9370ce59 79042011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
7905
7906 * plugin.cc (is_visible_from_outside): Return true for symbols
7907 in the -u option.
7908
55382fb7
ILT
79092011-02-04 Jeffrey Yasskin <jyasskin@google.com>
7910
7911 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
7912 filename.
7913
4e271fff
ST
79142011-02-02 Sriraman Tallam <tmsriram@google.com>
7915
7916 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 7917 to std::string.
4e271fff 7918 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 7919 section_name to be std::string.
4e271fff
ST
7920 (is_function_ctor_or_dtor): Change type of parameter to std::string.
7921
d433c3ac
ILT
79222011-01-25 Ian Lance Taylor <iant@google.com>
7923
7924 * script.cc (script_add_extern): Rewrite to use
7925 add_symbol_reference.
7926
880473a6
DK
79272011-01-25 Doug Kwan <dougkwan@google.com>
7928
d433c3ac 7929 * icf.cc (get_section_contents): Always lock section's object.
880473a6 7930
f30f86fa
ILT
79312011-01-24 Ian Lance Taylor <iant@google.com>
7932
7933 * options.h (class General_options): Accept
7934 --no-detect-odr-violations.
7935
8e51a0b9
ILT
79362011-01-24 Ian Lance Taylor <iant@google.com>
7937
7938 * version.cc (version_string): Bump to 1.11.
7939
0f3b89d8
ILT
79402011-01-24 Ian Lance Taylor <iant@google.com>
7941
7942 * plugin.cc (class Plugin_rescan): Define new class.
7943 (Plugin_manager::claim_file): Set any_claimed_.
7944 (Plugin_manager::save_archive): New function.
7945 (Plugin_manager::save_input_group): New function.
7946 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
7947 necessary.
7948 (Plugin_manager::new_undefined_symbol): New function.
7949 (Plugin_manager::rescan): New function.
7950 (Plugin_manager::rescannable_defines): New function.
7951 (Plugin_manager::add_input_file): Set any_added_.
7952 * plugin.h (class Plugin_manager): define new fields rescannable_,
7953 undefined_symbols_, any_claimed_, and any_added_. Declare
7954 Plugin_rescan as friend. Declare new functions.
7955 (Plugin_manager::Rescannable): Define type.
7956 (Plugin_manager::Rescannable_list): Define type.
7957 (Plugin_manager::Undefined_symbol_list): Define type.
7958 (Plugin_manager::Plugin_manager): Initialize new fields.
7959 * archive.cc (Archive::defines_symbol): New function.
7960 (Add_archive_symbols::run): Pass archive to plugins if any.
7961 * archive.h (class Archive): Declare defines_symbol.
7962 * readsyms.cc (Input_group::~Input_group): New function.
7963 (Finish_group::run): Pass input_group to plugins if any.
7964 * readsyms.h (class Input_group): Declare destructor.
7965 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
7966 any.
7967
3bb951e5
ILT
79682011-01-10 Ian Lance Taylor <iant@google.com>
7969
7970 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
7971 section as relro.
7972 (Layout::set_segment_offsets): Reset increase_relro before calling
7973 set_section_addresses a second time.
7974
0aa45fac
CC
79752011-01-04 Cary Coutant <ccoutant@google.com>
7976
7977 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
7978 sections before NOBITS sections.
7979
0db46eb4
L
79802011-01-01 H.J. Lu <hongjiu.lu@intel.com>
7981
7982 * version.cc (print_version): Update copyright to 2011.
7983
829c9745
CC
79842010-12-23 Cary Coutant <ccoutant@google.com>
7985
7986 * output.h (Output_data_reloc::add_output_section): Pass OD instead
7987 of OS to this->add. Add OD parameter to second form of the function.
7988
7500420b
ILT
79892010-12-20 Ian Lance Taylor <iant@google.com>
7990
7991 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
7992 second of two consecutive entries with same offset.
7993
f8e9a930
RW
79942010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7995
7996 * testsuite/Makefile.am (ifuncmain2static_LDADD)
7997 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
7998 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
7999 to avoid unneeded links against $(LDADD).
8000 * testsuite/Makefile.in: Regenerate.
8001
2fbb4320
ILT
80022010-12-15 Ian Lance Taylor <iant@google.com>
8003
8004 PR gold/12324
8005 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
8006 for R_X86_64_32 and R_X86_64_PC32.
8007 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
8008 ver_matching_def_pic.o.
8009 (ver_matching_def_pic.o): New target.
8010
fedb228d
RW
80112010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8012
8013 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
8014 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
8015 Move definition before File_read::View member definitions.
8016 (File_read::View::~View): Initialize and hold lock before
8017 updating current_mapped_bytes.
8018
9b547ce6
RW
80192010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8020
8021 * dwarf_reader.cc: Remove outdated comment.
8022 * gold-threads.cc: Fix typo in error message.
8023 * archive.cc: Fix typos in comments.
8024 * archive.h: Likewise.
8025 * arm-reloc-property.cc: Likewise.
8026 * arm-reloc-property.h: Likewise.
8027 * arm-reloc.def: Likewise.
8028 * arm.cc: Likewise.
8029 * attributes.h: Likewise.
8030 * cref.cc: Likewise.
8031 * ehframe.cc: Likewise.
8032 * fileread.h: Likewise.
8033 * gold.h: Likewise.
8034 * i386.cc: Likewise.
8035 * icf.cc: Likewise.
8036 * incremental.h: Likewise.
8037 * int_encoding.cc: Likewise.
8038 * layout.h: Likewise.
8039 * main.cc: Likewise.
8040 * merge.h: Likewise.
8041 * object.cc: Likewise.
8042 * object.h: Likewise.
8043 * options.cc: Likewise.
8044 * readsyms.cc: Likewise.
8045 * reduced_debug_output.cc: Likewise.
8046 * reloc.cc: Likewise.
8047 * script-sections.cc: Likewise.
8048 * sparc.cc: Likewise.
8049 * symtab.h: Likewise.
8050 * target-reloc.h: Likewise.
8051 * target.cc: Likewise.
8052 * target.h: Likewise.
8053 * timer.cc: Likewise.
8054 * timer.h: Likewise.
8055 * x86_64.cc: Likewise.
8056
83e17bd5
CC
80572010-12-09 Cary Coutant <ccoutant@google.com>
8058
8059 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
8060 stack.
8061 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
8062 parameter; change all callers.
8063 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
8064 * options.h (warn_execstack): New option.
8065
017257f8
DK
80662010-12-07 Doug Kwan <dougkwan@google.com>
8067
8068 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
8069 like function call relocations.
8070
c20cbc06
ILT
80712010-12-07 Ian Lance Taylor <iant@google.com>
8072
8073 * archive.cc (Archive::get_elf_object_for_member): Permit
8074 punconfigured to be NULL.
8075 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
8076 (Archive::include_member): Pass NULL to get_elf_object_for_member
8077 if we searched for the archive and this is the first included
8078 object.
8079
4dbfafcc
ILT
80802010-12-01 Ian Lance Taylor <iant@google.com>
8081
8082 * dwarf_reader.h (class Sized_dwarf_line_info): Add
8083 track_relocs_type_ field.
8084 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8085 Set track_relocs_type_.
8086 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
8087 contents when using RELA relocs.
8088 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
8089 reloc_map_.
8090 * reloc.cc (Track_relocs::next_addend): New function.
8091 * reloc.h (class Track_relocs): Declare next_addend.
8092
e5e19edd
ILT
80932010-12-01 Ian Lance Taylor <iant@google.com>
8094
8095 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
8096 virtual destructor.
8097
9a5ce24c
ILT
80982010-12-01 Ian Lance Taylor <iant@google.com>
8099
8100 * README: Update compilers known to work and fail.
8101
c7791212
NC
81022010-11-23 Matthias Klose <doko@ubuntu.com>
8103
8104 * configure.in: For --enable-gold, handle value `default' instead of
8105 `both*'. Always install ld as ld.bfd, install as ld if gold is
8106 not the default.
8107 * configure: Regenerate.
8108
0ad220c9
DK
81092010-11-18 Doug Kwan <dougkwan@google.com>
8110
8111 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
8112 and right_alignment to be zero. Store result alignment only if it is
8113 greater than existing alignment.
8114
ab8056e0
CC
81152010-11-16 Cary Coutant <ccoutant@google.com>
8116
8117 PR gold/12220
8118 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8119 Check for ".zdebug_line".
8120
fd064a5b
CC
81212010-11-16 Doug Kwan <dougkwan@google.com>
8122 Cary Coutant <ccoutant@google.com>
8123
8124 * output.h (Output_segment::set_section_addresses): Pass increase_relro
8125 by reference; adjust all callers.
8126 * output.cc (Output_segment::set_section_addresses): Adjust references
8127 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
8128 list is empty.
8129 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
8130 end at page boundary.
8131
6fc6ea19
CC
81322010-11-16 Cary Coutant <ccoutant@google.com>
8133
8134 PR gold/12220
8135 * layout.cc (Layout::choose_output_section): Transform names of
8136 compressed sections even when using a script with a SECTIONS clause.
8137 (Layout::output_section_name): Remove code to transform
8138 compressed debug section names.
8139 * output.cc (Output_section::add_input_section): Use uncompressed
8140 section size when tracking input sections.
8141
95a2c8d6
RS
81422010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
8143
8144 * symtab.h (Symbol::NON_PIC_REF): Remove.
8145 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
8146 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
8147 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
8148 (Symbol::use_plt_offset): Take a flags argument and pass it
8149 directly to needs_dynamic_reloc. Restrict check for undefined
8150 weak symbols to function calls.
8151 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
8152 (Target_arm::Scan::global): Use it.
8153 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
8154 (Target_arm::Relocate::relocate): Likewise.
8155 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
8156 parameter with an r_type parameter. Use get_reference_flags
8157 to get the flags.
8158 (Target_arm::Relocate::relocate): Update accordingly.
8159 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
8160 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
8161 (Target_i386::Scan::global): Likewise.
8162 (Target_i386::Relocate::relocate): Likewise.
8163 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
8164 parameter with an r_type parameter. Use get_reference_flags
8165 to get the flags.
8166 (Target_i386::Relocate::relocate): Update accordingly.
8167 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
8168 (Target_powerpc::Scan::global): Use it.
8169 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
8170 (Target_powerpc::Relocate::relocate): Likewise.
8171 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
8172 (Target_sparc::Scan::global): Use it.
8173 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
8174 (Target_sparc::Relocate::relocate): Likewise.
8175 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
8176 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
8177 (Target_x86_64::Scan::global): Likewise.
8178 (Target_x86_64::Relocate::relocate): Likewise.
8179
f625ae50
DK
81802010-11-08 Doug Kwan <dougkwan@google.com>
8181 Cary Coutant <ccoutant@google.com>
8182
8183 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
8184 (Arm_exidx_merge_section::section_contents_): New data member.
8185 (Arm_input_section::Arm_input_section): Initialize original_contents_.
8186 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 8187 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
8188 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
8189 in parameters instead of calling Object::section_contents without
8190 locking.
8191 (Arm_output_section::group_section): New parameter TASK. Pass it
8192 to callees that need locking objects.
8193 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
8194 to lock EXIDX input sections. Fix a formatting issue. Call
8195 Arm_exidx_merged_section::build_contents to create merged section
8196 contents.
8197 (Arm_output_section::create_stub_group): New parameter TASK. Use it
8198 to lock object of stub table owner.
8199 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
8200 TEXT_SIZE to initialize data member TEXT_SIZE_.
8201 (Arm_exidx_input_section::addralign): Fix typo in comment.
8202 (Arm_exidx_input_section::text_size): New method.
8203 (Target_arm::do_relax): New parameter TASK. Pass it to callees
8204 that require locking objects. Lock objects before scanning for stubs
8205 and updating local symbols.
8206 (Arm_input_section<big_endian>::init): Copy contents of original
8207 input section.
2e702c99 8208 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
8209 original input section instead of calling Object::section_contents
8210 without locking.
8211 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
8212 size without calling Object::section_size().
8213 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
8214 for size. Allocate a buffer for merged EXIDX entries.
8215 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 8216 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
8217 building code to Arm_exidx_merged_section::build_contetns. Write
8218 out contetns in buffer instead of building it on the fly.
8219 (Arm_relobj::make_exidx_input_section): Also pass text section size
8220 to Arm_exidx_input_section constructor.
8221 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
8222 (Arm_dynobj::do_read_symbols): Fix memory leak.
8223 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
8224 * target.h: (class Task): Add forward declaration.
8225 (Target::relax): Add new parameter TASK and pass it to
8226 Target::do_relax().
8227 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
8228
5f9bcf58
CC
82292010-11-05 Cary Coutant <ccoutant@google.com>
8230
8231 PR gold/10708
8232 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
8233 object when reading from the file.
8234 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
8235 second layout pass.
8236 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
8237 when reading section contents.
8238 (get_section_contents): Likewise.
8239 (icf::find_identical_sections): Likewise.
8240 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
8241 object when reading from the file.
8242 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
8243 the object when doing deferred section layout.
8244
e597fa08
NC
82452010-11-03 Nick Clifton <nickc@redhat.com>
8246
8247 PR gold/12001
8248 * script.h (class Symbol_assignment: name): New member. Returns
8249 the name of the symbol.
8250 * scrfipt.cc (Script_options::is_pending_assignment): New member.
8251 Returns true if the given symbol name is on the list of
8252 assignments wating to be processed.
8253 * archive.cc (should_incldue_member): If the symbol is undefined,
8254 check to see if it is on the list of symbols pending assignment.
8255
3f9a3278
ILT
82562010-11-03 Ryan Mansfield <rmansfield@qnx.com>
8257
8258 * script-sections.cc (Script_sections::find_memory_region): Check
8259 for a NULL output section pointer.
8260
d06fb4d1
DK
82612010-10-29 Doug Kwan <dougkwan@google.com>
8262
8263 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
8264 Output_section::add_relaxed_input_section.
8265 * output.cc (Output_section::add_relaxed_input_section): Add new
8266 arguments LAYOUT and NAME. Set section order index.
8267 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
8268 Copy section order index.
8269 * output.h (Output_section::add_relaxed_input_section): Add new
8270 arguments LAYOUT and NAME.
8271
90e24de5
ILT
82722010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8273
8274 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 8275 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
8276 * testsuite/Makefile.in: Regenerate.
8277
c9484ea5
DK
82782010-10-20 Doug Kwan <dougkwan@google.com>
8279
8280 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
8281 without SHF_LINK_ORDER flags.
8282 * layout.cc (Layout::choose_output_section): Do not filter
8283 SHF_LINK_ORDER flag in a relocatable link.
8284
5bc2f5be
CC
82852010-10-17 Cary Coutant <ccoutant@google.com>
8286
8287 * output.h (Output_segment::set_section_addresses): Change function
8288 signature. Update all callers.
8289 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
8290 sections.
8291 (Output_segment::set_section_addresses): Align after last TLS
8292 section. Add padding before last relro section instead of after.
8293
0c91cf04
DK
82942010-10-17 Doug Kwan <dougkwan@google.com>
8295
8296 * gold/arm.cc (Target_arm::got_section): Use correct order and set
8297 GOT output section to be writable.
8298
8c21d9d3
CC
82992010-10-14 Cary Coutant <ccoutant@google.com>
8300
8301 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
8302 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
8303 * gold.cc (queue_initial_tasks): Check parameters for incremental link
8304 mode.
8305 * incremental.cc (report_command_line): Ignore all forms of
8306 --incremental.
8307 * layout.cc (Layout::Layout): Check parameters for incremental link
8308 mode.
8309 * options.cc (General_options::parse_incremental): New function.
8310 (General_options::parse_no_incremental): New function.
8311 (General_options::parse_incremental_full): New function.
8312 (General_options::parse_incremental_update): New function.
8313 (General_options::incremental_mode_): New data member.
8314 (General_options::finalize): Check incremental_mode_.
8315 * options.h (General_options): Update help text for --incremental.
8316 Add --no-incremental, --incremental-full, --incremental-update.
8317 (General_options::Incremental_mode): New enum type.
8318 (General_options::incremental_mode): New function.
8319 (General_options::incremental_mode_): New data member.
8320 * parameters.cc (Parameters::incremental_mode_): New data member.
8321 (Parameters::set_options): Set incremental_mode_.
8322 (Parameters::set_incremental_full): New function.
8323 (Parameters::incremental): New function.
8324 (Parameters::incremental_update): New function.
8325 (set_parameters_incremental_full): New function.
8326 * parameters.h (Parameters::set_incremental_full): New function.
8327 (Parameters::incremental): New function.
8328 (Parameters::incremental_update): New function.
8329 (Parameters::incremental_mode_): New data member.
8330 (set_parameters_incremental_full): New function.
8331 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
8332 incremental link mode.
8333 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
8334 (Sized_relobj::do_relocate_sections): Likewise.
8335 * testsuite/Makefile.am (incremental_test): Use --incremental-full
8336 option.
8337 * testsuite/Makefile.in: Regenerate.
8338 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 8339
bb32aa18 83402010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
8341
8342 * script-sections.h (class Script_sections): Make
8343 Sections_elements typedef public.
8344 * script-sections.cc (class Sort_output_sections): Add elements_
8345 field. Add constructor which sets it; change all callers.
8346 (Sort_output_sections::is_before): New function.
8347 (Sort_output_sections::operator()): Call is_before.
8348 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
8349 conditional.
8350 * testsuite/script_test_10.sh: New test. Test script section
8351 order.
8352 * testsuite/script_test_10.t: Likewise.
8353 * testsuite/script_test_10.s: Likewise.
8354 * testsuite/Makefile.am: Wrap the cross linker tests and the
8355 common tests into NATIVE_OR_CROSS_LINKER.
8356 (check_SCRIPTS): Add script_test_10.sh.
8357 (check_DATA): Add script_test_10.stdout.
8358 (script_test_10.o, script_test_10): New targets.
8359 (script_test_10.stdout): New target.
8360 * configure, testsuite/Makefile.in: Regenerate.
8361
3cef7179
ILT
83622010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8363
8364 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
8365 error for the deprecated relocations.
8366 (Target_arm::Scan::global): Likewise.
8367 (Target_arm::Relocate::relocate): Likewise.
8368
7411e9a8
RS
83692010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
8370
8371 * fileread.cc (Input_file::find_file): Initialize *found_name
8372 and *namep when using the fallback search for case 4.
8373
6a9da32a
CC
83742010-10-11 Cary Coutant <ccoutant@google.com>
8375
8376 * options.h (class General_options): Redefine -z lazy as an alias for
8377 the negation of -z now.
8378
ac897c20
ILT
83792010-10-11 Ian Lance Taylor <iant@google.com>
8380
8381 * resolve.cc (symbol_to_bits): Report the value of the unsupported
8382 binding.
8383
ea5cae92
NC
83842010-10-06 Nick Clifton <nickc@redhat.com>
8385
8386 * script-sections.cc(class Memory_region): Remove
8387 current_lma_offset_ field. Rename current_vma_offset_ to
8388 current_offset_. Add last_section_ field.
8389 (Memory_region::get_current_vma_address): Rename to
8390 get_current_address.
8391 (Memory_region::get_current_lma_address): Delete.
8392 (Memory_region::increment_vma_offset): Rename to
8393 increment_offset.
8394 (Memory_region::increment_lma_offset): Delete.
8395 (Memory_region::attributes_compatible): New method. Returns
8396 true if the provided section is compatible with the region.
8397 (Memory_region::get_last_section): New method. Returns the last
8398 section to use the region.
8399 (Memory_region::set_last_section): New method. Stores the last
8400 section to use the region.
8401 (Script_sections::block_in_region): New method. Returns true if
8402 a block of memory is contained within a region.
8403 (Script_sections::find_memory_region): New method. Locates a
8404 memory region to be used to set a VMA or LMA address.
8405 (Output_section_definition::set_section_addresses): Add code to
8406 check for addresses set by memory regions.
8407 (Output_segment::set_section_addresses): Remove memory region
8408 walking code.
8409 (Script_sections::create_segment): Add a warning if a header
8410 segment is created outside of any region.
8411 * script-sections.h (class Script_sections): Add prototypes for
8412 find_memory_region and block_in_region methods.
8413 * testsuite/memory_test.s: Use .long instead of .word.
8414 * testsuite/memory_test.t: Add some more output sections.
8415 * testsuite/memory_test.sh: Update expected output.
8416
a9bfd952
DK
84172010-10-02 Doug Kwan <dougkwan@google.com>
8418
8419 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
8420 defintion to symtab.h
8421 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
8422 declaration to defintion.
8423
bacff3ab
NC
84242010-10-01 Nick Clifton <nickc@redhat.com>
8425
8426 * expression.cc (eval): Replace dummy argument with NULL.
8427 (eval_maybe_dot): Check for a NULL result section pointer.
8428 (Symbol_expression::value): Likewise.
8429 (Dot_expression::value): Likewise.
8430 (BINARY_EXPRESSION): Likewise.
8431 (Max_expression::value): Likewise.
8432 (Min_expression::value): Likewise.
8433 (Absolute_expression::value): Likewise.
8434 (Addr_expression::value_from_output_section): Likewise.
8435 (Loaddddr_expression::value_from_output_section): Likewise.
8436 (Segment_start_expression::value): Likewise.
8437 * script-sections.cc
8438 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
8439 argument with NULL.
8440 (Sections_elememt_dot_assignment::set_section_addresses):
8441 Likewise.
8442 (Output_data_expression::do_write_to_buffer): Likewise.
8443 (Output_section_definition::finalize_symbols): Likewise.
8444 (Output_section_definition::set_section_addresses): Likewise.
8445
f81bc8b5
DK
84462010-09-30 Doug Kwan <dougkwan@google.com>
8447
8448 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
8449
c95e9f27
ST
84502010-09-28 Sriraman Tallam <tmsriram@google.com>
8451
8452 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 8453 function.
c95e9f27
ST
8454 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
8455 virtual function.
8456 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
8457 virtual function.
8458 * icf.cc (get_section_contents): Inline merge sections only when
8459 target allows it.
8460
3cac54d2
RW
84612010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8462
8463 * configure: Regenerate.
8464
2904037a
ILT
84652010-09-17 Ian Lance Taylor <iant@google.com>
8466
8467 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
8468 * testsuite/Makefile.am (memory_test.o): New target.
8469 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
8470 memory_test.t.
8471 * testsuite/Makefile.in: Rebuild.
2904037a 8472
bca7fb63
DK
84732010-09-17 Doug Kwan <dougkwan@google.com>
8474
8475 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
8476 defintion if relocation uses GOT entries of the symbol.
8477 * testsuite/icf_safe_test.sh: Fix test.
8478 * testsuite/icf_safe_so_test.sh: Fix test.
8479
4ef28648
CC
84802010-09-16 Cary Coutant <ccoutant@google.com>
8481
8482 * script_sections.cc (class Memory_region): Remove "NULL" from
8483 vector initializations.
8484
793990de
CC
84852010-09-15 Cary Coutant <ccoutant@google.com>
8486
8487 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
8488 Resolve forwarding symbols.
8489
81e015e2
DK
84902010-09-15 Doug Kwan <dougkwan@google.com>
8491
8492 * gold/testsuite/script_test_3.t: Add ARM special sections.
8493 * gold/testsuite/script_test_4.t: Same.
8494 * gold/testsuite/script_test_5.t: Same.
8495 * gold/testsuite/script_test_6.t: Same.
8496 * gold/testsuite/script_test_7.t: Same.
8497 * gold/testsuite/script_test_7.t: Same.
8498 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
8499
36171d64
CC
85002010-09-14 Cary Coutant <ccoutant@google.com>
8501
8502 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
8503 (Target_x86_64::Relocate::relocate_tls): Replace check for
8504 saw_tls_block_reloc_ with test for executable section.
8505
d89051bd
CC
85062010-09-12 Cary Coutant <ccoutant@google.com>
8507
8508 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
8509 position-independent executables to shared libraries need dynamic
8510 relocations.
8511 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
8512 position-independent executables.
8513 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
8514 * testsuite/Makefile.in: Regenerate.
8515
fca41f0f
NC
85162010-09-10 Nick Clifton <nickc@redhat.com>
8517
8518 PR gold/11997
8519 * testsuite/memory_test.t: Discard any sections that are not
8520 needed.
8521
6695e4b3
L
85222010-09-09 H.J. Lu <hongjiu.lu@intel.com>
8523
8524 PR gold/11996
8525 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
8526 "This::" to work around a bug in gcc 4.2.
8527
8528 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
8529
0f72bf6f
RÁE
85302010-09-09 Rafael Espindola <espindola@google.com>
8531
8532 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
8533 sections with different PF_X flags in the same segment.
8534 (Layout::find_first_load_seg): Search all segments to find the first
8535 one.
8536 * options.h (rosegment): New.
8537
85382010-09-08 Rafael Espindola <espindola@google.com>
a6577478 8539
05a79166 8540 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 8541
aa98ff75
DK
85422010-09-08 Doug Kwan <dougkwan@google.com>
8543
8544 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
8545 (Arm_relobj::do_relocate_sections): Add new parameter for output
8546 file to match the parent.
8547 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
8548 of local symbols instead of input values. Update code to track
8549 changes in gold::relocate_section.
8550 * object.cc (Sized_relobj::compute_final_local_value): New methods.
8551 (Sized_relobj::compute_final_local_value_internal): New methods.
8552 (Sized_relobj::do_finalize_local_symbols): Move code from loop
8553 body into private version of Sized_relobj::compute_final_local_value.
8554 Call the inline method.
8555 * object.h (Symbol_value::Symbol_value): Define destructor. Free
8556 merged symbol value if there is one.
8557 (Symbol_value::has_output_value): New method defintiion.
8558 (Sized_relobj::Compute_final_local_value_status): New enum type.
8559 (Sized_relobj::compute_final_local_value): New methods.
8560 (Sized_relobj::compute_final_local_value_internal): New methods.
8561 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
8562 and arm_cortex_a8.sh.
8563 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
8564 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
8565 New tests.
8566 * Makefile.in: Regenerate.
8567 * testsuite/arm_bl_out_of_range.s: Update test.
8568 * testsuite/thumb_bl_out_of_range.s: Ditto.
8569 * testsuite/thumb_blx_out_of_range.s: Ditto.
8570 * testsuite/arm_branch_out_of_range.sh: New file.
8571 * testsuite/arm_cortex_a8.sh: Ditto.
8572 * testsuite/arm_cortex_a8_b.s: Ditto.
8573 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
8574 * testsuite/arm_cortex_a8_b_local.s: Ditto.
8575 * testsuite/arm_cortex_a8_bl.s: Ditto.
8576 * testsuite/arm_cortex_a8_blx.s: Ditto.
8577 * testsuite/arm_cortex_a8_local.s: Ditto.
8578 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
8579 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
8580
05a79166
L
85812010-09-08 Rafael Espindola <espindola@google.com>
8582
8583 * Makefile.am (memory_test.stdout): Run readelf with -W.
8584 * Makefile.in: Regenerate.
8585 * testsuite/memory_test.sh: Make the regexps accept both 32 and
8586 64 bit output.
8587
33dbc701
RÁE
85882010-09-08 Rafael Espindola <espindola@google.com>
8589
8590 * script-sections.cc (Script_sections::add_memory_region): Convert
8591 field precision to int.
8592 * script.cc (script_set_section_region, script_set_section_region):
8593 Convert field precision to int.
8594
731ca54a
RÁE
85952010-09-08 Rafael Espindola <espindola@google.com>
8596
8597 * arm.cc (do_finalize_sections): Create the __exidx_start and
8598 __exdix_end symbols even when the section is missing.
8599
7f8cd844
NC
86002010-09-08 Nick Clifton <nickc@redhat.com>
8601
8602 * README: Remove claim that MEMORY is not supported.
8603 * expression.cc (script_exp_function_origin)
8604 (script_exp_function_length): Move from here to ...
8605 * script.cc: ... here.
8606 (script_set_section_region, script_add_memory)
8607 (script_parse_memory_attr, script_include_directive): New
8608 functions.
8609 * script-sections.cc
8610 (class Memory_region): New class.
8611 (class Output_section_definition): Add set_memory_region,
8612 set_section_vma, set_section_lma and get_section_name methods.
8613 (class Script_Sections): Add add_memory_region,
8614 find_memory_region, find_memory_region_origin,
8615 find_memory_region_length and set_memory_region methods.
8616 Have set_section_addresses method walk the list of set memory
8617 regions.
8618 Extend the print methos to display memory regions.
8619 * script-sections.h: Add prototypes for new methods.
8620 Add enum for MEMORY region attributes.
8621 * yyscript.y: Add support for parsing MEMORY regions.
8622 * script-c.h: Add prototypes for new functions.
8623 * testsuite/Makefile.am: Add test of MEMORY region functionality.
8624 * testsuite/Makefile.in: Regenerate.
8625 * testsuite/memory_test.sh: New script.
8626 * testsuite/memory_test.s: New assembler source file.
8627 * testsuite/memory_test.t: New linker script.
8628
a4649286
DK
86292010-08-27 Doug Kwan <dougkwan@google.com>
8630
8631 * gold/resolve.cc (Symbol_table::should_override): Let a weak
8632 reference override an existing dynamic weak reference.
8633 * testsuite/Makefile.am: Add new test dyn_weak_ref.
8634 * testsuite/Makefile.in: Regenerate.
8635 * testsuite/dyn_weak_ref.sh: New file.
8636 * testsuite/dyn_weak_ref_1.c: Ditto.
8637 * testsuite/dyn_weak_ref_2.c: Ditto.
8638
b56648ad
ILT
86392010-08-27 Ian Lance Taylor <iant@google.com>
8640
8641 * incremental.h (class Incremental_input_entry): Add virtual
8642 destructor.
8643
809313cb
ILT
86442010-08-27 Ian Lance Taylor <iant@google.com>
8645
8646 * testsuite/start_lib_test_3.c: Mark t3 as used.
8647
11e32464
NC
86482010-08-27 Nick Clifton <nickc@redhat.com>
8649
8650 * options.cc (version_script): Fix small typo in previous
8651 whitespace tidyup.
8652
ca09d69a
NC
86532010-08-25 Nick Clifton <nickc@redhat.com>
8654
8655 * archive.cc: Formatting fixes: Remove whitespace between
8656 typename and following asterisk. Remove whitespace between
8657 function name and opening parenthesis.
8658 * archive.h: Likewise.
8659 * arm.cc: Likewise.
8660 * attributes.cc: Likewise.
8661 * attributes.h: Likewise.
8662 * common.cc: Likewise.
8663 * copy-relocs.cc: Likewise.
8664 * dirsearch.h: Likewise.
8665 * dynobj.cc: Likewise.
8666 * ehframe.cc: Likewise.
8667 * ehframe.h: Likewise.
8668 * expression.cc: Likewise.
8669 * fileread.cc: Likewise.
8670 * fileread.h: Likewise.
8671 * gc.h: Likewise.
8672 * gold-threads.cc: Likewise.
8673 * gold.cc: Likewise.
8674 * i386.cc: Likewise.
8675 * icf.h: Likewise.
8676 * incremental-dump.cc: Likewise.
8677 * incremental.cc: Likewise.
8678 * layout.cc: Likewise.
8679 * layout.h: Likewise.
8680 * main.cc: Likewise.
8681 * merge.cc: Likewise.
8682 * merge.h: Likewise.
8683 * object.cc: Likewise.
8684 * object.h: Likewise.
8685 * options.cc: Likewise.
8686 * options.h: Likewise.
8687 * output.cc: Likewise.
8688 * output.h: Likewise.
8689 * plugin.cc: Likewise.
8690 * plugin.h: Likewise.
8691 * powerpc.cc: Likewise.
8692 * reloc.cc: Likewise.
8693 * script-c.h: Likewise.
8694 * script-sections.cc: Likewise.
8695 * script.cc: Likewise.
8696 * stringpool.cc: Likewise.
8697 * symtab.cc: Likewise.
8698 * symtab.h: Likewise.
8699 * target.cc: Likewise.
8700 * timer.cc: Likewise.
8701 * timer.h: Likewise.
8702 * version.cc: Likewise.
8703 * x86_64.cc: Likewise.
8704
b8fa8750
NC
87052010-08-24 Nick Clifton <nickc@redhat.com>
8706
8707 PR 11899
8708 * layout.cc (segment_precedes): Sort segments by their physical
8709 addresses, if they have been set.
8710
9919d93b
CC
87112010-08-23 Cary Coutant <ccoutant@google.com>
8712
8713 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
8714 symbols data.
8715 (Lib_group::include_member): Unlock object after deleting its
8716 symbols data.
8717 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
8718 the bug fixed here.
8719
97b4be1c
CC
87202010-08-19 Neil Vachharajani <nvachhar@google.com>
8721 Cary Coutant <ccoutant@google.com>
8722
8723 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
8724 constructor, and set_blocker.
8725 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
8726 readsyms_blocker_.
8727 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
8728 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
8729 * testsuite/Makefile.am (start_lib_test): New test case.
8730 * testsuite/Makefile.in: Regenerate.
8731 * testsuite/start_lib_test_main.c: New file.
8732 * testsuite/start_lib_test_1.c: New file.
8733 * testsuite/start_lib_test_2.c: New file.
8734 * testsuite/start_lib_test_3.c: New file.
8735
dd0b1884
ILT
87362010-08-19 Ian Lance Taylor <iant@google.com>
8737
8738 * Makefile.in: Rebuild with automake 1.11.1.
8739 * aclocal.m4: Likewise.
8740 * testsuite/Makefile.in: Likewise.
8741
7223e9ca
ILT
87422010-08-19 Ian Lance Taylor <iant@google.com>
8743
8744 PR 10893
8745 * i386.cc (class Output_data_plt_i386): Update declarations.
8746 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
8747 local_ifuncs_ fields.
8748 (Target_i386::do_plt_section_for_global): New function.
8749 (Target_i386::do_plt_section_for_local): New function.
8750 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
8751 parameter; change all callers. Initialize global_ifuncs_ and
8752 local_ifuncs_. If doing a static link define __rel_iplt_start and
8753 __rel_iplt_end.
8754 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
8755 (Output_data_plt_i386::add_local_ifunc_entry): New function.
8756 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
8757 symbols.
8758 (Target_i386::make_plt_section): New function, broken out of
8759 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
8760 (Target_i386::make_plt_entry): Call make_plt_section.
8761 (Target_i386::make_local_ifunc_plt_entry): New function.
8762 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
8763 (Target_i386::Scan::local): Handle IFUNC symbols. Add
8764 R_386_IRELATIVE to switch.
8765 (Target_i386::Scan::global): Likewise.
8766 (Target_i386::Relocate::relocate): Likewise.
8767 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
8768 switch.
8769 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
8770 (Target_x86_64::do_plt_section_for_global): New function.
8771 (Target_x86_64::do_plt_section_for_local): New function.
8772 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
8773 parameter; change all callers. If doing a static link define
8774 __rela_iplt_start and __rela_iplt_end.
8775 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
8776 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
8777 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
8778 to point to .plt.
8779 (Target_x86_64::make_local_ifunc_plt_entry): New function.
8780 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
8781 switch.
8782 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
8783 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
8784 R_X86_64_IRELATIVE to switch.
8785 (Target_x86_64::Scan::global): Likewise.
8786 (Target_x86_64::Relocate::relocate): Likewise.
8787 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
8788 switch.
8789 * target.h (class Target): Add plt_section_for_global and
8790 plt_section_for_local functions. Add do_plt_section_for_global
8791 and do_plt_section_for_local virtual functions.
8792 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
8793 clarifying comments.
8794 (Symbol::use_plt_offset): Handle IFUNC symbol.
8795 * object.cc (Sized_relobj::Sized_relobj): Initialize
8796 local_plt_offsets_.
8797 (Sized_relobj::local_has_plt_offset): New function.
8798 (Sized_relobj::local_plt_offset): New function.
8799 (Sized_relobj::set_local_plt_offset): New function.
8800 (Sized_relobj::do_count): Handle IFUNC symbol.
8801 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
8802 a bit away from input_shndx_ field. Add set_is_func_symbol and
8803 is_ifunc_symbol functions.
8804 (class Sized_relobj): Update declarations. Remove Tls_got_entry
8805 and Local_tls_got_offsets. Define Local_plt_offsets. Add
8806 local_plt_offsets_ field.
8807 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
8808 * output.h (class Output_section_data): Add non-const
8809 output_section function.
8810 (class Output_data_got): Update declarations.
8811 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
8812 Add use_plt_offset parameter to global and local constructors.
8813 Change all callers. Change local_sym_index_ field to 31 bits.
8814 Change GSYM_CODE and CONSTANT_CODE accordingly.
8815 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
8816 doing a static link don't set sh_link field.
8817 (Output_data_got::Got_entry::write): Use PLT offset if
8818 appropriate.
8819 (Output_data_got::add_global_plt): New function.
8820 (Output_data_got::add_local_plt): New function.
8821 * target-reloc.h (relocate_section): Handle IFUNC symbol.
8822 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
8823 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
8824 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
8825 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
8826 IFUNC conditional.
8827 * testsuite/ifunc-sel.h: New file.
8828 * testsuite/ifuncmain1.c: New file.
8829 * testsuite/ifuncmain1vis.c: New file.
8830 * testsuite/ifuncmod1.c: New file.
8831 * testsuite/ifuncdep2.c: New file.
8832 * testsuite/ifuncmain2.c: New file.
8833 * testsuite/ifuncmain3.c: New file.
8834 * testsuite/ifuncmod3.c: New file.
8835 * testsuite/ifuncmain4.c: New file.
8836 * testsuite/ifuncmain5.c: New file.
8837 * testsuite/ifuncmod5.c: New file.
8838 * testsuite/ifuncmain6pie.c: New file.
8839 * testsuite/ifuncmod6.c: New file.
8840 * testsuite/ifuncmain7.c: New file.
8841 * configure, testsuite/Makefile.in: Rebuild.
8842
56f75c03
ILT
88432010-08-18 Ian Lance Taylor <iant@google.com>
8844
8845 * incremental.cc
8846 (Output_section_incremental_inputs::write_input_files): Add cast
8847 to avoid signed/unsigned comparison warning.
8848 (Output_section_incremental_inputs::write_info_blocks): Likewise.
8849
55455f89
CC
88502010-08-12 Cary Coutant <ccoutant@google.com>
8851
8852 * common.cc (Sort_commons::operator()): Remove unnecessary code.
8853
e2054bcb
ILT
88542010-08-13 Ian Lance Taylor <iant@google.com>
8855
8856 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
8857
74f67560
DK
88582010-08-12 Cary Coutant <ccoutant@google.com>
8859 Doug Kwan <dougkwan@google.com>
8860
8861 * resolve.cc (Symbol_table::should_override): When a weak dynamic
8862 defintion overrides non-weak undef, remember that the original undef
8863 is not weak.
8864 * symtab.cc (Symbol_table::sized_write_global): For undef without
8865 an original weak binding, set binding to global in output.
8866 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
8867 * testsuite/Makefile.in: Regenerate.
8868 * testsuite/strong_ref_weak_def.sh: New file.
8869 * testsuite/strong_ref_weak_def_1.c: Ditto.
8870 * testsuite/strong_ref_weak_def_2.c: Ditto.
8871
d1238d12
CC
88722010-08-12 Cary Coutant <ccoutant@google.com>
8873
8874 * testsuite/incremental_test.sh: Rewrite.
8875 * testsuite/incremental_test_1.c: Rewrite.
8876 * testsuite/incremental_test_2.c: Rewrite.
8877
0e70b911
CC
88782010-08-12 Cary Coutant <ccoutant@google.com>
8879
8880 * arm.cc (Target_arm::got_size): Add const.
8881 (Target_arm::got_entry_count): New function.
8882 (Target_arm::plt_entry_count): New function.
8883 (Target_arm::first_plt_entry_offset): New function.
8884 (Target_arm::plt_entry_size): New function.
8885 (Output_data_plt_arm::entry_count): New function.
8886 (Output_data_plt_arm::first_plt_entry_offset): New function.
8887 (Output_data_plt_arm::get_plt_entry_size): New function.
8888 * i386.cc (Target_i386::got_size): Add const.
8889 (Target_i386::got_entry_count): New function.
8890 (Target_i386::plt_entry_count): New function.
8891 (Target_i386::first_plt_entry_offset): New function.
8892 (Target_i386::plt_entry_size): New function.
8893 (Output_data_plt_i386::entry_count): New function.
8894 (Output_data_plt_i386::first_plt_entry_offset): New function.
8895 (Output_data_plt_i386::get_plt_entry_size): New function.
8896 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
8897 find_incremental_inputs_sections. Dump incremental_got_plt section.
8898 * incremental.cc: Include target.h.
8899 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
8900 parameter. Adjust all callers. Find incremental_got_plt section.
8901 (Incremental_inputs::create_data_sections): Create incremental_got_plt
8902 section.
8903 (Output_section_incremental_inputs::set_final_data_size): Calculate
8904 size of incremental_got_plt section.
8905 (Output_section_incremental_inputs::do_write): Write the
8906 incremental_got_plt section.
8907 (Got_plt_view_info): New struct.
8908 (Local_got_offset_visitor): New class.
8909 (Global_got_offset_visitor): New class.
8910 (Global_symbol_visitor_got_plt): New class.
8911 (Output_section_incremental_inputs::write_got_plt): New function.
8912 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
8913 Add parameter. Adjust all callers.
8914 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
8915 (Incremental_inputs::got_plt_section): New function.
8916 (Incremental_inputs::got_plt_section_): New data member.
8917 (Incremental_got_plt_reader): New class.
8918 * layout.cc (Layout::create_incremental_info_sections): Add the
8919 incremental_got_plt section.
8920 * object.h (Got_offset_list::get_list): New function.
8921 (Got offset_list::for_all_got_offsets): New function.
8922 (Sized_relobj::local_got_offset_list): New function.
8923 * powerpc.cc (Target_powerpc::got_size): Add const.
8924 (Target_powerpc::got_entry_count): New function.
8925 (Target_powerpc::plt_entry_count): New function.
8926 (Target_powerpc::first_plt_entry_offset): New function.
8927 (Target_powerpc::plt_entry_size): New function.
8928 (Output_data_plt_powerpc::entry_count): New function.
8929 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
8930 (Output_data_plt_powerpc::get_plt_entry_size): New function.
8931 * sparc.cc (Target_sparc::got_size): Add const.
8932 (Target_sparc::got_entry_count): New function.
8933 (Target_sparc::plt_entry_count): New function.
8934 (Target_sparc::first_plt_entry_offset): New function.
8935 (Target_sparc::plt_entry_size): New function.
8936 (Output_data_plt_sparc::entry_count): New function.
8937 (Output_data_plt_sparc::first_plt_entry_offset): New function.
8938 (Output_data_plt_sparc::get_plt_entry_size): New function.
8939 * symtab.h (Symbol::got_offset_list): New function.
8940 (Symbol_table::for_all_symbols): New function.
8941 * target.h (Sized_target::got_entry_count): New function.
8942 (Sized_target::plt_entry_count): New function.
8943 (Sized_target::plt_entry_size): New function.
8944 * x86_64.cc (Target_x86_64::got_size): Add const.
8945 (Target_x86_64::got_entry_count): New function.
8946 (Target_x86_64::plt_entry_count): New function.
8947 (Target_x86_64::first_plt_entry_offset): New function.
8948 (Target_x86_64::plt_entry_size): New function.
8949 (Output_data_plt_x86_64::entry_count): New function.
8950 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
8951 (Output_data_plt_x86_64::get_plt_entry_size): New function.
8952
09ec0418
CC
89532010-08-12 Cary Coutant <ccoutant@google.com>
8954
8955 * archive.cc: Include incremental.h.
8956 (Archive::Archive): Initialize incremental_info_.
8957 (Archive::include_member): Record archive members in incremental info.
8958 (Add_archive_symbols::run): Record begin and end of an archive in
8959 incremental info.
8960 (Lib_group::include_member): Record objects in incremental info.
8961 * archive.h (Incremental_archive_entry): Forward declaration.
8962 (Archive::set_incremental_info): New member function.
8963 (Archive::incremental_info): New member function.
8964 (Archive::Unused_symbol_iterator): New class.
8965 (Archive::unused_symbols_begin): New member function.
8966 (Archive::unused_symbols_end): New member function.
8967 (Archive::incremental_info_): New data member.
8968 * incremental-dump.cc (find_input_containing_global): New function.
8969 (dump_incremental_inputs): Dump new incremental info sections.
8970 * incremental.cc: Include symtab.h.
8971 (Output_section_incremental_inputs): New class.
8972 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
8973 new incremental info sections.
8974 (Sized_incremental_binary::do_check_inputs): Likewise.
8975 (Incremental_inputs::report_archive): Remove.
8976 (Incremental_inputs::report_archive_begin): New function.
8977 (Incremental_inputs::report_archive_end): New function.
8978 (Incremental_inputs::report_object): New function.
8979 (Incremental_inputs::finalize_inputs): Remove.
8980 (Incremental_inputs::report_input_section): New function.
8981 (Incremental_inputs::report_script): Rewrite.
8982 (Incremental_inputs::finalize): Do nothing but finalize string table.
8983 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
8984 (Incremental_inputs::sized_create_inputs_section_data): Remove.
8985 (Incremental_inputs::create_data_sections): New function.
8986 (Incremental_inputs::relocs_entsize): New function.
8987 (Output_section_incremental_inputs::set_final_data_size): New function.
8988 (Output_section_incremental_inputs::do_write): New function.
8989 (Output_section_incremental_inputs::write_header): New function.
8990 (Output_section_incremental_inputs::write_input_files): New function.
8991 (Output_section_incremental_inputs::write_info_blocks): New function.
8992 (Output_section_incremental_inputs::write_symtab): New function.
8993 * incremental.h (Incremental_script_entry): Forward declaration.
8994 (Incremental_object_entry): Forward declaration.
8995 (Incremental_archive_entry): Forward declaration.
8996 (Incremental_inputs): Forward declaration.
8997 (Incremental_inputs_header_data): Remove.
8998 (Incremental_inputs_header): Remove.
8999 (Incremental_inputs_header_write): Remove.
9000 (Incremental_inputs_entry_data): Remove.
9001 (Incremental_inputs_entry): Remove.
9002 (Incremental_inputs_entry_write): Remove.
9003 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
9004 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
9005 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
9006 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
9007 Likewise.
9008 (Incremental_input_entry): New class.
9009 (Incremental_script_entry): New class.
9010 (Incremental_object_entry): New class.
9011 (Incremental_archive_entry): New class.
9012 (Incremental_inputs::Incremental_inputs): Initialize new data members.
9013 (Incremental_inputs::report_inputs): Remove.
9014 (Incremental_inputs::report_archive): Remove.
9015 (Incremental_inputs::report_archive_begin): New function.
9016 (Incremental_inputs::report_archive_end): New function.
9017 (Incremental_inputs::report_object): Change prototype.
9018 (Incremental_inputs::report_input_section): New function.
9019 (Incremental_inputs::report_script): Change prototype.
9020 (Incremental_inputs::get_reloc_count): New function.
9021 (Incremental_inputs::set_reloc_count): New function.
9022 (Incremental_inputs::create_data_sections): New function.
9023 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9024 (Incremental_inputs::inputs_section): New function.
9025 (Incremental_inputs::symtab_section): New function.
9026 (Incremental_inputs::relocs_section): New function.
9027 (Incremental_inputs::get_stringpool): Add const.
9028 (Incremental_inputs::command_line): Add const.
9029 (Incremental_inputs::inputs): Remove.
9030 (Incremental_inputs::command_line_key): New function.
9031 (Incremental_inputs::input_file_count): New function.
9032 (Incremental_inputs::input_files): New function.
9033 (Incremental_inputs::relocs_entsize): New function.
9034 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9035 (Incremental_inputs::finalize_inputs): Remove.
9036 (Incremental_inputs::Input_info): Remove.
9037 (Incremental_inputs::lock_): Remove.
9038 (Incremental_inputs::inputs_): Change type.
9039 (Incremental_inputs::inputs_map_): Remove.
9040 (Incremental_inputs::current_object_entry_): New data member.
9041 (Incremental_inputs::inputs_section_): New data member.
9042 (Incremental_inputs::symtab_section_): New data member.
9043 (Incremental_inputs::relocs_section_): New data member.
9044 (Incremental_inputs::reloc_count_): New data member.
9045 (Incremental_inputs_reader): New class.
9046 (Incremental_symtab_reader): New class.
9047 (Incremental_relocs_reader): New class.
9048 * layout.cc (Layout::finalize): Move finalization of incremental info
9049 and creation of incremental info sections to follow finalization of
9050 symbol table. Set offsets for postprocessing sections.
9051 (Layout::create_incremental_info_sections): Call
9052 Incremental_inputs::create_data_sections. Add incremental symtab
9053 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
9054 sections to layout after input sections.
9055 * layout.h (struct Timespec): Forward declaration.
9056 (Layout::incremental_inputs): Add const.
9057 (Layout::create_incremental_info_sections): Add parameter.
9058 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
9059 * object.cc: Include incremental.h.
9060 (Relobj::finalize_incremental_relocs): New function.
9061 (Sized_relobj::do_layout): Record input sections in incremental info.
9062 * object.h (Object::output_section): New function.
9063 (Object::output_section_offset): Moved from Relobj.
9064 (Object::get_incremental_reloc_base): New function.
9065 (Object::get_incremental_reloc_count): New function.
9066 (Object::do_output_section): New function.
9067 (Object::do_output_section_offset): Moved from Relobj.
9068 (Object::do_get_incremental_reloc_base): New function.
9069 (Object::do_get_incremental_reloc_count): New function.
9070 (Object::Object): Initialize new data members.
9071 (Relobj::output_section): Renamed do_output_section and moved to
9072 protected.
9073 (Relobj::output_section_offset): Moved to Object.
9074 (Relobj::do_get_incremental_reloc_base): New function.
9075 (Relobj::do_get_incremental_reloc_count): New function.
9076 (Relobj::allocate_incremental_reloc_counts): New function.
9077 (Relobj::count_incremental_reloc): New function.
9078 (Relobj::finalize_incremental_relocs): New function.
9079 (Relobj::next_incremental_reloc_index): New function.
9080 (Relobj::reloc_counts_): New data member.
9081 (Relobj::reloc_bases_): New data member.
9082 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
9083 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
9084 (Sized_relobj::incremental_relocs_scan): New function.
9085 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9086 (Sized_relobj::incremental_relocs_write): New function.
9087 (Sized_relobj::incremental_relocs_write_reltype): New function.
9088 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
9089 incremental link.
9090 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
9091 archives and object files elsewhere.
9092 (Add_symbols::run): Report object files here.
9093 (Finish_group::run): Report end of archive at end of group.
9094 * reloc.cc: Include layout.h, incremental.h.
9095 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
9096 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
9097 (Sized_relobj::incremental_relocs_scan): New function.
9098 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9099 (Sized_relobj::do_relocate_sections): Write incremental relocations.
9100 (Sized_relobj::incremental_relocs_write): New function.
9101 (Sized_relobj::incremental_relocs_write_reltype): New function.
9102 * script.cc (read_input_script): Rewrite test for incremental link.
9103 Change call to Incremental_inputs::report_script.
9104 * symtab.h (Symbol_table::first_global_index): New function.
9105 (Symbol_table::output_count): New function.
9106
ce0d1972
DK
91072010-08-12 Doug Kwan <dougkwan@google.com>
9108
9109 * arm.cc (Target_arm::merge_object_attributes): Check command line
9110 options --no-wchar-size-warning and --no-enum-size-warning.
9111 * options.h (General_options): Add ld-compatible options
9112 --no-enum-size-warning and --no-wchar-size-warning.
9113
6e5710ce
ILT
91142010-08-04 Ian Lance Taylor <iant@google.com>
9115
9116 * x86_64.cc (Target_x86_64::Scan::local): Use
9117 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
9118 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
9119 (Target_x86_64::Scan::global): Likewise.
9120 (Target_x86_64::Relocate::relocate): Likewise.
9121 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
9122 Likewise.
9123
fef830db
CC
91242010-08-03 Cary Coutant <ccoutant@google.com>
9125
9126 * merge.cc (Output_merge_string::do_add_input_section): Count strings
9127 to reserve space in merged_strings vector. Keep total input size
9128 for stats.
9129 (Output_merge_string::do_print_merge_stats): Print total input size.
9130 * merge.h (Output_merge_string): Add input_size_ field.
9131 * stringpool.cc (Stringpool_template::string_length): Move
9132 implementations out of Stringpool_template class and place in
9133 stringpool.h.
9134 * stringpool.h (string_length): Move out of Stringpool_template.
9135
1e3811b0
ILT
91362010-08-03 Ian Lance Taylor <iant@google.com>
9137
9138 PR 11712
9139 * layout.cc (relaxation_loop_body): If address of load segment is
9140 set, adjust address to include headers if possible.
9141
7af0c620
ILT
91422010-08-03 Ian Lance Taylor <iant@google.com>
9143
9144 * version.cc (version_string): Bump to 1.10.
9145
22f0da72
ILT
91462010-08-03 Ian Lance Taylor <iant@google.com>
9147
9148 PR 11805
9149 * layout.h (enum Output_section_order): Define.
9150 (class Layout): Update declarations.
9151 * layout.cc (Layout::get_output_section): Add order parameter.
9152 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
9153 is_first_non_relro parameters. Change all callers.
9154 (Layout::choose_output_section): Likewise.
9155 (Layout::add_output_section_data): Likewise.
9156 (Layout::make_output_section): Likewise. Set order.
9157 (Layout::default_section_order): New function.
9158 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
9159 * output.cc (Output_section::Output_section): Initialize order_.
9160 Don't initialize deleted fields.
9161 (Output_segment::Output_segment): Don't initialize deleted
9162 fields.
9163 (Output_segment::add_output_section_to_load): New function
9164 replacing add_output_section. Change all callers to call this or
9165 add_output_section_to_nonload.
9166 (Output_segment::add_output_section_to_nonload): New function.
9167 (Output_segment::remove_output_section): Rewrite.
9168 (Output_segment::add_initial_output_data): Likewise.
9169 (Output_segment::has_any_data_sections): Likewise.
9170 (Output_segment::is_first_section_relro): Likewise.
9171 (Output_segment::maximum_alignment): Likewise.
9172 (Output_segment::has_dynamic_reloc): New function replacing
9173 dynamic_reloc_count. Change all callers.
9174 (Output_segment::has_dynamic_reloc_list): New function replacing
9175 dynamic_reloc_count_list. Change all callers.
9176 (Output_segment::set_section_addresses): Rewrite.
9177 (Output_segment::set_offset): Rewrite.
9178 (Output_segment::find_first_and_last_list): Remove.
9179 (Output_segment::set_tls_offsets): Rewrite.
9180 (Output_segment::first_section_load_address): Likewise.
9181 (Output_segment::output_section_count): Likewise.
9182 (Output_segment::section_with_lowest_load_address): Likewise.
9183 (Output_segment::write_section_headers): Likewise.
9184 (Output_segment::print_sections_to_map): Likewise.
9185 * output.h (class Output_data): Remove dynamic_reloc_count_
9186 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
9187 (Output_data::add_dynamic_reloc): Rewrite.
9188 (Output_data::has_dynamic_reloc): New function.
9189 (Output_data::dynamic_reloc_count): Remove.
9190 (class Output_section): Add order_ field. Remvoe is_relro_local_,
9191 is_last_relro_, is_first_non_relro_, is_interp_,
9192 is_dynamic_linker_section_ fields. Add order and set_order
9193 functions. Remove is_relro_local, set_is_relro_local,
9194 is_last_relro, set_is_last_relro, is_first_non_relro,
9195 set_is_first_non_relro functions, is_interp, set_is_interp,
9196 is_dynamic_linker_section, and set_is_dynamic_linker_section
9197 functions.
9198 (class Output_segment): Change Output_data_list from std::list to
9199 std:;vector. Add output_lists_ field. Remove output_data_ and
9200 output_bss_ fields. Update declarations.
9201
3ff2ccb0
ILT
92022010-08-02 Ian Lance Taylor <iant@google.com>
9203
9204 * arm.cc (Target_arm::gc_process_relocs): Use typename.
9205 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
9206 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
9207
88a4108b
ILT
92082010-08-02 Ian Lance Taylor <iant@google.com>
9209
9210 PR 11855
9211 * script.cc (Script_options::Script_options): Initialize
9212 symbol_definitions_ and symbol_references_.
9213 (Script_options::add_symbol_assignment): Update
9214 symbol_definitions_ and symbol_references_.
9215 (Script_options::add_symbol_reference): New function.
9216 (script_symbol): New function.
9217 * script.h (class Script_options): Add symbol_definitions_ and
9218 symbol_references_ fields.
9219 (Script_options::referenced_const_iterator): New type.
9220 (Script_options::referenced_begin): New function.
9221 (Script_options::referenced_end): New function.
9222 (Script_options::is_referenced): New function.
9223 (Script_options::any_unreferenced): New function.
9224 * script-c.h (script_symbol): Declare.
9225 * yyscript.y (exp): Call script_symbol.
9226 * symtab.cc: Include "script.h".
9227 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
9228 Change all callers. Check symbols referenced by scripts.
9229 (Symbol_table::add_undefined_symbols_from_command_line): Add
9230 layout parameter. Change all callers.
9231 (Symbol_table::do_add_undefined_symbols_from_command_line):
9232 Likewise. Break out loop body. Check symbols referenced by
9233 scripts.
9234 (Symbol_table::add_undefined_symbol_from_command_line): New
9235 function broken out of
9236 do_add_undefined_symbols_from_command_line.
9237 * symtab.h (class Symbol_table): Update declarations.
9238 * archive.cc: Include "layout.h".
9239 (Archive::should_include_member): Add layout parameter. Change
9240 all callers. Check for symbol mentioned in expression.
9241 * archive.h (class Archive): Update declaration.
9242 * object.cc (Sized_relobj::do_should_include_member): Add layout
9243 parameter.
9244 * object.h (Object::should_include_member): Add layout parameter.
9245 Change all callers.
9246 (Object::do_should_include_member): Add layout parameter.
9247 (class Sized_relobj): Update declaration.
9248 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
9249 parameter.
9250 * dynobj.h (class Sized_dynobj): Update declaration.
9251 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
9252 layout parameter.
9253 * plugin.h (class Sized_pluginobj): Update declaration.
9254
5f1ab67a
ILT
92552010-08-02 Ian Lance Taylor <iant@google.com>
9256
9257 PR 11866
9258 * output.cc (Output_segment::set_offset): Search for the first and
9259 last sections rather than assuming that the list is in order.
9260 (Output_segment::find_first_and_last_list): New function.
9261 * output.h (class Output_segment): Update declarations.
9262 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
9263 (relro_strip_test_SOURCES): New variable.
9264 (relro_strip_test_DEPENDENCIES): New variable.
9265 (relro_strip_test_LDFLAGS): New variable.
9266 (relro_strip_test_LDADD): New variable.
9267 (relro_strip_test.so): New target.
9268
a8df5856
ILT
92692010-08-02 Ian Lance Taylor <iant@google.com>
9270
9271 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
9272 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
9273 (Target_i386::got_tlsdesc_section): New function.
9274 (Target_i386::got_section): Create space for GOT entries for
9275 TLSDESC relocations.
9276 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
9277 R_386_TLS_GOTDESC.
9278 (Target_i386::Scan::global): Likewise.
9279 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
9280 using TLSDESC GOT.
9281 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
9282 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
9283 (Target_x86_64::got_tlsdesc_section): New function.
9284 (Target_x86_64::got_section): Create space for GOT entries for
9285 TLSDESC relocations.
9286 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
9287 R_386_TLS_GOTDESC.
9288 (Target_x86_64::Scan::global): Likewise.
9289 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
9290 using TLSDESC GOT.
9291
0c10a0a6
ILT
92922010-08-02 Ian Lance Taylor <iant@google.com>
9293
9294 * testsuite/final_layout.sh: Use dc to convert from hex to
9295 decimal.
9296
41cbeecc
ST
92972010-07-29 Sriraman Tallam <tmsriram@google.com>
9298
9299 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
9300 paramter to the call to gold::gc_process_relocs.
9301 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
9302 paramter to the call to gold::gc_process_relocs.
9303 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
9304 parameter to the call to gold::gc_process_relocs.
9305 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
9306 template parameter to the call to gold::gc_process_relocs.
9307 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
9308 paramter to the call to gold::gc_process_relocs.
9309 * gc.h (get_embedded_addend_size): New function.
9310 (gc_process_relocs): Save the size of the reloc for use by ICF.
9311 * icf.cc (get_section_contents): Get the addend from the text section
9312 for SHT_REL relocation sections.
9313 * icf.h (Icf::Reloc_addend_size_info): New typedef.
9314 (Icf::Reloc_info): Add new member reloc_addend_size_info.
9315 * int_encoding.h (read_from_pointer): New overloaded function.
9316 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
9317 * testsuite/icf_sht_rel_addend_test.sh: New file.
9318 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
9319 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
9320
6ea55b82
RW
93212010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9322
9323 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
9324 * Makefile.in: Regenerate.
9325 * testsuite/Makefile.in: Regenerate.
9326
9691462b
ILT
93272010-07-27 Jeffrey Yasskin <jyasskin@google.com>
9328
9329 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
9330 * gold/testsuite/debug_msg.cc: Likewise.
9331 * gold/testsuite/odr_violation1.cc
9332 * gold/testsuite/odr_violation2.cc
9333
76897331
CC
93342010-07-21 Cary Coutant <ccoutant@google.com>
9335
9336 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
9337 string, and length fields.
9338 (Output_merge_string::Merged_strings_list): New type.
9339 (Output_merge_string::Merged_strings_lists): New typedef.
9340 (Output_merge_string): Replace merged_strings_ with
9341 merged_strings_lists_.
9342 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
9343 Merged_strings_list per input object and section. Don't store pointer
9344 to the string. Don't store length with each merged string entry.
9345 (Output_merge_string::finalize_merged_data): Loop over list of merged
9346 strings lists. Recompute length of each merged string.
9347
78384e8f
CC
93482010-07-15 Cary Coutant <ccoutant@google.com>
9349
9350 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
9351 here.
9352
783659f9
ILT
93532010-07-14 Ian Lance Taylor <iant@google.com>
9354
9355 * descriptors.cc (Descriptors::open): Report correct name in error
9356 message.
9357
131687b4
DK
93582010-07-13 Doug Kwan <dougkwan@google.com>
9359
9360 * arm.cc (Arm_input_section::Arm_input_section): For a
9361 SHT_ARM_EXIDX section, always keeps the input sections.
9362 (Arm_input_section::set_exidx_section_link): New method.
9363 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
9364 has_errors_ to false.
9365 (Arm_exidx_input_section::has_errors,
9366 Arm_exidx_input_section::set_has_errors): New methods.
9367 (Arm_exidx_input_section::has_errors_): New data member.
9368 (Arm_relobj::get_exidx_shndx_list): New method.
9369 (Arm_output_section::append_text_sections_to_list): Do not skip
9370 section without SHF_EXECINSTR.
9371 (Arm_output_section::fix_exidx_coverage): Skip input sections with
9372 errors.
2e702c99 9373 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
9374 section header. Make error messages more verbose. Check for
9375 a non-executable section linked to an EXIDX section.
9376 (Arm_relobj::do_read_symbols): Remove error checking, which has been
9377 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
9378 check that there is no deferred EXIDX section if we exit early.
9379 Instead of not making an EXIDX section in case of an error, make one
9380 and set the has_errors flag of it.
9381 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
9382 in a relocatable link.
9383 (Target_arm::do_relax): Look for the EXIDX output section instead of
9384 assuming that it is called .ARM.exidx.
2e702c99 9385 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
9386 section list. Do not check for SHF_EXECINSTR section flags but
9387 skip any input section with errors.
9388 * output.cc (Output_section::Output_section): Initialize
9389 always_keeps_input_sections_ to false.
9390 (Output_section::add_input_section): Check for
9391 always_keeps_input_sections_.
9392 * output.h (Output_section::always_keeps_input_sections,
9393 Output_section::set_always_keeps_input_sections): New methods.
9394 (Output_section::always_keeps_input_sections): New data member.
9395
69517287
RÁE
93962010-07-13 Rafael Espindola <espindola@google.com>
9397
9398 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
9399 * fileread.h (Input_file): Add try_extra_search_path and find_file.
9400
82742395
ILT
94012010-07-13 Philip Herron <herron.philip@googlemail.com>
9402 Ian Lance Taylor <iant@google.com>
9403
9404 * output.h (Output_section_lookup_maps::add_merge_section):
9405 Correct check of whether value was inserted.
9406 (Output_section_lookup_maps::add_merge_input_section): Likewise.
9407 (Output_section_lookup_maps::add_relaxed_input_section):
9408 Likewise.
9409 * arm.cc (Target_arm::got_section): Remove used local os.
9410 * i386.cc (Target_i386::got_section): Likewise.
9411 * x86_64.cc (Target_x86_64::got_section): Likewise.
9412 * sparc.cc (Target_sparc::got_section): Likewise.
9413 (Target_sparc::relocate): Remove unused local have_got_offset.
9414 * powerpc.cc (Target_powerpc::relocate): Likewise.
9415
f2d707b5
ILT
94162010-07-13 Ian Lance Taylor <iant@google.com>
9417
241531d6
ILT
9418 * compressed_output.cc (zlib_decompress): Fix signature in
9419 !HAVE_ZLIB_H case.
9420
f2d707b5
ILT
9421 * archive.cc (Archive::include_member): Unlock an external member
9422 of a thin archive. Don't bother to delete an object we know is
9423 NULL.
9424
a2e47362
CC
94252010-07-12 Cary Coutant <ccoutant@google.com>
9426
9427 * compressed_output.cc (zlib_decompress): New function.
9428 (get_uncompressed_size): New function.
9429 (decompress_input_section): New function.
9430 * compressed_output.h (get_uncompressed_size): New function.
9431 (decompress_input_section): New function.
9432 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
9433 Handle compressed debug sections.
9434 * layout.cc (is_compressed_debug_section): New function.
9435 (Layout::output_section_name): Map compressed section names to
9436 canonical names.
9437 * layout.h (is_compressed_debug_section): New function.
9438 (is_debug_info_section): Recognize compressed debug sections.
9439 * merge.cc: Include compressed_output.h.
9440 (Output_merge_data::do_add_input_section): Handle compressed
9441 debug sections.
9442 (Output_merge_string::do_add_input_section): Handle compressed
9443 debug sections.
9444 * object.cc: Include compressed_output.h.
9445 (Sized_relobj::Sized_relobj): Initialize new data members.
9446 (build_compressed_section_map): New function.
9447 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
9448 * object.h (Object::section_is_compressed): New method.
9449 (Object::do_section_is_compressed): New method.
9450 (Sized_relobj::Compressed_section_map): New type.
9451 (Sized_relobj::do_section_is_compressed): New method.
9452 (Sized_relobj::compressed_sections_): New data member.
9453 * output.cc (Output_section::add_input_section): Handle compressed
9454 debug sections.
9455 * reloc.cc: Include compressed_output.h.
9456 (Sized_relobj::write_sections): Handle compressed debug sections.
9457
ce279a62
CC
94582010-07-08 Cary Coutant <ccoutant@google.com>
9459
9460 * resolve.cc (Symbol_table::resolve): Remember whether undef was
9461 weak when resolving to a dynamic def.
9462 (Symbol_table::should_override): Add adjust_dyndef flag; set it
9463 for weak undef/dynamic def cases. Adjust callers.
9464 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
9465 undef_binding_weak_.
9466 (Symbol_table::sized_write_globals): Adjust symbol binding.
9467 (Symbol_table::sized_write_symbol): Add binding parameter.
9468 * symtab.h (Symbol::set_undef_binding): New method.
9469 (Symbol::is_undef_binding_weak): New method.
9470 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
9471 (Symbol_table::should_override): Add new parameter.
9472 (Symbol_table::sized_write_symbol): Add new parameter.
9473
9474 * testsuite/weak_undef_file1.cc: Add new test case.
9475 * testsuite/weak_undef_file2.cc: Fix header comment.
9476 * testsuite/weak_undef_test.cc: Add new test case.
9477
b2286c10
DK
94782010-06-29 Doug Kwan <dougkwan@google.com>
9479
9480 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
9481 Initialize USE_SYMBOL_.
9482 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
9483 definition.
9484 (Arm_reloc_property::uses_symbol_): New data member declaration.
9485 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
9486 uses symbol value and symbol is undefined but not weakly undefined.
9487
4802450a
RÁE
94882010-06-28 Rafael Espindola <espindola@google.com>
9489
9490 * plugin.cc (Plugin::load): Use dlerror.
9491
e5ca47ba
ILT
94922010-06-26 Jeffrey Yaskin <jyasskin@google.com>
9493
9494 * symtab.cc (detect_odr_violations): When reporting an ODR
9495 violation, report an object where the symbol is defined.
9496
8a75a161
DK
94972010-06-25 Doug Kwan <dougkwan@google.com>
9498
9499 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
9500 (Target_arm::section_may_have_icf_unsafe_pointers): New method
9501 definition.
9502 (Target_arm::Scan::local_reloc_may_be_function_pointer,
9503 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
9504 target hook to detect function points.
9505 (Target_arm::Scan::possible_function_pointer_reloc): New method.
9506 * icf.h (Icf::check_section_for_function_pointers): Change type of
9507 parameter SECTION_NAME to const reference to std::string. Use
9508 target hook to determine if section may have unsafe pointers.
9509 * target.h (Target::section_may_have_icf_unsafe_pointers): New
9510 method definition.
9511
42218b9f
RÁE
95122010-06-21 Rafael Espindola <espindola@google.com>
9513
9514 * fileread.cc (Input_file::find_fie): New
9515 (Input_file::open): Use Input_file::find_fie.
9516 * fileread.h (Input_file::find_fie): New
9517 * plugin.cc (set_extra_library_path): New.
9518 (Plugin::load): Add set_extra_library_path to the transfer vector.
9519 (Plugin_manager::set_extra_library_path): New.
9520 (Plugin_manager::add_input_file): Use the extra search path if set.
9521 (set_extra_library_path(): New.
9522 * plugin.h (Plugin_manager): Add set_extra_library_path and
9523 extra_search_path_.
9524
a0506cca
CC
95252010-06-19 Cary Coutant <ccoutant@google.com>
9526
9527 * layout.cc (gdb_sections): Add .debug_types.
9528 (lines_only_debug_sections): Likewise.
9529
6508b958
RÁE
95302010-06-18 Rafael Espindola <espindola@google.com>
9531
9532 * plugin.cc (add_input_file,add_input_library)
9533 (Plugin_manager::add_input_file): Make filename arguments const.
9534 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
9535 const.
9536
3e235302
DK
95372010-06-16 Doug Kwan <dougkwan@google.com>
9538
9539 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
9540 .ARM.attributes section if we have not merged any input
9541 attributes sections.
9542
106e8a6c
DK
95432010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9544
9545 * arm.cc: Allow combining objects with no EABI version
9546 information.
9547
91ff43fe
RÁE
95482010-06-15 Rafael Espindola <espindola@google.com>
9549
9550 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
9551
68ed838c
ILT
95522010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9553
9554 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
9555 (struct iovec): Correct !HAVE_READV definition.
9556
f3a2388f
CC
95572010-06-10 Cary Coutant <ccoutant@google.com>
9558
9559 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
9560 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
9561 reloc sections.
9562 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
9563
9564 PR 11683
9565 * symtab.h (Symbol::is_placeholder): New member function.
9566 * target-reloc.h (relocate_section): Check for placeholder symbols.
9567
9568 * testsuite/Makefile.am (plugin_test_8): New test.
9569 (plugin_test_9): New test.
9570 * testsuite/Makefile.in: Regenerate.
9571
e1df38aa
NC
95722010-06-09 Nick Clifton <nickc@redhat.com>
9573
9574 * yyscript.y (input_list_element): Allow strings prefixed with
9575 the '-' character. Treat these as libraries.
9576 * script.cc (script_add_library): New function. Adds a library
9577 specified by "-l<name>" found in an input script.
9578 * script-c.h: Add prototype for script_add_library.
9579
25bbe950
DK
95802010-06-07 Doug Kwan <dougkwan@google.com>
9581
9582 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
9583 Restrict stub-group size to be within long conditional branch
9584 range when working around cortex-A8 erratum.
9585
0f32ea4c
ILT
95862010-06-07 Damien Diederen <dd@crosstwine.com>
9587
9588 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
9589 #ifdef typo.
9590
8fe2a369
ST
95912010-06-03 Sriraman Tallam <tmsriram@google.com>
9592
9593 PR gold/11658
9594 * output.cc
9595 (Output_section::Input_section_sort_entry::compare_section_ordering):
9596 Change to return non-zero correctly.
9597 (Output_section::Input_section_sort_section_order_index_compare
9598 ::operator()): Change to fix ambiguity in comparisons.
9599
6e9ba2ca
ST
96002010-06-01 Sriraman Tallam <tmsriram@google.com>
9601
9602 * gold.h (is_wildcard_string): New function.
9603 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
9604 (Layout::layout_eh_frame): Ditto.
9605 (Layout::find_section_order_index): New method.
9606 (Layout::read_layout_from_file): New method.
9607 * layout.h (Layout::find_section_order_index): New method.
9608 (Layout::read_layout_from_file): New method.
9609 (Layout::input_section_position_): New private member.
9610 (Layout::input_section_glob_): New private member.
9611 * main.cc (main): Call read_layout_from_file here.
9612 * options.h (--section-ordering-file): New option.
9613 * output.cc (Output_section::input_section_order_specified_): New
9614 member.
9615 (Output_section::Output_section): Initialize new member.
9616 (Output_section::add_input_section): Add new parameter.
9617 Keep input sections when --section-ordering-file is used.
9618 (Output_section::set_final_data_size): Sort input sections when
9619 section ordering file is specified.
9620 (Output_section::Input_section_sort_entry): Add new parameter.
9621 Check sorting type.
9622 (Output_section::Input_section_sort_entry::compare_section_ordering):
9623 New method.
9624 (Output_section::Input_section_sort_compare::operator()): Change to
9625 consider section_order_index.
9626 (Output_section::Input_section_sort_init_fini_compare::operator()):
9627 Change to consider section_order_index.
9628 (Output_section::Input_section_sort_section_order_index_compare
9629 ::operator()): New method.
9630 (Output_section::sort_attached_input_sections): Change to sort
9631 according to section order when specified.
e1df38aa
NC
9632 (Output_section::add_input_section<32, true>): Add new parameter.
9633 (Output_section::add_input_section<64, true>): Add new parameter.
9634 (Output_section::add_input_section<32, false>): Add new parameter.
9635 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
9636 * output.h (Output_section::add_input_section): Add new parameter.
9637 (Output_section::input_section_order_specified): New
9638 method.
9639 (Output_section::set_input_section_order_specified): New method.
9640 (Input_section::Input_section): Initialize section_order_index_.
9641 (Input_section::section_order_index): New method.
9642 (Input_section::set_section_order_index): New method.
9643 (Input_section::section_order_index_): New member.
9644 (Input_section::Input_section_sort_section_order_index_compare): New
9645 struct.
9646 (Output_section::input_section_order_specified_): New member.
9647 * script-sections.cc (is_wildcard_string): Delete and move modified
9648 method to gold.h.
9649 (Output_section_element_input::Output_section_element_input): Modify
9650 call to is_wildcard_string.
9651 (Output_section_element_input::Input_section_pattern
9652 ::Input_section_pattern): Ditto.
9653 (Output_section_element_input::Output_section_element_input): Ditto.
9654 * testsuite/Makefile.am (final_layout): New test case.
9655 * testsuite/Makefile.in: Regenerate.
9656 * testsuite/final_layout.cc: New file.
9657 * testsuite/final_layout.sh: New file.
9658
3537c84b
RÁE
96592010-06-01 Rafael Espindola <espindola@google.com>
9660
9661 * plugin.cc (Plugin::load): Pass the output name to the plugin.
9662
105b6afd
RÁE
96632010-06-01 Rafael Espindola <espindola@google.com>
9664
9665 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
9666 visibility of symbols.
9667
29e11421
DK
96682010-05-27 Doug Kwan <dougkwan@google.com>
9669
9670 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
9671 from start of output section instead of address for a local symbol
9672 in a merged or relaxed section when doing a relocatable link.
9673
5e0f337e
RÁE
96742010-05-26 Rafael Espindola <espindola@google.com>
9675
703d02da 9676 PR 11604
5e0f337e
RÁE
9677 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
9678 adding sections the garbage collector removed.
9679 * gold/testsuite/Makefile.am: Add test.
9680 * gold/testsuite/Makefile.in: Regenerate.
9681 * gold/testsuite/plugin_test_7.sh: New.
9682 * gold/testsuite/plugin_test_7_1.c: New.
9683 * gold/testsuite/plugin_test_7_2.c: New.
9684
f4187277
RÁE
96852010-05-26 Rafael Espindola <espindola@google.com>
9686
9687 * script-sections.cc (Output_section_definition::set_section_addresses):
9688 Check for --section-start.
9689
5c388529
DK
96902010-05-26 Doug Kwan <dougkwan@google.com>
9691
9692 * arm.cc (Arm_scan_relocatable_relocs): New class.
9693 (Target_arm::relocate_special_relocatable): New method.
9694 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
9695 (Arm_relocate_functions::thumb_branch_common): Same.
9696 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
9697 instead of Default_scan_relocatable_relocs.
9698 * target-reloc.h (relocate_for_relocatable): Let target handle
9699 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
9700 * target.h (Sized_target::relocate_special_relocatable): New method.
9701
bca1c3ae
ILT
97022010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9703
9704 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
9705
0439c796
DK
97062010-05-23 Doug Kwan <dougkwan@google.com>
9707
9708 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
9709 instead of a cast.
9710 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
9711 with a direct branch, not a conditional branch, to a stub.
9712 * merge.cc (Output_merge_base::record_input_section): New method
9713 defintion.
9714 (Output_merge_data::do_add_input_section): Record input section if
9715 keeps-input-sections flag is set.
9716 (Output_merge_string::do_add_input_section): Ditto.
9717 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
9718 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
9719 INPUT_SECTIONS_.
9720 (Output_merge_base::keeps_input_sections,
9721 Output_merge_base::set_keeps_input_sections,
9722 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
9723 method definitions.
9724 (Output_merge_base::Input_sections): New type declaration.
9725 (Output_merge_base::input_sections_begin,
9726 Output_merge_base::input_sections_end,
9727 Output_merge_base::do_set_keeps_input_sections): New method definitions.
9728 (Output_merge_base::bool keeps_input_sections_,
9729 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
9730 Output_merge_base::input_sections_): New data members.
9731 (Output_merge_data::do_set_keeps_input_sections): New method
9732 defintion.
9733 (Output_merge_string::do_set_keeps_input_sections): Ditto.
9734 * output.cc (Output_section::Input_section::relobj): Move method
9735 defintion from class declaration to here and handle merge sections.
9736 (Output_section::Input_section::shndx): Ditto.
9737 (Output_section::Output_section): Remove initializations of removed
9738 data members and initialize new data member LOOKUP_MAPS_.
9739 (Output_section::add_input_section): Set keeps-input-sections flag
9740 for a newly created merge output section as appropriate. Adjust code
9741 to use Output_section_lookup_maps class.
9742 (Output_section::add_relaxed_input_section): Adjst code for lookup
9743 maps code refactoring.
2e702c99 9744 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
9745 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
9746 class. If adding input section to a newly created merge output
9747 section fails, remove the new merge section.
9748 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 9749 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 9750 (Output_section::find_merge_section): Ditto.
0439c796 9751 (Output_section::build_lookup_maps): New method defintion.
2e702c99 9752 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
9753 Output_section_lookup_maps class.
9754 (Output_section::get_input_sections): Export merge sections. Adjust
9755 code to use Output_section_lookup_maps class.
9756 (Output_section:::add_script_input_section): Adjust code to use
9757 Output_section_lookup_maps class. Update lookup maps for merge
9758 sections also.
9759 (Output_section::discard_states): Use Output_section_lookup_maps.
9760 (Output_section::restore_states): Same.
9761 * output.h (Merge_section_properties): Move class defintion out of
9762 Output_section.
9763 (Output_section_lookup_maps): New class.
9764 (Output_section::Input_section::is_merge_section): New method
9765 defintion.
9766 (Output_section::Input_section::relobj): Move defintion out of class
9767 defintion. Declare method only.
9768 (Output_section::Input_section::shndx): Ditto.
9769 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 9770 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
9771 (Output_section::Merge_section_by_properties_map,
9772 Output_section::Output_section_data_by_input_section_map,
9773 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
9774 Remove types.
2e702c99 9775 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
9776 KEEPS_INPUT_SECTIONS.
9777 (Output_section::build_lookup_maps): New method declaration.
9778 (Output_section::merge_section_map_,
9779 Output_section::merge_section_by_properties_map_,
9780 Output_section::relaxed_input_section_map_,
9781 Output_section::is_relaxed_input_section_map_valid_): Remove data
9782 members.
9783 (Output_section::lookup_maps_): New data member.
9784
76295588
L
97852010-05-21 Doug Kwan <dougkwan@google.com>
9786
9787 PR gold/11619
9788 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
9789 avoid a compilation error.
9790
d103a984
RÁE
97912010-05-19 Rafael Espindola <espindola@google.com>
9792
9793 * script-sections.cc (Output_section_definition::allocate_to_segment):
9794 Update the phdrs_list even when the output section is NULL.
9795 * testsuite/Makefile.am: Add test.
9796 * testsuite/Makefile.in: Regenerate.
9797 * testsuite/script_test_9.cc: New.
9798 * testsuite/script_test_9.sh: New.
9799 * testsuite/script_test_9.t: New.
9800
6625d24e
DK
98012010-05-19 Doug Kwan <dougkwan@google.com>
9802
9803 * arm.cc (Arm_input_section::original_size): New method.
9804 (Arm_input_section::do_addralign): Add a cast.
9805 (Arm_input_section::do_output_offset): Remove static cast.
9806 (Arm_input_section::original_addralign,
9807 Arm_input_section::original_size_): Change type to uint32_t.
9808 (Arm_input_section::init): Add safe casts for section alignment
9809 and size.
9810 (Arm_input_section::set_final_data_size): Do not set address and
9811 offset of stub table.
9812 (Arm_output_section::fix_exidx_coverage): Change use of of
9813 Output_section::Simple_input_section to that of
9814 Output_section::Input_section.
9815 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
9816 except for the first pass.
9817 * output.cc (Output_section::get_input_sections): Change type of
9818 input_sections to std::list<Input_section>.
9819 (Output_section::add_script_input_section): Rename from
9820 Output_section::add_simple_input_section. Change type of SIS
9821 parameter from Simple_input_section to Input_section.
9822 * output.h (Output_section::Simple_input_section): Remove class.
9823 (Output_section::Input_section): Change class visibility to public.
9824 (Output_section::Input_section::addralign): Use stored alignments
9825 for special input sections if set.
9826 (Output_section::Input_section::set_addralign): New method.
9827 (Output_section::get_input_sections): Change parameter type from
9828 list of Simple_input_section to list of Input_section.
9829 (Output_section::add_script_input_section): Rename from
9830 Output_section::add_simple_input_section. Change first parameter's
9831 type from Simple_input_section to Input_section and remove the
9832 second and third parameters.
9833 * script-sections.cc (Input_section::Input_section_list): Change
9834 type to list of Output_section::Input_section/
9835 (Input_section_info::Input_section_info): Change parameter type of
9836 INPUT_SECTION to Output_section::Input_section.
9837 (Input_section_info::input_section): Change return type.
9838 (Input_section_info::input_section_): Change type to
9839 Output_section::Input_section.
9840 (Output_section_element_input::set_section_addresses): Adjust code
9841 to use Output_section::Input_section instead of
9842 Output_section::Simple_input_section. Adjust code for renaming
9843 of Output_section::add_simple_input_section.
9844 (Orphan_output_section::set_section_addresses): Ditto.
9845
e1e82ea4
RW
98462010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9847
9848 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
9849 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
9850
91e75c8a
RÁE
98512010-05-18 Rafael Espindola <espindola@google.com>
9852
9853 * options.cc (General_options::finalize): Handle -nostdlib.
9854 * options.h (nostdlib): New option.
9855 * script.cc (script_add_search_dir): Handle -nostdlib.
9856
da59ad79
DK
98572010-05-12 Doug Kwan <dougkwan@google.com>
9858
9859 * arm.cc (Target_arm::do_finalize_sections): Create an empty
9860 attributes section only if there no attributes section after merging.
9861 (Target_arm::merge_object_attributes): Move value of
e1df38aa 9862 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
9863 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
9864 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
9865 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
9866 and arm_attr_merge_7.stdout.
9867 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
9868 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
9869 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
9870 arm_attr_merge_7b.o): New rules.
9871 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
9872 arm_attr_merge_7
9873 * testsuite/Makefile.in: Regenerate.
9874 * testsuite/arm_attr_merge.sh: New file.
9875 * testsuite/arm_attr_merge_[67][ab].s: Same.
9876
3e01a7fd
NC
98772010-05-05 Nick Clifton <nickc@redhat.com>
9878
9879 * po/es.po: Updated Spanish translation.
9880
7ad2014a
L
98812010-04-27 H.J. Lu <hongjiu.lu@intel.com>
9882
9883 * Makefile.am (install-exec-local): Properly install gold as
9884 default cross linker.
9885 * Makefile.in: Regenerated.
9886
4fda8867
NC
98872010-04-27 H.J. Lu <hongjiu.lu@intel.com>
9888 Nick Clifton <nickc@redhat.com>
9889
9890 * configure.ac (install_as_default): Define and set to false
9891 unless --enable-gold or --enable-gold=both/gold has been
9892 specified.
9893 * configure: Regenerate.
9894
9895 * Makefile.am (install-exec-local): Install the executable as
9896 'ld.gold'. If install_as_default is true then also install it as
9897 'ld'.
9898 * Makefile.in: Regenerated.
9899
bd288ea2
ILT
99002010-04-24 Ian Lance Taylor <iant@google.com>
9901
9902 * layout.cc (Layout::layout_reloc): In relocatable link don't
9903 combine reloc sections for grouped sections.
9904
ef38fd8a
ST
99052010-04-23 Sriraman Tallam <tmsriram@google.com>
9906
9907 * gc.h (gc_process_relocs): Pass information on relocs pointing to
9908 sections that are not ordinary to icf.
9909 * icf.cc (get_section_contents): Handle relocation pointing to section
9910 with no object or shndx information.
9911 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
9912 * testsuite/Makefile.in: Regenerate.
9913 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
9914 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
9915
f6973bdc
ILT
99162010-04-22 Ian Lance Taylor <iant@google.com>
9917
9918 * expression.cc (Expression::Expression_eval_info): Add
9919 result_alignment_pointer field.
9920 (Expression::eval_with_dot): Add result_alignment_pointer
9921 parameter. Change all callers.
9922 (Expression::eval_maybe_dot): Likewise.
9923 (class Binary_expression): Add alignment_pointer parameter to
9924 left_value and right_value. Change all callers.
9925 (BINARY_EXPRESSION): Set result alignment.
9926 (class Trinary_expression): Add alignment_pointer parameter to
9927 arg2_value and arg3_value. Change all callers.
9928 (Trinary_cond::value): Set result alignment.
9929 (Max_expression::value, Min_expression::value): Likewise.
9930 (Align_expression::value): Likewise.
9931 * script-sections.cc (class Sections_element): Add dot_alignment
9932 parameter to set_section_addresses virtual function. Update
9933 instantiations.
9934 (class Output_section_element): Likewise.
9935 (Script_sections::create_segments): Add dot_alignment parameter.
9936 Change all callers.
9937 (Script_sections::create_segments_from_phdrs_clause): Likewise.
9938 (Script_sections::set_phdrs_clause_addresses): Likewise.
9939 * script-sections.h: Update declarations.
9940 * script.h: Update declarations.
9941 * output.h (Output_segment::set_minimum_p_align): Don't decrease
9942 min_p_align.
9943 * testsuite/script_test_3.t: Set large alignment.
9944 * testsuite/script_test_3.sh: Make sure that at least one LOAD
9945 segment has expected alignment.
9946
9c9c98a5
NC
99472010-04-22 Nick Clifton <nickc@redhat.com>
9948
9949 * po/gold.pot: Updated by the Translation project.
9950 * po/vi.po: Updated Vietnamese translation.
9951
2253bfba
L
99522010-04-22 H.J. Lu <hongjiu.lu@intel.com>
9953
9954 * testsuite/Makefile.am (check_PROGRAMS): Add
9955 icf_virtual_function_folding_test.
9956 * testsuite/Makefile.in: Regenerated.
9957
85fdf906
AH
99582010-04-15 Andrew Haley <aph@redhat.com>
9959
9960 * options.h (merge_exidx_entries): New option.
9961 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
9962 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
9963 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
9964 (Target_arm::merge_exidx_entries): New function.
9965 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
9966 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
9967 to Arm_exidx_fixup constructor.
9968 Add new arg, merge_exidx_entries.
9969 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
9970 Arm_output_section::fix_exidx_coverage.
9971
ce97fa81
ST
99722010-04-18 Sriraman Tallam <tmsriram@google.com>
9973
9974 * icf.cc (get_section_contents): Check for preemptible functions.
9975 Ignore addend when appropriate.
9976 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
9977 section folded.
9978 (add_from_relobj): Check for section folded.
9979 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
9980 * symtab.h (should_add_dynsym_entry): Add new parameter.
9981 * target-reloc.h (scan_relocs): Check for section folded.
9982 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
9983 Check reloc types for function pointers in shared objects.
9984 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
9985 case.
9986 (icf_preemptible_functions_test): New test case.
9987 (icf_string_merge_test): New test case.
9988 * testsuite.Makefile.in: Regenerate.
9989 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
9990 bar_glob. Refactor code.
9991 * testsuite/icf_preemptible_functions_test.cc: New file.
9992 * testsuite/icf_preemptible_functions_test.sh: New file.
9993 * testsuite/icf_string_merge_test.cc: New file.
9994 * testsuite/icf_string_merge_test.sh: New file.
9995 * testsuite/icf_virtual_function_folding_test.cc: New file.
9996 * testsuite/icf_virtual_function_folding_test.sh: New file.
9997
04ceb17c
DK
99982010-04-14 Doug Kwan <dougkwan@google.com>
9999
10000 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
10001 for local symbol recounting if we remove a section due to ICF.
10002 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
10003 there are no regular objects in input.
10004
153e7da4
DK
100052010-04-13 Doug Kwan <dougkwan@google.com>
10006
10007 * arm.cc (Arm_input_section::set_final_data_size): Compute
10008 accurate final data size instead of using current data size.
10009
4dbd9faf
DK
100102010-04-09 Doug Kwan <dougkwan@google.com>
10011
10012 * layout.cc (Layout::choose_output_section): Handle script section
10013 types.
10014 (Layout::make_output_section_for_script): Add section type parameter.
10015 Handle script section types.
10016 * layout.h (Layout::make_output_section_for_script): Add section
10017 type parameter.
10018 * output.cc (Output_section::Output_section): Initialize data member
10019 is_noload_.
10020 (Output_section::do_reset_address_and_file_offset): Do not set address
10021 to 0 if section is a NOLOAD section.
10022 * output.h (Output_section::is_noload): New method.
10023 (Output_section::set_is_noload): Ditto.
10024 (Output_section::is_noload_): New data member.
10025 * script-c.h (Script_section_type): New enum type.
10026 (struct Parser_output_section_header): Add new file section_type.
10027 * script-sections.cc (Sections_element::output_section_name): Add
10028 parameter for returning script section type.
10029 (Output_section_definition::output_section_name): Ditto.
10030 (Output_section_definition::section_type)P; New method.
10031 (Output_section_definiton::script_section_type_name): Ditto.
10032 (Output_section_definition::script_section_type_): New data member.
10033 (Output_section_definition::Output_section_definition): Initialize
10034 data member Output_section_definition::script_section_type_.
10035 (Output_section_definition::create_sections): Pass script section type
10036 to Layout::make_output_section_for_script.
10037 (Output_section_definition::output_section_name): Return script
10038 section type to caller.
10039 (Output_section_definition::set_section_address): Do not advance
10040 dot value and load address if section type is NOLOAD. Set address
10041 of NOLOAD sections regardless of section flags.
10042 (Output_section_definition::print): Print section type if it is
10043 not SCRIPT_SECTION_TYPE_NONE.
10044 (Output_section_definition::section_type): New method.
10045 (Output_section_definition::script_section_type_name): Ditto.
10046 (Script_sections::output_section_name): Add new parameter
10047 PSECTION_TYPE for returning script section type. Pass it to
10048 section elements. Handle discard sections.
10049 (Sort_output_sections::operator()): Handle NOLOAD sections.
10050 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 10051 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
10052 returning script section type.
10053 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
10054 INFO and NOLOAD.
10055 * yyscript.y (union): Add new field SECTION_TYPE.
10056 (COPY, DSECT, INFO, NOLOAD): New tokens.
10057 (opt_address_and_section_type): Change type to output_section_header.
10058 (section_type): New non-terminal
10059 (section_header): Handle section type.
2253bfba 10060 (opt_address_and_section_type): Return section type value.
4dbd9faf 10061
721ea635
L
100622010-04-09 H.J. Lu <hongjiu.lu@intel.com>
10063
10064 * testsuite/plugin_common_test_1.c (foo): Add prototype.
10065 * testsuite/plugin_common_test_2.c (foo): Likewise.
10066
6bf924b0
DK
100672010-04-08 Doug Kwan <dougkwan@google.com>
10068
10069 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
10070 Output_merge_data.
10071 * output.cc (Output_section::add_merge_input_section): Simplify
10072 code and return status of Output_merge_base::add_input_section.
e1df38aa 10073 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
10074 returns true.
10075
24af6f92
DK
100762010-04-07 Doug Kwan <dougkwan@google.com>
10077
10078 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
10079 if section is marked as containing instructions but has no mapping
10080 symbols.
10081 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
10082 correct section index.
10083 (Arm_relobj::find_linked_text_section): Ditto.
10084
00698fc5
CC
100852010-04-07 Cary Coutant <ccoutant@google.com>
10086
10087 * archive.cc (include_member): Destroy Read_symbols_data object before
10088 releasing file.
10089 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
10090 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
10091 (Read_symbols_data::~Read_symbols_data) New destructor.
10092 (Section_relocs::Section_relocs) New constructor.
10093 (Section_relocs::~Section_relocs) New destructor.
10094 (Read_relocs_data::Read_relocs_data) New constructor.
10095 (Read_relocs_data::~Read_relocs_data) New destructor.
10096 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
10097 pointers to NULL after deleting.
10098
7296d933
DK
100992010-04-07 Doug Kwan <dougkwan@google.com>
10100
10101 * arm.cc: Replace "endianity" with "endianness" in comments.
10102 (Arm_exidx_cantunwind): Ditto.
10103 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
10104 (Arm_relobj::merge_flags_and_attributes): New method.
10105 (Arm_relobj::merge_flags_and_attributes_): New data member.
10106 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
10107 (Arm_relobj::scan_sections_for_stubs): Ditto.
10108 (Arm_relobj::do_read_symbols): Check to see if we really want to
10109 merge processor-specific flags and attributes. Exit early if
10110 an object is empty except for section names and the undefined symbol.
10111 (Target_arm::do_finalize_sections): Move check for ELF format to
10112 Arm_relobj::do_read_symbols. Merge processor specific flags and
10113 attributes from a regular object only when we have determined that
10114 it is aapropriate. Do not create an .ARM.attributes section in
10115 output if there is no regular input object.
10116 (Target_arm::merge_processor_specific_flags): Check
10117 --warn-mismatch before printing any error.
10118 (Target_arm::merge_object_attributes): Ditto.
10119 * gold.cc (queue_middle_tasks): Handle the case in which there is
10120 no regular object in input.
10121 * options.cc (General_options::parse_EB): New method.
10122 (General_options::parse_EL): Same.
10123 (General_options::General_options): Initialize endianness_.
10124 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
10125 New options.
10126 (General_options::Endianness): New enum.
10127 (General_options::endianness): New method.
10128 (General_options::endianness_): New data member.
10129 * parameters.cc (Parameters::set_options): Check target endianness.
10130 (Parameters::set_target_once): Ditto.
10131 (Parameters::check_target_endianness): New method.
10132 (parameters_force_valid_target): If either -EL or -EB is specified,
10133 use it to define endianness of default target.
10134 * parameters.h (Parameters::check_target_endianness): New method
10135 declaration.
10136 * target.h (class Target): Change "endianity" to "endianness"
10137 in comments.
10138
efc8d4f2
RW
101392010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10140
10141 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
10142 * configure: Regenerate.
10143 * Makefile.in: Regenerate.
10144 * testsuite/Makefile.in: Regenerate.
10145
be234d88
CC
101462010-04-06 Cary Coutant <ccoutant@google.com>
10147
10148 gcc PR lto/42757
10149 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
10150 prevailing definitions of common symbols.
10151 * testsuite/plugin_test_6.sh: New test case.
10152 * testsuite/plugin_common_test_1.c: New test case.
10153 * testsuite/plugin_common_test_2.c: New test case.
10154 * testsuite/Makefile.am (plugin_test_6): New test case.
10155 * testsuite/Makefile.in: Regenerate.
10156
bd32c6bd
NC
101572010-04-06 Nick Clifton <nickc@redhat.com>
10158
10159 * po/vi.po: New Vietnamese translation.
10160
323c532f
DK
101612010-03-30 Doug Kwan <dougkwan@google.com>
10162
10163 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
10164
4fcd97eb
DK
101652010-03-25 Doug Kwan <dougkwan@google.com>
10166
10167 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
10168 to avoid a conversion warning on a 32-bit host.
10169
4ebf39db
ILT
101702010-03-24 Ian Lance Taylor <iant@google.com>
10171
10172 * testsuite/script_test_3.t: Add a TLS segment.
10173 * testsuite/Makefile.am (check_PROGRAMS): Add
10174 tls_phdrs_script_test.
10175 (tls_phdrs_script_test_SOURCES): Define.
10176 (tls_phdrs_script_test_DEPENDENCIES): Define.
10177 (tls_phdrs_script_test_LDFLAGS): Define.
10178 (tls_phdrs_script_test_LDADD): Define.
10179 * testsuite/Makefile.in: Rebuild.
10180
4a599bdd
CC
101812010-03-23 Cary Coutant <ccoutant@google.com>
10182
10183 * fileread.cc (find_or_make_view): Fix comment.
10184
6c93b22c
ILT
101852010-03-23 Ian Lance Taylor <iant@google.com>
10186
10187 * script-sections.cc (class Orphan_section_placement): Define
10188 PLACE_TLS and PLACE_TLS_BSS.
10189 (Orphan_section_placement::Orphan_section_placement): Initialize
10190 new places.
10191 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
10192 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
10193 (tls_script_test_SOURCES): Define.
10194 (tls_script_test_DEPENDENCIES): Define.
10195 (tls_script_test_LDFLAGS): Define.
10196 (tls_script_test_LDADD): Define.
10197 * testsuite/Makefile.in: Rebuild.
10198
a2c7281b
DK
101992010-03-22 Doug Kwan <dougkwan@google.com>
10200
10201 * arm.cc (Arm_relocate_functions::abs8,
10202 Arm_relocate_functions::abs16): Use correct check for overflow
10203 specified in the ARM ELF specs.
10204 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
10205 target of a BLX instruction specially.
10206 (Reloc_stub::stub_type_for_reloc): Ditto.
10207 (Relocate::relocate): Use symbolic names instead of numeric relocation
10208 codes to report error.
10209 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
10210 workaround.
10211 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
10212 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
10213 thumb2_blx_out_of_range.stdout
10214 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
10215 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
10216 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
10217 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
10218 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
10219 thumb2_blx_in_range, thumb2_blx_in_range.o,
10220 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
10221 thumb2_blx_out_of_range.o): New rules.
2e702c99 10222 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
10223 thumb2_blx_in_range and thumb2_blx_out_of_range.
10224 * testsuite/Makefile.in: Regenerate.
10225 * arm_branch_in_range.sh: Add tests for THUMB BLX.
10226 * testsuite/thumb_blx_in_range.s: New file.
10227 * testsuite/thumb_blx_out_of_range.s: New file.
10228
b0193076
RÁE
102292010-03-22 Rafael Espindola <espindola@google.com>
10230
10231 * archive.cc (Should_include): Move to archive.h.
10232 (should_include_member): Make it a member of Archive.
10233 (Lib_group): New.
10234 (Add_lib_group_symbols): New.
10235 * archive.h: Include options.h.
10236 (Archive_member): Moved from Archive.
10237 (Should_include): Moved from archive.cc.
10238 (Lib_group): New.
10239 (Add_lib_group_symbols): New.
10240 * dynobj.cc (do_should_include_member): New.
10241 * dynobj.h (do_should_include_member): New.
10242 * gold.cc (queue_initial_tasks): Update call to queue.
10243 * main.cc (main): Print lib group stats.
10244 * object.cc (do_should_include_member): New.
10245 * object.h: Include archive.h.
10246 (Object::should_include_member): New.
10247 (Object::do_should_include_member): New.
10248 (Sized_relobj::do_should_include_member): New.
10249 * options.cc (General_options::parse_start_lib): New.
10250 (General_options::parse_end_lib): New.
10251 (Input_arguments::add_file): Handle lib groups.
10252 (Input_arguments::start_group): Check we are not in a lib.
10253 (Input_arguments::start_lib): New.
10254 (Input_arguments::end_lib): New.
10255 * options.h (General_options): Add start_lib and end_lib.
10256 (Input_argument::lib_): New.
10257 (Input_argument::lib): New.
10258 (Input_argument::is_lib): New.
10259 (Input_file_lib): New.
10260 (Input_arguments::in_lib_): New.
10261 (Input_arguments::in_lib): New.
10262 (Input_arguments::start_lib): New.
10263 (Input_arguments::end_lib_): New.
10264 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
10265 in unused members as preempted.
10266 (Sized_pluginobj::do_should_include_member): New.
10267 * plugin.h (Sized_pluginobj::do_should_include_member): New.
10268 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
10269 return the blocker.
10270 (Read_symbols::do_whole_lib_group): New.
10271 (Read_symbols::do_lib_group): New.
10272 (Read_symbols::do_read_symbols): Handle lib groups.
10273 (Read_symbols::get_name): Handle lib groups.
10274 * readsyms.h (Read_symbols): Add an archive member pointer.
10275 (Read_symbols::do_whole_lib_group): New.
10276 (Read_symbols::do_lib_group): New.
10277 (Read_symbols::member_): New.
10278 * script.cc (read_input_script): Update call to queue_soon.
10279
d099120c
DK
102802010-03-19 Doug Kwan <dougkwan@google.com>
10281
10282 * arm.cc (Stub_table::Stub_table): Initialize new data members
10283 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10284 (Stub_table::add_reloc_stub): Assign stub offset and update
10285 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10286 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
10287 New data members.
2e702c99 10288 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
10289 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
10290 instead of going over all reloc stubs.
2e702c99 10291 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
10292 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10293 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 10294 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
10295 Stringpool_template::offset_.
10296 * stringpool.h (Stringpool_template::set_no_zero_null): Set
10297 Stringpool_template::offset_ to zero.
10298
1aa37384
DK
102992010-03-15 Doug Kwan <dougkwan@google.com>
10300
10301 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10302 offset_.
10303 (Stringpool_template::new_key_offset): New method.
10304 (Stringpool_template::add_string): Assign offsets when adding new
10305 strings.
10306 (Stringpool_template::set_string_offsets): Do not set string offsets
10307 when not optimizing.
10308 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
10309 member size_.
2e702c99
RM
10310 (Chunked_vector::clear): Clear size_.
10311 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
10312 (Chunked_vector::size): Return size_.
10313 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 10314 (Chunked_vector::size_): New data member.
1aa37384
DK
10315 (Stringpool_template::set_no_zero_null): Assert string set is empty.
10316 (Stringpool_template::new_key_offset): New method declaration.
10317 (Stringpool_template::offset_): New data member.
10318
b672b057
RÁE
103192010-03-15 Rafael Espindola <espindola@google.com>
10320
10321 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
10322 Add_symbols' constructor.
10323 * readsyms.h (Add_symbols): Remove the input_group member.
10324
b6848d3c
ILT
103252010-03-10 Ian Lance Taylor <iant@google.com>
10326
10327 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
10328 target to ask whether a reference to a symbol requires a stack
10329 split.
10330 * target.h (Target::is_call_to_non_split): New function.
10331 (Target::do_is_call_to_non_split): Declare virtual function.
10332 * target.cc: Include "symtab.h".
10333 (Target::do_is_call_to_non_split): New function.
10334 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
10335
a2a5469e
CC
103362010-03-10 Cary Coutant <ccoutant@google.com>
10337
10338 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
10339 (File_read::open[1]): Remove initial mapping of whole_file_view_.
10340 (File_read::open[2]): Add whole_file_view_ to list of views.
10341 (File_read::make_view): Remove test of whole_file_view_.
10342 (File_read::find_or_make_view): Create whole_file_view_ if
10343 necessary.
10344 (File_read::clear_views): Replace bool parameter with enum;
10345 adjust all callers. Don't delete views with permanent data;
10346 do delete cached views and views from archives if
10347 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
10348 if clearing the corresponding view.
10349 * fileread.h (File_read::Clear_views_mode): New enum.
10350 (File_read::View::is_permanent_view): New method.
10351 (File_read::clear_views): Replace bool parameter
10352 with enum; adjust all callers.
10353 * options.h (General_options): Change keep_files_mapped option;
10354 add map_whole_files.
10355 * readsyms.cc (Add_symbols::run): Delete sd_ object before
10356 releasing the file.
10357 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
10358 the file.
10359
8861f32b
DM
103602010-03-10 David S. Miller <davem@davemloft.net>
10361
10362 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
10363
d62d0f5f
ST
103642010-03-09 Sriraman Tallam <tmsriram@google.com>
10365
10366 * icf.cc (get_section_contents): Add '@' marker after processing the
10367 merge reloc.
10368
9177756d
DK
103692010-03-08 Doug Kwan <dougkwan@google.com>
10370
10371 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
10372 due to a conversion warning.
10373 (Arm_relobj::update_output_local_symbol_count): Check for local
10374 symbol with unset output index.
10375
9e9e071b
ILT
103762010-03-05 Ian Lance Taylor <iant@google.com>
10377
10378 * options.h (class General_options): Add --spare-dynamic-tags.
10379 * output.cc (Output_data_dynamic::set_final_data_size): Implement
10380 --spare-dynamic-tags.
10381
a81ee015
ILT
103822010-03-05 Ian Lance Taylor <iant@google.com>
10383
10384 * incremental.cc: Include "libiberty.h".
10385
44ec90b9
RO
103862010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
10387
10388 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
10389 function, is_info_ member.
10390 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
10391 (Versions::Versions): Update caller.
10392 (Versions::define_base_version): Likewise.
10393 (Versions::add_def): Likewise.
10394
0897ed3b
ST
103952010-03-03 Sriraman Tallam <tmsriram@google.com>
10396
10397 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
10398 (Scan::possible_function_pointer_reloc): New function.
10399 (Scan::local_reloc_may_be_function_pointer): Change to call
10400 possible_function_pointer_reloc.
10401 (Scan::global_reloc_may_be_function_pointer): Ditto.
10402 * icf.h (Icf::check_section_for_function_pointers): Change to reject
10403 relocations in ".data.rel.ro._ZTV" section.
10404 * testsuite/icf_safe_so_test.sh: Change to pass i386.
10405 * testsuite/icf_safe_so_test.cc: Ditto.
10406 * testsuite/icf_safe_test.cc: Ditto.
10407 * testsuite/icf_safe_test.sh: Ditto.
10408
d3bbad62
ILT
104092010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10410 Ian Lance Taylor <iant@google.com>
10411
10412 * target-reloc.h (relocate_section): Check the symbol table index
10413 for -1U before setting the local symbol index.
10414 (scan_relocatable_relocs): If copying the relocation, record that
10415 the local symbol is required.
10416 * object.h (Symbol_value::is_output_symtab_index_set): New
10417 function.
10418 (Symbol_value::may_be_discarded_from_output_symtab): New
10419 function.
10420 (Symbol_value::has_output_symtab_entry): New function.
10421 (Symbol_value::needs_output_symtab_entry): Remove.
10422 (Symbol_value::output_symtab_index): Make sure the symbol index is
10423 set.
10424 (Symbol_value::set_output_symtab_index): Make sure the symbol
10425 index is not set. Make sure the new index is valid.
10426 (Symbol_value::set_must_have_output_symtab_entry): New function.
10427 (Symbol_value::has_output_dynsym_entry): New function.
10428 (Symbol_value::set_output_dynsym_index): Make sure the new index
10429 is valid.
10430 (Sized_relobj::set_must_have_output_symtab_entry): New function.
10431 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
10432 local symbol if permitted.
10433 (Sized_relobj::do_finalize_local_symbols): Call
10434 is_output_symtab_index_set rather than needs_output_symtab_entry.
10435 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
10436 rather than needs_output_symtab_entry. Call
10437 has_output_dynsym_entry rather than needs_output_dynsym_entry.
10438 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
10439 is_output_symtab_index_set rather than needs_output_symtab_entry.
10440 * testsuite/discard_locals_relocatable_test.c: New file.
10441 * testsuite/discard_locals_test.sh: Test -r.
10442 * testsuite/Makefile.am (check_DATA): Add
10443 discard_locals_relocatable_test1.syms,
10444 discard_local_relocatable_test2.syms.
10445 (MOSTLYCLEANFILES): Likewise. Also add
10446 discard_locals_relocatable_test1.lout and
10447 discard_locals_relocatable_test2.out.
10448 (discard_locals_relocatable_test1.syms): New target.
10449 (discard_locals_relocatable_test.o): New target.
10450 (discard_locals_relocatable_test1.out): New target.
10451 (discard_locals_relocatable_test2.syms): New target.
10452 (discard_locals_relocatable_test2.out): New target.
10453 (various): Add missing ../ld-new dependencies.
10454 * testsuite/Makefile.in: Rebuild.
10455
7e8ccf26
NC
104562010-03-03 Nick Clifton <nickc@redhat.com>
10457
10458 * po/fi.po: New Finnish translation.
10459
2a0ff005
DK
104602010-03-01 Doug Kwan <dougkwan@google.com>
10461
10462 * layout.cc (Layout::Layout): Force section types of .init_array*,
10463 .preinit_array* and .fini_array* sections.
10464 * output.cc (Output_section::Input_section_sort_entry::has_priority):
10465 Fix check of return value of std::string::find.().
10466 (Output_section::Input_section_sort_compare::operator()): Remove
10467 comment about .init_array.
10468 (Output_section::Input_section_sort_init_fini_compare::operator()):
10469 New method.
10470 (Output_section::sort_attached_input_sections): Handle .init_array
10471 and .fini_array specially.
10472 * output.h (Output_section::Inut_section_sort_compare): Update
10473 comment.
10474 (Output_section::Input_section_sort_init_fini_compare): New struct.
10475
c3e4ae29
DK
104762010-02-26 Doug Kwan <dougkwan@google.com>
10477
10478 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
10479 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
10480 * testsuite/debug_msg.sh: Avoid matching source line number for
10481 use of global variable undef_int.
10482
2fd9ae7a
DK
104832010-02-26 Doug Kwan <dougkwan@google.com>
10484
10485 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
10486 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
10487 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
10488 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
10489 * options.cc (General_options::General_options): Initialize member
10490 fix_v4bx_.
10491 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
10492 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
10493 and rm_no_fix_v4bx.stdout
10494 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
10495 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
10496 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
10497 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
10498 and arm_no_fix_v4bx.
10499 * Makefile.in: Regenerate.
10500 * testsuite/arm_fix_v4bx.s: New file.
10501 * testsuite/arm_fix_v4bx.sh: Ditto.
10502
67ec7d0b
DK
105032010-02-24 Doug Kwan <dougkwan@google.com>
10504
10505 * arm.cc (Target_arm::got_section): Make the .got section the first
10506 non RELRO section in the data segment.
10507 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
10508 suffixes of section names.
10509
10165461
DK
105102010-02-24 Doug Kwan <dougkwan@google.com>
10511
10512 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
10513 flags and attributes merging if an input file is a binary file.
10514 * fileread.cc (Input_file::open): Record format of original file.
10515 * fileread.h (Input_file::Format): New enum type.
2e702c99 10516 (Input_file::Input_file): Initialize data member format_.
10165461
DK
10517 (Input_file::format): New method definition.
10518 (Input_file::format_):: New data member.
10519
4a54abbb
DK
105202010-02-24 Doug Kwan <dougkwan@google.com>
10521
10522 * arm.cc (Arm_output_data_got): New class.
10523 (ARM_TCB_SIZE): New constant
10524 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
10525 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
10526 If user uses a script with a SECTIONS clause, issue only a warning
10527 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 10528 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
10529 garbage collection.
10530 (Target_arm::got_mode_index_entry): Handle static linking.
10531 (Target_arm::Scan::local): Ditto.
10532 (Target_arm::Scan::global): Ditto.
10533 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
10534 all incorrectly implemented relocations.
e1df38aa 10535 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
10536 Arm_output_section::fix_exidx_coverage.
10537 * layout.cc (Layout::section_name_mapping): Remove trailing dots
10538 from ".ARM.exidx." and ".ARM.extab.".
10539
ca419a6f
ILT
105402010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10541
10542 * arm.cc (Target_arm::do_finalize_sections): Create attribute
10543 section if it does not already exist.
10544 * attributes.cc (Attributes_section_data::Attributes_section_data):
10545 Don't crash if size is zero.
10546
135b9c78
ILT
105472010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10548 Ian Lance Taylor <iant@google.com>
10549
10550 * gold.cc (queue_middle_tasks): If no input files were opened,
10551 exit.
10552 * workqueue.h (Task_function::Task_function): Assert that there is
10553 a blocker.
10554
bb0bfe4f
DK
105552010-02-22 Doug Kwan <dougkwan@google.com>
10556
10557 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
10558 * icf.cc (get_section_contents): Cast snprintf arguments to long long
10559 types to avoid warnings due to different uint64_t implementations
10560 on different hosts.
10561
2a2b6d42
DK
105622010-02-21 Doug Kwan <dougkwan@google.com>
10563
10564 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
10565 handling of the maximum backward branch offset.
2e702c99 10566 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
10567 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
10568 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 10569 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
10570 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
10571 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
10572 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
10573 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
10574 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
10575 thumb_bl_out_of_range thumb_bl_out_of_range.o,
10576 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
10577 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
10578 thumb2_bl_out_of_range.o): New rules.
10579 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
10580 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
10581 thumb2_bl_out_of_range
10582 * testsuite/Makefile.in: Regenerate.
10583 * testsuite/arm_bl_in_range.s: New file.
10584 * testsuite/arm_bl_out_of_range.s: Ditto.
10585 * testsuite/arm_branch_in_range.sh: Ditto.
10586 * testsuite/arm_branch_range.t: Ditto.
10587 * testsuite/thumb2_branch_range.t: Ditto.
10588 * testsuite/thumb_bl_in_range.s: Ditto.
10589 * testsuite/thumb_bl_out_of_range.s: Ditto.
10590 * testsuite/thumb_branch_range.t: Ditto.
10591
b487ad64
ST
105922010-02-20 Sriraman Tallam <tmsriram@google.com>
10593
10594 * gc.h (gc_process_relocs): Change vectors to point to the new list.
10595 Add reloc offset information.
10596 * icf.cc (get_section_contents): Change iterators to point to the new
10597 vectors. Add reloc offset information to the contents.
10598 * icf.h (Icf::Sections_reachable_info): New typedef.
10599 (Icf::Sections_reachable_list): New typedef.
10600 (Icf::Offset_info): New typedef.
10601 (Icf::Reloc_info): New struct typedef.
10602 (Icf::Reloc_info_list): New typedef.
10603 (Icf::symbol_reloc_list): Delete method.
10604 (Icf::addend_reloc_list): Delete method.
10605 (Icf::section_reloc_list): Delete method.
10606 (Icf::reloc_info_list): New method.
10607 (Icf::reloc_info_list_): New member.
10608
f96accdf
DK
106092010-02-19 Doug Kwan <dougkwan@google.com>
10610
10611 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
10612 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
10613 * arm.cc (Arm_relocation_functions): New forward declaration.
10614 (Target_arm::Target_arm): Initialize new data members
10615 got_mod_index_offset_ and tls_base_symbol_defined_.
10616 (Target_arm::Relocate::relocate_tls): New method.
10617 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
10618 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
10619 New methods.
2e702c99 10620 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
10621 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
10622 (Target_arm::got_mod_index_offset_,
10623 Target_arm::tls_base_symbol_defined_): New data members.
10624 (Target_arm::Scan::local, Target::Scan::global,
10625 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
10626 relocations.
10627
c8761b9a
DK
106282010-02-18 Doug Kwan <dougkwan@google.com>
10629
10630 * arm.cc (Arm_relobj::find_linked_text_section): New method.
10631 (Arm_relobj::make_exidx_input_section): Pass section index of linked
10632 text section as a parameter becuase some broken tools may not set
10633 the link in section header.
10634 (Target_arm::has_got_section): New method.
10635 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
10636 without any mapping symbol as data only. Remove warning.
10637 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
10638 link in its section header, try to discover the link by inspecting the
10639 REL31 relocation at the beginning of the section.
10640 (Target_arm::Scan::check_non_pic): Report name of offending relocation
10641 in error message.
10642 (Target_arm::Scan::global): Treat any reference to the symbol
10643 _GLOBAL_OFFSET_TABLE_ as a GOT access.
10644
21bb3914
ST
106452010-02-12 Sriraman Tallam <tmsriram@google.com>
10646
10647 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
10648 (Scan::global_reloc_may_be_function_pointer): New function.
10649 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10650 (Scan::global_reloc_may_be_function_pointer): New function.
10651 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10652 (Scan::global_reloc_may_be_function_pointer): New function.
10653 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
10654 (Scan::global_reloc_may_be_function_pointer): New function.
10655 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
10656 (Scan::global_reloc_may_be_function_pointer): New function.
10657 (Scan::possible_function_pointer_reloc): New function.
10658 (Target_x86_64::can_check_for_function_pointers): New function.
10659 * gc.h (gc_process_relocs): Scan relocation types to determine if
10660 function pointers were taken for targets that support it.
10661 * icf.cc (Icf::find_identical_sections): Include functions for
10662 folding in safe ICF whose pointer is not taken.
10663 * icf.h (Secn_fptr_taken_set): New typedef.
10664 (fptr_section_id_): New member.
10665 (section_has_function_pointers): New function.
10666 (set_section_has_function_pointers): New function.
10667 (check_section_for_function_pointers): New function.
10668 * options.h: Fix comment for safe ICF option.
10669 * target.h (can_check_for_function_pointers): New function.
10670 * testsuite/Makefile.am: Add icf_safe_so_test test case.
10671 Modify icf_safe_test for X86-64.
10672 * testsuite/Makefile.in: Regenerate.
10673 * testsuite/icf_safe_so_test.cc: New file.
10674 * testsuite/icf_safe_so_test.sh: New file.
10675 * testsuite/icf_safe_test.cc (kept_func_3): New function.
10676 (main): Change to take pointer to function kept_func_3.
10677 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
10678 folding is done correctly for X86-64.
10679
0da6fa6c
DM
106802010-02-12 David S. Miller <davem@davemloft.net>
10681
10682 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
10683 is_symbolless parameter.
10684 (Output_reloc<SHT_REL>::is_symbolless): New.
10685 (Output_reloc<SHT_REL>::is_symbolless_): New.
10686 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
10687 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
10688 (Output_reloc<SHT_RELA>::is_symbolless): New.
10689 (Output_data_reloc::add_global): Handle is_symbolless.
10690 (Output_data_reloc::add_global_relative): Likewise.
10691 (Output_data_reloc::add_local): Likewise.
10692 (Output_data_reloc::add_local_relative): Likewise.
10693 (Output_data_reloc::add_symbolless_global_addend): New.
10694 (Output_data_reloc::add_symbolless_local_addend): New.
10695 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
10696 is_symbolless.
10697 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
10698 instead of ->is_relative_
10699 (Output_reloc::write): Likewise.
10700 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
10701 (Output_reloc::write_rel): Simplify.
10702
10703 * sparc.cc (Target_sparc::Scan::local): Use
10704 ->add_symbolless_local_addend as needed.
10705 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
10706 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
10707 based upon relocation offset.
10708
e4782e83
DK
107092010-02-11 Doug Kwan <dougkwan@google.com>
10710
10711 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
10712 (Target_arm::Scan::global): Ditto. Also remove a comment before the
10713 beginning of function.
10714 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
10715 and MOVT_ABS relocations. Those are non issued in scanning. Fix
10716 parameter is_32bit in calls to should_apply_static_reloc.
10717 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
10718 (check_DATA): Add arm_abs_global.stdout.
10719 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
10720 arm_abs_global.stdout): New rules.
10721 (MOSTLLYCLEANFILES): Add arm_abs_global
10722 * Makefile.in: Regenerate.
10723 * testsuite/arm_abs_global.s: New file.
10724 * testsuite/arm_abs_global.sh: Ditto.
10725 * testsuite/arm_abs_lib.s: Ditto.
10726
93ceb764
ILT
107272010-02-11 Ian Lance Taylor <iant@google.com>
10728
10729 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
10730 Read_relocs task.
10731 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
10732 Allocate_commons_task first.
10733 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
10734 task, rather than symtab_lock_.
10735 (Gc_process_relocs::~Gc_process_relocs): New function.
10736 (Gc_process_relocs::is_runnable): Check this_blocker_.
10737 (Gc_process_relocs::locks): Use next_blocker_ rather than
10738 blocker_.
10739 (Scan_relocs::~Scan_relocs): New function.
10740 (Scan_relocs::is_runnable): Check this_blocker_ rather than
10741 symtab_lock_.
10742 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
10743 next_blocker_.
10744 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
10745 fields. Add this_blocker_ and next_blocker_ fields. Adjust
10746 constructor accordingly.
10747 (class Gc_process_relocs): Likewise.
10748 (class Scan_relocs): Likewise.
10749 * common.h (class Allocate_commons_task): Remove symtab_lock_
10750 field, and corresponding constructor parameter.
10751 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
10752 symtab_lock_.
10753 (Allocate_commons_task::locks): Likewise.
10754
114dfbe1
ILT
107552010-02-11 Ian Lance Taylor <iant@google.com>
10756
10757 * gold-threads.h (class Once): Define.
10758 (class Initialize_lock): Rewrite as child of Once.
10759 * gold-threads.cc (class Once_initialize): Define.
10760 (once_pointer_control): New static variable.
10761 (once_pointer, once_arg): New static variables.
10762 (c_run_once): New static function.
10763 (Once::Once, Once::run_once, Once::internal_run): New functions.
10764 (class Initialize_lock_once): Remove.
10765 (initialize_lock_control): Remove.
10766 (initialize_lock_pointer): Remove.
10767 (initialize_lock_once): Remove.
10768 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
10769 (Initialize_lock::initialize): Rewrite.
10770 (Initialize_lock::do_run_once): New function.
10771 * archive.cc (Archive::interpret_header): Only clear name if it is
10772 not already empty.
10773 * fileread.cc: Include "gold-threads.h"
10774 (file_counts_lock): New static variable.
10775 (file_counts_initialize_lock): Likewise.
10776 (File_read::release): Only increment counts when using --stats.
10777 Use a lock around the increment.
10778 * parameters.cc (class Set_parameters_target_once): Define.
10779 (set_parameters_target_once): New static variable.
10780 (Parameters::Parameters): Move here from parameters.h.
10781 (Parameters::set_target): Rewrite.
10782 (Parameters::set_target_once): New function.
10783 (Parameters::clear_target): Move here and rewrite.
10784 * parameters.h (class Parameters): Update declarations. Add
10785 set_parameters_target_once_ field.
10786 (Parameters::Parameters): Move to parameters.cc.
10787 (Parameters::clear_target): Likewise.
10788 * readsyms.cc (Read_symbols::do_group): Create a Start_group
10789 task.
10790 (Start_group::~Start_group): New function.
10791 (Start_group::is_runnable): New function.
10792 (Start_group::locks, Start_group::run): New functions.
10793 (Finish_group::run): Change saw_undefined to size_t.
10794 * readsyms.h (class Start_group): Define.
10795 (class Finish_group): Change saw_undefined_ field to size_t.
10796 (Finish_group::Finish_group): Remove saw_undefined and
10797 this_blocker parameters. Change all callers.
10798 (Finish_group::set_saw_undefined): New function.
10799 (Finish_group::set_blocker): New function.
10800 * symtab.h (class Symbol_table): Change saw_undefined to return
10801 size_t. Change saw_undefined_ field to size_t.
10802 * target-select.cc (Set_target_once::do_run_once): New function.
10803 (Target_selector::Target_selector): Initialize set_target_once_
10804 field. Don't initialize lock_ and initialize_lock_ fields.
10805 (Target_selector::instantiate_target): Rewrite.
10806 (Target_selector::set_target): New function.
10807 * target-select.h (class Set_target_once): Define.
10808 (class Target_selector): Update declarations. Make
10809 Set_target_once a friend. Remove lock_ and initialize_lock_
10810 fields. Add set_target_once_ field.
10811
fa17a3f4
ILT
108122010-02-10 Ian Lance Taylor <iant@google.com>
10813
10814 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
10815 queueing any tasks.
10816 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
10817 (queue_middle_tasks): Add all blockers before queueing any tasks.
10818 (queue_final_tasks): Likewise.
10819 * token.h (Task_token::add_blockers): New function.
10820 * object.h (Input_objects::number_of_relobjs): New function.
10821
c7177d31
ILT
108222010-02-10 Ian Lance Taylor <iant@google.com>
10823
5de0e392
ILT
10824 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
10825 shared, not if not position independent.
10826 * x86_64.cc (Relocate::relocate_tls): Likewise.
10827 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
10828 (tls_pie_pic_test): New target.
10829 * testsuite/Makefile.in: Rebuild.
10830
c7177d31
ILT
10831 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
10832 (tls_test_main_pie.o, tls_test_pie.o): New targets.
10833 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
10834 * testsuite/Makefile.in: Rebuild.
10835
684b268a
DM
108362010-02-09 David S. Miller <davem@davemloft.net>
10837
10838 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
10839 R_SPARC_RELATIVE using ->add_local_relative().
10840 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
10841
612a8d3d
DM
10842 * output.h (Output_data_dynamic::add_section_size): New method
10843 that takes two Output_data objects.
10844 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
10845 entry param. Handle it in initializers.
10846 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
10847 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
10848 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
10849 arg.
10850 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
10851 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
10852 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
10853 for dynrel_includes_plt.
10854 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10855 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10856 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
10857 before .rela.plt
10858 (Target_sparc::do_finalize_sections): Update to pass true for
10859 dynrel_includes_plt.
10860 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
10861 output before .rela.plt
10862 (Target_powerpc::do_finalize_sections): Update to pass true for
10863 dynrel_includes_plt when 32-bit.
10864
cb1be87e
DK
108652010-02-08 Doug Kwan <dougkwan@google.com>
10866
10867 * arm.cc (Arm_relobj::simple_input_section_output_address): New
10868 method.
10869 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
10870 Arm_relobj::scan_section_for_cortex_a8_stubs,
10871 Arm_relobj::do_relocation_section): Instead of calling
10872 Output_section::output_address, use faster
10873 Arm_relobj::simple_input_section_output_address.
10874
705b5121
DM
108752010-02-08 David S. Miller <davem@davemloft.net>
10876
10877 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
10878 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
10879 relocation helper function.
10880
024c4466
DM
10881 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
10882 just like R_SPARC_GOT{10,13,22}.
10883 (Target_sparc::Scan::local): Likewise.
10884 (Target_sparc::Relocate:relocate): Likewise.
10885
9109c078
ILT
108862010-02-06 Ian Lance Taylor <iant@google.com>
10887
10888 * configure.ac: Rewrite targetobjs duplicate removal code to use
10889 only shell constructs.
10890 * configure: Rebuild.
10891
cf846138
DK
108922010-02-05 Doug Kwan <dougkwan@google.com>
10893
10894 PR 11247
10895 * arm.cc (Arm_relobj::section_is_scannable): New method.
10896 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
10897 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
10898
6cfaf60b
DK
108992010-02-04 Doug Kwan <dougkwan@google.com>
10900
10901 PR 11247
10902 * arm-reloc-property.cc (cstdio): Include.
10903 * configure.ac (targetobjs): Remove duplicates.
10904 * configure: Regenerate.
10905 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
10906 big and little endian version for a given address size.
10907
5c57f1be
DK
109082010-02-03 Doug Kwan <dougkwan@google.com>
10909
10910 * arm-reloc-property.cc
10911 (Arm_reloc_property_table::reloc_name_in_error_message): New method
10912 definition.
10913 * arm-reloc-property.h
10914 (Arm_reloc_property_table::get_implemented_static_reloc_property):
10915 New method definition.
10916 (Arm_reloc_property_table::reloc_name_in_error_message): New method
10917 declaration.
10918 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
10919 overflow to N.
10920 (GOT_PREL): Change implemented to Y.
10921 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
10922 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
10923 (Arm_relocate_functions::movw_abs_nc): Remove method.
10924 (Arm_relocate_functions::movt_abs): Ditto.
10925 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
10926 (Arm_relocate_functions::thm_movt_abs): Ditto.
10927 (Arm_relocate_functions::movw_rel_nc): Ditto.
10928 (Arm_relocate_functions::movw_rel): Ditto.
10929 (Arm_relocate_functions::movt_rel): Ditto.
10930 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
10931 (Arm_relocate_functions:thm_movw_rel): Ditto.
10932 (Arm_relocate_functions:thm_movt_rel): Ditto.
10933 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
10934 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
10935 New method definitions.
10936 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
10937 (Arm_relocation_functions::arm_grp_ldr): Ditto.
10938 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
10939 (Arm_relocation_functions::arm_grp_ldc): Ditto.
10940 (Target_arm::Relocate::relocate): Check for non-static or
10941 unimplemented relocation code and exit early. Change calls to
10942 Target_arm::reloc_uses_thumb_bit and
10943 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
10944 instead. Refactor code to handle similar relocations to increase
10945 code sharing. Remove check for unsupported relocation code in switch
10946 statement.
10947 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
10948 relocation property table to find out size. Change error message to
10949 print out the name of a relocation code instead of the numeric value.
10950 (Target_arm::scan_reloc_for_stub): Use relocation property table
10951 instead of calling Target_arm::reloc_uses_thumb_bit().
10952
218c5831
DK
109532010-02-02 Doug Kwan <dougkwan@google.com>
10954
10955 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
10956 types of relaxed input section.
10957
0d31c79d
DK
109582010-02-02 Doug Kwan <dougkwan@google.com>
10959
10960 * Makefile.am (HFILES): Add arm-reloc-property.h.
10961 (DEFFILES): New.
2e702c99
RM
10962 (TARGETSOURCES): Add arm-reloc-property.cc
10963 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
10964 (libgold_a_SOURCES): $(DEFFILES)
10965 * Makefile.in: Regenerate.
10966 * arm-reloc-property.cc: New file.
10967 * arm-reloc-property.h: New file.
10968 * arm-reloc.def: New file.
10969 * arm.cc: Update comments.
10970 (arm-reloc-property.h): New included header.
10971 (arm_reloc_property_table): New global variable.
10972 (Target_arm::do_select_as_default_target): New method definition.
10973 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
10974 arm-reloc-property to targ_extra_obj.
10975 * parameters.cc (set_parameters_target): Call
10976 Target::select_as_default_target().
10977 * target.h (Target::select_as_default_target): New method definition.
10978 (Target::do_select_as_default_target): Same.
10979
546c7457
DK
109802010-02-01 Doug Kwan <dougkwan@google.com>
10981
10982 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
10983 first_output_text_section_.
10984 (Arm_exidx_fixup::first_output_text_section): New method definition.
10985 (Arm_exidx_fixup::first_output_text_section_): New data member.
10986 (Arm_exidx_fixup::process_exidx_section): Record the first text
10987 output section seen.
10988 (Arm_output_section::fix_exidx_coverage): Set correct linked section
10989 and entsize in output section header.
10990
11b861d5
DK
109912010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10992
10993 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
10994 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
10995 (Arm_relocate_functions::thm_alu11): New Method.
10996 (Arm_relocate_functions::thm_pc8): New Method.
10997 (Arm_relocate_functions::thm_pc12): New Method.
10998 (Target_arm::Scan::local): Handle the relocations.
10999 (Target_arm::Scan::global): Likewise.
11000 (Target_arm::Relocate::relocate): Likewise.
11001 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11002
c9a2c125
DK
110032010-01-29 Doug Kwan <dougkwan@google.com>
11004
11005 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
11006 of relocation types as ld.
11007
1521477a
DK
110082010-01-29 Doug Kwan <dougkwan@google.com>
11009
11010 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
11011 to public.
11012 (Arm_relocate_functions::thumb_branch_common): Ditto.
11013 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
11014 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
11015 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
11016 Arm_relocate_functions::jump24): Remove.
11017 (Target_arm::Relocate::relocate): Adjust code to call
11018 Arm_relocation_functions::arm_branch_common and
11019 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 11020 wrappers. Merge switch-cases together to reduce source code size.
1521477a 11021
e7eca48c
DK
110222010-01-29 Doug Kwan <dougkwan@google.com>
11023
11024 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
11025 output_local_symbol_count_needs_update_.
11026 (Arm_relobj::output_local_symbol_count_needs_update,
11027 Arm_relobj::set_output_local_symbol_count_needs_update,
11028 Arm_relobj::update_output_local_symbol_count): New methods.
11029 (Arm_relobj::output_local_symbol_count_needs_update_): New data
11030 member.
11031 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
11032 of pointed function as in a R_ARM_PREL31 relocation.
11033 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
11034 for output local symbol count updating.
11035 (Target_arm::do_relax): Update output local symbol counts in objects
11036 if necessary.
11037 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
11038
02961d7e
ILT
110392010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11040
11041 * arm.cc: Added support for the ARM relocations:
11042 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
11043 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
11044 (Arm_relocate_functions::movw_rel_nc): Renamed (was
11045 movw_prel_nc).
11046 (Arm_relocate_functions::movw_rel): New method.
11047 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
11048 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
11049 thm_movw_prel_nc).
11050 (Arm_relocate_functions::thm_movw_rel): New method.
11051 (Arm_relocate_functions::thm_movt_rel): Renamed (was
11052 thm_movt_prel).
11053 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
11054 relocations.
11055 (Target_arm::Scan::global): Likewise.
11056 (Target_arm::Relocate::relocate): Likewise.
11057 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11058 Likewise.
11059
b10d2873
ILT
110602010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11061
11062 * arm.cc: Added support for ARM group relocations.
11063 (Target_arm::reloc_needs_sym_origin): New method.
11064 (Arm_relocate_functions::calc_grp_kn): New method.
11065 (Arm_relocate_functions::calc_grp_residual): New method.
11066 (Arm_relocate_functions::calc_grp_gn): New method.
11067 (Arm_relocate_functions::arm_grp_alu): New Method.
11068 (Arm_relocate_functions::arm_grp_ldr): New Method.
11069 (Arm_relocate_functions::arm_grp_ldrs): New Method.
11070 (Arm_relocate_functions::arm_grp_ldc): New Method.
11071 (Target_arm::Scan::local): Handle the ARM group relocations.
11072 (Target_arm::Scan::global): Likewise.
11073 (Target_arm::Relocate::relocate): Likewise.
11074 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11075 Likewise.
11076
2b328d4e
DK
110772010-01-26 Doug Kwan <dougkwan@google.com>
11078
11079 * arm.cc (set): Include.
11080 (class Arm_exidx_fixup): Change type of last_input_section_ to const
11081 pointer type.
2e702c99 11082 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
11083 (Arm_output_section::append_text_sections_to_list): New method.
11084 (Arm_output_section::fix_exidx_coverage): Ditto.
11085 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 11086 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
11087 Relobj::set_section_offset() instead of
11088 Sized_relobj::invalidate_section_offset().
2e702c99 11089 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
11090 parameter for section headers. Ignore relocation sections for
11091 unallocated sections and EXIDX sections.
11092 (Target_arm::fix_exidx_coverage): New method.
11093 (Target_arm::output_section_address_less_than): New type.
11094 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
11095 linked text section instead of the EXIDX section.
11096 (Arm_output_section::create_stub_group): Add an assertion to check
11097 that this is not an EXIDX output section.
11098 (Arm_output_section::append_text_sections_to_list): New method.
11099 (Arm_output_section::fix_exidx_coverage): Ditto.
11100 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 11101 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
11102 (Target_arm::do_relax): Fix EXIDX output section coverage in the
11103 first pass.
11104 (Target_arm::fix_exidx_coverage): New method.
11105 * object.h (Relobj::set_output_section): New method.
11106 (Sized_relobj::invalidate_section_offset): Remove method.
11107 (Sized_relobj::do_invalidate_section_offset): Remove method.
11108 (Sized_relobj::do_set_section_offset): Handle offset value -1.
11109
c7f3c371
DK
111102010-01-25 Doug Kwan <dougkwan@google.com>
11111
11112 * arm.cc (Arm_exidx_merged_section::do_output_offset):
11113 Fix warning due to signed and unsigned comparison on a 32-bit host.
11114
8923b24c
DK
111152010-01-22 Doug Kwan <dougkwan@google.com>
11116
11117 * arm.cc (Target_arm::do_relax): Record an output section for section
11118 offset adjustment it contains any stub table that has changed.
11119 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
11120 offsets in an output section if necessary.
11121 * output.cc (Output_section::Output_section): Initialize
11122 section_offsets_need_adjustments_.
11123 (Output_section::add_input_section_for_script): Renamed to
11124 Output_section::add_simple_input_section.
11125 (Output_section::save_states): Add a comment.
11126 (Output_section::discard_states): New method defintion.
11127 (Output_section::adjust_section_offsets): Same.
11128 * output.h (Output_section::add_input_section_for_script): Renamed to
11129 Output_section::add_simple_input_section.
11130 (Output_section::discard_states): New method declaration.
11131 (Output_section::adjust_section_offsets): Same.
11132 (Output_section::section_offsets_need_adjustment,
11133 Output_section::set_section_offsets_need_adjustment): New method
11134 definitions.
11135 (Output_section::section_offsets_need_adjustment_): New data member.
11136 * script-sections.cc
11137 (Output_section_element_input::set_section_address): Adjust code for
11138 renaming of Output_section::add_input_section_for_script.
11139 (Orphan_output_section::set_section_address): Same.
11140
9b2fd367
DK
111412010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11142
11143 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
11144 Fix_v4bx enum values .
11145 * gold/options.h (General_options): New option definitions.
11146 (General_options::fix_v4bx): New method.
11147 (General_options::Fix_v4bx): New enum.
11148 * gold/options.cc (General_options::parse_fix_v4bx): New method.
11149 (General_options::parse_fix_v4bx_interworking): New method.
11150
80d0d023
DK
111512010-01-22 Doug Kwan <dougkwan@google.com>
11152
11153 * arm.cc (Arm_exidx_fixup): New class.
11154
af2cdeae
DK
111552010-01-21 Doug Kwan <dougkwan@google.com>
11156
11157 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
11158 classes.
11159 (Arm_exidx_section_offset_map): New type.
11160
993d07c1
DK
111612010-01-21 Doug Kwan <dougkwan@google.com>
11162
11163 * arm.cc (Arm_exidx_input_section): New class.
11164 (Arm_relobj::exidx_input_section_by_link,
11165 Arm_relobj::exidx_input_section_by_shndx,
11166 Arm_relobj::make_exidx_input_section): New methods.
11167 (read_arm_attributes_section): Remove.
11168 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
11169 information about them.
11170 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
11171 to here.
11172
5ac169d4
DK
111732010-01-20 Doug Kwan <dougkwan@google.com>
11174
11175 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
11176 Input_section_specifier to Section_id.
11177 (Target_arm::new_arm_input_section: Adjust code for change of key
11178 type.
11179 (Target_arm::find_arm_input_section): Ditto.
11180 * gc.h (object.h): Include for Section_id nand Section_id_hash.
11181 (Section_id): Remove.
11182 (Garbage_collection::Section_id_hash): Remove.
11183 * icf.h (object.h): Include for Section_id nand Section_id_hash.
11184 (Section_id): Remove.
11185 (Icf::Section_id_hash): Remove.
11186 * object.h (Section_id, Const_section_id, Section_id_hash,
11187 Const_section_id_hash): New type definitions.
11188 * output.cc (Output_section::add_relaxed_input_section): Change to
11189 use Const_section_id instead of Input_section_specifier as key type.
11190 (Output_section::add_merge_input_section): Ditto.
11191 (Output_section::build_relaxation_map): Change to use Section_id
11192 instead of Input_section_specifier as key type.
2e702c99 11193 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
11194 Ditto.
11195 (Output_section::convert_input_sections_to_relaxed_sections): Change
11196 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 11197 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
11198 (Output_section::find_relaxed_input_section): Ditto.
11199 * output.h (Input_section_specifier): Remove class.
11200 (Output_section::Output_section_data_by_input_section_map): Change
11201 key type to Const_section_id.
11202 (Output_section::Output_relaxed_input_section_by_input_section_map):
11203 Ditto.
11204 (Output_section::Relaxation_map): Change key type to Section_id.
11205
a2162063
ILT
112062010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11207
11208 * gold/arm.cc: Added support for R_ARM_V4BX relocation
11209 (class Arm_v4bx_stub): New class.
11210 (DEF_STUBS): Updated definition to support v4_veneer_bx.
11211 (Stub_factory::make_arm_v4bx_stub): New method.
11212 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
11213 (Stub_table::empty): Handle v4bx stubs.
11214 (Stub_table::add_arm_v4bx_stub): New method.
11215 (Stub_table::find_arm_v4bx_stub): New method.
11216 (Arm_relocate_functions::v4bx): New method.
11217 (Target_arm::fix_v4bx): New method.
11218 (Target_arm::Target_arm): Handle R_ARM_V4BX.
11219 (Stub_table::relocate_stubs): Likewise.
11220 (Stub_table::do_write): Likewise.
11221 (Stub_table::update_data_size_and_addralign): Likewise.
11222 (Stub_table::finalize_stubs): Likewise.
11223 (Target_arm::Scan::local): Likewise.
11224 (Target_arm::Scan::global): Likewise.
11225 (Target_arm::do_finalize_sections): Likewise.
11226 (Target_arm::Relocate::relocate): Likewise.
11227 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11228 Likewise.
11229 (Target_arm::scan_reloc_for_stub): Likewise.
11230 (Target_arm::scan_reloc_section_for_stubs): Likewise.
11231
5696ab0b
ILT
112322010-01-19 Ian Lance Taylor <iant@google.com>
11233
11234 * output.cc (Output_section_headers::do_sized_write): Write large
11235 segment count to sh_info field.
11236 (Output_file_header::do_sized_write): For large segment count,
11237 write PN_XNUM to e_phnum field.
11238
800d0f56
ILT
112392010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11240
11241 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
11242 (Arm_relocate_functions::thm_jump8): New function.
11243 (Arm_relocate_functions::thm_jump11): New function.
11244 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
11245 R_ARM_THM_JUMP11.
11246 (Target_arm::Scan::global): Likewise.
11247 (Target_arm::Relocate::relocate): Likewise.
11248 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11249 Likewise.
11250
41263c05
DK
112512010-01-14 Doug Kwan <dougkwan@google.com>
11252
11253 * arm.cc (map, utility): Include headers.
11254 (Target_arm::apply_cortex_a8_workaround): New method.
11255 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
11256 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
11257 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
11258 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
11259 the --[no-]fix-cortex-a8 command line options.
11260 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
11261 (Target_arm::relocate_stub): Use addend in instruction template.
11262 * options.h (DEFINE_bool): Set the user-set flag.
11263 (General_options): Add --[no-]-fix-cortex options.
11264 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 11265 : Update fast look-up map after conversion.
41263c05 11266
459e9b03
ST
112672010-01-14 Sriraman Tallam <tmsriram@google.com>
11268
11269 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
11270 in the first pass of do_layout.
11271
b521dfe4
DK
112722010-01-13 Doug Kwan <dougkwan@google.com>
11273
11274 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11275 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
11276 apparent compiler problem of not folding static constant integral
11277 data members of elfcpp::Elf_sizes<32>.
11278
44272192
DK
112792010-01-13 Doug Kwan <dougkwan@google.com>
11280
11281 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11282 Arm_relobj::section_needs_cortex_a8_stub_scanning,
11283 Arm_relobj::scan_section_for_cortex_a8_erratum,
11284 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
11285 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
11286 sections to scan for relocation stubs into a new method
11287 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
11288 relocation and Cortex-A8 stub scanning.
11289 (Target_arm::do_relax): Force stubs to be after stubbed sections
11290 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 11291 the beginning of a new relaxation pass. Update a comment.
44272192
DK
11292 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
11293
44b71ece
ILT
112942010-01-12 Ian Lance Taylor <iant@google.com>
11295
11296 * target-reloc.h (visibility_error): New inline function.
11297 (relocate_section): Call visibility_error.
11298 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
11299 (MOSTLYCLEANFILES): Likewise.
11300 (protected_4_pic.o, protected_3.err): New targets.
11301 * testsuite/protected_4.cc: New file.
11302
a120bc7f
DK
113032010-01-12 Doug Kwan <dougkwan@google.com>
11304
11305 * arm.cc (Cortex_a8_reloc): New class.
11306 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
11307 and cortex_a8_relocs_info_.
11308 (Target_arm::fix_cortex_a8): New method definition.
11309 (Target_arm::Cortex_a8_relocs_info): New type.
11310 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
11311 New data member declarations.
11312 (Target_arm::scan_reloc_for_stub): Record information about
11313 relocations for THUMB branches that might be exempted from the
11314 Cortex-A8 workaround.
11315 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
11316 at the beginning of a relaxation pass.
11317
20138696
DK
113182010-01-12 Doug Kwan <dougkwan@google.com>
11319
11320 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
11321 (Arm_relobj::Mapping_symbol_position,
11322 Arm_reloj::Mapping_symbol_position_less,
11323 Arm_relobj::Mapping_symbols_info): New types.
11324 (Target_arm::is_mapping_symbol_name): New method definition.
11325 (Arm_relobj::do_count_local_symbols): Save information about mapping
11326 symbols.
11327
089d69dc
DK
113282010-01-11 Doug Kwan <dougkwan@google.com>
11329
11330 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
11331 Arm_relocate_functions::thumb32_branch_upper,
11332 Arm_relocate_functions::thumb32_branch_lower,
11333 Arm_relocate_functions::thumb32_cond_branch_offset,
11334 Arm_relocate_functions::thumb32_cond_branch_upper,
11335 Arm_relocate_functions::thumb32_cond_branch_lower,
11336 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
11337 branch offset encoding.
11338 (Arm_relocate_functions::thumb_branch_common): Use new branch
11339 offset encoding methods to avoid code duplication.
11340 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
11341 (Stub_addend_reader::operator()): Use new branch encoding method
11342 to avoid code duplication.
11343
99e5bff2
DK
113442010-01-11 Doug Kwan <dougkwan@google.com>
11345
11346 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
11347 (Target_arm::do_finalize_sections): Define special EXIDX section
11348 symbols only if referenced.
11349 * gc.h (Garbage_collection::add_reference): New method.
11350 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
11351 code duplication.
11352
98e090bd
ILT
113532010-01-11 Ian Lance Taylor <iant@google.com>
11354
d0a91bd8
ILT
11355 * script.cc (Version_script_info::build_expression_list_lookup):
11356 Change complaing about duplicate wildcard match from error to
11357 warning.
11358
98e090bd
ILT
11359 * script.cc (class Lazy_demangler): Recreate--revert part of patch
11360 of 2009-12-30.
11361 (Version_script_info::Version_script_info): Initialize globs_,
11362 default_version_, default_is_global_, and exact_. Don't
11363 initialize globals_ or locals_.
11364 (Version_script_info::build_lookup_tables): Build local symbols
11365 first.
11366 (Version_script_info::unquote): New function.
11367 (Version_script_info::add_exact_match): New function.
11368 (Version_script_info::build_expression_list_lookup): Remove lookup
11369 parameter. Add is_global parameter. Change all callers. Handle
11370 wildcard pattern specially. Unquote pattern. Call
11371 add_exact_match.
11372 (Version_script_info::get_name_to_match): New function.
11373 (Version_script_info::get_symbol_version): New function.
11374 (Version_script_info::get_symbol_version_helper): Remove.
11375 (Version_script_info::check_unmatched_names): Call unquote.
11376 * script.h (class Version_script_info): Change get_symbol_version
11377 to be non-inline and add is_global parameter; change all callers.
11378 Rewrite symbol_is_local. Update declarations. Define struct
11379 Version_tree_match, Exact, Globs. Don't define struct Lookup.
11380 Remove globals_ and locals_ members. Add exact_, globs_,
11381 default_version_, is_global_.
11382 (Version_script_info::Glob): Remove pattern, add expression and
11383 is_global. Update constructor. Change all callers.
11384 * dynobj.cc (Versions::finalize): Mark the version symbol as the
11385 default version.
11386 (Versions::symbol_section_contents): If a symbol is undefined, or
11387 defined in a dynamic object, set the version index to
11388 VER_NDX_LOCAL.
11389 * symtab.cc (Symbol_table::add_from_relobj): Don't call
11390 symbol_is_local.
11391 (Symbol_table::add_from_pluginobj): Likewise.
11392 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
11393
d56962d3
DK
113942010-01-11 Doug Kwan <dougkwan@google.com>
11395
11396 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
11397 (incremental_dump_LDADD): Add linking option for libintl.
11398 * Makefile.in: Regenerate.
11399
94e6ee91
L
114002010-01-11 H.J. Lu <hongjiu.lu@intel.com>
11401
11402 PR gold/11144
11403 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
11404 instead of -Ds.
11405 * testsuite/Makefile.in: Regenerated.
11406
e96c574b
DK
114072010-01-10 Doug Kwan <dougkwan@google.com>
11408
11409 * options.h (DEFINE_var): Use parentheses around argument varname__
11410 in macro body to avoid any unintended subsequent substitutions.
11411
7198066b
ILT
114122010-01-10 Ian Lance Taylor <iant@google.com>
11413
ba4d53bf
ILT
11414 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
11415 candidates before doing symbol resolution.
11416
7198066b
ILT
11417 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
11418 ODR candidates if only one is weak.
11419
a2beed37
ILT
114202010-01-08 Ian Lance Taylor <iant@google.com>
11421
11422 * script.cc (Version_script_info::build_expression_list_lookup):
11423 Don't warn about ambiguous version, just record the ambiguity.
11424 (Version_script_info::get_symbol_version_helper): Give error if
11425 version is ambiguous.
11426
2fb7225c
DK
114272010-01-08 Doug Kwan <dougkwan@google.com>
11428
11429 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
11430 prev_data_size_ and prev_addralign_. Remove initializer for
11431 deleted data member has_been_changed_.
11432 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
11433 to determine if the table is empty.
11434 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
11435 Remove.
11436 (Stub_table::add_reloc_stub): Define method in class definition
11437 instead of just declaring it there.
11438 (Stub_table::add_cortex_a8_stub): New method definition.
11439 (Stub_table::update_data_size_and_addralign): Ditto.
11440 (Stub_table::finalize_stubs): Ditto.
11441 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
11442 (Stub_table::do_addralign_): Return address alignment in the
11443 (Stub_table::do_reset_address_and_file_offset): Define method in
11444 class definition instead of declaring it there. Set current data
11445 size to be the data size of the previous pass.
11446 (Stub_table::set_final_data_size): Use current data size as the
11447 final data size.
11448 (Stub_table::relocate_stub): Change parameter type of stub from
11449 Reloc_stub pointer to Stub pointer.
11450 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
11451 (Stub_table::Cortex_a8_stub_list): New typedef.
11452 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
11453 Stub_table::prev_addralign_): New data member.
11454 (Arm_relobj::Arm_relobj): Initialize data member
11455 section_has_cortex_a8_workaround_.
11456 (Arm_relobj::section_has_cortex_a8_workaround,
11457 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
11458 definitions.
11459 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
11460 declarations.
11461 (Target_arm::relocate_stub): Change parameter type of stub from
11462 Reloc_stub pointer to Stub pointer.
11463 (Insn_template::size, Insn_template::alignment): Handle
11464 THUMB16_SPECIAL_TYPE.
11465 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
11466 Stub_table::update_data_size_and_addralign,
11467 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
11468 definitions.
11469 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
11470 (Stub_table::do_write): Ditto.
11471 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 11472
880cd20d
ILT
114732010-01-08 Ian Lance Taylor <iant@google.com>
11474
11475 PR 11108
11476 * symtab.h (class Symbol): Remove fields is_target_special_ and
11477 has_plt_offset_. Add field is_defined_in_discarded_section_.
11478 (Symbol::is_defined_in_discarded_section): New function.
11479 (Symbol::set_is_defined_in_discarded_section): New function.
11480 (Symbol::has_plt_offset): Rewrite.
11481 (Symbol::set_plt_offset): Verify that new offset is not -1U.
11482 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
11483 Don't initialize is_target_special_ or has_plt_offset_.
11484 Initialize is_defined_in_discarded_section_.
11485 (Symbol_table::add_from_relobj): If appropriate, set
11486 is_defined_in_discarded_section.
11487 * resolve.cc (Symbol::override_base_with_special): Don't test
11488 is_target_special_. Change has_plt_offset_ to has_plt_offset().
11489 * target-reloc.h (relocate_section): Do special handling for
11490 symbols defined in discarded sections for global symbols as well
11491 as local symbols.
11492
2703e3eb
ILT
114932010-01-08 Ian Lance Taylor <iant@google.com>
11494
11495 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
11496 the SHT_SYMTAB case.
11497
339d40a3
ILT
114982010-01-08 Ian Lance Taylor <iant@google.com>
11499
11500 * object.cc (Sized_relobj::do_layout): Don't get confused if
11501 layout_eh_frame returns NULL.
11502
abecea76
ILT
115032010-01-08 Ian Lance Taylor <iant@google.com>
11504
11505 PR 11084
11506 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
11507 dynamic symbol table, use the normal symbol table.
11508 (Sized_dynobj::do_read_symbols): Remove assertion about type of
11509 symbol table.
11510
6b7dd3f3
ILT
115112010-01-08 Ian Lance Taylor <iant@google.com>
11512
11513 PR 11072
11514 * layout.cc (Layout::include_section): Remove .gnu_debuglink
11515 sections.
11516
36c50e63
L
115172010-01-08 H.J. Lu <hongjiu.lu@intel.com>
11518
11519 * version.cc (print_version): Change to "Copyright 2010".
11520
e291e7b9
ILT
115212010-01-08 Ian Lance Taylor <iant@google.com>
11522
11523 PR 10287
11524 PR 11063
11525 * i386.cc (class Target_i386): Change return type of plt_section
11526 to be non-const.
11527 (class Output_data_plt_i386): Add tls_desc_rel_ field.
11528 (Output_data_plt_i386::Output_data_plt_i386): Initialize
11529 tls_desc_rel_ field.
11530 (Output_data_plt_i386::rel_tls_desc): New function.
11531 (Target_i386::rel_tls_desc_section): New function.
11532 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
11533 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
11534 R_386_TLS_DESC reloc in rel_tls_desc_section.
11535 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
11536 Define struct Tlsdesc_info.
11537 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
11538 (Target_x86_64::do_reloc_symbol_index): New function.
11539 (Target_x86_64::add_tlsdesc_info): New function.
11540 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
11541 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
11542 tlsdesc_rel_ field.
11543 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
11544 all callers.
11545 (Output_data_plt_x86_64::rela_tlsdesc): New function.
11546 (Target_x86_64::rela_tlsdesc_section): New function.
11547 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
11548 handling.
11549 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
11550 (Target_x86_64::do_reloc_addend): New function.
11551 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
11552 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
11553 declarations. Define TARGET_CODE. Add arg field to u1_ union.
11554 (Output_reloc::type): New function.
11555 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
11556 (Output_reloc::is_target_specific): New function.
11557 (Output_reloc::target_arg): New function.
11558 (class Output_reloc) [SHT_RELA]: Add four new constructors for
11559 absolute relocs and target specific relocs.
11560 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
11561 add_target_specific.
11562 (class Output_data_reloc) [SHT_RELA]: Likewise.
11563 * output.cc (Output_reloc::Output_reloc): Add four new versions
11564 for absolute relocs and target specific relocs.
11565 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
11566 (Output_reloc::get_symbol_index): Likewise.
11567 (Output_reloc::local_section_offset): Check that local_sym_index_
11568 is not TARGET_CODE or 0.
11569 (Output_reloc::symbol_value): Likewise.
11570 (Output_reloc::write) [SHT_RELA]: Call target for target specific
11571 reloc.
11572 * target.h (class Target): Add reloc_symbol_index and reloc_addend
11573 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
11574 functions.
11575 * layout.cc (add_target_dynamic_tags): Use output section for
11576 DT_PLTRELSZ and DT_JMPREL.
11577
3a44184e
ILT
115782010-01-07 Ian Lance Taylor <iant@google.com>
11579
11580 PR 11061
11581 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
11582 function.
11583 (class Output_data_reloc_generic): Define.
11584 (class Output_data_reloc_base): Change base class to
11585 Output_data_reloc_generic. Change add() method to call
11586 bump_relative_reloc_count for a relative reloc. Remove
11587 sort_relocs_ field.
11588 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
11589 to sort_relocs().
11590 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
11591 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
11592 appropriate.
11593 * layout.h (class Layout): Update declaration.
11594
ea715a34
ILT
115952010-01-07 Ian Lance Taylor <iant@google.com>
11596
11597 * output.h (class Output_data): Add const version of
11598 output_section and do_output_section.
11599 (class Output_section_data): Add const version of
11600 do_output_section.
11601 (class Output_section): Likewise.
11602 * layout.cc (Layout::add_target_dynamic_tags): New function.
11603 * layout.h (class Layout): Update declarations.
11604 * arm.cc (Target_arm::do_finalize_sections): Use
11605 add_target_dynamic_tags.
11606 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11607 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11608 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11609 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11610
659948a4
ILT
116112010-01-07 Ian Lance Taylor <iant@google.com>
11612
11613 PR 11042
11614 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
11615 object as needed.
11616
9d3b86f6
ILT
116172010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
11618 Ian Lance Taylor <iant@google.com>
11619
11620 PR 11019
11621 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
11622 Xindex::read_symtab_xindex.
11623
bb0d3eb0
DK
116242010-01-07 Doug Kwan <dougkwan@google.com>
11625
11626 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
11627 (Insn_template::thumb16_bcond_insn): New method declaration.
11628 (Insn_template): Fix spelling.
11629 (Stub::thumb16_special): New method declaration.
11630 (Stub::do_write): Define virtual method which was previously pure
11631 virtual.
11632 (Stub::do_thumb16_special): New method declaration.
11633 (Stub::do_fixed_endian_write): New template member.
11634 (Reloc_stub::do_write): Remove.
11635 (Reloc_stub::do_fixed_endian_write): Remove.
11636 (Cortex_a8_stub): New class definition.
11637 (Stub_factory::make_cortex_a8_stub): New method definition.
11638 (Stub_factory::Stub_factory): Add missing static storage class
11639 qualifier for elf32_arm_stub_a8_veneer_blx.
11640
ffeef7df
ILT
116412010-01-07 Ian Lance Taylor <iant@google.com>
11642
dc3f80fe
ILT
11643 PR 10980
11644 * options.h (class General_options): Add --warn-unresolved-symbols
11645 and --error-unresolved-symbols.
11646 * errors.cc (Errors::undefined_symbol): Implement
11647 --warn-unresolved-symbols.
11648
ffeef7df
ILT
11649 * options.h (class General_options): Add -z text and -z textoff.
11650 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
11651
f1ec9ded
ST
116522010-01-06 Sriraman Tallam <tmsriram@google.com>
11653
11654 * gc.h (Garbage_collection::Cident_section_map): New typedef.
11655 (Garbage_collection::cident_sections): New function.
11656 (Garbage_collection::add_cident_section): New function.
11657 (Garbage_collection::cident_sections_): New member.
11658 (gc_process_relocs): Add references to sections whose names are C
11659 identifiers.
11660 * gold.h (cident_section_start_prefix): New constant.
11661 (cident_section_stop_prefix): New constant.
11662 (is_cident): New function.
11663 * layout.cc (Layout::define_section_symbols): Replace string constants
11664 with the newly defined constants.
11665 * object.cc (Sized_relobj::do_layout): Track sections whose names are
11666 C identifiers.
11667 * testsuite/Makefile.am: Add gc_orphan_section_test.
11668 * testsuite/Makefile.in: Regenerate.
11669 * testsuite/gc_orphan_section_test.cc: New file.
11670 * testsuite/gc_orphan_section_test.sh: New file.
11671
6eda8c29
ILT
116722010-01-06 Ian Lance Taylor <iant@google.com>
11673
b9674e17
ILT
11674 PR 10980
11675 * options.h (class General_options): Add --warn-shared-textrel.
11676 * layout.cc (Layout::finish_dynamic_section): Implement
11677 --warn-shared-textrel.
11678
6eda8c29
ILT
11679 PR 10980
11680 * options.h (class General_options): Add --warn-multiple-gp.
11681
32dcd44e
ILT
116822010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11683
11684 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
11685 $(THREADSLIB) and $(LIBDL).
11686 * Makefile.in: Rebuild.
11687
a192ba05
ILT
116882010-01-06 Ian Lance Taylor <iant@google.com>
11689
11690 PR 10980
11691 * options.cc (General_options::parse_section_start): New function.
11692 (General_options::section_start): New function.
11693 (General_options::General_options): Initialize all members.
11694 * options.h: Include <map>
11695 (class General_options): Add --section-start. Add section_starts_
11696 member.
11697 * layout.cc (Layout::attach_allocated_section_to_segment): If
11698 --section-start was used, set the address of the segment. Remove
11699 local sort_sections.
11700 (Layout::relaxation_loop_body): If the address of the load segment
11701 has been set by --section-start, don't use it.
11702 * output.h (Output_segment::update_flags_for_output_section): New
11703 function.
11704 * output.cc (Output_segment::add_output_section): Call
11705 update_flags_for_output_section.
11706
dde3f402
ILT
117072010-01-05 Ian Lance Taylor <iant@google.com>
11708
62dfdd4d
ILT
11709 PR 10980
11710 * options.h (class General_options): Add --undefined-version.
11711 * script.cc (struct Version_expression): Add was_matched_by_symbol
11712 field.
11713 (Version_script_info::matched_symbol): New function.
11714 (Version_script_info::get_symbol_version_helper): Call
11715 matched_symbol.
11716 (Version_script_info::check_unmatched_names): New function.
11717 * script.h (class Version_script_info): Update declarations.
11718 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
11719
9c4ae156
ILT
11720 * options.h (class General_options): Use DEFINE_bool_alias for
11721 allow_multiple_definition.
11722 * resolve.cc (Symbol_table::should_override): Don't test
11723 allow_multiple_definition.
11724
dde3f402
ILT
11725 PR 10980
11726 * options.h (class General_options): Add --cref.
11727 * main.cc (main): Print cref table if --cref. Don't close mapfile
11728 until after printing cref table.
11729 * cref.cc: Include "symtab.h".
11730 (class Cref_inputs): Define Cref_table_compare and Cref_table.
11731 (Cref_table_compare::operator()): New function.
11732 (Cref_inputs::gather_cref): New function.
11733 (filecol): New static const.
11734 (Cref_inputs::print_cref): New function.
11735 (Cref::print_cref): New function.
11736 * cref.h: Include <cstdio>.
11737 (class Cref): Update declarations.
11738 * mapfile.h (Mapfile::file): New function.
11739 * object.h (class Object): Define Symbols. Declare virtual
11740 do_get_global_symbols.
11741 (Object::get_global_symbols): New function.
11742 * object.cc (Input_objects::add_object): Pass object to cref_ if
11743 --cref.
11744 (Input_objects::archive_start): Likewise.
11745 (Input_objects::archive_stop): Likewise.
11746 (Input_objects::print_cref): New function.
11747 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
11748 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
11749 --cref.
11750 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
11751 function.
11752 * plugin.h (class Sized_pluginobj): Update declarations.
11753
8781f709
ILT
117542010-01-05 Ian Lance Taylor <iant@google.com>
11755
11756 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
11757 to is_default_version. Rename insdef to insdefault.
11758 (Symbol_table::add_from_relobj): Rename def to is_default_version
11759 and local to is_forced_local.
11760 (Symbol_table::add_from_pluginobj): Likewise.
11761 (Symbol_table::add_from_dynobj): Likewise.
11762 (Symbol_table::define_special_symbol): Rename insdef to
11763 insdefault.
11764
fe35d28d
ILT
117652010-01-04 Ian Lance Taylor <iant@google.com>
11766
30bc8c46
ILT
11767 PR 10980
11768 * options.h (class General_options): Add
11769 --allow-multiple-definition and -z muldefs.
11770 * resolve.cc (Symbol_table::should_override): Don't warn about a
11771 multiple symbol definition if --allow-multiple-definition or -z
11772 muldefs.
11773
7eaea549
ILT
11774 PR 10980
11775 * options.h (class General_options): Add --add-needed and
11776 --copy-dt-needed-entries. Tweak --as-needed help entry.
11777 * object.cc (Input_objects::check_dynamic_dependencies): Give an
11778 error if --copy-dt-needed-entries aka --add-needed is used and
11779 would cause a change in behaviour.
11780
fe35d28d
ILT
11781 PR 10980
11782 * options.h (class General_options): Add -G as a short version of
11783 --shared. Add no-op options -assert, -g, and -i.
11784
55a2bb35
ST
117852010-01-04 Sriraman Tallam <tmsriram@google.com>
11786
11787 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
11788 check for .text or .gnu.linkonce.t sections.
11789 * icf.cc (Icf::find_identical_sections): Ditto.
11790 Change the detection for mangled function name within the section
11791 name.
11792 * icf.h (is_section_foldable_candidate): New function.
11793
719328e1
ILT
117942009-12-30 Ian Lance Taylor <iant@google.com>
11795
11796 PR 10980
11797 * options.h (class General_options): Permit two dashes with
11798 --retain-symbols-file.
11799
d7bb5745
ILT
118002009-12-30 Ian Lance Taylor <iant@google.com>
11801
403a15dd
ILT
11802 PR 10979
11803 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
11804 don't put the file header and segment headers in the text
11805 segment.
11806
eda294df
ILT
11807 PR 10979
11808 * common.cc (Sort_commons::operator()): Stabilize sort when both
11809 entries are NULL.
11810 (Symbol_table::do_allocate_commons_list): When allocating common
11811 symbols, skip a symbol which is no longer common.
11812 * symtab.h (Symbol::is_common): Test whether the symbol comes from
11813 an object before checking its type.
11814 * testsuite/common_test_2.c: New file.
11815 * testsuite/common_test_3.c: New file.
11816 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
11817 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
11818 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
11819 (common_test_2_pic.o, common_test_2.so): New targets.
11820 (common_test_3_pic.o, common_test_3.so): New targets.
11821 * testsuite/Makefile.in: Rebuild.
11822
d7bb5745
ILT
11823 PR 10979
11824 * script.cc (read_input_script): If we see a new SECTIONS clause,
11825 and we have added an input section, give an error.
11826 * layout.h (class Layout): Add have_added_input_section function.
11827 Add have_added_input_section_ field.
11828 * layout.cc (Layout::Layout): Initialize
11829 have_added_input_section_.
11830 (Layout::layout): Set have_added_input_section_.
11831 (Layout::layout_eh_frame): Likewise.
11832
fc59c572
ILT
118332009-12-30 Ian Lance Taylor <iant@google.com>
11834
11835 PR 10931
11836 * options.h (class General_options): Add --sort-common option.
11837 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
11838 * common.cc (Sort_common): Add sort_order parameter to
11839 constructor. Add sort_order_ field.
11840 (Sort_commons::operator): Check sort_order_.
11841 (Symbol_table::allocate_commons): Determine the sort order.
11842 (Symbol_table::do_allocate_commons): Add sort_order parameter.
11843 Change all callers.
11844 (Symbol_table::do_allocate_commons_list): Likewise.
11845
1c74fab0
ILT
118462009-12-30 Ian Lance Taylor <iant@google.com>
11847
11848 PR 10916
11849 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
11850 symbols from this object, don't change the visibility of an
11851 undefined symbol.
11852 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
11853
6affe781
ILT
118542009-12-30 Ian Lance Taylor <iant@google.com>
11855
11856 PR 10861
11857 * script.h (class Version_script_info): Define Language enum.
11858 Update declarations. Define Glob, Exact, and Lookup types. Add
11859 new fields globals_, locals_, and is_finalized_.
11860 * script.cc: Various formatting fixes.
11861 (class Parser_closure): Change language_stack_ from a vector of
11862 std::string to one of Version_script_info::Language. Adjust all
11863 uses accordingly.
11864 (class Lazy_demangler): Remove.
11865 (struct Version_expression): Change language from std::string to
11866 Version_script_info::Language.
11867 (Version_script_info::Version_script_info): New function.
11868 (Version_script_info::~Version_script_info): Don't call clear.
11869 (Version_script_info::finalize): New function.
11870 (Version_script_info::build_lookup_tables): New function.
11871 (Version_script_info::build_expression_list_lookup): New
11872 function.
11873 (Version_script_info::get_symbol_version_helper): Rewrite to use
11874 lookup tables.
11875 (Version_script_info::print_expression_list): Adjust to use
11876 Version_script_info::Language.
11877 (script_push_lex_into_version_mode): Check that the version script
11878 has not been finalized.
11879 (version_script_push_lang): Change language string to
11880 Version_script_info::Language.
11881 * options.cc (Command_line::version_script): New function.
11882 * options.h (class General_options): Add finalize_dynamic_list
11883 function. Change version_script from declaration to definition.
11884 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
11885 * testsuite/version_script.map: Remove duplicate def of foo.
11886 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
11887 version_script.map.
11888 * testsuite/Makefile.in: Rebuild.
11889
818bf354
ILT
118902009-12-30 Ian Lance Taylor <iant@google.com>
11891
11892 PR 10843
11893 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
11894 if the input symbol index is 0, make the output symbol index 0.
11895
ebcc8304
ILT
118962009-12-30 Ian Lance Taylor <iant@google.com>
11897
11898 PR 10670
11899 * options.h (class General_options): Add -x/--discard-all.
11900 * object.cc (Sized_relobj::do_count_local_symbols): Handle
11901 --discard-all. If the local symbol needs a dynamic entry, check
11902 that before handling --discard-locals.
11903
176fe33f
ILT
119042009-12-30 Ian Lance Taylor <iant@google.com>
11905
bb321bb1
ILT
11906 PR 10450
11907 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
11908 flags to PF_R.
11909 (Output_segment::add_output_section): Don't change the flags if
11910 the type is PT_TLS.
11911
176fe33f
ILT
11912 PR 10450
11913 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
11914 GNU hash table if they need a dynamic value. Otherwise, don't add
11915 them if they are defined in a dynamic object or are forced local.
11916
e8cd95c7
ILT
119172009-12-29 Ian Lance Taylor <iant@google.com>
11918
1b81fb71
ILT
11919 PR 10450
11920 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
11921 .gnu.hash table for a 32-bit target.
11922
8d6d383d
ILT
11923 PR 10450
11924 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
11925 regular and a dynamic object only needs a dynamic symbol table
11926 entry if it is externally visible.
11927
e785ec03
ILT
11928 PR 10450
11929 * i386.cc (class Target_i386): Initialize global_offset_table_ in
11930 constructor. Add global_offset_table_ field.
11931 (Target_i386::got_section): Set global_offset_table_.
11932 (Target_i386::do_finalize_sections): Set global_offset_table_
11933 size.
11934 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
11935 in constructor. Add global_offset_table_ field.
11936 (Target_x86_64::got_section): Set global_offset_table_.
11937 (Target_x86_64::do_finalize_sections): Set global_offset_table_
11938 size.
11939
1a2dff53
ILT
11940 * layout.cc (Layout::Layout): Initialize increase_relro_.
11941 (Layout::get_output_section): Add is_relro, is_last_relro, and
11942 is_first_non_relro parameters. Change all callers.
11943 (Layout::choose_output_section): Likewise.
11944 (Layout::add_output_section_data): Likewise.
11945 (Layout::make_output_section): Likewise.
11946 (Layout::set_segment_offsets): Clear increase_relro when using a
11947 linker script.
11948 * layout.h (class Layout): Add increase_relro method. Add
11949 increase_relro_ field. Update declarations.
11950 * output.cc (Output_section::Output_section): Initialize
11951 is_last_relro_ and is_first_non_relro_.
11952 (Output_segment::add_output_section): Group relro sections is
11953 do_sort is true. Handle is_last_relro and is_first_non_relro.
11954 (Output_segment::maximum_alignment): Remove relro handling.
11955 (Output_segment::set_section_addresses): Add increase_relro
11956 parameter. Change all callers. Add initial alignment to align
11957 relro sections on separate page. Remove old relro handling.
11958 (Output_segment::set_section_list_addresses): Remove in_relro
11959 parameter. Change all callers.
11960 (Output_segment::set_offset): Add increase parameter. Change all
11961 callers. Remove old relro handling.
11962 * output.h (class Output_section): Add new methods: is_last_relro,
11963 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
11964 Add is_last_relro_ and is_first_non_relro_ fields.
11965 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
11966 Create separate .got.plt section. Call increase_relro.
11967 * x86_64.cc (Target_x86_64::got_section): Likewise.
11968 * testsuite/relro_script_test.t: Add .got.plt.
11969
f0ba79e2
ILT
11970 PR 10450
11971 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
11972 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
11973 (Layout::finalize): Call set_dynamic_symbol_size.
11974 (Layout::set_dynamic_symbol_size): New function.
11975 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
11976 set_dynamic_symbol_size.
11977
e8cd95c7
ILT
11978 PR 10450
11979 * output.h (class Output_section): Add is_entsize_zero_ field.
11980 * output.cc (Output_section::Output_section): Initialize
11981 is_entsize_zero_.
11982 (Output_section::set_entsize): If two different entsizes are
11983 requested, force it to zero.
11984 (Output_section::add_input_section): Set flags for .debug_str
11985 before updating section flags. Set entsize.
11986 (Output_section::update_flags_for_input_section): Set SHF_MERGE
11987 and SHF_STRING if all input sections have those flags.
11988
3e1b9a8a
RÁE
119892009-12-29 Rafael Espindola <espindola@google.com>
11990
11991 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
11992 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
11993 reporting.
3e1b9a8a 11994
3dcad376
ST
119952009-12-29 Sriraman Tallam <tmsriram@google.com>
11996
11997 * options.cc (General_options::parse_version): Allow -v to exit
11998 without an error if there is nothing to link.
11999
084e2665
ILT
120002009-12-29 Ian Lance Taylor <iant@google.com>
12001
12002 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
12003 using a version of gcc before 4.1.
12004 * configure: Rebuild.
12005
250acde3
CD
120062009-12-28 Chris Demetriou <cgd@google.com>
12007
12008 * attributes.cc (Output_attributes_section_data::do_write): Use
12009 std::vector::front rather than std::vector::data.
12010
99fff23b
ILT
120112009-12-28 Ian Lance Taylor <iant@google.com>
12012
12013 * symtab.h (class Symbol_table): Add enum Defined.
12014 * resolve.cc (Symbol_table::should_override): Add defined
12015 parameter. Change all callers. Test whether object is NULL
12016 before calling a method on it.
12017 (Symbol_table::report_resolve_problem): Add defined parameter.
12018 Change all callers.
12019 (Symbol_table::should_override_with_special): Likewise.
12020 * symtab.cc (Symbol_table::define_in_output_data): Add defined
12021 parameter. Change all callers.
12022 (Symbol_table::do_define_in_output_data): Likewise.
12023 (Symbol_table::define_in_output_segment): Likewise.
12024 (Symbol_table::do_define_in_output_segment): Likewise.
12025 (Symbol_table::define_as_constant): Likewise.
12026 (Symbol_table::do_define_as_constant): Likewise.
12027 * script.h (class Symbol_assignment): Add is_defsym parameter to
12028 constructor; change all callers.
12029 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
12030 parameter. Change all callers. Add is_defsym_ field.
12031 (class Parser_closure): Add parsing_defsym parameter to
12032 constructor; change all callers. Add parsing_defsym accessor
12033 function. Add parsing_defsym_ field.
12034
556bd683
ILT
120352009-12-28 Ian Lance Taylor <iant@google.com>
12036
12037 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 12038 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 12039
1782c879
ILT
120402009-12-23 Ian Lance Taylor <iant@google.com>
12041
12042 * i386.cc (Target_i386::do_calls_non_split): Recognize
12043 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
12044 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
12045 -fsplit-stack prologue when using %r11.
1782c879 12046
329ca2b1
ST
120472009-12-21 Sriraman Tallam <tmsriram@google.com>
12048
12049 * options.cc (General_options::parse_version): Make -v continue and do
12050 the link like GNU ld does.
12051
d675ff46
RÁE
120522009-12-17 Rafael Avila de Espindola <espindola@google.com>
12053
12054 * Makefile.am (CCFILES): Add timer.cc.
12055 (HFILES): Add timer.h.
12056 * configure.ac: Check for sysconf and times.
12057 * main.cc: include timer.h.
12058 (main): Use Timer instead of get_run_time.
12059 * timer.cc: New.
12060 * timer.h: New.
12061 * workqueue.cc: include timer.h.
12062 (Workqueue::find_and_run_task):
12063 Report user, sys and wall time.
12064 * Makefile.in: Regenerate.
12065 * config.in: Regenerate.
12066 * configure: Regenerate.
12067
d6344fb5
DK
120682009-12-16 Doug Kwan <dougkwan@google.com>
12069
12070 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
12071 sections.
12072 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
12073 relaxed input sections.
12074 * output.cc (Output_section::find_relaxed_input_section): Change
12075 return type to Output_relaxed_input_section pointer. Adjust code
12076 for new type of relaxed_input_section_map_.
12077 * output.h (Output_section::find_relaxed_input_section): Change
12078 return type to Output_relaxed_input_section pointer.
12079 (Output_section::Output_relaxed_input_section_by_input_section_map):
12080 New type.
12081 (Output_section::relaxed_input_section_map_): Change type to
12082 Output_section::Output_relaxed_input_section_by_input_section_map.
12083 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
12084 input section.
12085
0e0d5469
ILT
120862009-12-15 Ian Lance Taylor <iant@google.com>
12087
12088 * layout.cc (Layout::create_shstrtab): Only write out after input
12089 sections if we are compressing debug sections.
12090
0649a889
ILT
120912009-12-15 Ian Lance Taylor <iant@google.com>
12092
12093 * archive.cc (Archive::add_symbols): Only look up a symbol without
12094 a version if there is, in fact, a version.
12095
2ea97941
ILT
120962009-12-14 Ian Lance Taylor <iant@google.com>
12097
12098 Revert -Wshadow changes, all changes from:
12099 2009-12-11 Doug Kwan <dougkwan@google.com>
12100 2009-12-11 Nick Clifton <nickc@redhat.com>
12101 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
12102
b0eec2cc
DK
121032009-12-11 Doug Kwan <dougkwan@google.com>
12104
12105 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
12106 due to -Wshadow.
12107 * attributes.cc (Object_attribute::size): Ditto.
12108 (Attributes_section_data::size): Ditto.
12109 (Attributes_section_data::Attributes_section_data): Ditto.
12110 (Output_attributes_section_data::do_write): Ditto.
12111 * attributes.h (Object_attribute::set_type): Ditto.
12112 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
12113
91d6fa6a
NC
121142009-12-11 Nick Clifton <nickc@redhat.com>
12115
12116 * archive.cc: Fix shadowed variable warnings.
12117 * arm.cc: Likewise.
12118 * compressed_output.cc: Likewise.
12119 * compressed_output.h: Likewise.
12120 * configure: Likewise.
12121 * dwarf_reader.cc: Likewise.
12122 * dynobj.cc: Likewise.
12123 * dynobj.h: Likewise.
12124 * ehframe.cc: Likewise.
12125 * ehframe.h: Likewise.
12126 * errors.cc: Likewise.
12127 * expression.cc: Likewise.
12128 * fileread.cc: Likewise.
12129 * fileread.h: Likewise.
12130 * freebsd.h: Likewise.
12131 * i386.cc: Likewise.
12132 * icf.cc: Likewise.
12133 * incremental.h: Likewise.
12134 * layout.cc: Likewise.
12135 * layout.h: Likewise.
12136 * mapfile.cc: Likewise.
12137 * merge.cc: Likewise.
12138 * merge.h: Likewise.
12139 * object.cc: Likewise.
12140 * object.h: Likewise.
12141 * options.h: Likewise.
12142 * output.cc: Likewise.
12143 * output.h: Likewise.
12144 * parameters.cc: Likewise.
12145 * plugin.cc: Likewise.
12146 * powerpc.cc: Likewise.
12147 * reduced_debug_output.cc: Likewise.
12148 * reduced_debug_output.h: Likewise.
12149 * reloc.cc: Likewise.
12150 * reloc.h: Likewise.
12151 * resolve.cc: Likewise.
12152 * script-sections.cc: Likewise.
12153 * script.cc: Likewise.
12154 * script.h: Likewise.
12155 * sparc.cc: Likewise.
12156 * symtab.cc: Likewise.
12157 * symtab.h: Likewise.
12158 * target-select.cc: Likewise.
12159 * target-select.h: Likewise.
12160 * token.h: Likewise.
12161 * workqueue.cc: Likewise.
12162 * workqueue.h: Likewise.
12163 * x86_64.cc: Likewise.
12164
a0351a69
DK
121652009-12-10 Doug Kwan <dougkwan@google.com>
12166
12167 * arm.cc (attributes.h): New include.
12168 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
12169 (Arm_relobj::~Arm_relobj): Delete object pointed by
12170 attributes_section_data_.
12171 (Arm_relobj::attributes_section_data): New method definition.
12172 (Arm_relobj::attributes_section_data_): New data member declaration.
12173 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
12174 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
12175 attributes_section_data_.
12176 (Arm_dynobj::attributes_section_data): New method definition.
12177 (Arm_dynobj::attributes_section_data_): New data member declaration.
12178 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
12179 initialization value of may_use_blx_ to false.
2e702c99 12180 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
12181 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
12182 object attributes to compute results instead of hard-coding.
12183 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
12184 Target_arm::get_secondary_compatible_arch,
12185 Target_arm::set_secondary_compatible_arch
12186 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12187 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
12188 New method declarations.
12189 (Target_arm::get_aeabi_object_attribute): New method definition.
12190 (Target_arm::attributes_section_data_): New data member declaration.
12191 (read_arm_attributes_section): New template definition.
12192 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
12193 (Arm_dynobj::do_read_symbols): Ditto.
12194 (Target_arm::do_finalize_sections): Merge attributes sections from
12195 input. Check for BLX use after attributes section merging.
12196 Fix __exidx_start and __exidx_end visibility. Create an
12197 .ARM.attributes section if necessary.
12198 (Target_arm::get_secondary_compatible_arch,
12199 Target_arm::set_secondary_compatible_arch,
12200 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12201 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 12202 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
12203 New method definitions.
12204
b59befec
ILT
122052009-12-09 Ian Lance Taylor <iant@google.com>
12206
12207 * plugin.cc (Plugin::load): Don't cast from void* to a function
12208 pointer.
12209
1276bc89
ILT
122102009-12-09 Ian Lance Taylor <iant@google.com>
12211
12212 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
12213 information fields.
12214
2f2de248
L
122152009-12-09 H.J. Lu <hongjiu.lu@intel.com>
12216
12217 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
12218 Replace two_file_shared_1.so with two_file_shared_2.so.
12219 * testsuite/Makefile.in: Regenerated.
12220
4f787271
DK
122212009-12-08 Doug Kwan <dougkwan@google.com>
12222
12223 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
12224 (HFILES): Add attributes.h and int_encoding.h.
12225 * Makefile.in: Regenerate.
12226 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
12227 function definitions to int_encoding.cc
12228 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
12229 prototypes to int_encoding.h
12230 * reduced_debug_output.cc (int_encoding.h): New include.
12231 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
12232 function definitions to int_encoding.cc
12233 (insert_into_vector, read_from_pointer): Move template definitions to
12234 int_encoding.h
12235 * attributes.cc: New file.
12236 * attributes.h: New file.
12237 * int_encoding.cc: New file.
12238 * int_encoding.h: New file.
12239
20b52f1a
RÁE
122402009-12-07 Rafael Avila de Espindola <espindola@google.com>
12241
12242 PR gold/11055
12243 * incremental-dump.cc (dump_incremental_inputs): New.
12244 (main): Use dump_incremental_inputs.
12245
53d7974c
L
122462009-12-07 H.J. Lu <hongjiu.lu@intel.com>
12247
12248 PR gold/10893
12249 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
12250 checking elfcpp::STT_FUNC.
12251 (Target_i386::Relocate::relocate): Likewise.
12252 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
12253
12254 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
12255 symbols from shared libraries into normal FUNC symbols.
12256
12257 * symtab.h (Symbol): Add is_func and use it.
12258
05a352e6
DK
122592009-12-05 Doug Kwan <dougkwan@google.com>
12260
12261 * arm.cc (Target_arm::arm_info): Initialize new fields
12262 attributes_section and attributes_vendor.
12263 * i386.cc (Target_i386::i386_info): Same.
12264 * object.cc (Sized_relobj::do_layout): Skip attribute section.
12265 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
12266 fields attributes_section and attributes_vendor.
53d7974c 12267 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
12268 * target.h (Target::attributes_section, Target::attributes_vendor,
12269 Target::is_attributes_section, Target::attribute_arg_type,
12270 Target::attributes_order): New method definitions.
12271 (Target::Target_info::attributes_section,
12272 Target::Target_info::attributes_vendor): New fields.
12273 (Target::do_attribute_arg_type, Target::do_attributes_order): New
12274 virtual method definitions.
12275 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
12276 attributes_section and attributes_vendor.
12277 * testsuite/testfile.cc (Target_test::test_target_info): Same.
12278
f4e5969c
DK
122792009-12-05 Doug Kwan <dougkwan@google.com>
12280
12281 * arm.cc: Update comments about interworking and stub generation.
12282 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
12283 considered as non-PIC.
12284 (Arm_relocate_functions::base_abs): Fix formatting.
12285 (Arm_relocate_functions::got_prel): Fix comment. Change interface
12286 of function to use GOT entry address instead of offset.
12287 (Target_arm::Scan::global): Issue an error if a symbol would need a
12288 PLT does not get one because it is untyped. Remove code to create
12289 dynamic symbols for relative branches.
12290 (Target_arm::Relocate::relocate: Use 0 instead of false since function
12291 takes unsigned integer instead of boolean.
12292
1abce4a6
L
122932009-12-05 H.J. Lu <hongjiu.lu@intel.com>
12294
12295 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
12296 (two_file_test_LDADD): Likewise.
12297 (common_test_1_LDADD): Likewise.
12298 (exception_test_LDADD) Likewise.
12299 (weak_test_LDADD): Likewise.
12300 (many_sections_test_LDADD): Likewise.
12301 (initpri1_LDADD): Likewise.
12302 (script_test_1_LDADD): Likewise.
12303 (script_test_2_LDADD): Likewise.
12304 (justsyms_LDADD): Likewise.
12305 (binary_test_LDADD): Likewise.
12306 (large_LDADD): Likewise.
12307 * testsuite/Makefile.in: Regenerated.
12308
adcf2816 123092009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 12310
adcf2816
L
12311 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
12312 (Symbol_table::override_with_special): Likewise.
12313 (Symbol_table::add_from_object): Likewise.
12314
28e67f5d
RÁE
123152009-12-04 Rafael Avila de Espindola <espindola@google.com>
12316
12317 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12318 Don't set the data_offset twice.
12319
ae10a101
RÁE
123202009-12-04 Rafael Avila de Espindola <espindola@google.com>
12321
12322 * testsuite/Makefile.in: Regenerate.
12323
f59f41f3
DK
123242009-12-03 Doug Kwan <dougkwan@google.com>
12325
12326 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
12327 (Target_arm::do_finalize_sections): Add parameter for symbol table
12328 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
12329 * i386.cc (Target_i386::do_finalize_sections): Add an additional
12330 parameter for symbol table pointer.
12331 * layout.cc (Layout::finalize): Call Target::finalize_sections with
12332 an additional parameter for a pointer to symbol table.
12333 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
12334 parameter for a symbol table pointer.
12335 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
12336 * target.h (Target::finalize_sections, Target::do_finalize_sections):
12337 Ditto.
12338 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
12339 parameter for a symbol table pointer.
12340
ca55d848
RÁE
123412009-12-03 Rafael Avila de Espindola <espindola@google.com>
12342
12343 * incremental.cc (Incremental_inputs_header)
12344 (Incremental_inputs_header_write, Incremental_inputs_entry)
12345 (Incremental_inputs_entry_write): Move ...
12346 * incremental.h (Incremental_inputs_header)
12347 (Incremental_inputs_header_write, Incremental_inputs_entry)
12348 (Incremental_inputs_entry_write): here.
12349
3aec4f9c
RÁE
123502009-12-02 Rafael Avila de Espindola <espindola@google.com>
12351
12352 * incremental.cc (make_sized_incremental_binary): Set the target.
12353 Error if it is incompatible.
12354 * output.h (Output_file): Add filename method.
12355
9c0ae74d
RÁE
123562009-12-02 Rafael Avila de Espindola <espindola@google.com>
12357
12358 * incremental.cc (Incremental_inputs_entry): Remove unused argument
12359 from the get_* methods.
12360
a45500ae
RÁE
123612009-12-02 Rafael Avila de Espindola <espindola@google.com>
12362
12363 * incremental-dump.cc (main): Check that the offeset of a script is 0.
12364 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12365 Write 0 for the data_offset of scripts.
12366
325e6408
RÁE
123672009-12-02 Rafael Avila de Espindola <espindola@google.com>
12368
12369 * testsuite/Makefile.am: Add the incremental_test.sh test.
12370 * testsuite/incremental_test.sh: New.
12371 * testsuite/incremental_test_1.c: New.
12372 * testsuite/incremental_test_2.c: New.
12373
954c3e2e
RÁE
123742009-12-01 Rafael Avila de Espindola <espindola@google.com>
12375
703d02da 12376 * incremental-dump.cc (main): Fix typos.
954c3e2e 12377
f8086623
RÁE
123782009-11-27 Rafael Avila de Espindola <espindola@google.com>
12379
12380 PR gold/11025
12381 * incremental-dump.cc (main): Use llu to print 64 bit values.
12382
3b0dd6ac
L
123832009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
12384 H.J. Lu <hongjiu.lu@intel.com>
12385
12386 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
12387 $(LIBDL).
12388 (incremental_dump_LDADD): Likewise.
12389 * Makefile.in: Regenerated.
12390
a6d1ef57 123912009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 12392
a6d1ef57
DK
12393 Revert:
12394
12395 2009-11-25 Doug Kwan <dougkwan@google.com>
12396
12397 * arm.cc (Target_arm::Target_arm): Move method definition
12398 outside of class definition. Add code to handle
12399 --target1-rel, --target1-abs and --target2= options.
12400 (Target_arm::get_reloc_reloc_type): Change method to be
12401 non-static and const.
12402 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
12403 New data member declaration.
12404 (Target_arm::Scan::local, Target_arm::Scan::global,
12405 Target_arm::Relocate::relocate,
12406 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12407 Adjust call to Target_arm::get_real_reloc_type.
12408 (Target_arm::get_real_reloc_type): Use command line options
12409 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12410 * options.h (--target1-rel, --target1-abs, --target2): New
12411 ARM-only options.
12412
50aeb7d4
DK
124132009-11-25 Doug Kwan <dougkwan@google.com>
12414
12415 * arm.cc (Target_arm::Target_arm): Move method definition outside of
12416 class definition. Add code to handle --target1-rel, --target1-abs
12417 and --target2= options.
12418 (Target_arm::get_reloc_reloc_type): Change method to be non-static
12419 and const.
12420 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
12421 member declaration.
12422 (Target_arm::Scan::local, Target_arm::Scan::global,
12423 Target_arm::Relocate::relocate,
12424 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
12425 call to Target_arm::get_real_reloc_type.
12426 (Target_arm::get_real_reloc_type): Use command line options to
12427 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12428 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
12429 options.
12430
51938283
DK
124312009-11-25 Doug Kwan <dougkwan@google.com>
12432
12433 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
12434 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
12435 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
12436 formatting.
12437 (Arm_relocate_functions::thm_call): Replace body with a call to
12438 Arm_relocate_functions::thumb_branch_common.
12439 (Arm_relocate_functions::thm_jump24,
12440 Arm_relocate_functions::thm_xpc22): New method definitions.
12441 (Arm_relocate_functions::thumb_branch_common): New method definition.
12442 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
12443 operator.
12444 (Target_arm::Relocate::relocate): Adjust call to thm_call.
12445 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
12446
e2b8f3c4
RÁE
124472009-11-24 Rafael Avila de Espindola <espindola@google.com>
12448
12449 * Makefile.am: Build incremental-dump
12450 * Makefile.in: Regenerate.
12451 * incremental-dump.cc: New.
12452 * incremental.cc (Incremental_inputs_header_data,
12453 Incremental_inputs_entry_data): Move to incremental.h
12454 * incremental.h: (Incremental_inputs_header_data,
12455 Incremental_inputs_entry_data): Move from incremental.cc
12456
bcba9aec
RÁE
124572009-11-24 Rafael Avila de Espindola <espindola@google.com>
12458
12459 * incremental.cc (Incremental_inputs_header,
12460 Incremental_inputs_header_write, Incremental_inputs_entry,
12461 Incremental_inputs_entry_write): Add a typedef with the data type.
12462
7c3afe08
RÁE
124632009-11-24 Rafael Avila de Espindola <espindola@google.com>
12464
12465 * incremental.cc (Incremental_inputs_header,
12466 Incremental_inputs_header_write, Incremental_inputs_entry,
12467 Incremental_inputs_entry_write): Update comment about which
12468 type has the filed descriptions.
12469
d204b6e9
DK
124702009-11-15 Doug Kwan <dougkwan@google.com>
12471
12472 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
12473 (Arm_relocate_functions::arm_branch_common): Change method defintion
12474 in class definition to a method declaration and update list of formal
12475 parameters.
12476 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
12477 Arm_relocation_functions::jump24): Adjust call to
12478 Arm_relocate_functions::arm_branch_common. Update list of formal
12479 parameters.
12480 (Arm_relocate_functions::xpc25): New method definition.
12481 (Arm_relocate_functions::arm_branch_common): Move method defintion
12482 out from class definition. Use stubs for mode-switching and extending
12483 branch ranges.
12484 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
12485 specially. Change code to enable use of stubs in ARM branches.
12486
43d12afe
DK
124872009-11-10 Doug Kwan <dougkwan@google.com>
12488
12489 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
12490 in method declaration.
12491 (Target_arm::relocate_stub): New method declaration.
12492 (Target_arm::default_target): Change to return a pointer instead of
12493 a const reference.
12494 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
12495 Target_arm::default_target.
12496 (Arm_Relobj::do_relocate_sections): Remove options paramater in
12497 method definition.
12498 (Target_arm::relocate_section): Adjust view.
12499 (Target_arm::relocate_stub): New method definition.
12500
ac33a407
DK
125012009-11-10 Doug Kwan <dougkwan@google.com>
12502
12503 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
12504 a format warning.
12505 * incremental.cc (open_incremental_binary): Initialized local
12506 variables to avoid warnings.
12507 * object.cc (make_elf_object): Ditto.
12508 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
12509 a format warning.
e1df38aa 12510
88ee28e9
L
12511009-11-09 H.J. Lu <hongjiu.lu@intel.com>
12512
12513 PR gold/10930
12514 * testsuite/plugin_test.c: Include "config.h".
12515
2daedcd6
DK
125162009-11-09 Doug Kwan <dougkwan@google.com>
12517
12518 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
12519 (arm_symbol_value): Remove.
12520 (Arm_relocate_functions::arm_branch_common,
12521 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
12522 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
12523 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
12524 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
12525 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
12526 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
12527 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
12528 Arm_relocate_functions::thm_mobw_abs_nc,
12529 Arm_relocate_functions::thm_mov_abs,
12530 Arm_relocate_functions::movw_prel_nc,
12531 Arm_relocate_functions::thm_movt_abs,
12532 Arm_relocate_functions::movt_prel,
12533 Arm_relocate_functions::thm_movw_prel_nc,
12534 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
12535 (Target_arm::Relocate::relocate): Only decompose address into two
12536 parts if relocation type uses the thumb-bit and pass the actual
12537 bit instead of a flag indicating that the thumb-bit is used. Adjust
12538 calls to methods in Arm_relocate_functions for this change.
12539
1276bc89 125402009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
12541
12542 PR 10925
12543 * reloc.cc: Instantiate
12544 Sized_relobj::initialize_input_to_output_maps and
12545 Sized_relobj:free_input_to_output_maps.
12546
e53ad1b5
ILT
125472009-11-06 Ian Lance Taylor <iant@google.com>
12548
12549 PR 10876
12550 * defstd.cc (in_segment): Set only_if_ref true for "end".
12551
eb44217c
DK
125522009-11-06 Doug Kwan <dougkwan@google.com>
12553
12554 * arm.cc (class Reloc_stub): Correct a comment.
12555 (Target_arm::Target_arm): Initialize arm_input_section_map_.
12556 (Target_arm::scan_section_for_stubs): New method declaration.
12557 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
12558 Change methods from private to protected.
12559 (Target_arm::do_may_relax): New method definition.
12560 (Target_arm::do_relax, Target_arm::group_sections,
12561 Target_arm::scan_reloc_for_stub,
12562 Target_arm::scan_reloc_section_for_stubs): New method declarations.
12563 (Target_arm::arm_input_section_map_): New data member declaration.
12564 (Target_arm::scan_reloc_for_stub,
12565 Target_arm::scan_reloc_section_for_stubs,
12566 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
12567 Target_arm::do_relax): New method definitions.
12568
5d329b7d
ILT
125692009-11-06 Mikolaj Zalewski <mikolaj@google.com>
12570
12571 * configure.ac: Check for (struct stat)::st_mtim
12572 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
12573 * config.in: Regenerate.
12574 * configure: Regenerate.
12575
96a0d71b
ILT
125762009-11-05 Ian Lance Taylor <iant@google.com>
12577
12578 PR 10910
12579 * output.cc (Output_segment::add_output_section): Add missing
12580 return statement.
12581
594c8e5e
ILT
125822009-11-04 Ian Lance Taylor <iant@google.com>
12583
12584 PR 10880
12585 * object.h (class Object): Add is_needed and set_is_needed
12586 methods. Add is_needed_ field. Make bool fields into bitfields.
12587 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
12588 defined in a dynamic object and referenced by a regular object,
12589 set is_needed for the dynamic object.
12590 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
12591 if the file is marked with as_needed and it is not needed.
12592
22b127cc
ILT
125932009-11-04 Ian Lance Taylor <iant@google.com>
12594
12595 PR 10887
12596 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
12597 tags if data is discarded by linker script.
12598 * i386.cc (Target_i386::do_finalize_sections): Likewise.
12599 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
12600 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
12601 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
12602
f5c870d2
ILT
126032009-11-04 Ian Lance Taylor <iant@google.com>
12604
12605 * layout.cc (Layout::get_output_section): Add is_interp and
12606 is_dynamic_linker_section parameters. Change all callers.
12607 (Layout::choose_output_section): Likewise.
12608 (Layout::make_output_section): Likewise.
12609 (Layout::add_output_section_data): Add is_dynamic_linker_section
12610 parameter. Change all callers.
12611 * layout.h (class Layout): Update declarations.
12612 * output.h (class Output_section): Add is_interp, set_is_interp,
12613 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
12614 Add is_interp_, is_dynamic_linker_section_ fields. Change
12615 generate_code_fills_at_write_ to a bitfield.
12616 * output.cc (Output_section::Output_sections): Initialize new
12617 fields.
12618 (Output_segment::add_output_section): Add do_sort parameter.
12619 Change all callers.
12620
1ae4d23b
ILT
126212009-11-03 Ian Lance Taylor <iant@google.com>
12622
12623 PR 10860
12624 * options.h (class General_options): Add --warn-common.
12625 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
12626 merging two common symbols.
12627 (Symbol_table::should_override): Handle --warn-common when merging
12628 a common symbol with a defined symbol. Use report_resolve_problem
12629 for multiple definitions.
12630 (Symbol_table::report_resolve_problem): New function.
12631 * symtab.h (class Symbol_table): Declare report_resolve_problem.
12632
55da9579
DK
126332009-11-03 Doug Kwan <dougkwan@google.com>
12634
12635 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
12636 stub_factory_.
12637 (Target_arm::stub_factory): New method definition.
12638 (Target_arm::new_arm_input_section,
12639 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
12640 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 12641 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
12642 New type definitions.
12643 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
12644 member declarations.
12645 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
12646 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
12647 New method definitions.
12648
37a9ac43
ILT
126492009-11-03 Ian Lance Taylor <iant@google.com>
12650
12651 * options.h (class General_options): Add --warn_constructors.
12652
b3d6a3d4
ILT
126532009-11-03 Ian Lance Taylor <iant@google.com>
12654
12655 PR 10893
12656 * defstd.cc (in_section): Add entries for __rel_iplt_start,
12657 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
12658
934b01dd
ILT
126592009-11-03 Ian Lance Taylor <iant@google.com>
12660
12661 PR 10895
12662 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
12663 --msgid-bugs-address.
12664 (install-pdf): New target.
12665 (install-data_yes): Look up one directory to find mkinstalldirs.
12666
03c1939b
L
126672009-11-03 H.J. Lu <hongjiu.lu@intel.com>
12668
12669 * po/Make-in (.po.gmo): Don't generate .gmo files in source
12670 tree.
12671
ebd95253
DK
126722009-10-30 Doug Kwan <dougkwan@google.com>
12673
12674 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
12675
e9bbb538
DK
126762009-10-30 Doug Kwan <dougkwan@google.com>
12677
12678 * arm.cc (Stub_addend_reader): New struct template definition
12679 and partial specializations.
12680 (Stub_addend_reader::operator()): New method definition for a
12681 partially specialized template.
12682
d5b40221
DK
126832009-10-30 Doug Kwan <dougkwan@google.com>
12684
12685 * arm.cc (Arm_relobj::processor_specific_flags): New method
12686 definition.
12687 (Arm_relobj::do_read_symbols): New method declaration.
12688 (Arm_relobj::processor_specific_flags_): New data member declaration.
12689 (Arm_dynobj): New class definition.
12690 (Target_arm::do_finalize_sections): Add input_objects parameter.
12691 (Target_arm::do_adjust_elf_header): New method declaration.
12692 (Target_arm::are_eabi_versions_compatible,
12693 (Target_arm::merge_processor_specific_flags): New method declaration.
12694 (Target_arm::do_make_elf_object): New overloaded method definitions
12695 and declaration.
12696 (Arm_relobj::do_read_symbols): New method definition.
12697 (Arm_dynobj::do_read_symbols): Ditto.
12698 (Target_arm::do_finalize_sections): Add input_objects parameters.
12699 Merge processor-specific flags from all input objects.
12700 (Target_arm::are_eabi_versions_compatible,
12701 Target_arm::merge_processor_specific_flags,
12702 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
12703 New method definitions.
12704 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
12705 Input_objects pointer type parameter.
12706 * layout.cc (Layout::finalize): Pass input objects to target's.
12707 finalize_sections function.
12708 * output.cc (Output_file_header::do_sized_write): Set ELF file
12709 header's processor-specific flags.
12710 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
12711 Input_objects pointer type parameter.
12712 * sparc.cc (Target_sparc::do_finalize_sections): Same.
12713 * target.h (Input_objects): New forward class declaration.
12714 (Target::processor_specific_flags,
12715 Target::are_processor_specific_flags_sect): New method definitions.
12716 (Target::finalize_sections): Add input_objects parameter.
12717 (Target::Target): Initialize processor_specific_flags_ and
12718 are_processor_specific_flags_set_.
12719 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
12720 parameter.
12721 (Target::set_processor_specific_flags): New method definition.
12722 (Target::processor_specific_flags_,
12723 Target::are_processor_specific_flags_set_): New data member
12724 declarations.
12725 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
12726 Input_objects pointer type parameter.
12727
ebabffbd
DK
127282009-10-30 Doug Kwan <dougkwan@google.com>
12729
12730 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
12731
ad0f2072
ILT
127322009-10-28 Ian Lance Taylor <iant@google.com>
12733
12734 * object.h (class Relobj): Drop options parameter from
12735 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
12736 do_scan_relocs, do_relocate. Change all callers.
12737 (class Sized_relobj): Drop options parameters from
12738 do_gc_process_relocs, do_scan_relocs, do_relocate,
12739 do_relocate_sections, relocate_sections, emit_relocs_scan,
12740 emit_relocs_scan_reltype. Change all callers.
12741 (struct Relocate_info): Remove options field and all references to
12742 it.
12743 * reloc.h (class Read_relocs): Remove options constructor
12744 parameter and options_ field. Change all callers.
12745 (class Gc_process_relocs, class Scan_relocs): Likewise.
12746 (class Relocate_task): Likewise.
12747 * target-reloc.h (scan_relocs): Remove options parameter. Change
12748 all callers.
12749 (scan_relocatable_relocs): Likewise.
12750 * target.h (class Sized_target): Remove options parameter from
12751 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
12752 all callers.
12753 * gc.h (gc_process_relocs): Remove options parameter. Change all
12754 callers.
12755 * arm.cc: Update functions to remove options parameters.
12756 * i386.cc: Likewise.
12757 * powerpc.cc: Likewise.
12758 * sparc.cc: Likewise.
12759 * x86_64.cc: Likewise.
12760 * testsuite/testfile.cc: Likewise.
12761
8ffa3667
DK
127622009-10-28 Doug Kwan <dougkwan@google.com>
12763
12764 * arm.cc (Arm_relobj): New class definition.
e1df38aa 12765 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
12766 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
12767 New method definitions.
12768
40f36857
CC
127692009-10-28 Cary Coutant <ccoutant@google.com>
12770
12771 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
12772 (Plugin::cleanup_done_): New member.
12773 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
12774 (Plugin_manager::cleanup_done_): Remove.
12775 (Plugin_manager::add_input_file): Edit error message.
12776 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
12777 (Plugin_manager::cleanup): Remove use of cleanup_done_.
12778
2c849493
ILT
127792009-10-27 Mikolaj Zalewski <mikolajz@google.com>
12780
12781 * fileread.cc: (File_read::View::~View): Use the new
12782 data_ownership_ filed.
12783 (File_read::~File_read): Dispose the new whole_file_view_.
12784 (File_read::open): Mmap the whole file if needed.
12785 (File_read::open): Use whole_file_view_ instead of contents_.
12786 (File_read::find_view): Use whole_file_view_ if applicable.
12787 (File_read::do_read): Use whole_file_view_ instead of contents_.
12788 (File_read::make_view): Use whole_file_view_ instead of contents_,
12789 update File_read::View::View call.
12790 (File_read::find_or_make_view): Update File_read::View::View
12791 call.
12792 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
12793 remove contents_
12794 (File_read::View::Data_ownership): New enum.
12795 (File_read::View::View): Replace bool mapped_ with Data_ownership
12796 argument.
12797 (File_read::View::mapped_): Remove (replaced by data_ownership_).
12798 (File_read::View::data_ownership_): New field.
12799 (File_read::contents_): Remove (replaced by whole_file_view_).
12800 (File_read::whole_file_view_): New field.
12801 * options.h (class General_options): Add --keep-files-mapped.
12802
24998053
CC
128032009-10-27 Cary Coutant <ccoutant@google.com>
12804
12805 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
12806 * testsuite/Makefile.am (plugin_test_5): New test case.
12807 * testsuite/Makefile.in: Regenerate.
12808
72adc4fa
DK
128092009-10-25 Doug Kwan <dougkwan@google.com>
12810
12811 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
12812 from private to protected to allow access by child class.
12813 (Sized_relobj::do_relocate_sections): New method declaration.
12814 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 12815 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
12816 Sized_relobj::relocate_sections. Instantiate template explicitly
12817 for different target sizes and endianity.
12818
07f508a2
DK
128192009-10-24 Doug Kwan <dougkwan@google.com>
12820
12821 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
12822 (Arm_input_section::as_arm_input_section): New method.
12823 (Arm_output_section): New class definition.
12824 (Arm_output_section::create_stub_group,
12825 Arm_output_section::group_sections): New method definitions.
12826
10ad9fe5
DK
128272009-10-22 Doug Kwan <dougkwan@google.com>
12828
12829 * arm.cc (Arm_input_section): New class definition.
12830 (Arm_input_section::init, Arm_input_section:do_write,
12831 Arm_input_section::set_final_data_size,
12832 Arm_input_section::do_reset_address_and_file_offset): New method
12833 definitions.
12834
56ee5e00
DK
128352009-10-21 Doug Kwan <dougkwan@google.com>
12836
12837 * arm.cc (Stub_table, Arm_input_section): New forward class
12838 declarations.
12839 (Stub_table): New class defintion.
12840 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
12841 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
12842 New method definition.
12843
b569affa
DK
128442009-10-21 Doug Kwan <dougkwan@google.com>
12845
12846 * arm.cc: Update copyright comments.
12847 (Target_arm): New forward class template declaration.
12848 (Arm_address): New type.
12849 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
12850 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
12851 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
12852 constants.
12853 (Insn_template): Same.
12854 (DEF_STUBS): New macro.
12855 (Stub_type): New enum type.
12856 (Stub_template): New class definition.
12857 (Stub): Same.
12858 (Reloc_stub): Same.
12859 (Stub_factory): Same.
12860 (Target_arm::Target_arm): Initialize may_use_blx_ and
12861 should_force_pic_veneer_.
12862 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
12863 Target_arm::should_force_pic_veneer,
12864 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
12865 Target_arm::using_thumb_only, Target_arm:;default_target): New
12866 method defintions.
12867 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
12868 New data member declarations.
12869 (Insn_template::size, Insn_template::alignment): New method defintions.
12870 (Stub_template::Stub_template): New method definition.
12871 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
12872 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
12873 (Stub_factory::Stub_factory): New method definition.
12874 * gold.h (string_hash): New template.
12875 * output.h (Input_section_specifier::hash_value): Use
12876 gold::string_hash.
12877 (Input_section_specifier::string_hash): Remove.
12878 * stringpool.cc (Stringpool_template::string_hash): Use
12879 gold::string_hash.
12880
6c172549
DK
128812009-10-20 Doug Kwan <dougkwan@google.com>
12882
12883 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
12884 symbols of relaxed input sections.
12885 * output.h (Output_section::find_relaxed_input_section): Make
12886 method public.
12887
c5617f2f
DK
128882009-10-16 Doug Kwan <dougkwan@google.com>
12889
12890 * dynobj.cc (Versions::Versions): Initialize version_script_.
12891 Only insert base version symbol definition for a shared object
12892 if version script defines any version versions.
12893 (Versions::define_base_version): New method definition.
12894 (Versions::add_def): Check that base version is not needed.
12895 (Versions::add_need): Define base version lazily.
12896 * dynobj.h (Versions::define_base_version): New method declaration.
12897 (Versions::needs_base_version_): New data member declaration.
12898 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
12899 (check_DATA): Add no_version_test.stdout.
12900 (libno_version_test.so, no_version_test.o no_version_test.stdout):
12901 New make rules.
12902 * testsuite/Makefile.in: Regenerate.
12903 * testsuite/no_version_test.c: New file.
12904 * testsuite/no_version_test.sh: Ditto.
12905
3c12dcdb
DK
129062009-10-16 Doug Kwan <dougkwan@google.com>
12907
12908 * expression.cc (class Segment_start_expression): New class definition.
12909 (Segment_start_expression::value): New method definition.
12910 (script_exp_function_segment_start): Return a new
12911 Segment_start_expression.
12912 * gold/script-c.h (script_saw_segment_start_expression): New function
12913 prototype.
12914 * script-sections.cc (Script_sections::Script_sections): Initialize
12915 SAW_SEGMENT_START_EXPRESSION_ to false.
12916 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
12917 and -Tbbs options to specify section addresses if given in
12918 command line and no SEGMENT_START expression is seen in a script.
12919 * script-sections.h (Script_sections::saw_segment_start_expression,
12920 Script_sections::set_saw_segment_start_expression): New method
12921 definition.
12922 (Script_sections::saw_segment_start_expression_): New data member
12923 declaration.
12924 * script.cc (script_saw_segment_start_expression): New function.
12925 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
12926 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
12927 script_test_7.sh and script_test_8.sh.
12928 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
12929 script_test_8.stdout.
12930 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
12931 (script_test_6, script_test_6.stdout, script_test_7,
12932 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
12933 * Makefile.in: Regenerate.
12934 * testsuite/script_test_6.sh: New file.
12935 * testsuite/script_test_6.t: Same.
12936 * testsuite/script_test_7.sh: Same.
12937 * testsuite/script_test_7.t: Same.
12938 * testsuite/script_test_8.sh: Same.
12939
64b1ae37
DK
129402009-10-16 Doug Kwan <dougkwan@google.com>
12941
12942 * output.cc (Output_segment::set_section_list_address): Cast
12943 expressions to unsigned long long type to avoid format warnings.
12944
661be1e2
ILT
129452009-10-15 Ian Lance Taylor <iant@google.com>
12946
12edd763 12947 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 12948 dot assignment to script_sections_.
12edd763
ILT
12949 * script-sections.cc (Script_sections::add_dot_assignment):
12950 Initialize if necessary.
12951
68b6574b
ILT
12952 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
12953 program headers with no load segment if there is a linker script.
12954
661be1e2
ILT
12955 * layout.cc (Layout::set_segment_offsets): Align the file offset
12956 to the segment aligment for -N or -n with no load segment.
12957 * output.cc (Output_segment::add_output_section): Don't crash if
12958 the first section is a TLS section.
12959 (Output_segment::set_section_list_addresses): Print an error
12960 message if the address moves backward in a linker script.
12961 * script-sections.cc
12962 (Output_section_element_input::set_section_addresses): Don't
12963 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
12964 (Orphan_output_section::set_section_addresses): Likewise.
12965
f15f61a7
DK
129662009-10-15 Doug Kwan <dougkwan@google.com>
12967
12968 * layout.cc (Layout::finish_dynamic_section): Generate tags
12969 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
12970 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
12971 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
12972
82bb573a
ILT
129732009-10-14 Ian Lance Taylor <iant@google.com>
12974
12975 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
12976 fields.
12977 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
12978 data_shdr fields of relinfo.
12979 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
12980 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
12981 R_386_TLS_LDO_32, adjust based on section flags.
12982 (Target_i386::Relocate::fix_up_ldo): Remove.
12983
374ad285
ILT
129842009-10-13 Ian Lance Taylor <iant@google.com>
12985
12986 Add support for -pie.
12987 * options.h (class General_options): Add -pie and
12988 --pic-executable.
12989 (General_options::output_is_position_independent): Test -pie.
12990 (General_options::output_is_executable): Return true if not shared
12991 and not relocatable.
12992 (General_options::output_is_pie): Remove.
12993 * options.cc (General_options::finalize): Reject incompatible uses
12994 of -pie.
12995 * gold.cc (queue_middle_tasks): A -pie link is not static.
12996 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
12997 * symtab.cc (Symbol::final_value_is_known): Return false if
12998 output_is_position_independent.
12999 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
13000 output_is_position_independent.
13001 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
13002 output_is_position_independent.
13003 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
13004 output_is_position_independent.
13005 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
13006 two_file_pie_test.
13007 (basic_pie_test.o, basic_pie_test): New targets.
13008 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
13009 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
13010 (two_file_pie_test): New target.
13011 * testsuite/Makefile.in: Rebuild.
13012 * README: Remove note saying that -pie is not supported.
13013
c6585162
ILT
130142009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
13015
13016 * options.h (class General_options): Add -init and -fini.
13017 * layout.cc (Layout::finish_dynamic_section): Emit
13018 given init and fini functions.
13019
032ce4e9
ST
130202009-10-13 Sriraman Tallam <tmsriram@google.com>
13021
13022 * gc.h (gc_process_relocs): Check if icf is enabled using new
13023 function.
13024 * gold.cc (queue_initial_tasks): Likewise.
13025 (queue_middle_tasks): Likewise.
13026 * object.cc (do_layout): Likewise.
13027 * symtab.cc (is_section_folded): Likewise.
13028 * main.cc (main): Likewise.
13029 * reloc.cc (Read_relocs::run): Likewise.
13030 (Sized_relobj::do_scan_relocs): Likewise.
13031 * icf.cc (is_function_ctor_or_dtor): New function.
13032 (Icf::find_identical_sections): Check if function is ctor or dtor when
13033 safe icf is chosen.
13034 * options.h (General_options::icf): Change option to be an enum.
13035 (Icf_status): New enum.
13036 (icf_enabled): New method.
13037 (icf_safe_folding): New method.
13038 (set_icf_status): New method.
13039 (icf_status_): New variable.
13040 * (options.cc) (General_options::finalize): Set icf_status_.
13041 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
13042 icf_test and icf_keep_unique_test to use the --icf enum flag.
13043 * testsuite/icf_safe_test.sh: New file.
e1df38aa 13044 * testsuite/icf_safe_test.cc: New file.
032ce4e9 13045
f345227a
ST
130462009-10-12 Sriraman Tallam <tmsriram@google.com>
13047
13048 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
13049 includes to gc.h and icf.h.
13050 * arm.cc: Include gc.h.
13051 * gold.cc: Likewise.
13052 * i386.cc: Likewise.
13053 * powerpc.cc: Likewise.
13054 * sparc.cc: Likewise.
13055 * x86_64.cc: Likewise.
13056 * gc.h: Include icf.h.
13057
1c7814ed
ILT
130582009-10-11 Ian Lance Taylor <iant@google.com>
13059
13060 * plugin.cc: Include "gold.h" before other header files.
13061
ae3b5189
CD
130622009-10-10 Chris Demetriou <cgd@google.com>
13063
13064 * options.h (Input_file_argument::Input_file_type): New enum.
13065 (Input_file_argument::is_lib_): Replace with...
13066 (Input_file_argument::type_): New member.
13067 (Input_file_argument::Input_file_argument): Take Input_file_type
13068 'type' rather than boolean 'is_lib' as second argument.
13069 (Input_file_argument::is_lib): Use type_.
13070 (Input_file_argument::is_searched_file): New function.
13071 (Input_file_argument::may_need_search): Handle is_searched_file.
13072 * options.cc (General_options::parse_library): Support -l:filename.
13073 (General_options::parse_just_symbols): Update for Input_file_argument
13074 changes.
13075 (Command_line::process): Likewise.
13076 * archive.cc (Archive::get_file_and_offset): Likewise.
13077 * plugin.cc (Plugin_manager::release_input_file): Likewise.
13078 * script.cc (read_script_file, script_add_file): Likewise.
13079 * fileread.cc (Input_file::Input_file): Likewise.
13080 (Input_file::will_search_for): Handle is_searched_file.
13081 (Input_file::open): Likewise.
13082 * readsyms.cc (Read_symbols::get_name): Likewise.
13083 * testsuite/Makefile.am (searched_file_test): New test.
13084 * testsuite/Makefile.in: Regenerate.
13085 * testsuite/searched_file_test.cc: New file.
13086 * testsuite/searched_file_test_lib.cc: New file.
13087
f3048a1d
ILT
130882009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13089 Ian Lance Taylor <iant@google.com>
13090
13091 * descriptor.cc: Include <cstdio> and "binary-io.h".
13092 (Descriptors::open): Open the files in binary mode always.
13093 * script.cc (Lex::get_token): Treat \r as whitespace.
13094
d4780e57
ILT
130952009-10-09 Ian Lance Taylor <iant@google.com>
13096
13097 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
13098
d9a893b8
ILT
130992009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13100 Ian Lance Taylor <iant@google.com>
13101
13102 * configure.ac: Check for readv function also.
13103 * fileread.cc (readv): Define if not HAVE_READV.
13104 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
13105 does not exist.
13106 * config.in: Regenerate.
13107 * configure: Regenerate.
13108
c0a62865
DK
131092009-10-09 Doug Kwan <dougkwan@google.com>
13110
13111 * layout.cc (Layout::make_output_section): Call target hook to make
13112 ordinary output section.
13113 (Layout::finalize): Adjust parameter list of call the
13114 Target::may_relax().
13115 * layout.h (class Layout::section_list): New method.
13116 * merge.h (Output_merge_base::entsize): Change visibility to public.
13117 (Output_merge_base::is_string, Output_merge_base::do_is_string):
13118 New methods.
13119 (Output_merge_string::do_is_string): New method.
13120 * object.cc (Sized_relobj::do_setup): renamed from
13121 Sized_relobj::set_up.
13122 * object.h (Sized_relobj::adjust_shndx,
13123 Sized_relobj::initializ_input_to_output_maps,
13124 Sized_relobj::free_input_to_output_maps): Change visibilities to
13125 protected.
13126 (Sized_relobj::setup): Virtualize.
13127 (Sized_relobj::do_setup): New method declaration.
13128 (Sized_relobj::invalidate_section_offset,
13129 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
13130 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
13131 * options.cc (parse_int): New function.
13132 * options.h (parse_int): New declaration.
13133 (DEFINE_int): New macro.
13134 (stub_group_size): New option.
13135 * output.cc (Output_section::Output_section): Initialize memebers
13136 merge_section_map_, merge_section_by_properties_map_,
13137 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
13138 (Output_section::add_input_section): Handled deferred code-fill
13139 generation and remove an old comment.
13140 (Output_section::add_relaxed_input_section): New method definition.
13141 (Output_section::add_merge_input_section): Use merge section by
13142 properties map to speed to search. Update merge section maps
13143 as appropriate.
13144 (Output_section::build_relaxation_map): New method definition.
13145 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
13146 Same.
13147 (Output_section::relax_input_section): Renamed to
13148 Output_section::convert_input_sections_to_relaxed_sections and change
13149 interface to take a vector of pointers to relaxed sections.
13150 (Output_section::find_merge_section,
13151 Output_section::find_relaxed_input_section): New method definitions.
13152 (Output_section::is_input_address_mapped,
13153 Output_section::output_offset, Output_section::output_address):
13154 Use output section data maps to speed up searching.
13155 (Output_section::find_starting_output_address): Add comments.
13156 (Output_section::do_write,
13157 Output_section::write_to_postprocessing_buffer): Do code-fill
13158 generation as appropriate.
13159 (Output_section::get_input_sections): Invalidate relaxed input section
13160 map.
13161 (Output_section::restore_states): Adjust type of checkpoint .
13162 Invalidate relaxed input section map.
13163 * output.h (Output_merge_base): New class declaration.
13164 (Input_section_specifier): New class defintion.
13165 (class Output_relaxed_input_section) Change base class to
13166 Output_section_data_build.
13167 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
13168 base class initializer.
13169 (Output_section::add_relaxed_input_section): New method declaration.
13170 (Output_section::Input_section): Change visibility to protected.
2e702c99 13171 (Output_section::Input_section::relobj,
c0a62865
DK
13172 Output_section::Input_section::shndx): Handle relaxed input sections.
13173 Output_section::input_sections) Change visibility to protected. Also
13174 define overload to return a non-const pointer.
13175 (Output_section::Merge_section_properties): New class defintion.
13176 (Output_section::Merge_section_by_properties_map,
13177 Output_section::Output_section_data_by_input_section_map,
13178 Output_section::Relaxation_map): New types.
13179 (Output_section::relax_input_section): Rename method to
13180 Output_section::convert_input_sections_to_relaxed_sections and change
13181 interface to take a vector of relaxed section pointers.
13182 (Output_section::find_merge_section,
13183 Output_section::find_relaxed_input_section,
13184 Output_section::build_relaxation_map,
13185 Output_section::convert_input_sections_in_list_to_relaxed_sections):
13186 New method declarations.
13187 (Output_section::merge_section_map_
13188 Output_section::merge_section_by_properties_map_,
13189 Output_section::relaxed_input_section_map_,
13190 Output_section::is_relaxed_input_section_map_valid_,
13191 Output_section::generate_code_fills_at_write_): New data members.
13192 * script-sections.cc
13193 (Output_section_element_input::set_section_addresses): Call
13194 current_data_size and addralign methods of relaxed input sections.
13195 (Orphan_output_section::set_section_addresses): Call current_data_size
13196 and addralign methods of relaxed input sections.
13197 * symtab.cc (Symbol_table::compute_final_value): Extract template
13198 from the body of Symbol_table::sized_finalize_symbol.
13199 (Symbol_table::sized_finalized_symbol): Call
13200 Symbol_table::compute_final_value.
13201 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
13202 (Symbol_table::compute_final_value): New templated method declaration.
13203 * target.cc (Target::do_make_output_section): New method defintion.
13204 * target.h (Target::make_output_section): New method declaration.
13205 (Target::relax): Add more parameters for input objects, symbol table
13206 and layout. Adjust call to do_relax.
13207 (Target::do_make_output_section): New method declaration.
13208 (Target::do_relax): Add parameters for input objects, symbol table
13209 and layout.
13210
d446d6c4
ILT
132112009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13212
13213 * pread.c: Include stdio.h.
13214
bc06c745
ILT
132152009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13216
13217 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
13218 defined.
13219
75aea3d0
ILT
132202009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13221
13222 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
13223 Change read_shndx type to unsigned int.
13224 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13225 int.
13226 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13227 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
13228 Change read_shndx type to unsigned int.
13229 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13230 int.
13231 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13232 * layout.cc (Layout::create_symtab_sections): Cast the result of
13233 local_symcount * symsize to off_t in the gold_assert.
13234
be8fcb75
ILT
132352009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13236
13237 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
13238 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
13239 R_ARM_BASE_ABS.
13240 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
13241 (Arm_relocate_functions::thm_abs5): New function.
13242 (Arm_relocate_functions::abs12): New function.
13243 (Arm_relocate_functions::abs16): New function.
13244 (Arm_relocate_functions::base_abs): New function.
13245 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
13246 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
13247 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
13248 R_ARM_BASE_ABS.
13249 (Scan::global): Likewise.
13250 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
13251 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
13252 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
13253 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
13254 R_ARM_BASE_ABS.
13255
c2a122b6
ILT
132562009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13257
13258 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
13259 (Arm_relocate_functions::movt_prel): New function.
13260 (Arm_relocate_functions::thm_movw_prel_nc): New function.
13261 (Arm_relocate_functions::thm_movt_prel): New function.
13262 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
13263 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
13264 (Scan::global, Relocate::relocate): Likewise.
13265 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13266
c4aa1e2d
ILT
132672009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13268
13269 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
13270 Incremental_checker.
13271 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
13272 unsigned int.
13273 (class Incremental_inputs_header): New class.
13274 (Incremental_inputs_header_writer): Edit comment.
13275 (Incremental_inputs_entry): New class.
13276 (Incremental_inputs_entry_writer): Edit comment.
13277 (Sized_incremental_binary::do_find_incremental_inputs_section):
13278 Add *strtab_shndx parameter, fill it.
13279 (Sized_incremental_binary::do_check_inputs): New method.
13280 (Incremental_checker::can_incrementally_link_output_file): Use
13281 Sized_incremental_binary::check_inputs.
13282 (Incremental_inputs::report_command_line): Save command line in
13283 command_line_.
13284 * incremental.h:
13285 (Incremental_binary::find_incremental_inputs_section): New
13286 method.
13287 (Incremental_binary::do_find_incremental_inputs_section): Add
13288 strtab_shndx parameter.
13289 (Incremental_binary::do_check_inputs): New pure virtual method.
13290 (Sized_incremental_binary::do_check_inputs): Declare.
13291 (Incremental_checker::Incremental_checker): Add incremental_inputs
13292 parameter, use it to initialize incremental_inputs_.
13293 (Incremental_checker::incremental_inputs_): New field.
13294 (Incremental_checker::command_line): New method.
13295 (Incremental_checker::inputs): New method.
13296 (Incremental_checker::command_line_): New field.
13297
c549a694
ILT
132982009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13299
13300 * incremental.cc: Include <cstdarg> and "target-select.h".
13301 (vexplain_no_incremental): New function.
13302 (explain_no_incremental): New function.
13303 (Incremental_binary::error): New method.
13304 (Sized_incremental_binary::do_find_incremental_inputs_section): New
13305 method.
13306 (make_sized_incremental_binary): New function.
13307 (open_incremental_binary): New function.
13308 (can_incrementally_link_file): Add checks if output is ELF and has
13309 inputs section.
13310 * incremental.h: Include "elfcpp_file.h" and "output.h".
13311 (Incremental_binary): New class.
13312 (Sized_incremental_binary): New class.
13313 (open_incremental_binary): Declare.
13314 * object.cc (is_elf_object): Use
13315 elfcpp::Elf_recognizer::is_elf_file.
13316 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
13317 * output.h (Output_file::filesize): New method.
13318
fd3c5f0b
ILT
133192009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13320
13321 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
13322 New function.
13323 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
13324 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
13325 function.
13326 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
13327 function.
13328 (Arm_relocate_functions::movw_abs_nc): New function.
13329 (Arm_relocate_functions::movt_abs): New function.
13330 (Arm_relocate_functions::thm_movw_abs_nc): New function.
13331 (Arm_relocate_functions::thm_movt_abs): New function.
13332 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
13333 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
13334 (Scan::global): Likewise.
13335 (Relocate::relocate): Likewise.
13336 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13337
7f5309a5
ILT
133382009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13339
13340 * arm.cc (Arm_relocate_functions::got_prel) New function.
13341 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
13342 (Relocate::relocate): Likewise.
13343 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13344
364c7fa5
ILT
133452009-10-06 Ian Lance Taylor <iant@google.com>
13346
13347 * options.h (class General_options): Define
13348 split_stack_adjust_size parameter.
13349 * object.h (class Object): Add uses_split_stack_ and
13350 has_no_split_stack_ fields. Add uses_split_stack and
13351 has_no_split_stack accessor functions. Declare
13352 handle_split_stack_section.
13353 (class Reloc_symbol_changes): Define.
13354 (class Sized_relobj): Define Function_offsets. Declare
13355 split_stack_adjust, split_stack_adjust_reltype, and
13356 find_functions.
13357 * object.cc (Object::handle_split_stack_section): New function.
13358 (Sized_relobj::do_layout): Call handle_split_stack_section.
13359 * dynobj.cc (Sized_dynobj::do_layout): Call
13360 handle_split_stack_section.
13361 * reloc.cc (Sized_relobj::relocate_sections): Call
13362 split_stack_adjust for executable sections in split_stack
13363 objects. Pass reloc_map to relocate_section.
13364 (Sized_relobj::split_stack_adjust): New function.
13365 (Sized_relobj::split_stack_adjust_reltype): New function.
13366 (Sized_relobj::find_functions): New function.
13367 * target-reloc.h: Include "object.h".
13368 (relocate_section): Add reloc_symbol_changes parameter. Change
13369 all callers.
13370 * target.h (class Target): Add calls_non_split method. Declare
13371 do_calls_non_split virtual method. Declare match_view and
13372 set_view_to_nop.
13373 * target.cc: Include "elfcpp.h".
13374 (Target::do_calls_non_split): New function.
13375 (Target::match_view): New function.
13376 (Target::set_view_to_nop): New function.
13377 * gold.cc (queue_middle_tasks): Give an error if mixing
13378 split-stack and non-split-stack objects with -r.
13379 * i386.cc (Target_i386::relocate_section): Add
13380 reloc_symbol_changes parameter.
13381 (Target_i386::do_calls_non_split): New function.
13382 * x86_64.cc (Target_x86_64::relocate_section): Add
13383 reloc_symbol_changes parameter.
13384 (Target_x86_64::do_calls_non_split): New function.
13385 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
13386 parameter.
13387 * powerpc.cc (Target_powerpc::relocate_section): Add
13388 reloc_symbol_changes parameter.
13389 * sparc.cc (Target_sparc::relocate_section): Add
13390 reloc_symbol_changes parameter.
13391 * configure.ac: Call AM_CONDITIONAL for the default target.
13392 * configure: Rebuild.
13393 * testsuite/Makefile.am (TEST_AS): New variable.
13394 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
13395 (check_DATA): Add split_i386 and split_x86_64 files.
13396 (SPLIT_DEFSYMS): Define.
13397 (split_i386_[1234n].o): New targets.
13398 (split_i386_[124]): New targets.
13399 (split_i386_[1234r].stdout): New targets.
13400 (split_x86_64_[1234n].o): New targets.
13401 (split_x86_64_[124]): New targets.
13402 (split_x86_64_[1234r].stdout): New targets.
13403 (MOSTLYCLEANFILES): Add new executables.
13404 * testsuite/split_i386.sh: New file.
13405 * testsuite/split_x86_64.sh: New file.
13406 * testsuite/split_i386_1.s: New file.
13407 * testsuite/split_i386_2.s: New file.
13408 * testsuite/split_i386_3.s: New file.
13409 * testsuite/split_i386_4.s: New file.
13410 * testsuite/split_i386_n.s: New file.
13411 * testsuite/split_x86_64_1.s: New file.
13412 * testsuite/split_x86_64_2.s: New file.
13413 * testsuite/split_x86_64_3.s: New file.
13414 * testsuite/split_x86_64_4.s: New file.
13415 * testsuite/split_x86_64_n.s: New file.
13416 * testsuite/testfile.cc (Target_test): Update relocation_section
13417 function.
13418 * testsuite/Makefile.in: Rebuild.
13419
e8a9fcda
ILT
134202009-10-06 Ian Lance Taylor <iant@google.com>
13421
13422 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
13423 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
13424 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
13425 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
13426 the address on ldo_addrs_.
13427 (Target_i386::Relocate::fix_up_ldo): New function.
13428
e99daf92
ILT
134292009-10-06 Rafael Espindola <espindola@google.com>
13430
13431 * plugin.cc (add_input_library): New.
13432 (Plugin::load): Add add_input_library to tv.
13433 (Plugin_manager::add_input_file): Add the is_lib argument.
13434 (add_input_file): Update call to Plugin_manager::add_input_file.
13435 (add_input_library): New.
13436 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
13437
966d4097
DK
134382009-09-30 Doug Kwan <dougkwan@google.com>
13439
13440 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
13441 symbol and call Symbol::may_need_copy_reloc to determine if
13442 a copy reloc is needed.
13443 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
13444 nocopyreloc is given in command line.
13445 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
13446 given in command line.
13447 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
13448 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
13449 of the removed Target_i386::may_need_copy_reloc.
13450 * options.h (copyreloc): New option with default value false.
13451 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13452 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
13453 instead of the removed Target_powerpc::may_need_copy_reloc.
13454 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13455 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
13456 instead of the removed Target_sparc::may_need_copy_reloc.
13457 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
13458 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
13459 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
13460 instead of the removed Target_x86_64::may_need_copy_reloc.
13461
029ba973
ILT
134622009-09-30 Ian Lance Taylor <iant@google.com>
13463
13464 * object.h (class Object): Remove target_ field, and target,
13465 sized_target, and set_target methods.
13466 (Object::sized_target): Remove.
13467 (class Sized_relobj): Update declarations. Remove sized_target.
13468 * object.cc (Sized_relobj::setup): Remove target parameter.
13469 Change all callers.
13470 (Input_objects::add_object): Don't do anything with the target.
13471 (make_elf_sized_object): Add punconfigured parameter. Change all
13472 callers. Set or test parameter target.
13473 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
13474 Change all callers.
13475 * parameters.cc (Parameters::set_target): Change parameter type to
13476 be non-const.
13477 (Parameters::default_target): Remove.
13478 (set_parameters_target): Change parameter type to be non-const.
13479 (parameters_force_valid_target): New function.
13480 (parameters_clear_target): New function.
13481 * parameters.h (class Parameters): Update declarations. Remove
13482 default_target method. Add sized_target and clear_target
13483 methods. Change target_ to be non-const.
13484 (set_parameters_target): Update declaration.
13485 (parameters_force_valid_target): Declare.
13486 (parameters_clear_target): Declare.
13487 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
13488 as NULL if we aren't searching.
13489 (Add_symbols::run): Don't check for compatible target.
13490 * fileread.cc (Input_file::open_binary): Call
13491 parameters_force_valid_target.
13492 * gold.cc (queue_middle_tasks): Likewise.
13493 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
13494 set_target on object.
13495 * dynobj.h (class Sized_dynobj): Update declarations.
13496 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
13497 make_elf_object returns NULL.
13498 (Archive::include_member): Don't check whether object target is
13499 compatible.
13500 * output.cc (Output_section::add_input_section): Get target from
13501 parameters.
13502 (Output_section::relax_input_section): Likewise.
13503 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
13504 parameters.
13505 (Sized_relobj::do_scan_relocs): Likewise.
13506 (Sized_relobj::relocate_sections): Likewise.
13507 * resolve.cc (Symbol_table::resolve): Likewise.
13508 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
13509 parameter. Change all callers.
13510 (Symbol_table::add_from_object): Get target from parameters.
13511 (Symbol_table::add_from_relobj): Don't check object target.
13512 (Symbol_table::add_from_dynobj): Likewise.
13513 (Symbol_table::define_special_symbol): Get target from
13514 parameters.
13515 * symtab.h (class Symbol_table): Update declaration.
13516 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
13517 parameter. Change all callers. Clear parameter target.
13518 (Binary_test): Test target here.
13519 * testsuite/object_unittest.cc (gold_testsuite): Remove
13520 target_test_pointer parameter. Change all callers.
13521 (Object_test): Test target here.
13522
a6a22b83
ILT
135232009-09-26 Ian Lance Taylor <iant@google.com>
13524
13525 * testsuite/initpri1.c: Don't try to use constructor priorities if
13526 compiling with gcc before 4.3.
13527
6a8f49fe
ILT
135282009-09-22 Mikolaj Zalewski <mikolajz@google.com>
13529
13530 * testsuite/retain_symbols_file_test.sh (check_present): Change
13531 output file name to retain_symbols_file_test.stdout.
13532 (check_absent): Likewise.
13533
8c604651
CS
135342009-09-18 Craig Silverstein <csilvers@google.com>
13535
13536 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
13537 * options.cc: Include <cerrno> and <fstream>.
13538 (General_options::finalize): Parse -retain-symbols-file tag.
13539 * options.h: New flag.
13540 (General_options): New method should_retain_symbol, new
13541 variable symbols_to_retain.
13542 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
13543 should_retain_symbol map.
13544 * testsuite/Makefile.am (retain_symbols_file_test): New test.
13545 * testsuite/Makefile.in: Regenerate.
13546 * testsuite/retain_symbols_file_test.sh: New file.
13547
ca58b19f
NC
135482009-09-18 Nick Clifton <nickc@redhat.com>
13549
13550 * po/es.po: Updated Spanish translation.
13551
20e6d0d6
DK
135522009-09-17 Doug Kwan <dougkwan@google.com>
13553
13554 * debug.h (DEBUG_RELAXATION): New constant.
13555 (DEBUG_ALL): Add DEBUG_RELAXATION.
13556 (debug_string_to_enum): Add relaxation debug option.
13557 * layout.cc
13558 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
13559 Layout::Relaxation_debug_check::read_sections,
13560 Layout::Relaxation_debug_check::read_sections): New method definitions.
13561 (Layout::Layout): Initialize data members
13562 record_output_section_data_from_scrips_,
13563 script_output_section_data_list_ and relaxation_debug_check_.
13564 (Layout::save_segments, Layout::restore_segments,
13565 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13566 Layout::relaxation_loop_body): New method definitions.
13567 (Layout::finalize): Support relaxation. Move section layout code to
13568 Layout::relaxation_loop_body.
13569 (Layout::set_asection_address_from_script): Move code for orphan
13570 section placement out.
13571 (Layout::place_orphan_sections_in_script): New method definition.
13572 * layout.h (Output_segment_headers, Output_file_header):
13573 New forward class declarations.
13574 (Layout::~Layout): Define.
13575 (Layout::new_output_section_data_from_script): New method definition.
13576 (Layout::place_orphan_sections_in_script): New method declaration.
13577 (Layout::Segment_states): New type declaration.
13578 (Layout::save_segments, Layout::restore_segments,
13579 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13580 Layout::relaxation_loop_body): New method declarations.
13581 (Layout::Output_section_data_list): New type declaration.
13582 (Layout::Relaxation_debug_check): New class definition.
13583 (Layout::record_output_section_data_from_script_,
13584 Layout::script_output_section_data_list_, Layout::segment_states_,
13585 Layout::relaxation_debug_check_): New data members.
13586 * output.cc: (Output_section_headers::do_size): New method definition.
13587 (Output_section_headers::Output_section_headers): Move size
13588 computation to Output_section_headers::do_size.
13589 (Output_segment_headers::do_size): New method definition.
e1df38aa 13590 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
13591 Output_file_header::do_size and call it.
13592 (Output_file_header::do_size): New method definition.
13593 (Output_data_group::Output_data_group): Adjust call to
13594 Output_section_data.
13595 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
13596 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 13597 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
13598 RELAXED_INPUT_SECTION_CODE.
13599 (Output_section::Output_section): Initialize data member checkpoint_.
13600 (Output_section::~Output_section): Delete checkpoint object pointed
13601 by checkpoint_.
13602 (Output_section::add_input_section): Always add an Input_section if
13603 relaxing.
13604 (Output_section::add_merge_input_section): Add assert.
13605 (Output_section::relax_input_section): New method definition.
13606 (Output_section::set_final_data_size): Set load address to zero for
13607 an unallocated section.
13608 (Output_section::do_address_and_file_offset_have_reset_values):
13609 New method definition.
13610 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
13611 Handle relaxed input section.
13612 (Output_section::sort_attached_input_sections): Checkpoint input
13613 section list lazily.
13614 (Output_section::get_input_sections): Change type of input_sections to
13615 list of Simple_input_section pointers. Checkpoint input section list
13616 lazily. Also handle relaxed input sections.
13617 (Output_section::add_input_section_for_script): Take a reference to
13618 a Simple_input_section object instead of Relobj pointer and section
13619 index as parameter. Handle relaxed input sections.
13620 (Output_section::save_states, Output_section::restore_states): New
13621 method definitions.
13622 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
13623 (Output_data::is_data_size_fixed): New method definition.
13624 (Output_data::reset_addresss_and_file_offset): Do not reset data size
13625 if it is fixed.
13626 (Output_data::address_and_file_offset_have_reset_values): New method
13627 definition.
13628 (Output_data::do_address_and_file_offset_have_reset_values): New method
13629 definition.
13630 (Output_data::set_data_size): Check that data size is not fixed.
13631 (Output_data::fix_data_size): New method definition.
13632 (Output_data::is_data_size_fixed_): New data member.
13633 (Output_section_headers::set_final_data_size): New method definition.
13634 (Output_section_headers::do_size): New method declaration.
13635 (Output_segment_headers::set_final_data_size): New method definition.
13636 (Output_segment_headers::do_size): New method declaration.
13637 (Output_file_header::set_final_data_size)::New method definition.
13638 (Output_file_header::do_size)::New method declaration.
13639 (Output_section_data::Output_section_data): Add new parameter
13640 is_data_size_fixed and use it to fix data size.
13641 (Output_data_const::Output_data_const): Adjust call to base class
13642 constructor and fix data size.
13643 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
13644 base class constructor and fix data size.
13645 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
13646 base class constructor and fix data size.
13647 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
13648 class constructor and fix data size.
13649 (Output_data_group::set_final_data_size): New method definition.
13650 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
13651 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
13652 class constructor and fix data size.
13653 (Output_relaxed_input_section): New class definition.
13654 (Output_section::Simple_input_section): New class definition.
13655 (Output_section::get_input_sections): Adjust parameter list.
13656 (Output_section::add_input_section_for_script): Same.
13657 (Output_section::save_states, Output_section::restore_states,
13658 Output_section::do_address_and_file_offset_have_reset_values,
13659 (Output_section::Input_section::Input_section): Handle
13660 RELAXED_INPUT_SECTION_CODE. Add new overload for
13661 Output_relaxed_input_section.
13662 (Output_section::Input_section::is_input_section,
13663 Output_section::Input_section::set_output_section): Handle relaxed
13664 input section.
13665 (Output_section::Input_section::is_relaxed_input_section,
13666 Output_section::Input_section::output_section_data,
13667 Output_section::Input_section::relaxed_input_section): New method
13668 definitions.
13669 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
13670 value.
13671 (Output_section::Input_section::u1_): Update comments.
13672 (Output_section::Input_section::u2_): Add new union member poris.
13673 (Output_section::Checkpoint_output_section): New classs definition.
13674 (Output_section::relax_input_section): New method declaration.
13675 (Output_section::checkpoint_): New data member.
13676 (Output_segment): Update comments.
13677 (Output_segment::Output_segment): Un-privatize copy constructor.
13678 (Output_segment::operator=): Un-privatize.
13679 * script-sections.cc (Output_section_element::Input_section_list):
13680 Change element type to Output_section::Simple_input_section.
13681 (Output_section_element_dot_assignment::set_section_addresses):
13682 Register output section data for relaxation clean up.
13683 (Output_data_exression::Output_data_expression): Adjust call to base
13684 constructor to fix data size.
13685 (Output_section_element_data::set_section_addresses): Register
13686 Output_data_expression object for relaxation clean up.
13687 (struct Input_section_info): Replace Relobj pointer and section index
13688 pair with Output_section::Simple_input_section and Convert struct to a
13689 class.
13690 (Input_section_sorter::operator()): Adjust access to
e1df38aa 13691 Input_section_info data member to use accessors.
20e6d0d6
DK
13692 (Output_section_element_input::set_section_addresses): Use layout
13693 parameter. Adjust code to use Output_section::Simple_input_section
13694 and Input_secction_info classes. Register filler for relaxation
13695 clean up.
13696 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
13697 and section index pair with Output_section::Simple_input_section
13698 class. Adjust code accordingly.
13699 (Phdrs_element::release_segment): New method definition.
13700 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
13701 segment list.
13702 (Script_sections::release_segments): New method definition.
13703 * gold/script-sections.h (Script_sections::release_segments): New
13704 method declaration.
13705 * gold/target.h (Target::may_relax, Target::relax,
13706 Target::do_may_relax, Target::do_relax): New method definitions.
13707
5e445df6
ILT
137082009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13709
13710 * arm.cc (has_signed_unsigned_overflow): New function.
13711 (Arm_relocate_functions::abs8): New function.
13712 (Target_arm::Scan::local): Handle R_ARM_ABS8.
13713 (Target_arm::Scan::global): Likewise.
13714 (Target_arm::relocate::relocate): Likewise.
13715 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
13716 Likewise.
13717
8c604651 137182009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
13719
13720 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
13721 * testsuite/Makefile.in: Regenerate.
13722
1e9cc1c2
NC
137232009-09-11 Nick Clifton <nickc@redhat.com>
13724
13725 * po/gold.pot: Updated by the Translation project.
13726
6a89f575
CC
137272009-09-08 Cary Coutant <ccoutant@google.com>
13728
13729 * output.cc (Output_file::open): Add execute permission to empty file.
13730 * testsuite/Makefile.am (permission_test): New test.
13731 * testsuite/Makefile.in: Regenerate.
13732
fdcac5af
ILT
137332009-09-02 Ian Lance Taylor <iant@google.com>
13734
13735 * output.cc (Output_file::resize): Call map_no_anonymous rather
13736 than map.
13737
44453f85
ILT
137382009-09-01 Mikolaj Zalewski <mikolajz@google.com>
13739
13740 * gold.cc: Include "incremental.h".
13741 (queue_initial_tasks): Call Incremental_checker methods.
13742 * incremental.cc: Include "output.h".
13743 (Incremental_checker::can_incrementally_link_output_file): New
13744 method.
13745 * incremental.h (Incremental_checker): New class.
13746
13747 * output.cc (Output_file::open_for_modification): New method.
13748 (Output_file::map_anonymous): Changed return type to bool. Record
13749 map in base_ field.
13750 (Output_file::map_no_anonymous): New method, broken out of map.
13751 (Output_file::map): Use map_no_anonymous and map_anonymous.
13752 * output.h (class Output_file): Update declarations.
13753
293c1386
CC
137542009-08-24 Cary Coutant <ccoutant@google.com>
13755
13756 * options.h (Command_line::Pre_options): New class.
13757 (Command_line::pre_options): New member.
13758 * options.cc (gold::options::ready_to_register): New variable.
13759 (One_option::register_option): Do nothing if not registering options.
13760 Assert if same short option registered twice.
13761 (General_options::General_options): Turn off option registration when
13762 done constructing.
13763 (Command_line::Pre_options::Pre_options): New constructor.
13764
f773f3d2
CC
137652009-08-24 Cary Coutant <ccoutant@google.com>
13766
06a73cfe
CC
13767 * options.h (General_options::no_keep_memory): Remove incorrect
13768 short option.
f773f3d2 13769
a15af8e2
RW
137702009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13771
13772 * Makefile.am (am__skiplex, am__skipyacc): New.
13773 * Makefile.in: Regenerate.
13774
c462b41b
RW
137752009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13776
14ec8efd
RW
13777 * Makefile.am (AM_CPPFLAGS): Renamed from ...
13778 (INCLUDES): ... this.
13779 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
13780 (AM_CPPFLAGS): Renamed from ...
13781 (INCLUDE): ... this.
13782 * Makefile.in, testsuite/Makefile.in: Regenerate.
13783
81ecdfbb
RW
13784 * Makefile.in: Regenerate.
13785 * aclocal.m4: Likewise.
13786 * config.in: Likewise.
13787 * configure: Likewise.
13788 * testsuite/Makefile.in: Likewise.
13789
c462b41b
RW
13790 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
13791 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
13792 * Makefile.in: Regenerate.
13793 * testsuite/Makefile.in: Regenerate.
13794
2da73f13
CC
137952009-08-19 Cary Coutant <ccoutant@google.com>
13796
13797 * resolve.cc (Symbol_table::resolve): Don't complain about defined
13798 symbols in shared libraries overridden by hidden or internal symbols
13799 in the main program.
13800
2db70501
CD
138012009-08-19 Chris Demetriou <cgd@google.com>
13802
13803 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
13804 checking source file names in error messages.
13805
f733487b
DK
138062009-08-18 Doug Kwan <dougkwan@google.com>
13807
13808 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
13809 an elcpp::Ehdr as parameter. Adjust call to set_target.
13810 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
13811 an elfcpp::Ehdr as parameter.
13812 * object.cc (Object::set_target): Remove the version that looks up
13813 a target and sets it.
13814 (Sized_relobj::setup): Take a Target object instead of
13815 an elfcpp::Ehdr as parameter. Adjust call to set_target.
13816 (make_elf_sized_object): Find target and ask target to
13817 make an ELF object.
13818 * object.h: (Object::set_target): Remove the version that looks up
13819 a target and sets it.
13820 (Sized_relobj::setup): Take a Target object instead of
13821 an elfcpp:Ehdr as parameter.
13822 * target.cc: Include dynobj.h.
13823 (Target::do_make_elf_object_implementation): New.
2e702c99 13824 (Target::do_make_elf_object): New.
f733487b
DK
13825 * target.h (Target::make_elf_object): New template declaration.
13826 (Target::do_make_elf_object): New method declarations.
13827 (Target::do_make_elf_object_implementation): New template declaration.
13828
cc70f101
ILT
138292009-08-14 Ian Lance Taylor <iant@google.com>
13830
13831 * gold.h (FUNCTION_NAME): Define.
13832 (gold_unreachable): Use FUNCTION_NAME.
13833
ef5e0cb1
ST
138342009-08-12 Sriraman Tallam <tmsriram@google.com>
13835
13836 * icf.cc (Icf::find_identical_sections): Issue a warning when a
13837 symbol in the --keep-unique list is not found.
13838
48c187ce
ST
138392009-08-12 Sriraman Tallam <tmsriram@google.com>
13840
13841 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
13842 been maked as --keep-unique.
13843 (Icf::unfold_section): New function.
13844 * icf.h (Icf::unfold_section): New function.
13845 * options.h (General_options::keep_unique): New option.
13846 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
13847 * testsuite/Makefile.in: Regenerate.
13848 * testsuite/icf_keep_unique_test.sh: New file.
13849 * testsuite/icf_keep_unique_test.cc: New file.
13850
645afe0c
CC
138512009-08-12 Cary Coutant <ccoutant@google.com>
13852
13853 PR 10471
13854 * resolve.cc (Symbol_table::resolve): Check for references from
13855 dynamic objects to hidden and internal symbols.
13856 * testsuite/Makefile.am (hidden_test.sh): New test.
13857 * testsuite/Makefile.in: Regenerate.
13858 * testsuite/hidden_test.sh: New script.
13859 * testsuite/hidden_test_1.c: New test source.
13860 * testsuite/hidden_test_main.c: New test source.
13861
11af873f
DK
138622009-08-11 Doug Kwan <dougkwan@google.com>
13863
13864 * arm.cc: Update comments.
13865 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
13866 segment to locate the .ARM.exidx section if present.
13867
b9f7d72d
DK
138682009-08-09 Doug Kwan <dougkwan@google.com>
13869
13870 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
13871 patch.
13872
ddd3c53c
ST
138732009-08-07 Sriraman Tallam <tmsriram@google.com>
13874 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
13875 compiler warnings.
13876
27721062
ST
138772009-08-06 Sriraman Tallam <tmsriram@google.com>
13878
13879 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
13880 valid tls_segment only for non-debug-section relocations.
13881 * testsuite/Makefile.am: Add gc_tls_test.
13882 * testsuite/Makefile.in: Regenerate.
13883 * testsuite/gc_tls_test.cc: New file.
13884 * testsuite/gc_tls_test.sh: New file.
13885
ef15dade 138862009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 13887
ef15dade
ST
13888 * icf.cc: New file.
13889 * icf.h: New file.
13890 * Makefile.am (CCFILES): Add icf.cc.
13891 (HFILES): Add icf.h
13892 * Makefile.in: Regenerate.
13893 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
13894 * gc.h (gc_process_relocs): Populate lists used by icf to contain
13895 section, symbol and addend information for the relocs.
13896 * gold.cc (queue_middle_tasks): Call identical code folding.
13897 * gold.h: Add defines for multimap.
13898 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
13899 to the call of finalize_local_symbols.
13900 * main.cc (main): Create object of class Icf.
13901 * object.cc (Sized_relobj::do_layout): Allow this function to be
13902 called twice during icf.
13903 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
13904 to sections marked as identical by icf.
13905 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
13906 when available.
13907 (Sized_relobj::do_section_entsize): New function.
13908 * object.h (Object::section_entsize): New function.
13909 (Object::do_section_entsize): New pure virtual function.
13910 (Relobj::finalize_local_symbols): Add new parameter.
13911 (Relobj::do_section_entsize): New function.
13912 * options.h (General_options::icf): New option.
13913 (General_options::icf_iterations): New option.
13914 (General_options::print_icf_sections): New option.
13915 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
13916 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
13917 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
13918 icf.
13919 * symtab.cc (Symbol_table::is_section_folded): New function.
13920 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
13921 to sections marked as identical by icf.
13922 * symtab.h (Symbol_table::set_icf): New function.
13923 (Symbol_table::icf): New function.
13924 (Symbol_table::is_section_folded): New function.
13925 (Symbol_table::icf_): New data member.
13926 * target-reloc.h (relocate_section): Ignore sections folded by icf.
13927 * testsuite/Makefile.am: Add commands to build icf_test.
13928 * testsuite/Makefile.in: Regenerate.
13929 * testsuite/icf_test.sh: New file.
13930 * testsuite/icf_test.cc: New file.
13931
c3b65ac4
CD
139322009-07-24 Chris Demetriou <cgd@google.com>
13933
13934 * layout.cc (is_compressible_debug_section): Fix incorrect
13935 comment about compressed section names.
13936
1caf2c51
ILT
139372009-07-20 Ian Lance Taylor <ian@airs.com>
13938
13939 PR 10419
13940 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
13941
1ef4d87f
ILT
139422009-07-16 Ian Lance Taylor <iant@google.com>
13943
13944 PR 10400
13945 * layout.h: #include <map>.
13946 (class Kept_section): Change from struct to class. Add accessors
13947 and setters. Add section size to Comdat_group mapping. Change
13948 Comdat_group to std::map. Add is_comdat_ field. Add
13949 linkonce_size field in union.
13950 (class Layout): Update declaration of find_or_add_kept_section.
13951 Don't declare find_kept_object.
13952 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
13953 parameter. Add object, shndx, is_comdat, and is_group_name
13954 parameters. Change all callers. Adjust for new Kept_section.
13955 (Layout::find_kept_object): Remove.
13956 * object.cc (Sized_relobj::include_section_group): Update use of
13957 Kept_section. Rename secnum to shndx. Only record
13958 Kept_comdat_section if sections are the same size.
13959 (Sized_relobj::include_linkonce_section): Update use of
13960 Kept_section. Only record Kept_comdat_section if sections are the
13961 same size. Set size of linkonce section.
13962 (Sized_relobj::map_to_kept_section): Update call to
13963 get_kept_comdat_section.
13964 * object.h (class Sized_relobj): Rename fields in
13965 Kept_comdat_section to drop trailing underscores; change object
13966 field to Relobj*. Change Kept_comdat_section_table to store
13967 struct rather than pointer.
13968 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
13969 Add kept_object and kept_shndx parameters. Change all callers.
13970 (Sized_relobj::get_kept_comdat_section): Change return type to
13971 bool. Add kept_object and kept_shndx parameters. Change all
13972 callers.
13973 * plugin.cc (Pluginobj::include_comdat_group): Update call to
13974 Layout::find_or_add_kept_section.
13975
37c3b7b0
ILT
139762009-07-09 Ian Lance Taylor <iant@google.com>
13977
13978 * merge.cc (Object_merge_map::initialize_input_to_output_map):
13979 Reserve space in the hash table.
13980
98fa85cb
ILT
139812009-07-06 Mikolaj Zalewski <mikolajz@google.com>
13982
13983 * fileread.cc (File_read::get_mtime): New method.
13984 * fileread.h (Timespec): New structure.
13985 (File_read::get_mtime): New method.
13986 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
13987 Renamed from timestamp_nsec.
13988 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
13989 Elf_Xword.
e1df38aa 13990 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 13991 timestamp_nsec.
e1df38aa 13992 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
13993 (Incremental_inputs::report_obejct): Save mtime; style fix.
13994 (Incremental_inputs::report_script): Save mtime; style fix.
13995 (Incremental_inputs::finalize_inputs): Style fix.
13996 (Incremental_inputs::finalize): Style fix.
13997 (Incremental_inputs::create_input_section_data): Store inputs
13998 mtime.
13999 * incremental.h (Incremental_inputs::report_script): Add mtime
14000 argument.
14001 (Incremental_inputs::Input_info::Input_info): Intialize only one
14002 union member.
14003 (Incremental_inputs::Input_info::archive): Move to nameless
14004 union.
14005 (Incremental_inputs::Input_info::obejct): Move to nameless union.
14006 (Incremental_inputs::Input_info::script): Move to nameless union.
14007 (Incremental_inputs::mtime): New field.
14008 * script.cc (read_input_script): Pass file mtime to
14009 Incremental_input.
14010 * script.h (Script_info::inputs): Style fix.
14011
c9d70757
ILT
140122009-07-01 Ian Lance Taylor <ian@airs.com>
14013
14014 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
14015 instead of 32.
14016
9c547ec3
ILT
140172009-06-24 Ian Lance Taylor <iant@google.com>
14018
14019 PR 10156
14020 * layout.cc (Layout::choose_output_section): If we find an
14021 existing section, update the flags.
14022 (Layout::create_notes): New function, broken out of
14023 Layout::finalize.
14024 (Layout::finalize): Don't create note sections.
14025 (Layout::create_note): Don't crash if linker script discards
14026 section.
14027 (Layout::create_gold_note): Likewise.
14028 (Layout::create_build_id): Likewise. Don't set
14029 after_input_sections on the section.
14030 (Layout::create_executable_stack_info): Remove target parameter.
14031 Change caller.
14032 * layout.h (class Layout): Declare create_notes. Update
14033 declaration of create_executable_stack_info.
14034 * gold.cc (queue_middle_tasks): Call create_notes.
14035 * output.cc (Output_section::update_flags_for_input_section): Move
14036 here from output.h. If SHF_ALLOC flag is newly set, mark address
14037 invalid.
14038 * output.h (Output_data::mark_address_invalid): New function.
14039 (class Output_section): Only declare, not define,
14040 update_flags_for_input_section. Remove set_flags.
14041
55458500
ILT
140422009-06-24 Ian Lance Taylor <iant@google.com>
14043
14044 * script-sections.cc (Output_section_definition::
14045 set_section_addresses): Rename shadowing local load_address to
14046 laddr.
14047
1307d6cd
ILT
140482009-06-24 Ian Lance Taylor <iant@google.com>
14049
14050 PR 10244
14051 * reloc.cc (relocate_sections): Skip empty relocation sections.
14052
ec3f783e
ILT
140532009-06-23 Ian Lance Taylor <iant@google.com>
14054
14055 PR 10156
14056 * layout.cc (Layout::create_note): Use choose_output_section
14057 rather than make_output_section.
14058
459c9f1c
ILT
140592009-06-23 Ian Lance Taylor <iant@google.com>
14060
14061 PR 10237
14062 * options.cc (General_options::parse_V): Set printed_version_.
14063 (General_options::General_options): Initialize printed_version_.
14064 * options.h (class General_options): Add printed_version_ field.
14065 * gold.cc (queue_initial_tasks): If there are no input files,
14066 don't give a fatal error if we printed the version information.
14067 (queue_middle_tasks): If using -r with a shared object, give a
14068 fatal error rather than an ordinary error.
14069
1518dc8f
ILT
140702009-06-23 Ian Lance Taylor <iant@google.com>
14071
14072 PR 10219
14073 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
14074 (Layout::make_output_section): Set have_stabstr_section_ if we see
14075 a .stab*str section.
14076 (Layout::finalize): Call link_stabs_sections.
14077 (Layout::link_stabs_sections): New file.
14078 * layout.h (class Layout): Add have_stabstr_section_ field.
14079 Declare link_stabs_sections.
14080
3d857b98
DK
140812009-06-23 Doug Kwan <dougkwan@google.com>
14082
14083 * Makefile.am (libgold_a_LIBADD): New.
14084 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 14085 * Makefile.in: Regenerate.
3d857b98
DK
14086 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
14087 * configure: Regenerate.
14088 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
14089 * fileread.cc: Include sys/state.h
14090 * gold.h: Declare memmem and strndup if found missing.
14091 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
14092
0639a6f6
ILT
140932009-06-23 Ian Lance Taylor <iant@google.com>
14094
14095 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
14096 * configure: Rebuild.
14097
8d63875c
ILT
140982009-06-23 Ian Lance Taylor <iant@google.com>
14099
14100 PR 10147
14101 * object.cc (Object::section_contents): Don't try to get a view if
14102 the section has length zero.
14103 (Object::handle_gnu_warning_section): If the section is empty, use
14104 the name of the section as the warning.
14105
f7c8a183
ILT
141062009-06-23 Ian Lance Taylor <iant@google.com>
14107
14108 PR 10133
14109 * stringpool.h (class Stringpool_template): Add optimize_ field.
14110 (Stringpool_template::set_optimize): New function.
14111 * stringpool.cc (Stringpool_template::Stringpool_template):
14112 Initialize optimize_ field.
14113 (Stringpool_template::set_string_offsets): Test local optimize
14114 fild rather than parameter.
14115 * layout.cc (Layout::Layout): Call set_optimize on the section
14116 name stringpool.
14117
e6a307ba
ILT
141182009-06-22 Ian Lance Taylor <iant@google.com>
14119
14120 PR 10030
14121 * yyscript.y: Parse TARGET.
14122 * script.cc (script_set_target): New function.
14123 * script-c.h (script_set_target): Declare.
14124 * options.cc (General_options::string_to_object_format): Rename
14125 from string_to_object_format in anonymous namespace. Change
14126 callers.
14127 * options.h (class General_options): Declare
14128 string_to_object_format.
14129
3ee173de
ILT
141302009-06-22 Ian Lance Taylor <iant@google.com>
14131
14132 * script-sections.cc (Script_sections::create_segments): Don't put
14133 program headers in a PT_LOAD segment if -n or -N.
14134
141352009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
14136
14137 PR 10141
14138 * options.h (class General_options): Add -z lazy and -z now. Sort
14139 -z options into alphabetical order.
14140 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
14141
cd6739a1 141422009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
14143
14144 * layout.cc (Layout::make_output_section): Call
14145 Target::new_output_section.
14146 (Layout::attach_allocated_section_to_segment): Put large section
14147 sections in a separate load segment with the large segment flag
14148 set.
14149 (Layout::segment_precedes): Sort large data segments after other
14150 load segments.
14151 (align_file_offset): New static function.
14152 (Layout::set_segment_offsets): Use align_file_offset.
14153 * output.h (class Output_section): Add is_small_section_ and
14154 is_large_section_ fields.
14155 (Output_section::is_small_section): New function.
14156 (Output_section::set_is_small_section): New function.
14157 (Output_section::is_large_section): New function.
14158 (Output_section::set_is_large_section): New function.
14159 (Output_section::is_large_data_section): New function.
14160 (class Output_segment): Add is_large_data_segment_ field.
14161 (Output_segment::is_large_data_segment): New function.
14162 (Output_segment::set_is_large_data_segment): New function.
14163 * output.cc (Output_section::Output_section): Initialize new
14164 fields.
14165 (Output_segment::Output_segment): Likewise.
14166 (Output_segment::add_output_section): Add assertion that large
14167 data sections always go in large data segments. Force small data
14168 sections to the end of the list of data sections. Force small BSS
14169 sections to the start of the list of BSS sections. For large BSS
14170 sections to the end of the list of BSS sections.
14171 * symtab.h (class Symbol): Declare is_common_shndx.
14172 (Symbol::is_defined): Check Symbol::is_common_shndx.
14173 (Symbol::is_common): Likewise.
14174 (class Symbol_table): Define enum Commons_section_type. Update
14175 declarations. Add small_commons_ and large_commons_ fields.
14176 * symtab.cc (Symbol::is_common_shndx): New function.
14177 (Symbol_table::Symbol_table): Initialize new fields.
14178 (Symbol_table::add_from_object): Put small and large common
14179 symbols in the right list.
14180 (Symbol_table::sized_finalized_symbol): Check
14181 Symbol::is_common_shndx.
14182 (Symbol_table::sized_write_globals): Likewise.
14183 * common.cc (Symbol_table::do_allocate_commons): Allocate new
14184 common symbol lists. Don't call do_allocate_commons_list if the
14185 list is empty.
14186 (Symbol_table::do_allocate_commons_list): Remove is_tls
14187 parameter. Add comons_section_type parameter. Change all
14188 callers. Handle small and large common symbols.
14189 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
14190 Symbol::is_common_shndx.
14191 * resolve.cc (symbol_to_bits): Likewise.
14192 * target.h (Target::small_common_shndx): New function.
14193 (Target::small_common_section_flags): New function.
14194 (Target::large_common_shndx): New function.
14195 (Target::large_common_section_flags): New function.
14196 (Target::new_output_section): New function.
14197 (Target::Target_info): Add small_common_shndx, large_common_shndx,
14198 small_common_section_flags, and large_common_section_flags
14199 fields.
14200 (Target::do_new_output_section): New virtual function.
14201 * arm.cc (Target_arm::arm_info): Initialize new fields.
14202 * i386.cc (Target_i386::i386_info): Likewise.
14203 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
14204 Likewise.
14205 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
14206 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
14207 (Target_x86_64::do_new_output_section): New function.
14208 * configure.ac: Define conditional MCMODEL_MEDIUM.
14209 * testsuite/Makefile.am (check_PROGRAMS): Add large.
14210 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
14211 (large_LDFLAGS): Define.
14212 * testsuite/large.c: New file.
14213 * testsuite/testfile.cc (Target_test::test_target_info):
14214 Initialize new fields.
14215 * configure, testsuite/Makefile.in: Rebuild.
14216
bb04269c
DK
142172009-06-05 Doug Kwan <dougkwan@google.com>
14218
14219 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 14220 * Makefile.in: Regenerate.
bb04269c
DK
14221 * i386.cc (class Target_i386): Define new virtual method to
14222 override do_is_local_label_name in parent.
14223 * object.cc (Sized_relobj::do_count_local_symbols): Discard
14224 local symbols if --discard-locals or -X is given.
14225 * options.h (class General_options): Declare new options
14226 '--discard-locals' and '-X' for discarding locals.
14227 * target.h (class Target): Define new methods is_local_label_name.
14228 Declare new virtual method do_is_local_label_name.
14229 * target.cc: New file.
14230 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
14231 (check_SCRIPTS): Add discard_locals_test.sh.
14232 (check_DATA): Add discard_local_tests.syms.
14233 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
14234 (discard_local_tests.syms, discard_locals_test.o): New make rules.
14235 * testsuite/Makefile.in: Regenerate.
14236 * testsuite/discard_locals_test.c: New file.
14237 * testsuite/discard_locals_test.sh: Same.
14238
805bb01c
DK
142392009-06-05 Doug Kwan <dougkwan@google.com>
14240
14241 * object.cc (Sized_relobj::Sized_relobj): Initialize
14242 discarded_eh_frame_shndx_ to -1U.
14243 (Sized_relobj::do_layout): Record index of a discard .eh_frame
14244 section.
14245 (Sized_relobj::do_count_local_symbols): Skip local symbols in
14246 a discarded .eh_frame section.
14247 (Sized_relobj::do_finalize_local_symbols): Ditto.
14248 * object.h (class Sized_relobj): Declare new member
14249 discarded_eh_frame_shndx_.
14250 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
14251 (local_labels_test.o, local_labels_test): New rules.
14252 * testsuite/Makefile.in: Regenerate.
14253
1dcd334d
DK
142542009-06-04 Doug Kwan <dougkwan@google.com>
14255
14256 * layout.cc (Layout::section_name_mapping): Add mapping for
14257 special ARM sections.
14258
96d49306
DK
142592009-06-03 Doug Kwan <dougkwan@google.com>
14260
14261 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
14262 (utils::has_overflow): Same.
14263
dff16297
ILT
142642009-06-03 Ian Lance Taylor <iant@google.com>
14265
14266 * layout.cc (Layout::section_name_mapping): New array, replacing
14267 Layout::linkonce_mapping.
14268 (Layout::section_name_mapping_count): New variable, replacing
14269 Layout::linkonce_mapping_count.
14270 (Layout::linkonce_output_name): Remove.
14271 (Layout::output_section_name): Rewrite.
14272 * layout.h (class Layout): Rename Linkonce_mapping to
14273 Section_name_mapping, linkonce_mapping to section_name_mapping,
14274 linkonce_mapping_count to section_name_mapping_count. Don't
14275 declare linkonce_output_name.
14276
c121c671
DK
142772009-06-03 Doug Kwan <dougkwan@google.com>
14278
14279 * gold/arm.cc (namespace utils): New.
14280 (Target_arm::reloc_is_non_pic): Define new method.
14281 (class Arm_relocate_functions): New.
14282 (Target_arm::Relocate::relocate): Handle relocation types used by
14283 Android.
14284
07800fab
ILT
142852009-06-03 Ian Lance Taylor <iant@google.com>
14286
14287 * arm.cc (Target_arm::scan::global): Use || instead of |.
14288
c121c671
DK
142892009-06-02 Doug Kwan <dougkwan@google.com>
14290
14291 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
14292 issued_non_pic_error_.
14293 (class Target_arm::Scan): Declare new method check_non_pic.
14294 Define new method symbol_needs_plt_entry.
14295 Declare new data member issued_non_pic_error_.
14296 (class Target_arm::Relocate): Declare new method
14297 should_apply_static_reloc.
14298 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
14299 (Target_arm::Scan::check_non_pic): Define new method.
14300 (Target_arm::Scan::local): Handle a small subset of reloc types used
14301 by Android.
14302 (Target_arm::Scan::local): Same.
14303 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
14304
b19b0c6d
ILT
143052009-05-31 Mikolaj Zalewski <mikolajz@google.com>
14306
14307 * incremental.cc (Incremental_inputs::report_command_line): Filter
14308 out --incremental-* options.
14309
94cdfcff
DK
143102009-05-29 Doug Kwan <dougkwan@google.com>
14311
14312 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
14313 template class.
14314 (class Target_arm): Update comment.
14315 (Target_arm::Target_arm): Initialize new data members GOT_,
14316 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
14317 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
14318 and Target_arm::rel_dyn_section.
14319 Declare new_enum Target_arm::Got_type.
14320 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
14321 and DYNBSS_.
14322 Update commments for member do_dynsym_value.
14323 (Target_arm::got_size, Target_arm::plt_section,
14324 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
14325 new methods inside class defintion.
14326 (Target_arm::got_section): Define new method.
14327 (Target_arm::rel_dyn_section): Same.
14328 (Output_data_plt_arm): New template class.
14329 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
14330 (Output_data_plt_arm:do_adjust_output_section): Define new method.
14331 (Output_data_plt_arm::add_entry): Same.
14332 (Output_data_plt_arm::first_plt_entry): Define new
14333 static data member for PLT instruction template.
14334 (Output_data_plt_arm::plt_entry): Same.
14335 (Output_data_plt_arm::do_write): Define new method.
14336 (Target_arm::make_plt_entry): Same.
14337 (Target_arm::do_finalize_sections): Same.
14338 (Target_arm::do_dynsym_value): Same.
14339
4a657b0d
DK
143402009-05-28 Doug Kwan <dougkwan@google.com>
14341
14342 * Makefile.am (TARGETSOURCES): Add arm.cc.
14343 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
14344 * Makefile.in: Regenerate.
14345 * arm.cc: New file.
14346 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
14347
e7ae8c36
DK
143482009-05-26 Doug Kwan <dougkwan@google.com>
14349
14350 * options.cc (General_options::parse_exclude_libs). Fix a comment.
14351 (General_options::check_excluded_libs): Strip off directories in
14352 archive name before matching like GNU ld does.
14353 * testsuite/Makefile.am (MOSTLYCLEANFILES,
14354 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
14355 (exclude_libs_test_LDFLAGS): Add linker option
14356 -Wl,--exclude-libs,libexclude_libs_test_3
14357 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
14358 an explicit archive without using -l.
14359 (alt/libexclude_libs_test_3.a): New make rule.
14360 * testsuite/Makefile.in: Regenerate.
14361 * testsuite/exclude_libs_test.c : Declare lib3_default().
14362 (main): Call it.
14363 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
14364 * exclude_libs_test_3.c: New file.
14365
f12e7348
NC
143662009-05-26 Nick Clifton <nickc@redhat.com>
14367
14368 * po/id.po: New Indonesian translation.
14369 * po/gold.pot: Updated template file.
14370
4daadc0d
ST
143712009-05-22 Sriraman Tallam <tmsriram@google.com>
14372
e1df38aa 14373 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
14374 gc_comdat_test files. Add -Wl,--gc-sections to build
14375 gc_comdat_test.
14376 * testsuite/Makefile.in: Regenerate.
14377 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
14378
531813ad
ST
143792009-05-21 Sriraman Tallam <tmsriram@google.com>
14380
14381 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
14382 kept comdat section was garbage collected.
14383 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
14384 * testsuite/Makefile.in: Regenerate.
14385 * testsuite/gc_comdat_test.sh: New file.
14386 * testsuite/gc_comdat_test_1.cc: New file.
14387 * testsuite/gc_comdat_test_2.cc: New file.
14388
65514900
CC
143892009-05-19 Doug Kwan <dougkwan@google.com>
14390
14391 * archive.cc (Archive::Archive): Move constructor from archive.h
14392 to here. Initialize no_export_.
14393 (Archive::get_elf_object_for_member): Set no_export flag of object.
14394 * archive.h (Archive::Archive): Move constructor body to
14395 archive.cc.
14396 (Archive::no_export): New method.
14397 (Archive::no_export_): New field.
14398 * object.h (Object::Object): Initialize no_export_ to false.
14399 (Object::no_export, Object::set_no_export): New methods.
14400 (Object::no_export_): New field.
14401 * options.cc (General_options::parse_exclude_libs): New method.
14402 (General_options::check_excluded_libs) Same.
14403 * options.h (exclude_libs): New option.
14404 (General_options::check_excluded_libs): New method declaration.
14405 (General_options::excluded_libs_): New field.
14406 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
14407 default or protected visibility if an object has no-export flag set.
14408 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
14409 (check_SCRIPTS): Add exclude_libs_test.sh.
14410 (check_DATA): Add exclude_libs_test.syms.
14411 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
14412 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
14413 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
14414 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
14415 (exclude_libs_test.syms, libexclude_libs_test_1.a,
14416 libexclude_libs_test_2.a): New rules.
14417 * testsuite/Makefile.in: Regenerate.
14418 * testsuite/exclude_libs_test.c: New file.
14419 * testsuite/exclude_libs_test.sh: Ditto.
14420 * testsuite/exclude_libs_test_1.c: Ditto.
14421 * testsuite/exclude_libs_test_2.c: Ditto.
14422
1b77ea50
ILT
144232009-05-15 Ian Lance Taylor <iant@google.com>
14424
14425 * configure.ac: Check for declarations for cases where libiberty.h
14426 checks HAVE_DECL_xxx.
14427 * configure, config.in: Rebuild.
14428
072fe7ce
ILT
144292009-05-15 Mikolaj Zalewski <mikolajz@google.com>
14430
14431 * gold.h (Incremental_argument_list): Remove (invalid) forward
14432 declaration.
14433 * incremental.cc (Incremental_inputs::report_achive): New method.
14434 (Incremental_inputs::report_object): New method.
14435 (Incremental_inputs::report_script): New method.
14436 (Incremental_inputs::finalize_inputs): New method.
14437 (Incremental_inputs::finalize): Call finalize_inputs().
14438 (Incremental_inputs::sized_create_incremental_inputs_section_data):
14439 Create inputs entries.
14440 * incremental.h (Incremental_input_type): New enum.
14441 (Incremental_inputs::Incremental_input): Initialize new fields.
14442 (Incremental_inputs::report_inputs): New method.
14443 (Incremental_inputs::report_achive): New method.
14444 (Incremental_inputs::report_object): New method.
14445 (Incremental_inputs::report_script): New method.
14446 (Incremental_inputs::finalize_inputs): New method.
14447 (Incremental_inputs::Input_info): New struct.
14448 (Incremental_inputs::Input_info_map): New typedef.
14449 (Incremental_inputs::lock_): New field.
14450 (Incremental_inputs::Inputs_): New field.
14451 (Incremental_inputs::Inputs_map): New field.
14452 * main.cc (main): Call Incremental_input::report_inputs.
14453 * options.h (Input_argument_list): Typedef moved from
14454 Input_arguments.
14455 (Input_file_group::Files): Remove, use ::Input_argument_list.
14456 (Input_file_group::Input_argument_list): Remove, use
14457 ::Input_argument_list.
14458 * plugin.cc (Plugin_manager::add_input_file): Add error in
14459 incremental build.
14460 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
14461 functions.
14462 * script.cc (read_input_script): Call
14463 Incremental_input::report_script.
14464 * script.h (Script_info): New class.
14465
b0481b0b
ILT
144662009-04-27 Ian Lance Taylor <iant@google.com>
14467
14468 * x86_64.cc (do_adjust_output_section): Set entsize to
14469 plt_entry_size.
14470
b22a5a41 144712009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
14472
14473 * output.cc (Output_file::close): After short writes, continue
14474 writing from the correct offset in the buffer being written.
14475
40fde488
CD
144762009-04-23 Chris Demetriou <cgd@google.com>
14477
14478 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
14479 * configure: Regenerate.
14480 * config.in: Regenerate.
14481 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
14482 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
14483
3ce2c28e
ILT
144842009-04-21 Mikolaj Zalewski <mikolajz@google.com>
14485
14486 * incremental.cc (Incremental_inputs_header_data): Renamed from
14487 Incremental_input_header_data.
14488 (Incremental_inputs_header_data::data_size): New field.
14489 (Incremental_inputs_header_data::put_input_file_count): Renamed
14490 from input_file_count.
14491 (Incremental_inputs_header_data::put_command_line_offset): Renamed
14492 from command_line_offset.
14493 (Incremental_inputs_header_data::put_reserved): Renamed from
14494 put_reserved.
14495 (Incremental_inputs_entry_data): Renamed from
14496 Incremental_input_entry_data.
14497 (Incremental_inputs_entry_data::data_size): New field.
14498 (Incremental_inputs::report_command_line): New method.
14499 (Incremental_inputs::finalize): New method.
14500 (Incremental_inputs::create_incremental_inputs_data): New method.
14501 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
14502 * incremental.h: New file.
14503 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 14504 (Layout::finalize): Create incremental inputs section in
3ce2c28e 14505 incremental builds.
703d02da 14506 (Layout::create_incremental_info_sections): New method.
3ce2c28e 14507 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
14508 (Layout::create_incremental_info_sections): New method.
14509 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
14510 * main.cc (main): Notify Incremental_input of the command line.
14511
e55bde5e
ILT
145122009-04-01 Ian Lance Taylor <iant@google.com>
14513 Mikolaj Zalewski <mikolajz@google.com>
14514
14515 * gold.h (reserve_unordered_map): Define, three versions, one for
14516 each version of Unordered_map.
14517 * layout.cc (Layout::Layout): Remove options parameter. Add
14518 number_of_input_files parameter. Don't initialize options_.
14519 Initialize number_of_input_files_ and resized_signatures_. Move
14520 sections_are_attached_.
14521 (Layout::layout_group): Reserve space for group_signatures_.
14522 (Layout::find_or_add_kept_section): Change name parameter to be a
14523 reference. Resize signatures_ map when it gets large enough.
14524 (Layout::layout_eh_frame): Use parameters->options() instead of
14525 this->options_.
14526 (Layout::make_output_section): Likewise.
14527 (Layout::attach_allocated_section_to_segment): Likewise.
14528 (Layout::finalize, Layout::create_executable_stack): Likewise.
14529 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
14530 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
14531 * layout.h (class Layout): Update declarations. Remove options_
14532 field. Add number_of_input_files_ and resized_signatures_
14533 fields. Move sections_are_attached_ field.
14534 * main.cc (main): Pass number of input files to Layout
14535 constructor. Don't pass options.
14536
154b857c
ILT
145372009-03-30 Ian Lance Taylor <iant@google.com>
14538
14539 * ffsll.c (ffsll): Correct implementation.
14540
2f35ab9b
ILT
145412009-03-27 Ian Lance Taylor <iant@google.com>
14542
fd03461a
ILT
14543 * ffsll.c: New file.
14544 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
14545 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
14546 * ftruncate.c (ftruncate): Declare before definition.
14547 * mremap.c (mremap): Likewise.
14548 * pread.c (pread): Likewise.
14549 * configure, Makefile.in, config.in: Rebuild.
14550
2f35ab9b
ILT
14551 * mremap.c: New file.
14552 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
14553 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
14554 (mremap): Declare if HAVE_MREMAP is not defined.
14555 * configure, Makefile.in, config.in: Rebuild.
14556
33aea2fd
CC
145572009-03-27 Cary Coutant <ccoutant@google.com>
14558
14559 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
14560 position independent.
14561 * sparc.cc (Target_sparc::check_non_pic): Likewise.
14562 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
14563
6d479619
CC
145642009-03-24 Cary Coutant <ccoutant@google.com>
14565
14566 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
14567 an executable.
14568 (needs_dynamic_reloc): Likewise.
14569
afc06bb8
ILT
145702009-03-24 Ian Lance Taylor <iant@google.com>
14571
14572 * yyscript.y (file_cmd): Recognize EXTERN.
14573 (extern_name_list, extern_name_list_body): New nonterminals.
14574 * script.cc (script_add_extern): Define.
14575 * script-c.h (script_add_extern): Declare.
14576
f6060a4d
ILT
145772009-03-24 Rafael Avila de Espindola <espindola@google.com>
14578
14579 * object.cc (is_elf_object): Define.
14580 * object.h (is_elf_object): Declare.
14581 * archive.cc (Archive::get_elf_object_for_member): Call
14582 is_elf_object.
33aea2fd 14583 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 14584
26736d8e
ILT
145852009-03-24 Elliott Hughes <enh@google.com>
14586
14587 * output.cc (Output_file::map_anonymous): Define.
14588 (Output_file::map): Use map_anonymous. If the regular mmap fails,
14589 try an anonymous one. Report the size if the mmap fails.
14590 * output.h (class Output_file): Declare map_anonymous.
14591
22fd9730
ILT
145922009-03-24 Ian Lance Taylor <iant@google.com>
14593
14594 * target-select.cc (instantiate_target): Don't acquire the lock if
14595 the instantiated_target_ field has already been set.
14596
cb010894
ILT
145972009-03-23 Ian Lance Taylor <iant@google.com>
14598
7f055c20
ILT
14599 * gold-threads.h (class Initialize_lock): Define.
14600 * gold-threads.cc (class Initialize_lock_once): Define.
14601 (initialize_lock_control): New static variable.
14602 (initialize_lock_pointer): New static variable.
14603 (initialize_lock_once): New static function.
14604 (Initialize_lock::Initialize_lock): Define.
14605 (Initialize_lock::initialize): Define.
14606 * target-select.h: Include "gold-threads.h".
14607 (class Target_selector): Add lock_ and initialize_lock_ fields.
14608 Don't define instantiate_target, just declare it.
14609 * target-select.cc (Target_selector::Target_selector): Initialize
14610 new fields.
14611 (Target_selector::instantiate_target): Define.
14612 * descriptors.h: Include "gold-threads.h".
14613 (class Descriptors): Add initialize_lock_ field.
14614 * descriptors.cc (Descriptors::Descriptors): Initialize new
14615 field.
14616 (Descriptors::open): Use initialize_lock_ field
14617 * errors.h (class Errors): Add initialize_lock_ field.
14618 * errors.cc (Errors::Errors): Initialize new field.
14619 (Errors::initialize_lock): Use initialize_lock_ field.
14620 * powerpc.cc (class Target_selector_powerpc): Remove
14621 instantiated_target_ field. In do_recognize call
14622 instantiate_target rather than do_instantiate_target. In
14623 do_instantiate_target just allocate a new target.
14624 * sparc.cc (class Target_selector_sparc): Likewise.
14625
36959681
ILT
14626 * freebsd.h: New file.
14627 * i386.cc: Include "freebsd.h".
14628 (Target_i386): Derive from Target_freebsd rather than
14629 Sized_target.
14630 (Target_selector_i386): Derive from Target_selector_freebsd rather
14631 than Target_selector.
14632 * x86_64.cc: Include "freebsd.h".
14633 (Target_x86_64): Derive from Target_freebsd rather than
14634 Sized_target.
14635 (Target_selector_x86_64): Derive from Target_selector_freebsd
14636 rather than Target_selector.
14637 * target.h (class Target): Add adjust_elf_header and
14638 do_adjust_elf_header.
14639 * output.cc (Output_file_header:: do_sized_write): Call target
14640 adjust_elf_header routine.
14641 * configure.tgt: Set targ_osabi.
14642 * configure.ac: Define GOLD_DEFAULT_OSABI.
14643 * parameters.cc (Parameters::default_target): Pass
14644 GOLD_DEFAULT_OSABI to select_target.
14645 * target-select.h (class Target_selector): Make instantiate_target
14646 protected rather than private.
14647 * Makefile.am (HFILES): Add freebsd.h.
14648 * configure, Makefile.in, config.in: Rebuild.
14649
cb010894
ILT
14650 * merge.cc (do_add_input_section): Correct pend value. Change
14651 message about last entry not being null terminated from error to
14652 warning.
14653
0e879927
ILT
146542009-03-20 Mikolaj Zalewski <mikolajz@google.com>
14655
14656 * incremental.cc: New file.
14657 * Makefile.am (CCFILES): Add incremental.cc.
14658 * Makefile.in: Rebuild.
14659
41105937
PP
146602009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
14661
14662 * layout.cc (Layout::output_section_name): Preserve names
14663 of '.note.' sections.
e1df38aa 14664
60439920
ILT
146652009-03-19 Ian Lance Taylor <iant@google.com>
14666
14667 * descriptors.cc (Descriptors::open): Check that the options are
14668 valid before using them.
14669
0d371ad3
ILT
146702009-03-18 Ian Lance Taylor <iant@google.com>
14671
14672 * script-sections.h: Include <list>.
14673 (class Script_sections): Change Sections_elements from std::vector
14674 to std::list. Typedef public Elements_iterator. Add
14675 orphan_section_placement_, data_segment_align_start_, and
14676 saw_data_segment_align_ fields. Remove data_segment_align_index_
14677 field.
14678 * script-sections.cc (class Orphan_section_placement): New class.
14679 (class Sections_element): Add virtual functions is_relro and
14680 orphan_section_init. Remove virtual function place_orphan_here.
14681 (class Output_section_definition): Add is_relro and
14682 orphan_section_init. Remove place_orphan_here.
14683 (class Orphan_output_section): Likewise.
14684 (Script_sections::Script_sections): Update for field changes.
14685 (Script_sections::data_segment_align): Set saw_data_segment_align_
14686 and data_segment_align_start_, not data_segment_align_index.
14687 (Script_sections::data_segment_relro_end): Check
14688 saw_data_segment_align_. Use data_segment_align_start_ rather
14689 than data_segment_align_index_.
14690 (Script_sections::place_orphan): Rewrite to use
14691 Orphan_section_placement.
14692
9201d894
ILT
146932009-03-17 Ian Lance Taylor <iant@google.com>
14694
9c5b8369
ILT
14695 * archive.cc (Archive::add_symbols): Check for a version attached
14696 to the symbol name in the archive map.
14697 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
14698 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
14699 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
14700 (ver_test_11.a): New target.
14701 * testsuite/Makefile.in: Rebuild.
14702
9201d894
ILT
14703 * configure.ac: Check for chsize and posix_fallocate. Replace
14704 ftruncate.
14705 * ftruncate.c: New file, from gnulib.
14706 * output.cc (posix_fallocate): Define dummy version if not
14707 HAVE_POSIX_FALLOCATE.
14708 (Output_file::map): Call posix_fallocate rather than lseek and
14709 write.
14710 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
14711 * configure, Makefile.in, config.in: Rebuild.
14712
ef4ab7a8 147132009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 14714
ef4ab7a8
PP
14715 * layout.h (Layout::create_note): Add section_name parameter.
14716 * layout.cc (Layout::create_note): Likewise.
14717 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 14718
8c500701
ILT
147192009-03-17 Ian Lance Taylor <iant@google.com>
14720
e85b18e1
ILT
14721 * descriptors.cc: Include "options.h".
14722 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
14723 (Descriptors::open): Always use O_CLOEXEC when opening a new
14724 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
14725 then set FD_CLOEXEC.
14726
9efe6174
ILT
14727 * sparc.cc (class Target_sparc): Add has_got_section.
14728 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
14729 make sure we have a GOT section.
14730
14731 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
14732 (Target_sparc::Scan::local): Likewise.
14733 (Target_sparc::Scan::global): Likewise.
14734 (Target_sparc::Relocate::relocate): Likewise.
14735 (Target_sparc::Relocate::relocate_tls): Likewise.
14736
8c500701
ILT
14737 * symtab.cc (Symbol_table::define_default_version): New function,
14738 broken out of add_from_object.
14739 (Symbol_table::add_from_object): Call define_default_version.
14740 (Symbol_table::define_special_symbol): Add resolve_oldsym
14741 parameter. Change all callers. If the version for a symbol comes
14742 from a version script, resolve it with the symbol with the same
14743 name with no version. Also add the symbol without a version if
14744 appropriate.
14745 (do_define_in_output_data): If resolving with oldsym, don't delete
14746 sym.
14747 (do_define_in_output_segment): Likewise.
14748 (do_define_as_constant): Likewise.
14749 * symtab.h (class Symbol_table): Update declarations.
14750
f1ed28fb
ILT
147512009-03-13 Ian Lance Taylor <iant@google.com>
14752
15f8229b
ILT
14753 * readsyms.cc (Read_symbols::incompatible_warning): New function.
14754 (Read_symbols::requeue): New function.
14755 (Read_symbols::do_read_symbols): If make_elf_object fails because
14756 the target type is not configured, and the file was searched for,
14757 issue a warning and retry with the next directory.
14758 (Add_symbols::run): If the file has an incompatible format, and
14759 it was searched for, requeue the Read_symbols task. On error,
14760 release the object.
14761 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
14762 dirindex parameter to constructor. Change all callers. Declare
14763 incompatible_warning and requeue.
14764 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
14765 input_argument_ and input_group_ fields. Add them to
14766 constructor. Change all callers.
14767 (class Read_script): Add dirindex_ field. Add it to constructor.
14768 Change all callers.
14769 * archive.cc (Archive::setup): Remove input_objects parameter.
14770 Change all callers.
14771 (Archive::get_file_and_offset): Likewise.
14772 (Archive::read_all_symbols): Likewise.
14773 (Archive::read_symbols): Likewise.
14774 (Archive::get_elf_object_for_member): Remove input_objects
14775 parameter. Add punconfigured parameter. Change all callers.
14776 (Archive::add_symbols): Change return type to bool. Check return
14777 value of include_member.
14778 (Archive::include_all_members): Likewise.
14779 (Archive::include_member): Change return type to bool. Return
14780 false if first included object has incompatible target. Set
14781 included_member_ field.
14782 (Add_archive_symbols::run): If add_symbols returns false, requeue
14783 Read_symbols task.
14784 * archive.h (class Archive): Add included_member_ field.
14785 Initialize it in constructor. Add input_file and searched_for
14786 methods. Update declarations.
14787 (class Add_archive_symbols): Add dirpath_, dirindex_, and
14788 input_argument_ fields. Add them to constructor. Change all
14789 callers.
14790 * script.cc: Include "target-select.h".
14791 (class Parser_closure): Add skip_on_incompatible_target_ and
14792 found_incompatible_target_ fields. Add
14793 skip_on_incompatible_target parameter to constructor. Change all
14794 callers. Add methods skip_on_incompatible_target,
14795 clear_skip_on_incompatible_target, found_incompatible_target, and
14796 set_found_incompatible_target.
14797 (read_input_script): Add dirindex parameter. Change all callers.
14798 If parser finds an incompatible target, requeue Read_symbols
14799 task.
14800 (script_set_symbol): Clear skip_on_incompatible_target in
14801 closure.
14802 (script_add_assertion, script_parse_option): Likewise.
14803 (script_start_sections, script_add_phdr): Likewise.
14804 (script_check_output_format): New function.
14805 * script.h (read_input_script): Update declaration.
14806 * script-c.h (script_check_output_format): Declare.
14807 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
14808 (ignore_cmd): Remove OUTPUT_FORMAT.
14809 * fileread.cc (Input_file::Input_file): Add explicit this.
14810 (Input_file::will_search_for): New function.
14811 (Input_file::open): Add pindex parameter. Change all callers.
14812 * fileread.h (class Input_file): Add input_file_argument method.
14813 Declare will_search_for. Update declarations.
14814 * object.cc (make_elf_object): Add punconfigured parameter.
14815 Change all callers.
14816 * object.h (class Object): Make input_file public. Add
14817 searched_for method.
14818 (make_elf_object): Update declaration.
14819 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
14820 restart search.
14821 * dirsearch.h (class Dirsearch): Update declaration.
14822 * options.h (class General_options): Add --warn-search-mismatch.
14823 * parameters.cc (Parameters::is_compatible_target): New function.
14824 * parameters.h (class Parameters): Declare is_compatible_target.
14825 * workqueue.cc (Workqueue::add_blocker): New function.
14826 * workqueue.h (class Workqueue): Declare add_blocker.
14827
f1ed28fb
ILT
14828 * fileread.cc (Input_file::open): Remove options parameter.
14829 Change all callers.
14830 (Input_file::open_binary): Likewise.
14831 * script.cc (read_input_script): Likewise.
14832 * readsyms.h (class Read_symbols): Remove options_ field. Remove
14833 options parameter from constructor. Change all callers.
14834 (class Read_script): Likewise.
14835 * fileread.h (class Input_file): Update declarations.
14836 * script.h (read_input_script): Update declaration.
14837
34dd024a
NC
148382009-03-10 Nick Clifton <nickc@redhat.com>
14839
14840 * po/es.po: New Spanish translation.
14841
6d71b17c
CC
148422009-03-06 Cary Coutant <ccoutant@google.com>
14843
14844 * options.cc (parse_short_option): Keep dash_z from registering itself.
14845
031cdbed
ILT
148462009-03-03 Ian Lance Taylor <iant@google.com>
14847
14848 PR 9918
14849 * target-reloc.h (relocate_section): Pass output_section to
14850 relocate.
14851 * i386.cc (Target_i386::should_apply_static_reloc): Add
14852 output_section parameter. Change all callers.
14853 (Target_i386::Relocate::relocate): Add output_section parameter.
14854 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
14855 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
14856 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
14857 * testsuite/two_file_shared.sh: New script.
14858 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
14859 (check_DATA): Add two_file_shared.dbg.
14860 (two_file_shared.dbg): New target.
14861 * testsuite/Makefile.in: Rebuild.
14862
15d5fa16
ILT
148632009-03-01 Ian Lance Taylor <iant@google.com>
14864
14865 * configure.ac: Check for byteswap.h.
14866 * configure: Rebuild.
14867 * config.in: Rebuild.
14868
8a4c0b0d
ILT
148692009-03-01 Mikolaj Zalewski <mikolajz@google.com>
14870
14871 * layout.cc (Layout::find_or_add_kept_section): New function.
14872 (Layout::add_comdat): Removed.
14873 * layout.h (struct Kept_section): Move out of class Layout.
14874 Remove trailing underscores from field names. Add group_sections
14875 field. Rename group_ field to is_group. Change all uses.
14876 (class Layout): Declare find_or_add_kept_section, not add_comdat.
14877 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
14878 comdat_groups_ field.
14879 (Sized_relobj::include_section_group): Use
14880 find_or_add_kept_section and Kept_section::group_sections.
14881 (Sized_relobj::include_linkonce_section): Likewise.
14882 * object.cc (class Sized_relobj): Don't define Comdat_group or
14883 Comdat_group_table. Remove find_comdat_group and
14884 add_comdat_group. Remove comdat_groups_ field.
14885 * plugin.cc (include_comdat_group): Use
14886 Layout::find_or_add_kept_section.
14887
b4ecf66b
ILT
148882009-02-28 Ian Lance Taylor <iant@google.com>
14889
14359ca0
ILT
14890 * README: --gc-sections and map files are now supported. Document
14891 some build requirements.
14892
b4ecf66b
ILT
14893 PR 6992
14894 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
14895 relocatable link set the value of the section symbol to zero.
14896 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
14897 relocatable link don't include the section address in the local
14898 symbol value.
14899
0602e05a
ILT
149002009-02-27 Ian Lance Taylor <iant@google.com>
14901
fd9d194f
ILT
14902 PR 6811
14903 * options.h (class Search_directory): Add is_system_directory.
14904 (class General_options): Declare is_in_system_directory.
14905 * options.cc (get_relative_sysroot): Make static.
14906 (get_default_sysroot): Make static.
14907 (General_optoins::is_in_system_directory): New function.
14908 * fileread.cc (Input_file::is_in_system_directory): New function.
14909 * fileread.h (class Input_file): Declare is_in_system_directory.
14910 * object.h (class Object): Add is_in_system_directory.
14911 (class Input_objects): Remove system_library_directory_ field.
14912 * object.cc (Input_objects::add_object): Don't set
14913 system_library_directory_.
14914 (input_objects::found_in_system_library_directory): Remove.
14915 * symtab.cc (Symbol_table::write_globals): Remove input_objects
14916 parameter. Change all callers.
14917 (Symbol_table::sized_write_globals): Likewise.
14918 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
14919 Call Object::is_in_system_directory.
14920 * symtab.h (class Symbol_table): Update declarations.
14921
61edd21f
ILT
14922 PR 5990
14923 * descriptors.h (Open_descriptor): Add is_on_stack field.
14924 * descriptors.cc (Descriptors::open): If the descriptor is on the
14925 top of the stack, remove it. Initialize is_on_stack field.
14926 (Descriptors::release): Only add pod to stack if it is not on the
14927 stack already.
14928 (Descriptors::close_some_descriptor): Clear stack_next and
14929 is_on_stack fields.
14930
e29e076a
ILT
14931 PR 7091
14932 * output.cc (Output_section::find_starting_output_address): Rename
14933 from starting_output_address; add PADDR parameter; change return
14934 type.
14935 * output.h (class Output_section): Declare
14936 find_starting_output_address instead of starting_output_address.
14937 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
14938 section symbol for which we can't find a merge section.
14939
0602e05a
ILT
14940 PR 9836
14941 * symtab.cc (Symbol_table::add_from_object): If the visibility is
14942 hidden or internal, force the symbol to be local.
14943 * resolve.cc (Symbol::override_visibility): Define.
14944 (Symbol::override_base): Use override_visibility.
14945 (Symbol_table::resolve): Likewise.
14946 (Symbol::override_base_with_special): Likewise.
14947 (Symbol_table::override_with_special): If the visibility is hidden
14948 or internal, force the symbol to be local.
14949 * symtab.h (class Symbol): Add set_visibility and
14950 override_visibility.
14951 * testsuite/ver_test_1.sh: New file.
14952 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
14953 (check_DATA): Add ver_test_1.syms.
14954 (ver_test_1.syms): New target.
14955 * testsuite/Makefile.in: Rebuild.
14956
401a9a73
CC
149572009-02-25 Cary Coutant <ccoutant@google.com>
14958
14959 * layout.cc (Layout::choose_output_section): Don't rename sections
14960 when using a linker script that has a SECTIONS clause.
14961 * Makefile.in: Regenerate.
14962
14963 * testsuite/Makefile.am (script_test_5.sh): New test case.
14964 * testsuite/Makefile.in: Regenerate.
14965 * testsuite/script_test_5.cc: New file.
14966 * testsuite/script_test_5.sh: New file.
14967 * testsuite/script_test_5.t: New file.
14968
f488e4b0
CC
149692009-02-13 Rafael Avila de Espindola <espindola@google.com>
14970
14971 * archive.cc (Archive::include_member): Update calls to add_symbols.
14972 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
14973 the Layout argument.
14974 * dynobj.h (do_add_symbols): Add the Layout argument.
14975 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
14976 Layout argument.
14977 * object.h (Object::add_symbols): Add the Layout argument.
14978 (Object::do_add_symbols): Add the Layout argument.
14979 (Sized_relobj::do_add_symbols): Add the Layout argument.
14980 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
14981 Unify the two versions.
14982 (Add_plugin_symbols): Remove.
14983 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
14984 (Sized_pluginobj::do_add_symbols): Unify the two versions.
14985 (Add_plugin_symbols): Remove.
14986 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
14987 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
14988 (Add_symbols::run): Make it work with Pulginobj.
14989
89dd1680
ILT
149902009-02-06 Ian Lance Taylor <iant@google.com>
14991
14992 * object.cc (Sized_relobj::do_layout): Make info message start
14993 with lower case letter.
14994
266d0a74
ILT
149952009-02-06 Mikolaj Zalewski <mikolajz@google.com>
14996
602b464e
ILT
14997 * binary.cc: Fix file comment.
14998
266d0a74
ILT
14999 * options.h (enum Incremental_disposition): Define.
15000 (class General_options): Add new options: --incremental,
15001 --incremental_changed, --incremental_unchanged,
15002 --incremental_unknown. Add incremental_disposition_ and
15003 implicit_incremental_ fields.
15004 (General_options::incremental_disposition): New function.
15005 (class Position_dependent_options): Add incremental_disposition
15006 option.
15007 (Position_dependent_options::copy_from_options): Set incremental
15008 dispositions.
15009 * options.cc (General_options::parse_incremental_changed): New
15010 function.
2e702c99
RM
15011 (General_options::parse_incremental_unchanged): New function.
15012 (General_options::parse_incremental_unknown): New function.
15013 (General_options::General_options): Initialize new fields
266d0a74 15014 incremental_disposition_ and implicit_incremental_.
2e702c99 15015 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
15016 without --incremental.
15017
f073bbf7
CD
150182009-02-06 Chris Demetriou <cgd@google.com>
15019
15020 * gold.h (gold_undefined_symbol): Change to take only a Symbol
15021 pointer and to report location as the file name associated with
15022 the symbol.
15023 (gold_undefined_symbol_at_location): New function to replace the
15024 old gold_undefined_symbol functionality.
15025 * target-reloc.h (relocate_section): Update to use
15026 gold_undefined_symbol_at_location.
15027 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
15028 Call gold_undefined_symbol function rather than gold_error.
15029 * errors.h (Errors::undefined_symbol): Take location as a
15030 string, rather than calculating it from a relocation.
15031 * errors.cc (Errors::fatal): Print "fatal error:" before the
15032 formatted message.
15033 (Errors::error, Errors::error_at_location): Print "error: "
15034 before the formatted message.
15035 (Errors::undefined_symbol): Take location as a string, rather
15036 than calculating it from a relocation.
15037 (gold_undefined_symbol_at_location): New function akin to
15038 old gold_undefined_symbol, calculates location from relocation.
15039 (gold_undefined_symbol): Change to take only a Symbol pointer
15040 and to report location as the file name associated with the symbol.
15041 * testsuite/debug_msg.sh: Update for changed error messages.
15042 * testsuite/undef_symbol.sh: Likewise.
15043
8e94a90c
ILT
150442009-02-04 Duncan Sands <baldrick@free.fr>
15045
15046 PR 9812
15047 * reduced_debug_output.h
15048 (Output_reduced_debug_abbrev_section::failed): Use format for
15049 gold_warning.
15050 (Output_reduced_debug_info_section::faild): Likewise.
15051
88a0e15b
ILT
150522009-01-31 Mikolaj Zalewski <mikolajz@google.com>
15053
15054 * script.cc (Lazy_demangler): New class.
2e702c99 15055 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
15056 symbol only once.
15057
5efc7cd2
CC
150582009-01-29 Cary Coutant <ccoutant@google.com>
15059
15060 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
15061 to __tls_get_addr.
15062 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
15063
e0ebcf42
ILT
150642009-01-28 Ian Lance Taylor <iant@google.com>
15065
5efc7cd2 15066 * version.cc (version_string): Bump to 1.9.
75fe7426 15067
e0ebcf42
ILT
15068 * gold.h: Include <cstring> and <stdint.h>.
15069 * version.cc: Include <cstdio>.
15070 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
15071 warning.
15072 * reduced_debug_output.cc (insert_into_vector): Rename from
15073 Insert_into_vector; change all callers. Use Swap_unaligned to
15074 avoid aliasing issue; remove union since it is unnecessary.
15075
8e2813be 150762009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
15077
15078 * Makefile.am (CCFILES): Add gc.cc.
15079 (HFILES): Add gc.h.
15080 * Makefile.in: Regenerate.
15081 * gold.cc (Gc_runner): New class.
15082 (queue_initial_tasks): Call garbage collection related tasks
15083 when corresponding options are invoked.
15084 (queue_middle_gc_tasks): New function.
15085 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
15086 processed early before laying out sections during garbage collection.
15087 * gold.h (queue_middle_gc_tasks): New function.
15088 (is_prefix_of): Move from "layout.cc".
15089 * i386.cc (Target_i386::gc_process_relocs): New function.
15090 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
15091 * main.cc (main): Create object of class "Garbage_collection".
15092 * object.cc (Relobj::copy_symbols_data): New function.
15093 (Relobj::is_section_name_included): New function.
e1df38aa
NC
15094 (Sized_relobj::do_layout): Allow this function to be called twice
15095 during garbage collection and defer layout of section during the
6d03d481
ST
15096 first call.
15097 * object.h (Relobj::get_symbols_data): New function.
15098 (Relobj::is_section_name_included): New function.
15099 (Relobj::copy_symbols_data): New function.
15100 (Relobj::set_symbols_data): New function.
15101 (Relobj::get_relocs_data): New function.
15102 (Relobj::set_relocs_data): New function.
15103 (Relobj::is_output_section_offset_invalid): New pure virtual function.
15104 (Relobj::gc_process_relocs): New function.
15105 (Relobj::do_gc_process_relocs): New pure virtual function.
15106 (Relobj::sd_): New data member.
15107 (Sized_relobj::is_output_section_offset_invalid): New function.
15108 (Sized_relobj::do_gc_process_relocs): New function.
15109 * options.h (General_options::gc_sections): Modify to not be a no-op.
15110 (General_options::print_gc_sections): New option.
15111 * plugin.cc (Plugin_finish::run): Remove function call to
15112 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
15113 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
15114 * reloc.cc (Read_relocs::run): Add task to process relocs and
15115 determine unreferenced sections when doing garbage collection.
15116 (Gc_process_relocs): New class.
15117 (Sized_relobj::do_gc_process_relocs): New function.
15118 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
15119 sections that are garbage collected.
15120 * reloc.h (Gc_process_relocs): New class.
15121 * sparc.cc (Target_sparc::gc_process_relocs): New function.
15122 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
15123 symbols whose corresponding sections are garbage collected.
15124 (Symbol_table::Symbol_table): Add new parameter for the garbage
15125 collection object.
15126 (Symbol_table::gc_mark_undef_symbols): New function.
15127 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15128 (Symbol_table::gc_mark_dyn_syms): New function.
15129 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
15130 as garbage.
15131 (Symbol_table::add_from_object): Likewise.
15132 (Symbol_table::add_from_relobj): When building shared objects, do not
15133 treat externally visible symbols as garbage.
15134 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
15135 table information for static and relocatable links.
15136 * symtab.h (Symbol_table::set_gc): New function.
15137 (Symbol_table::gc): New function.
15138 (Symbol_table::gc_mark_undef_symbols): New function.
15139 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15140 (Symbol_table::gc_mark_dyn_syms): New function.
15141 (Symbol_table::gc_): New data member.
e1df38aa 15142 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
15143 function.
15144 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
15145 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
15146
3b293544
CF
151472009-01-20 Chris Faylor <me.sourceware@sourceware.org>
15148
15149 * options.h (General_options::gc_sections): Define as a no-op for now.
15150 (General_options::no_keep_memory): Ditto.
15151 (General_options::Bshareable): Define.
15152 * options.cc (General_options::finalize): Honor -Bshareable.
15153
83d22aa8
AS
151542009-01-20 Andreas Schwab <schwab@suse.de>
15155
15156 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
15157 read the value in the contents, since we don't use it. Use the
15158 template endianness when writing.
15159 (Relocate::relocate): Use it for R_PPC_REL16_HA.
15160
cd536b21
AS
151612009-01-19 Andreas Schwab <schwab@suse.de>
15162
15163 * configure.tgt (powerpc64-*): Fix targ_obj.
15164
99e9a495
ILT
151652009-01-15 Ian Lance Taylor <iant@google.com>
15166
15167 * object.cc (Sized_relobj::write_local_symbols): Don't write out
15168 local symbols when stripping all symbols.
15169
bbbfea06
CC
151702009-01-14 Cary Coutant <ccoutant@google.com>
15171
99e9a495 15172 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 15173
0f7c0701
CC
151742009-01-14 Cary Coutant <ccoutant@google.com>
15175
15176 * archive.cc (Archive::get_elf_object_for_member): Remove call
15177 to File_read::claim_for_plugin.
15178 * descriptors.cc (Descriptors::open): Remove reference to
15179 is_claimed.
15180 (Descriptors::claim_for_plugin): Remove.
15181 * descriptors.h (Descriptors::claim_for_plugin): Remove.
15182 (Descriptors::is_claimed): Remove.
15183 (claim_descriptor_for_plugin): Remove.
15184 * fileread.cc (File_read::claim_for_plugin): Remove.
15185 * fileread.h (File_read::claim_for_plugin): Remove.
15186 (File_read::descriptor): Reopen descriptor if necessary.
15187 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
15188 (Plugin_manager::all_symbols_read): Add task parameter. Change
15189 all callers.
15190 (Plugin_manager::get_input_file): New function.
15191 (Plugin_manager::release_input_file): New function.
15192 (Pluginobj::Pluginobj): Add filesize parameter and initialize
15193 corresponding data member.
15194 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
15195 and pass to base constructor. Change all callers.
15196 (get_input_file, release_input_file): New functions.
15197 (make_sized_plugin_object): Add filesize parameter. Change all callers.
15198 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
15199 (Plugin_manager::all_symbols_read): Add task parameter.
15200 (Plugin_manager::get_input_file): New function.
15201 (Plugin_manager::release_input_file): New function.
15202 (Plugin_manager::task_): New data member.
15203 (Pluginobj::Pluginobj): Add filesize parameter.
15204 (Pluginobj::filename): New function.
15205 (Pluginobj::descriptor): New function.
15206 (Pluginobj::filesize): New function.
15207 (Pluginobj::filesize_): New data member.
15208 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
15209 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
15210 File_read::claim_for_plugin; use Object::unlock to unlock the file.
15211
15212 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
15213 with archive libraries.
15214 * testsuite/Makefile.in: Regenerate.
15215 * testsuite/plugin_test.c (struct sym_info): New type.
15216 (get_input_file, release_input_file): New static variables.
15217 (onload): Capture new transfer vector entries.
15218 (claim_file_hook): Stop reading at end of file according to filesize.
15219 Factor out parsing of readelf output into separate function.
15220 (all_symbols_read_hook): Exercise get_input_file and release_input_file
15221 APIs and get the source file name from the symbol table. Convert
15222 source file name to corresponding object file name. Print info
15223 message when adding new input files.
15224 (parse_readelf_line): New function.
15225 * testsuite/plugin_test_1.sh: Add checks for new info messages.
15226 * testsuite/plugin_test_2.sh: Likewise.
15227 * testsuite/plugin_test_3.sh: Likewise.
15228 * testsuite/plugin_test_4.sh: New test case.
15229
62a6d109
ILT
152302009-01-07 Ian Lance Taylor <iant@google.com>
15231
15232 * version.cc (version_string): Bump to 1.8.
15233
483620e8
CC
152342008-12-23 Cary Coutant <ccoutant@google.com>
15235
15236 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
15237 * plugin.cc (Plugin_manager::finish): Rename as
15238 layout_deferred_objects. Move cleanup to separate function.
15239 (Plugin_manager::cleanup): New function.
15240 (Plugin_finish::run): Call layout_deferred_objects and cleanup
15241 separately.
15242 * plugin.h (Plugin_manager::finish): Rename as
15243 layout_deferred_objects.
15244 (Plugin_manager::cleanup): New function.
15245 (Plugin_manager::cleanup_done): New field.
15246
d66a9eb3
CC
152472008-12-23 Cary Coutant <ccoutant@google.com>
15248
15249 * plugin.cc (is_visible_from_outside): New function.
15250 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
15251 so we don't return "IR only" status for exported symbols or -r links.
15252
15253 * testsuite/Makefile.am (plugin_test_3): New test case.
15254 * testsuite/Makefile.in: Regenerate.
15255 * testsuite/plugin_test_3.sh: New file.
15256
5995b570
CC
152572008-12-22 Cary Coutant <ccoutant@google.com>
15258
15259 * object.cc (Sized_relobj::layout_section): New function.
15260 (Sized_relobj::do_layout): Defer layout of input sections until after
15261 plugin has provided replacement files.
15262 (Sized_relobj::do_layout_deferred_sections): New function.
15263 * object.h (Relobj::set_section_offset): Remove virtual keyword.
15264 (Relobj::layout_deferred_sections): New function.
15265 (Relobj::do_layout_deferred_sections): New function.
15266 (Sized_relobj::do_layout_deferred_sections): New function.
15267 (Sized_relobj::layout_section): New function.
15268 (Sized_relobj::Deferred_layout): New structure.
15269 (Sized_relobj::deferred_layout_): New field.
15270 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
15271 Change all callers. Layout deferred sections.
15272 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
15273 references.
15274 (Plugin_hook::run): Move code from do_plugin_hook inline.
15275 (Plugin_hook::do_plugin_hook): Remove.
15276 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
15277 (Plugin_manager::finish): Renamed, was cleanup.
15278 (Plugin_manager::should_defer_layout): New function.
15279 (Plugin_manager::add_deferred_layout_object): New function.
15280 (Plugin_manager::Deferred_layout_list): New type.
15281 (Plugin_manager::deferred_layout_objects_): New field.
15282 (Plugin_hook::do_plugin_hook): Remove.
15283
ee769c88
ILT
152842008-12-17 Ian Lance Taylor <iant@google.com>
15285
15286 * options.h (class General_options): Add --no case for
15287 --export-dynamic.
15288
abc8dcba
CC
152892008-12-16 Cary Coutant <ccoutant@google.com>
15290
15291 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
15292 vector.
15293 (Plugin_manager::claim_file): Create plugin object even if
15294 plugin did not call the add_symbols callback.
15295 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
15296 asking for more symbols than were added.
15297 * testsuite/Makefile.am (plugin_test_1): Add test case with
15298 no global symbols.
15299 (empty.syms): New target.
15300 * testsuite/Makefile.in: Regenerate.
15301 * testsuite/plugin_test.c (claim_file_hook): Add new debug
15302 message. Don't call add_symbols if no globals.
15303 (all_symbols_read_hook): Don't provide replacement for empty
15304 claimed file.
15305
b0074644
ILT
153062008-12-12 Ian Lance Taylor <iant@google.com>
15307
68943102
ILT
15308 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
15309 r_type == 0 for a local symbol with r_sym == 0.
15310 (scan_relocatable_relocs): Pass r_sym to
15311 local_non_section_strategy.
15312 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
15313 r_sym parameter.
15314
b0074644
ILT
15315 * configure.ac: Update test for TLS descriptors: they are
15316 supported as of glibc 2.9.
15317 * configure: Rebuild.
15318
c2508178
ILT
153192008-12-11 Ian Lance Taylor <iant@google.com>
15320
15321 PR 7091
15322 * target-reloc.h (Default_scan_relocatable_relocs): For each
15323 function, map r_type == 0 to RELOC_DISCARD.
15324
2756a258
CC
153252008-12-10 Cary Coutant <ccoutant@google.com>
15326
15327 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
15328 object to override a kept COMDAT group from a plugin object.
15329
bb6f53d3
ILT
153302008-12-09 Ian Lance Taylor <iant@google.com>
15331
fbc558e1
ILT
15332 PR 7088
15333 * yyscript.y (file_cmd): Handle INPUT.
15334
bb6f53d3
ILT
15335 * testsuite/initpri1.c: Change all declarations to be full
15336 prototypes by adding void, to avoid compiler warnings.
15337
4674ecfc
CC
153382008-12-05 Rafael Avila de Espindola <espindola@google.com>
15339
15340 * options.cc (General_options::parse_plugin_opt): New.
15341 (General_options::add_plugin): The argument now is just the filename.
15342 (General_options::add_plugin_option): New.
15343 * options.h (plugin_opt): New.
15344 (add_plugin): Change argument name.
15345 (add_plugin_option): New.
15346 * plugin.cc (Plugin::load): Don't parse the plugin option.
15347 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
15348 (Plugin::add_option): New.
15349 (Plugin::args_): Change type.
15350 (Plugin::filename_): New.
15351 (Plugin_manager::add_plugin_option): New.
15352 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
15353 * testsuite/Makefile.in: Regenerate.
15354
fd06b4aa
CC
153552008-12-05 Cary Coutant <ccoutant@google.com>
15356
15357 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
15358 Handle --strip-lto-sections option.
15359 * options.h (strip_lto_sections): New option.
15360
6c52134c
CC
153612008-12-01 Cary Coutant <ccoutant@google.com>
15362
15363 * plugin.cc (ld_plugin_message): Change format parameter to const.
15364 Fix mismatch between new[] and delete.
15365
a45248e0
CC
153662008-11-14 Cary Coutant <ccoutant@google.com>
15367
15368 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
15369 instead of -1U.
15370
c82fbeee
CS
153712008-11-05 Craig Silverstein <csilvers@google.com>
15372
15373 * options.cc (General_options::parse_dynamic_list): New function.
15374 * options.h (General_options): New flags dynamic_list,
15375 dynamic_list_data, dynamic_list_cpp_new, and
15376 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
15377 (General_options::in_dynamic_list): New function.
15378 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
15379 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
15380 (Lex::can_continue_name): Likewise.
15381 (yylex): Likewise.
15382 (read_script_file): New parameter script_options.
15383 (read_dynamic_list): New function.
15384 (Script_options::define_dynamic_list): New function.
15385 (dynamic_list_keyword_parsecodes): New variable.
15386 (dynamic_list_keywords): New variable.
15387 * script.h (Script_options::define_dynamic_list): New function
15388 prototype.
15389 (read_dynamic_list): New function prototype.
15390 * symtab.cc (strprefix): New macro.
15391 (Symbol::should_add_dynsym_entry): Support dynamic_list,
15392 dynamic_list_data, dynamic_list_cpp_new, and
15393 dynamic_list_cpp_typeinfo.
15394 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
15395 (dynamic_list_expr): New rule.
15396 (dynamic_list_nodes): Likewise.
15397 (dynamic_list_node): Likewise.
15398 * testsuite/Makefile.am (dynamic_list): New test.
15399 * testsuite/Makefile.in: Regenerated.
15400 * testsuite/dynamic_list.t: New file.
15401 * testsuite/dynamic_list.sh: New file.
15402
e0bb29a5
CS
154032008-11-05 Craig Silverstein <csilvers@google.com>
15404
15405 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
15406 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
15407 (t11_last): Likewise.
15408 * testsuite/ver_test_6.c (main): Likewise.
15409
4e1e25e0
CC
154102008-10-07 Cary Coutant <ccoutant@google.com>
15411
15412 * options.c (General_options::finalize): Add check for -static and
15413 -shared.
15414 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
15415 is not empty.
15416
92f03fcb
CC
154172008-10-02 Cary Coutant <ccoutant@google.com>
15418
15419 * plugin.cc (make_sized_plugin_object): Fix conditional
15420 compilation to work when not all targets are enabled.
15421
fbd8a257
CC
154222008-09-29 Cary Coutant <ccoutant@google.com>
15423
15424 * archive.cc (Archive::get_file_and_offset): Use filename instead
15425 of name to get library path.
15426 (Archive::include_member): Unlock external member of a thin archive.
15427
15428 * testsuite/Makefile.am (TEST_AR): New variable.
15429 (thin_archive_test_1): New test.
15430 (thin_archive_test_2): New test.
81636b3f
CC
15431 * testsuite/Makefile.in: Regenerate.
15432 * testsuite/thin_archive_main.cc: New file.
15433 * testsuite/thin_archive_test_1.cc: New file.
15434 * testsuite/thin_archive_test_2.cc: New file.
15435 * testsuite/thin_archive_test_3.cc: New file.
15436 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 15437
eff45813
CC
154382008-09-29 Cary Coutant <ccoutant@google.com>
15439
15440 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
15441 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
15442 instead of -1U.
15443 (Sized_relobj::do_finalize_local_symbols): Likewise.
15444 (Sized_relobj::map_to_kept_section): Likewise.
15445 * object.h (Sized_relobj::invalid_address): New constant.
15446 (Sized_relobj::do_output_section_offset): Check for invalid_address
15447 and return -1ULL.
15448 * output.cc (Output_reloc::local_section_offset): Use constant
15449 invalid_address instead of -1U.
15450 (Output_reloc::get_address): Likewise.
15451 (Output_section::output_address): Change -1U to -1ULL.
15452 * output.h (Output_reloc::invalid_address): New constant.
15453 * reloc.cc (Sized_relobj::write_sections): Use constant
15454 invalid_address instead of -1U.
15455 (Sized_relobj::relocate_sections): Likewise.
15456 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
15457 values for merge sections.
15458 * target-reloc.h (relocate_for_relocatable): Use constant
15459 invalid_address instead of -1U.
15460
89fc3421
CC
154612008-09-19 Cary Coutant <ccoutant@google.com>
15462
15463 Add plugin functionality for link-time optimization (LTO).
15464 * configure.ac (plugins): Add --enable-plugins option.
15465 * configure: Regenerate.
15466 * config.in: Regenerate.
15467 * Makefile.am (LIBDL): New variable.
15468 (CCFILES): Add plugin.cc.
15469 (HFILES): Add plugin.h.
15470 (ldadd_var): Add LIBDL.
15471 * Makefile.in: Regenerate.
15472
15473 * archive.cc: Include "plugin.h".
15474 (Archive::setup): Don't preread archive symbols when using a plugin.
15475 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
15476 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
15477 files.
15478 (Archive::include_member): Add symbols from plugin objects.
15479 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
15480 * descriptors.cc (Descriptors::open): Check for file descriptors
15481 abandoned by plugins.
15482 (Descriptors::claim_for_plugin): New function.
15483 * descriptors.h (Descriptors::claim_for_plugin): New function.
15484 (Open_descriptor::is_claimed): New field.
15485 (claim_descriptor_for_plugin): New function.
15486 * fileread.cc (File_read::claim_for_plugin): New function.
15487 * fileread.h (File_read::claim_for_plugin): New function.
15488 (File_read::descriptor): New function.
15489 * gold.cc: Include "plugin.h".
15490 (queue_initial_tasks): Add task to call plugin hooks for generating
15491 new object files.
15492 * main.cc: Include "plugin.h".
15493 (main): Load plugin libraries.
15494 * object.h (Pluginobj): Declare.
15495 (Object::pluginobj): New function.
15496 (Object::do_pluginobj): New function.
15497 (Object::set_target): New function.
15498 * options.cc: Include "plugin.h".
15499 (General_options::parse_plugin): New function.
15500 (General_options::General_options): Initialize plugins_ field.
15501 (General_options::add_plugin): New function.
15502 * options.h (Plugin_manager): Declare.
15503 (General_options): Add --plugin option.
15504 (General_options::has_plugins): New function.
15505 (General_options::plugins): New function.
15506 (General_options::add_plugin): New function.
15507 (General_options::plugins_): New field.
15508 * plugin.cc: New file.
15509 * plugin.h: New file.
15510 * readsyms.cc: Include "plugin.h".
15511 (Read_symbols::do_read_symbols): Check for archive before checking
15512 for ELF file. Call plugin hooks to claim files.
15513 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
15514 from a real object file; force override when processing replacement
15515 files.
15516 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
15517 (Symbol::init_base_object): Likewise.
15518 (Symbol::init_base_output_data): Likewise.
15519 (Symbol::init_base_output_segment): Likewise.
15520 (Symbol::init_base_constant): Likewise.
15521 (Symbol::init_base_undefined): Likewise.
15522 (Symbol::output_section): Assert that object is not a plugin.
15523 (Symbol_table::add_from_pluginobj): New function.
15524 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
15525 undefined.
15526 (Symbol_table::sized_write_globals): Likewise.
15527 (Symbol_table::add_from_pluginobj): Instantiate template.
15528 * symtab.h (Sized_pluginobj): Declare.
15529 (Symbol::in_real_elf): New function.
15530 (Symbol::set_in_real_elf): New function.
15531 (Symbol::in_real_elf_): New field.
15532 (Symbol_table::add_from_pluginobj): New function.
15533
15534 * testsuite/Makefile.am (AM_CFLAGS): New variable.
15535 (LIBDL): New variable.
15536 (LDADD): Add LIBDL.
15537 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
15538 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
15539 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
15540 (MOSTLYCLEANFILES): Likewise.
15541 * testsuite/Makefile.in: Regenerate.
15542 * testsuite/plugin_test.c: New file.
15543 * testsuite/plugin_test_1.sh: New file.
15544 * testsuite/plugin_test_2.sh: New file.
15545
de31bda5
ILT
155462008-09-16 Ian Lance Taylor <iant@google.com>
15547
9c2d0ef9
ILT
15548 * target-reloc.h (relocate_section): Check whether a symbol is
15549 defined by the ABI before reporting an undefined symbol error.
15550 * target.h (Target::is_defined_by_abi): Make parameter const.
15551 (Target::do_is_defined_by_abi): Likewise.
15552 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
15553 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
15554 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
15555 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
15556 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
15557 * testsuite/Makefile.in: Rebuild.
15558
de31bda5
ILT
15559 * fileread.cc (make_view): Add casts to avoid warning.
15560
9fa33bee
AO
155612008-09-16 Alexandre Oliva <aoliva@redhat.com>
15562
15563 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
15564 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15565
183fd0e3
AO
155662008-09-16 Alexandre Oliva <aoliva@redhat.com>
15567
15568 * options.h (General_options::output_is_executable): New.
15569 (General_options::output_is_pie): New.
15570 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
15571 for shared libraries.
15572 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15573
7be8330a
CD
155742008-09-11 Chris Demetriou <cgd@google.com>
15575
15576 * options.h (origin): New -z option.
15577 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
15578 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
15579 in DT_FLAGS_1.
15580
a9caad02
CC
155812008-09-05 Cary Coutant <ccoutant@google.com>
15582
15583 * fileread.cc (File_read::make_view): Add check for attempt to map
15584 beyond end of file.
15585
ae6dce4d
CC
155862008-09-05 Cary Coutant <ccoutant@google.com>
15587
15588 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
15589 explicit instantiations.
15590
d7ab2a47
KVH
155912008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
15592
15593 PR gold/6858
15594 * options.cc (General_options::finalize): Allow undefined symbols
15595 in shlibs if linking -shared.
15596
15597 PR gold/6859
15598 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
15599 symbols as not needing a dynsym entry.
15600
1e52a9c1
CS
156012008-08-20 Craig Silverstein <csilvers@google.com>
15602
15603 * fileread.cc (File_read::open): Do not lock the file unless it
15604 was successfully opened.
15605
d85c80a3
CC
156062008-08-14 Cary Coutant <ccoutant@google.com>
15607
15608 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
15609 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
15610 * testsuite/tls_test.cc (struct int128): 128-bit struct
15611 for testing TLS relocs with non-zero addend.
15612 (v12): New TLS variable.
15613 (t12): New test.
15614 (t_last): Add check for v12.
15615 * testsuite/tls_test.h (t12): New function.
15616 * testsuite/tls_test_main.cc (thread_routine): Call new test.
15617
2d924fd9
ILT
156182008-08-13 Ian Lance Taylor <iant@google.com>
15619
15620 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
15621 set tls_segment_ or relro_segment_.
15622 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
15623 when appropriate.
15624 * output.h (Output_section::clear_is_relro): New function.
15625 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
15626 sections specially even when output_data_ is empty.
15627 (Output_segment::maximum_alignment): When first section is relro,
15628 only force alignment for PT_LOAD segments.
15629 * script.cc (script_data_segment_align): New function.
15630 (script_data_segment_relro_end): New function.
15631 * script-c.h (script_data_segment_align): Declare.
15632 (script_data_segment_relro_end): Declare.
15633 * script-sections.h (class Script_sections): Declare
15634 data_segment_align and data_segment_relro_end. Add fields
15635 segment_align_index_ and saw_relro_end_.
15636 * script-sections.cc (class Sections_element): Add set_is_relro
15637 virtual function. Add new bool* parameter to place_orphan_here.
15638 Add get_output_section virtual function.
15639 (class Output_section_definition): Add set_is_relro. Add new
15640 bool* parameter to place_orphan_here. Add get_output_section.
15641 Add is_relro_ field.
15642 (Output_section_definition::Output_section_definition): Initialize
15643 evaluated_address_, evaluated_load_address, evaluated_addralign_,
15644 and is_relro_ fields.
15645 (Output_section_definition::place_orphan_here): Add is_relro
15646 parameter.
15647 (Output_section_definition::set_section_addresses): Set relro for
15648 output section.
15649 (Output_section_definition::alternate_constraint): Likewise.
15650 (class Orphan_output_section): Add new bool* parameter to
15651 place_orphan_here. Add get_output_section.
15652 (Orphan_output_section::place_orphan_here): Add is_relro
15653 parameter.
15654 (Script_sections::Script_sections): Initialize
15655 data_segment_align_index_ and saw_relro_end_.
15656 (Script_sections::data_segment_align): New function.
15657 (Script_sections::data_segment_relro_end): New function.
15658 (Script_sections::place_orphan): Set or clear is_relro.
15659 (Script_sections::set_section_addresses): Force alignment of first
15660 TLS section.
15661 * yyscript.y (exp): Call script_data_segment_align and
15662 script_data_segment_relro_end.
15663 * testsuite/relro_script_test.t: New file.
15664 * testsuite/relro_test.cc (using_script): Declare.
15665 (t1, t2): Test using_script.
15666 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
15667 (relro_script_test_SOURCES): Define.
15668 (relro_script_test_DEPENDENCIES): Define.
15669 (relro_script_test_LDFLAGS): Define.
15670 (relro_script_test_LDADD): Define.
15671 (relro_script_test.so): New target.
15672 * testsuite/Makefile.in: Rebuild.
15673
f827c9a9
CC
156742008-08-06 Cary Coutant <ccoutant@google.com>
15675
15676 * archive.cc (Archive::total_archives, Archive::total_members)
15677 (Archive::total_members_loaded): New variables.
15678 (Archive::setup): Add parameter. Add option to preread
15679 archive symbols.
15680 (Archive::read_armap): Add counter.
15681 (Archive::get_file_and_offset): New function.
15682 (Archive::get_elf_object_for_member): New function.
15683 (Archive::read_all_symbols): New function.
15684 (Archive::read_symbols): New function.
15685 (Archive::add_symbols): Add counters.
15686 (Archive::include_all_members): Use armap to find members if it's
15687 already built.
15688 (Archive::include_member): Skip reading symbols if already read.
15689 Factored code into Archive::get_file_and_offset and
15690 Archive::get_elf_object_for_member. Changed call to
15691 Mapfile::report_include_archive_member.
15692 (Archive::print_stats): New function.
15693 * archive.h: Declare Object and Read_symbols_data classes.
15694 (Archive::Archive): Add initializers for new members.
15695 (Archive::setup): Add parameter.
15696 (Archive::print_stats): New function.
15697 (Archive::total_archives, Archive::total_members)
15698 (Archive::total_members_loaded): New variables.
15699 (Archive::get_file_and_offset): New function.
15700 (Archive::get_elf_object_for_member): New function.
15701 (Archive::read_all_symbols): New function.
15702 (Archive::read_symbols): New function.
15703 (Archive::Archive_member): New class.
15704 (Archive::members_): New member.
15705 (Archive::num_members_): New member.
15706 * main.cc: Include archive.h.
15707 (main): Call Archive::print_stats.
15708 * mapfile.cc (Mapfile::report_include_archive_member): Delete
15709 archive parameter; member_name is now the fully-decorated name.
15710 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
15711 * options.h: (General_options): Add --preread-archive-symbols option.
15712 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
15713 Archive::setup.
15714
de4c45bd
ILT
157152008-08-04 Ian Lance Taylor <iant@google.com>
15716
15717 * symtab.h (Symbol::use_plt_offset): New function.
15718 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
15719 * powerpc.cc (Relocate::relocate): Likewise.
15720 * sparc.cc (Relocate::relocate): Likewise.
15721 * x86_64.cc (Relocate::relocate): Likewise.
15722 * testsuite/weak_plt.sh: New test.
15723 * testsuite/weak_plt_main.cc: New test.
15724 * testsuite/weak_plt_shared.cc: New test.
15725 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
15726 (check_PROGRAMS): Add weak_plt.
15727 (check_DATA): Add weak_plt_shared.so.
15728 (weak_plt_main_pic.o, weak_plt): New targets.
15729 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
15730 * testsuite/Makefile.in: Rebuild.
15731
15732 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
15733 gcctestdir/ld.
15734 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
15735 * testsuite/Makefile.in: Rebuild.
15736
323ee3f4
AM
157372008-08-04 Alan Modra <amodra@bigpond.net.au>
15738
15739 * Makefile.am (POTFILES.in): Set LC_ALL=C.
15740 * Makefile.in: Regenerate.
15741 * po/POTFILES.in: Regenerate.
15742
7c07ecec
ILT
157432008-07-29 Ian Lance Taylor <iant@google.com>
15744
15745 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
15746 symbols before other symbols.
15747 * testsuite/script_test_2.cc (test_addr): Declare.
15748 (test_addr_alias): Declare.
15749 (main): Check that test_addr and test_addr_alias have the right
cd536b21 15750 values.
7c07ecec
ILT
15751 * testsuite/script_test_2.t: Define test_addr_alias and
15752 test_addr.
15753
5778530e
ILT
157542008-07-24 Ian Lance Taylor <iant@google.com>
15755
2a00e4fb
ILT
15756 PR 5990
15757 * descriptors.cc: New file.
15758 * descriptors.h: New file.
15759 * gold-threads.h (class Hold_optional_lock): New class.
15760 * fileread.cc: Include "descriptors.h".
15761 (File_read::~File_read): Release descriptor rather than closing
15762 it.
15763 (File_read::open) [file]: Call open_descriptor rather than open.
15764 Set is_descriptor_opened_.
15765 (File_read::open) [memory]: Assert that descriptor is not open.
15766 (File_read::reopen_descriptor): New function.
15767 (File_read::release): Release descriptor.
15768 (File_read::do_read): Make non-const. Reopen descriptor.
15769 (File_read::read): Make non-const.
15770 (File_read::make_view): Reopen descriptor.
15771 (File_read::do_readv): Likewise.
15772 * fileread.h (class File_read): Add is_descriptor_opened_ field.
15773 Update declarations.
15774 * layout.cc: Include "descriptors.h".
15775 (Layout::create_build_id): Use open_descriptor rather than open.
15776 * output.cc: Include "descriptors.h".
15777 (Output_file::open): Use open_descriptor rather than open.
15778 * archive.cc (Archive::const_iterator): Change Archive to be
15779 non-const.
15780 (Archive::begin, Archive::end): Make non-const.
15781 (Archive::count_members): Likewise.
15782 * archive.h (class Archive): Update declarations.
15783 * object.h (Object::read): Make non-const.
15784 * Makefile.am (CCFILES): Add descriptors.cc.
15785 (HFILES): Add descriptors.h.
15786 * Makefile.in: Rebuild.
15787
801647d1
ILT
15788 PR 6716
15789 * gold.h: Always include <clocale>. Add Solaris workarounds
15790 following code in binutils/sysdep.h.
15791
5edd166e
ILT
15792 PR 6048
15793 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
15794 this->eh_frame_hdr_ is NULL before using it.
15795
c89ad728
ILT
15796 * dynobj.cc (Versions::Versions): Update comment.
15797
aa86f06b
ILT
15798 * dynobj.cc (Versions::Versions): If there is an soname, use it as
15799 the base version name.
15800
5778530e
ILT
15801 * stringpool.cc (Stringpool_template::add_with_length): Set key to
15802 array size plus one.
15803 (Stringpool_template::set_string_offsets): Subtract one from key
15804 before using it as an array index.
15805 (Stringpool_template::get_offset_with_length): Likewise.
15806 (Stringpool_template::write_to_buffer): Likewise.
15807 * stringpool.h (Stringpool_template::get_offset_from_key):
15808 Likewise.
15809
057ead22
ILT
158102008-07-23 Ian Lance Taylor <iant@google.com>
15811
7f649c59
ILT
15812 PR 6658
15813 * object.h (Merged_symbol_value::value): Do our best to handle a
15814 negative addend.
15815
057ead22
ILT
15816 PR 6647
15817 * script.cc (Version_script_info::get_versions): Don't add empty
15818 version tag to return value.
15819 (Version_script_info::get_symbol_version_helper): Change return
15820 type to bool. Add pversion parameter. Change all callers.
15821 (script_register_vers_node): Don't require a non-NULL tag.
15822 * script.h (class Version_script_info): Update declarations.
15823 (Version_script_info::get_symbol_version): Change return type to
15824 bool. Add version parameter. Change all callers.
15825 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
15826 handling. Handle an empty version from a version script.
15827 (Symbol_table::define_special_symbol): Likewise.
15828 * testsuite/ver_test_10.script: New file.
15829 * testsuite/ver_test_10.sh: New file.
15830 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
15831 (check_DATA): Add ver_test_10.syms.
15832 (ver_test_10.syms, ver_test_10.so): New target.
15833 * testsuite/Makefile.in: Rebuild.
15834
58e54ac2
CD
158352008-07-23 Simon Baldwin <simonb@google.com>
15836
15837 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
15838 to zero for undefined symbols from dynamic libraries.
15839
95d14cd3
ILT
158402008-07-23 Ian Lance Taylor <iant@google.com>
15841
15842 * symtab.cc (Symbol_table::resolve): Remove version parameter.
15843 Change all callers.
15844 * symtab.h (class Symbol_table): Update declaration.
15845 * testsuite/ver_test_9.cc: New file.
15846 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
15847 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
15848 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
15849 (ver_test_9.so, ver_test_9.o): New targets.
15850 * testsuite/Makefile.in: Rebuild.
15851
92de84a6
ILT
158522008-07-22 Ian Lance Taylor <iant@google.com>
15853
34810851
ILT
15854 * options.h (class General_options): Define --check-sections.
15855 * layout.cc (Layout::set_segment_offsets): Handle
15856 --check-sections.
15857
af6156ef
ILT
15858 * options.h (class General_options): Define -n/--nmagic and
15859 -N/--omagic.
15860 * options.cc (General_options::finalize): For -n/--nmagic or
15861 -N/--omagic, set -static.
15862 * layout.cc (Layout::attach_allocated_section_to_segment): If
15863 -N/--omagic, don't put read-only and read-write sections in
15864 different segments.
15865 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
15866 finding a read-only segment.
15867 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
15868 don't set the minimum segment alignment to the common page size,
15869 and don't set the file offset to the address modulo the page size.
15870 * script-sections.cc (Script_sections::create_segments): If
15871 -n/--omagic, don't put read-only and read-write sections in
15872 different segments.
15873
92de84a6
ILT
15874 * cref.cc: New file.
15875 * cref.h: New file.
15876 * options.h (class General_options): Add --print-symbol-counts.
15877 * main.cc (main): Issue defined symbol report if requested.
15878 * archive.cc (Archive::interpret_header): Make into a const member
15879 function.
15880 (Archive::add_symbols): Call Input_objects::archive_start and
15881 archive_stop.
15882 (Archive::const_iterator): Define new class.
15883 (Archive::begin, Archive::end): New functions.
15884 (Archive::include_all_members): Rewrite to use iterator.
15885 (Archive::count_members): New function.
15886 * archive.h (class Archive): Update declarations.
15887 (Archive::filename): New function.
15888 * object.cc: Include "cref.h".
15889 (Sized_relobj::Sized_relobj): Initialize defined_count_.
15890 (Sized_relobj::do_get_global_symbol_counts): New function.
15891 (Input_objects::add_object): Add object to cross-referencer.
15892 (Input_objects::archive_start): New function.
15893 (Input_objects::archive_stop): New function.
15894 (Input_objects::print_symbol_counts): New function.
15895 * object.h: Declare Cref and Archive.
15896 (Object::get_global_symbol_counts): New function.
15897 (Object::do_get_global_symbol_counts): New pure virtual function.
15898 (class Sized_relobj): Add defined_count_ field. Update
15899 declarations.
15900 (class Input_objects): Add cref_ field. Update constructor.
15901 Update declarations.
15902 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
15903 defined_count_.
15904 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
15905 symbol counts.
15906 (Sized_dynobj::do_get_global_symbol_counts): New function.
15907 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
15908 defined_count_. Update declarations. Define Symbols typedef.
15909 * symtab.cc (Symbol_table::add_from_relobj): Add defined
15910 parameter. Change all callers.
15911 (Symbol_table::add_from_dynobj): Add sympointers and defined
15912 parameters. Change all callers.
15913 * symtab.h (class Symbol_table): Update declarations.
15914 * Makefile.am (CCFILES): Add cref.cc.
15915 (HFILES): Add cref.h.
15916 * Makefile.in: Rebuild.
15917
3f7c5e1d
CD
159182008-07-22 Simon Baldwin <simonb@google.com>
15919
15920 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
15921 to zero when writing undefined symbols.
15922
e0b64032
ILT
159232008-07-22 Ian Lance Taylor <iant@google.com>
15924
15925 * output.cc (Output_section::add_input_section): Don't try to
15926 merge empty merge sections.
15927
096b02cf
CS
159282008-07-21 Craig Silverstein <csilvers@google.com>
15929
15930 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
15931 Include symbol version in error message.
cd536b21 15932
1d1f116d
CD
159332008-07-20 Chris Demetriou <cgd@google.com>
15934
cd536b21 15935 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
15936 (RANDOM_SEED_CFLAGS): New substituted variable.
15937 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
15938 * configure: Rebuild.
15939 * Makefile.in: Likewise.
15940 * testsuite/Makefile.in: Likewise.
15941
a18f591e
ILT
159422008-07-18 Ian Lance Taylor <iant@google.com>
15943
15944 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
15945 where we see NAME/NULL and NAME/VERSION as separate symbols.
15946 * testsuite/ver_test_main.cc (main): Call t4.
15947 (t4, t4_2a): Define.
15948 * testsuite/ver_test_2.cc (t4_2): Define.
15949 * testsuite/ver_test_2.script: Put t4_2a in VER2.
15950 * testsuite/ver_test_4.cc (t4_2a): Define.
15951 * testsuite/ver_test_4.script: Put t4_2a in VER2.
15952 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
15953
c6e3f6ed
ILT
159542008-07-17 Ian Lance Taylor <iant@google.com>
15955
15956 * dynobj.cc (Versions::add_def): If we give an error about a
15957 missing version, go ahead and create the version anyhow.
15958
ef9beddf
ILT
159592008-07-10 Ian Lance Taylor <iant@google.com>
15960
15961 Handle output sections with more than 0x7fffffff bytes.
15962 * object.h (class Relobj): Change map_to_output_ to
15963 output_sections_, and just keep a section pointer. Change all
15964 uses. Move comdat group support to Sized_relobj.
15965 (Relobj::is_section_specially_mapped): Remove.
15966 (Relobj::output_section): Remove poff parameter. Change all
15967 callers.
15968 (Relobj::output_section_offset): New function.
15969 (Relobj::set_section_offset): Rewrite.
15970 (Relobj::map_to_output): Remove.
15971 (Relobj::output_sections): New function.
15972 (Relobj::do_output_section_offset): New pure virtual function.
15973 (Relobj::do_set_section_offset): Likewise.
15974 (class Sized_relobj): Add section_offsets_ field. Add comdat
15975 group support from Relobj. Update declarations.
15976 (Sized_relobj::get_output_section_offset): New function.
15977 (Sized_relobj::do_output_section_offset): New function.
15978 (Sized_relobj::do_set_section_offset): New function.
15979 * object.cc (Relobj::output_section_address): Remove.
15980 (Sized_relobj::Sized_relobj): Initialize new fields.
15981 (Sized_relobj::include_section_group): Cast find_kept_object to
15982 Sized_relobj.
15983 (Sized_relobj::include_linkonce_section): Likewise.
15984 (Sized_relobj::do_layout): Use separate arrays for output section
15985 and output offset.
15986 (Sized_relobj::do_count_local_symbols): Change map_to_output to
15987 output_sections.
15988 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
15989 output_sections and section_offsets.
15990 (Sized_relobj::write_local_symbols): Likewise.
15991 (map_to_kept_section): Compute output address directly.
15992 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
15993 output_sections and section_offsets.
15994 (Sized_relobj::write_sections): Likewise.
15995 (Sized_relobj::relocate_sections): Likewise.
15996 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
15997 * output.h (class Output_reloc): Update declarations. Change
15998 u2_.relobj to Sized_relobj*.
15999 (class Output_data_reloc): Change add functions to use
16000 Sized_relobj*.
16001 * output.cc (Output_reloc::Output_reloc): Change relobj to
16002 Sized_relobj*.
16003 (Output_reloc::local_section_offset): Change return type to
16004 Elf_Addr. Use get_output_section_offset.
16005 (Output_reloc::get_address): Likewise.
16006 (Output_section::is_input_address_mapped): Don't call
16007 is_section_specially_mapped.
16008 (Output_section::output_offset): Likewise.
16009 (Output_section::output_address): Likewise.
16010 (Output_section::starting_output_address): Likewise.
16011 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
16012 parameter to Sized_relobj*.
16013 (Copy_relocs::need_copy_reloc): Likewise.
16014 (Copy_relocs::save): Likewise.
16015 * copy-relocs.h (class Copy_relocs): Update declarations.
16016 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
16017 Sized_relobj*. Change relobj_ field to Sized_relobj*.
16018 * target-reloc.h (relocate_for_relocatable): Change
16019 offset_in_output_section type to Elf_Addr. Change code that uses
16020 it as well.
16021 * layout.cc (Layout::layout): Always set *off.
16022 * mapfile.cc (Mapfile::print_input_section): Use
16023 output_section_offset.
16024 * i386.cc (Target_i386::copy_reloc): Change object parameter to
16025 Sized_relobj*.
16026 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
16027 * sparc.cc (Target_sparc::copy_reloc): Likewise.
16028 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
16029
5cb66f97
ILT
160302008-07-03 Ian Lance Taylor <iant@google.com>
16031
16032 * layout.cc (Layout::include_section): Do not discard unrecognized
16033 SHT_STRTAB sections.
16034
afe47622
CS
160352008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
16036
16037 * script.cc (Lex::can_continue_name): Make '?' allowable in
16038 version-script names.
16039 * testsuite/version_script.map: Change glob pattern to use '?'
16040
5adf9721
ILT
160412008-06-30 Manish Singh <yosh@gimp.org>
16042
16043 PR 6585
16044 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
16045 Correct typo.
16046
e6fde208
ILT
160472008-06-30 Ian Lance Taylor <iant@google.com>
16048
16049 PR 6660
16050 PR 6682
16051 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
16052 versions]: Don't try to read the value in the contents, since we
16053 don't use it. Use the template endianness when writing.
16054
3f2e6a2d
CC
160552008-06-25 Cary Coutant <ccoutant@google.com>
16056
16057 * fileread.cc (File_read::make_view): Assert on zero-length view.
16058 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
16059 symbol table when there are no symbols to read.
16060
c43d3a48
CS
160612008-06-23 Craig Silverstein <csilvers@google.com>
16062
16063 * version.cc (version_string): Bump to 1.7
16064
5f494ea0
CS
160652008-06-18 Craig Silverstein <csilvers@google.com>
16066
16067 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
16068 constant 0xFFFF to type Valtype.
16069 (Powerpc_relocate_functions::rel16_ha): Likewise.
16070
c42e122e
ILT
160712008-06-17 Ian Lance Taylor <iant@google.com>
16072
f34787f8
ILT
16073 * output.h (Output_section::Input_section): Initialize p2align_ to
16074 zero for Output_section_data constructors.
16075 (Output_section::Input_section::addralign): If not an input
16076 section, return the alignment of the Output_section_data.
16077 * testsuite/copy_test.cc: New file.
16078 * testsuite/copy_test_1.cc: New file.
16079 * testsuite/copy_test_2.cc: New file.
16080 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
16081 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
16082 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
16083 (copy_test_1_pic.o, copy_test_1.so): New targets.
16084 (copy_test_2_pic.o, copy_test_2.so): New targets.
16085 * testsuite/Makefile.in: Rebuild.
16086
c42e122e
ILT
16087 * script-sections.cc (Script_sections::place_orphan): Initialize
16088 local variable exact.
16089
ce3ac18a
DE
160902008-06-13 David Edelsohn <edelsohn@gnu.org>
16091
16092 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
16093
42cacb20
DE
160942008-06-12 David Edelsohn <edelsohn@gnu.org>
16095 David S. Miller <davem@davemloft.net>
16096
16097 * powerpc.cc: New file.
16098 * Makefile.am (TARGETSOURCES): Add powerpc.cc
16099 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
16100 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
16101 * Makefile.in: Rebuild.
16102
7b308235
ILT
161032008-06-09 Ian Lance Taylor <iant@google.com>
16104
16105 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
16106 <exception>.
16107 (throwing, orig_terminate): New static variables.
16108 (terminate_handler): New static function.
16109 (t2): Set terminate handler.
16110
f0b886e3
ILT
161112008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
16112
16113 PR 6584
cd536b21 16114 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
16115 alignment.
16116
3e90f135
CC
161172008-05-30 Cary Coutant <ccoutant@google.com>
16118
16119 * archive.cc (Archive::include_all_members) Correct to step
16120 over symbol table and extended name table in thin archives.
16121
e09ad04a
ILT
161222008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
16123
16124 PR 6407
16125 * target-reloc.h (relocate_for_relocatable): Fix new_offset
16126 calculation.
16127
62b01cb5
ILT
161282008-05-28 Caleb Howe <cshowe@google.com>
16129
16130 * reduced_debug_output.cc: New file.
16131 * reduced_debug_output.h: New file.
92de84a6 16132 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
16133 * options.cc (General_options::finalize): Add strip_debug_non_line
16134 to the strip heirarchy.
16135 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
16136 fields.
16137 * layout.cc: Include "reduced_debug_output.h".
16138 (Layout::Layout): Initialize new fields.
16139 (line_only_debug_sections): New static array.
16140 (is_lines_only_debug_sections): New static inline function.
16141 (Layout::include_section): Handle --strip-debug-non-line.
16142 (Layout::make_output_section): If --strip-debug-non-line, build
16143 new output sections for .debug_abbrev and .debug_info.
16144 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
16145 gold. Warn about possible overflow.
16146 (read_signed_LEB_128): Likewise.
16147 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
16148 (read_signed_LEB_128): Declare.
16149 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
16150 (HFILES): Add reduced_debug_output.h.
16151 * Makefile.in: Rebuild.
16152
7d9e3d98
ILT
161532008-05-21 Ian Lance Taylor <iant@google.com>
16154
16155 * mapfile.cc: New file.
16156 * mapfile.h: New file.
16157 * options.h (class General_options): Add -M/--print-map and -Map.
16158 * options.cc (General_options::finalize): Make -M equivalent to
16159 -Map -.
16160 * main.cc: Include <cstdio> and "mapfile.h".
16161 (main): Open mapfile if requested.
16162 * gold.cc (class Middle_runner): Add mapfile_ field. Update
16163 constructor. Change caller.
16164 (queue_initial_tasks): Add mapfile parameter. Change caller.
16165 (queue_middle_tasks): Likewise.
16166 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
16167 declarations.
16168 * archive.cc: Include "mapfile.h".
16169 (Archive::add_symbols): Add mapfile parameter. Change all
16170 callers. Pass mapfile, symbol, and reason to include_member.
16171 (Archive::include_all_members): Add mapfile parameter. Change all
16172 callers.
16173 (Archive::include_member): Add mapfile, sym, and why parameters.
16174 Change all callers. Report inclusion to map file.
16175 * archive.h: Include "fileread.h".
16176 (class Archive): Update declarations.
16177 (Archive::file): New const method.
16178 (class Add_archive_symbols): Add mapfile_ field. Update
16179 constructor. Change all callers.
16180 * readsyms.h (class Read_symbols): Likewise.
16181 (class Finish_group): Likewise.
16182 (class Read_script): Likewise.
16183 * common.cc: Include "mapfile.h".
16184 (Symbol_table::allocate_commons): Add mapfile parameter. Change
16185 all callers.
16186 (Symbol_table::do_allocate_commons): Likewise.
16187 (Symbol_table::do_allocate_commons_list): Likewise. Report common
16188 symbol allocation to mapfile.
16189 * common.h (class Allocate_commons_task): Add mapfile_ field.
16190 Update constructor. Change all callers.
16191 * symtab.h (class Symbol_table): Update declarations.
16192 * layout.cc: Include "mapfile.h".
16193 (Layout_task_runner::run): Print information to mapfile.
16194 (Layout::create_gold_note): Change Output_data_fixed_space to
16195 Output_data_zero_fill.
16196 (Layout::create_build_id): Likewise.
16197 (Layout::print_to_mapfile): New function.
16198 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
16199 constructor. Change caller.
16200 (class Layout): Declare print_to_mapfile.
16201 * output.cc (Output_section::Input_section::print_to_mapfile): New
16202 function.
16203 (Output_section::add_input_section): If producing a map, always
16204 add to input_sections_ list.
16205 (Output_section::do_print_to_mapfile): New function.
16206 (Output_segment::print_sections_to_mapfile): New function.
16207 (Output_segment::print_section_list_to_mapfile): New function.
16208 * output.h: Include "mapfile.h".
16209 (Output_data::print_to_mapfile): New function.
16210 (Output_data::do_print_to_mapfile): New virtual function.
16211 (Output_segment_headers::do_print_to_mapfile): New function.
16212 (Output_file_header::do_print_to_mapfile): New function.
16213 (Output_data_const::do_print_to_mapfile): New function.
16214 (class Output_data_const_buffer): Add map_name_ field. Update
16215 constructor. Change all callers. Add do_print_to_mapfile
16216 function.
16217 (class Output_data_fixed_space): Likewise.
16218 (class Output_data_space): Likewise.
16219 (class Output_data_zero_fill): New class.
16220 (Output_data_strtab::do_print_to_mapfile): New function.
16221 (Output_data_reloc_base::do_print_to_mapfile): New function.
16222 (Output_relocatable_relocs::do_print_to_mapfile): New function.
16223 (Output_data_group::do_print_to_mapfile): New function.
16224 (Output_data_got::do_print_to_mapfile): New function.
16225 (Output_data_dynamic::do_print_to_mapfile): New function.
16226 (Output_symtab_xindex::do_print_to_mapfile): New function.
16227 (class Output_section): Declare do_print_to_mapflie. Declare
16228 print_to_mapfile in Input_section.
16229 (class Output_segment): Declare new functions.
16230 * object.h (Sized_relobj::symbol_count): New function.
16231 * script-sections.cc
16232 (Output_section_element_dot_assignment::set_section_addresses):
16233 Change Output_data_fixed_space to Output_data_zero_fill.
16234 (Output_data_expression::do_print_to_mapfile): New function.
16235 * script.cc (read_input_script): Add mapfile parameter. Change
16236 all callers.
16237 * script.h (read_input_script): Update declaration.
16238 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
16239 (Eh_frame::do_print_to_mapfile): New function.
16240 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
16241 (Output_merge_string::do_print_to_mapfile): New function.
16242 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
16243 function.
16244 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
16245 function.
16246 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
16247 function.
16248 * Makefile.am (CCFILES): Add mapfile.cc.
16249 (HFILES): Add mapfile.h.
16250 * Makefile.in: Rebuild.
16251
9f1d377b
ILT
162522008-05-19 Ian Lance Taylor <iant@google.com>
16253
16254 * options.h (class General_options): Add -z relro.
16255 * layout.cc (Layout::Layout): Initialize relro_segment_.
16256 (Layout::add_output_section_data): Return the output section.
16257 (Layout::make_output_section): Rcognize relro sections and mark
16258 them appropriately.
16259 (Layout::attach_allocated_section_to_segment): Put relro sections
16260 in a PT_GNU_RELRO segment.
16261 (Layout::create_initial_dynamic_sections): Mark the .dynamic
16262 section as relro.
16263 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
16264 PT_TLS segments.
16265 (Layout::linkonce_mapping): Map d.rel.ro.local to
16266 .data.rel.ro.local.
16267 (Layout::output_section_name): Us .data.rel.ro.local for any
16268 section which begins with that.
16269 * layout.h (class Layout): Update add_output_section_data
16270 declaration. Add relro_segment_ field.
16271 * output.cc (Output_section::Output_section): Initialize is_relro_
16272 and is_relro_local_ fields.
16273 (Output_segment::add_output_section): Group relro sections.
16274 (Output_segment::is_first_section_relro): New function.
16275 (Output_segment::maximum_alignment): If there is a relro section,
16276 align the segment to the common page size.
16277 (Output_segment::set_section_addresses): Track whether we are
16278 looking at relro sections. If the last section is a relro
16279 section, align to the common page size.
16280 (Output_segment::set_section_list_addresses): Add in_relro
16281 parameter. Change all callers. Align to the page size when
16282 moving from relro to non-relro section.
16283 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
16284 segment.
16285 * output.h (class Output_section): Add is_relro_ and
16286 is_relro_local_ fields.
16287 (Output_section::is_relro): New function.
16288 (Output_section::set_is_relro): New function.
16289 (Output_section::is_relro_local): New function.
16290 (Output_section::set_is_relro_local): New function.
16291 (class Output_segment): Update declarations.
16292 * i386.cc (Target_i386::got_section): Mark .got section as relro.
16293 * sparc.cc (Target_sparc::got_section): Likewise.
16294 * x86_64.cc (Target_x86_64::got_section): Likewise.
16295 * testsuite/relro_test_main.cc: New file.
16296 * testsuite/relro_test.cc: New file.
16297 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
16298 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
16299 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
16300 (relro_test.so, relro_test_pic.o): New targets.
16301 * testsuite/Makefile.in: Rebuild.
16302
a984ee1d
ILT
163032008-05-16 Ian Lance Taylor <iant@google.com>
16304
01676dcd
ILT
16305 * output.cc (Output_segment::add_output_section): Remove front
16306 parameter.
16307 * output.h (class Output_segment): Remove
16308 add_initial_output_section and overloaded add_output_section.
16309 Update declaration of remaining add_output_section.
16310 * layout.cc (Layout::create_interp): Call add_output_section
16311 rather than add_initial_output_section.
16312 (Layout::finish_dynamic_section): Likewise.
16313
497897f9
ILT
16314 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
16315 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
16316 know the dynamic type.
16317 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
16318 field. Initialize it in constructor.
16319 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
16320 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
16321 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
16322 reloc.
16323
a984ee1d
ILT
16324 * output.cc (Output_reloc::get_address): Change return type to
16325 Elf_Addr.
16326 * output.h (class Output_reloc): Update get_address declaration.
16327 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
16328 for section addresses.
16329
55ba0940
ILT
163302008-05-09 Ian Lance Taylor <iant@google.com>
16331
16332 PR 6493
16333 * gold.cc (gold_nomem): Use return value of write.
16334
75517b77
ILT
163352008-05-08 Ian Lance Taylor <iant@google.com>
16336
16337 * symtab.c (Symbol::init_base_output_data): Add version
16338 parameter. Change all callers.
16339 (Symbol::init_base_output_segment): Likewise.
16340 (Symbol::init_base_constant): Likewise.
16341 (Symbol::init_base_undefined): Likewise.
16342 (Sized_symbol::init_output_data): Likewise.
16343 (Sized_symbol::init_output_segment): Likewise.
16344 (Sized_symbol::init_constant): Likewise.
16345 (Sized_symbol::init_undefined): Likewise.
16346 (Symbol_table::do_define_in_output_data): If the new symbol has a
16347 version, mark it as the default.
16348 (Symbol_table::do_define_in_output_segment): Likewise.
16349 (Symbol_table::do_define_as_constant): Likewise.
16350 * symtab.h (class Symbol): Update declarations.
16351 (class Sized_symbol): Likewise.
16352 * resolve.cc (Symbol::override_version): New function.
c42e122e 16353 (Symbol::override_base): Call override_version.
75517b77
ILT
16354 (Symbol::override_base_with_special): Likewise.
16355 * testsuite/ver_script_8.script: New file.
16356 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
16357 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
16358 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
16359 (ver_test_8_1.so, ver_test_8_2.so): New targets.
16360
f1f70eae
ILT
163612008-05-06 Ian Lance Taylor <iant@google.com>
16362
f3e9c5c5
ILT
16363 PR 6049
16364 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
16365 functions.
16366 (class General_options): Remove existing --undefined, and add
16367 --no-undefined instead. Add new --undefined as synonym for -u.
16368 * archive.cc (Archive::add_symbols): Check whether symbol was
16369 named with -u.
16370 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
16371 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
16372 all uses. Add IS_UNDEFINED. Update declarations to split
16373 different versions of init_base. Declare init_base_undefined.
16374 (Symbol::is_defined): Handle IS_UNDEFINED.
16375 (Symbol::is_undefined): Likewise.
16376 (Symbol::is_weak_undefined): Call is_undefined.
16377 (Symbol::is_absolute): Handle IS_CONSTANT.
16378 (class Sized_symbol): Update declarations to split different
16379 versions of init. Declare init_undefined.
16380 (class Symbol_table): Declare new functions.
16381 * symtab.cc (Symbol::init_base_object): Rename from init_base.
16382 Change all callers.
16383 (Symbol::init_base_output_data): Likewise.
16384 (Symbol::init_base_output_segment): Likewise.
16385 (Symbol::init_base_constant): Likewise.
16386 (Symbol::init_base_undefined): New function.
16387 (Sized_symbol::init_object): Rename from init. Change all
16388 callers.
16389 (Sized_symbol::init_output_data): Likewise.
16390 (Sized_symbol::init_output_segment): Likewise.
16391 (Sized_symbol::init_constant): Likewise.
16392 (Sized_symbol::init_undefined): New function.
16393 (Symbol_table::add_undefined_symbols_from_command_line): New
16394 function.
16395 (Symbol_table::do_add_undefined_symbols_from_command_line): New
16396 function.
16397 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
16398 (Symbol::output_section): Likewise.
16399 (Symbol::set_output_section): Likewise.
16400 (Symbol_table::sized_finalize_symbol): Likewise.
16401 (Symbol_table::sized_write_globals): Likewise.
16402 * resolve.cc (Symbol_table::should_override): Likewise.
16403 (Symbol::override_base_with_special): Likewise.
16404
8bdcdf2c
ILT
16405 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
16406 symbol, change it to have default visibility.
16407 * testsuite/protected_1.cc: New file.
16408 * testsuite/protected_2.cc: New file.
16409 * testsuite/protected_3.cc: New file.
16410 * testsuite/protected_main_1.cc: New file.
16411 * testsuite/protected_main_2.cc: New file.
16412 * testsuite/protected_main_3.cc: New file.
16413 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
16414 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
16415 (protected_1_LDFLAGS, protected_1_LDADD): Define.
16416 (protected_1.so): New target.
16417 (protected_1_pic.o, protected_2_pic.o): New targets.
16418 (protected_3_pic.o): New target.
16419 (check_PROGRAMS): Add protected_2.
16420 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
16421 (protected_2_LDFLAGS, protected_2_LDADD): Define.
16422 * testsuite/Makefile.in: Rebuild.
16423
2b706932
ILT
16424 * options.h (DEFINE_var): Add set_user_set_##varname__.
16425 (DEFINE_bool_alias): New macro.
16426 (class General_options): Define -Bstatic using DEFINE_bool_alias
16427 rather than DEFINE_special. Add --undefined as an alias for -z
16428 defs.
16429 * options.cc (General_options::parse_Bstatic): Remove.
16430
d82a5bcc
ILT
16431 * options.h (class General_options): Add --fatal-warnings.
16432 * main.cc (main): Implement --fatal-warnings.
16433 * errors.h (Errors::warning_count): New function.
16434
f1f70eae
ILT
16435 * options.h (class General_options): Add -Bsymbolic-functions.
16436 * symtab.h (Symbol::is_preemptible): Check for
16437 -Bsymbolic-functions.
16438
8825ac63
ILT
164392008-05-05 Ian Lance Taylor <iant@google.com>
16440
d98bc257
ILT
16441 * options.h (DEFINE_bool): For DASH_Z, create the negative option
16442 as noVARNAME rather than no-VARNAME.
16443 (class General_options): Add option -z combreloc.
16444 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
16445 get_address.
16446 (Output_reloc::sort_before) [SHT_REL]: New function.
16447 (Output_reloc::sort_before) [SHT_RELA]: New function.
16448 (class Output_data_reloc_base): Add sort_relocs_ field. Define
16449 Sort_relocs_comparison.
16450 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
16451 parameter. Change all callers.
16452 (Output_data_reloc::Output_data_reloc) [both versions]: Add
16453 sort_relocs parameter. Change all callers.
16454 * output.cc (Output_reloc::get_address): New function, broken out
16455 of write_rel.
16456 (Output_reloc::write_rel): Call it.
16457 (Output_reloc::compare): New function.
16458 (Output_data_reloc_base::do_write): Optionally sort relocs.
16459
60b2b4e7
ILT
16460 * configure.ac: If targ_extra_obj is set, link it in.
16461 * configure.tgt: Initialize all variables.
16462 (x86_64*): Set targ_extra_obj and targ_extra_size.
16463 * configure: Rebuild.
16464
8825ac63
ILT
16465 * object.cc (Sized_relobj::include_section_group): Adjust section
16466 indexes read from group data. Build vector to pass to
16467 layout_group.
16468 * layout.cc (Layout::layout_group): Add flags and shndxes
16469 parameters. Remove contents parameter. Change caller. Update
16470 explicit instantiations.
16471 * layout.h (class Layout): Update layout_group declaration.
16472 * output.cc (Output_data_group::Output_data_group): Add flags and
16473 input_shndxes parameters. Remove contents parameter. Change
16474 caller.
16475 (Output_data_group::do_write): Change input_sections_ to
16476 input_shndxes_.
16477 * output.h (class Output_data_group): Update constructor
16478 declaration. Rename input_sections_ to input_shndxes_.
16479 * testsuite/many_sections_test.cc: Add template.
16480
e94cf127
CC
164812008-04-30 Cary Coutant <ccoutant@google.com>
16482
4418b2d5
CC
16483 * target-reloc.h (relocate_section): Fix dead-pointer bug.
16484
e94cf127
CC
16485 * layout.cc (Layout::include_section): Refactored check for debug
16486 info section.
16487 (Layout::add_comdat): Add new parameters. Change type
16488 of signature parameter. Add object and shndx to signatures table.
16489 (Layout::find_kept_object): New function.
16490 * layout.h: Include <cstring>.
16491 (Layout::is_debug_info_section): New function.
16492 (Layout::add_comdat): Add new parameters.
16493 (Layout::find_kept_object): New function.
16494 (Layout::Kept_section): New struct.
16495 (Layout::Signatures): Change type of map range.
16496 * object.cc (Relobj::output_section_address): New function.
16497 (Sized_relobj::include_section_group): Add new parameters. Change
16498 calls to Layout::add_comdat. Change to build table of kept comdat
16499 groups and table mapping discarded sections to kept sections.
16500 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
16501 (Sized_relobj::do_layout): Change calls to include_section_group and
16502 include_linkonce_section.
16503 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
16504 value to zero when section is discarded.
16505 (Sized_relobj::map_to_kept_section): New function.
16506 * object.h (Relobj::output_section_address): New function.
16507 (Relobj::Comdat_group): New type.
16508 (Relobj::find_comdat_group): New function.
16509 (Relobj::Comdat_group_table): New type.
16510 (Relobj::Kept_comdat_section): New type.
16511 (Relobj::Kept_comdat_section_table): New type.
16512 (Relobj::add_comdat_group): New function.
16513 (Relobj::set_kept_comdat_section): New function.
16514 (Relobj::get_kept_comdat_section): New function.
16515 (Relobj::comdat_groups_): New field.
16516 (Relobj::kept_comdat_sections_): New field.
16517 (Symbol_value::input_value): Update comment.
16518 (Sized_relobj::map_to_kept_section) New function.
16519 (Sized_relobj::include_linkonce_section): Add new parameter.
16520 * target-reloc.h (Comdat_behavior): New type.
16521 (get_comdat_behavior): New function.
16522 (relocate_section): Add code to map a discarded section to the
16523 corresponding kept section when applying a relocation.
16524
e4e5049b
CS
165252008-04-30 Craig Silverstein <csilvers@google.com>
16526
16527 * dwarf_reader.cc (next_generation_count): New static var.
16528 (Addr2line_cache_entry): New struct.
16529 (addr2line_cache): New static var.
16530 (Dwarf_line_info::one_addr2line): Added caching.
16531 (Dwarf_line_info::clear_addr2line_cache): New function.
16532 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
16533 cache-size parameter.
16534 (Dwarf_line_info::one_addr2line_cache): New function.
16535 * symtab.cc (Symbol_table::detect_odr_violations): Pass
16536 new cache-size argument to one_addr2line(), and clear cache.
16537
d09e9154
CC
165382008-04-28 Cary Coutant <ccoutant@google.com>
16539
16540 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
16541 R_386_PC8 relocations.
16542
7ef73768
ILT
165432008-04-23 Ian Lance Taylor <iant@google.com>
16544
55438702
ILT
16545 * object.cc (Sized_relobj::include_section_group): Check for
16546 invalid section group.
16547
c165fb93
ILT
16548 * object.cc (make_elf_object): Correct test for 64-bit ELF file
16549 header size.
16550
7ef73768
ILT
16551 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
16552 than read for file header.
16553 * archive.cc (Archive::include_member): Likewise.
16554
6194aaab
L
165552008-04-23 Paolo Bonzini <bonzini@gnu.org>
16556
16557 * aclocal.m4: Regenerate.
16558 * configure: Regenerate.
16559
d491d34e
ILT
165602008-04-19 Ian Lance Taylor <iant@google.com>
16561
5ea2bac6
ILT
16562 * version.cc (version_string): Bump to 1.6.
16563
7bc3e21a
ILT
16564 * testsuite/Makefile.am (many_sections_r_test): New target.
16565 (many_sections_r_test_SOURCES): Remove.
16566 (many_sections_r_test_DEPENDENCIES): Remove.
16567 (many_sections_r_test_LDFLAGS): Remove.
16568 (many_sections_r_test_LDADD): Remove.
16569
7fcd3aa9
ILT
16570 * object.cc (Sized_relobj::do_add_symbols): Always pass
16571 local_symbol_count_ to add_from_relobj.
16572
4c94d6ae
ILT
16573 * testsuite/Makefile.am (many_sections_check.h): Only check one in
16574 every thousand variables.
16575 * testsuite/Makefile.in: Rebuild.
16576
d491d34e
ILT
16577 * object.cc (Xindex::initialize_symtab_xindex): New function.
16578 (Xindex::read_symtab_xindex): New function.
16579 (Xindex::sym_xindex_to_shndx): New function.
16580 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
16581 available.
16582 (Sized_relobj::do_initialize_xindex): New function.
16583 (Sized_relobj::do_read_symbols): Adjust section links.
16584 (Sized_relobj::symbol_section_and_value): Add is_ordinary
16585 parameter. Change all callers.
16586 (Sized_relobj::include_section_group): Adjust section links and
16587 symbol section indexes.
16588 (Sized_relobj::do_layout): Adjust section links.
16589 (Sized_relobj::do_count_local_symbols): Adjust section links and
16590 symbol section indexes.
16591 (Sized_relobj::do_finalize_local_symbols): Distinguish between
16592 ordinary and special symbols.
16593 (Sized_relobj::write_local_symbols): Add symtab_xindex and
16594 dynsym_xindex parameters. Change all callers. Adjust section
16595 links. Use SHN_XINDEX when needed.
16596 (Sized_relobj::get_symbol_location_info): Adjust section links.
16597 Don't get fooled by special symbols.
16598 * object.h (class Xindex): Define.
16599 (class Object): Add xindex_ parameter. Declare virtual functoin
16600 do_initialize_xindex.
16601 (Object::adjust_sym_shndx): New function.
16602 (Object::set_xindex): New protected function.
16603 (class Symbol_value): Add is_ordinary_shndx_ field.
16604 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
16605 (Symbol_value::value): Assert ordinary section.
16606 (Symbol_value::initialize_input_to_output_map): Likewise.
16607 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
16608 Change all callers.
16609 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
16610 all callers.
16611 (class Sized_relobj): Update declarations.
16612 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
16613 parameter. Change all callers.
16614 (Sized_relobj::adjust_shndx): New function.
16615 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
16616 field.
16617 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
16618 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
16619 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
16620 (Sized_dynobj::read_dynsym_section): Adjust section links.
16621 (Sized_dynobj::read_dynamic): Likewise.
16622 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
16623 section links.
16624 (Sized_dynobj::do_initialize_xindex): New function.
16625 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
16626 do_initialize_xindex.
16627 (Sized_dynobj::adjust_shndx): New function.
16628 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
16629 dynsym_xindex_ fields.
16630 (Layout::finalize): Add a call to set_section_indexes before
16631 creating the symtab sections.
16632 (Layout::set_section_indexes): Don't do anything if the section
16633 already has a section index.
16634 (Layout::create_symtab_sections): Add shnum parameter. Change
16635 caller. Create .symtab_shndx section if needed.
16636 (Layout::create_shdrs): Add shstrtab_section parameter. Change
16637 caller.
16638 (Layout::allocated_output_section_count): New function.
16639 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
16640 needed.
16641 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
16642 fields. Update declarations.
16643 (Layout::symtab_xindex): New function.
16644 (Layout::dynsym_xindex): New function.
16645 (class Write_symbols_task): Add layout_ field.
16646 (Write_symbols_task::Write_symbols_task): Add layout parameter.
16647 Change caller.
16648 * output.cc (Output_section_headers::Output_section_headers): Add
16649 shstrtab_section parameter. Change all callers.
16650 (Output_section_headers::do_sized_write): Store overflow values
16651 for section count and section string table section index in
16652 section header zero.
16653 (Output_file_header::do_sized_write): Check for overflow of
16654 section count and section string table section index.
16655 (Output_symtab_xindex::do_write): New function.
16656 (Output_symtab_xindex::endian_do_write): New function.
16657 * output.h (class Output_section_headers): Add shstrtab_section_.
16658 Update declarations.
16659 (class Output_symtab_xindex): Define.
16660 (Output_section::has_out_shndx): New function.
16661 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
16662 field.
16663 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
16664 Change all callers.
16665 (Sized_symbol::init): Likewise.
16666 (Symbol::output_section): Check for ordinary symbol.
16667 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
16668 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
16669 callers.
16670 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
16671 Change all callers. Simplify handling of symbols from sections
16672 not included in the link.
16673 (Symbol_table::add_from_dynobj): Handle ordinary symbol
16674 distinction.
16675 (Weak_alias_sorter::operator()): Assert that symbols are
16676 ordinary.
16677 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
16678 distinction.
16679 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
16680 parameters. Change all callers.
16681 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
16682 symbol distinction. Use SHN_XINDEX when needed.
16683 (Symbol_table::write_section_symbol): Add symtab_xindex
16684 parameter. Change all callers.
16685 (Symbol_table::sized_write_section_symbol): Likewise. Use
16686 SHN_XINDEX when needed.
16687 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
16688 declarations.
16689 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
16690 (Symbol::is_defined): Check is_ordinary.
16691 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
16692 (Symbol::is_absolute, Symbol::is_common): Likewise.
16693 (class Sized_symbol): Update declarations.
16694 (class Symbol_table): Update declarations.
16695 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
16696 parameters. Change all callers.
16697 (Sized_symbol::override): Likewise.
16698 (Symbol_table::override): Likewise.
16699 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
16700 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
16701 is_ordinary, and orig_st_shndx parameters. Change all callers.
16702 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
16703 to be in an ordinary section.
16704 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
16705 object and is_ordinary parameters. Change all callers.
16706 (Sized_dwarf_line_info::read_relocs): Add object parameter.
16707 Change all callers. Don't add undefined or non-ordinary symbols
16708 to reloc_map_.
16709 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
16710 Change all callers.
16711 * dwarf_reader.h (class Sized_dwarf_line_info): Update
16712 declarations.
16713 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
16714 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
16715 (Sized_relobj::relocate_sections): Likewise.
16716 * target-reloc.h (scan_relocs): Adjust section symbol index.
16717 (scan_relocatable_relocs): Likewise.
16718 * i386.cc (Scan::local): Check for ordinary symbols.
16719 * sparc.cc (Scan::local): Likewise.
16720 * x86_64.cc (Scan::local): Likewise.
16721 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
16722 to symbol_section_and_value.
16723 * testsuite/many_sections_test.cc: New file.
16724 * testsuite/Makefile.am (BUILT_SOURCES): Define.
16725 (check_PROGRAMS): Add many_sections_test.
16726 (many_sections_test_SOURCES): Define.
16727 (many_sections_test_DEPENDENCIES): Define.
16728 (many_sections_test_LDFLAGS): Define.
16729 (BUILT_SOURCES): Add many_sections_define.h.
16730 (many_sections_define.h): New target.
16731 (BUILT_SOURCES): Add many_sections_check.h.
16732 (many_sections_check.h): New target.
16733 (check_PROGRAMS): Add many_sections_r_test.
16734 (many_sections_r_test_SOURCES): Define.
16735 (many_sections_r_test_DEPENDENCIES): Define.
16736 (many_sections_r_test_LDFLAGS): Define.
16737 (many_sections_r_test_LDADD): Define.
16738 (many_sections_r_test.o): New target.
16739 * testsuite/Makefile.in: Rebuild.
16740
c5818ff1
CC
167412008-04-17 Cary Coutant <ccoutant@google.com>
16742
16743 * errors.cc (Errors::info): New function.
16744 (gold_info): New function.
16745 * errors.h (Errors::info): New function.
16746 * gold.h (gold_info): New function.
16747 * object.cc (Input_objects::add_object): Print trace output.
16748 * options.cc (options::parse_set): New function.
16749 (General_options::parse_wrap): Deleted.
16750 (General_options::General_options): Deleted initializer.
16751 * options.h (options::String_set): New typedef.
16752 (options::parse_set): New function.
16753 (DEFINE_set): New macro.
16754 (General_options::wrap): Changed to use DEFINE_set. Changed
16755 callers of any_wrap_symbols and is_wrap_symbol.
16756 (General_options::trace, General_options::trace_symbol):
16757 New options.
16758 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
16759 (General_options::wrap_symbols_): Deleted.
16760 * symtab.cc (Symbol_table::add_from_object): Print trace output.
16761
b5be4a7c
DM
167622008-04-17 David S. Miller <davem@davemloft.net>
16763
16764 * options.cc (General_options::parse_V): New function.
16765 * options.h: Add entries for -V and -Qy.
16766
155a0dd7
ILT
167672008-04-17 Ian Lance Taylor <iant@google.com>
16768
16769 * common.cc (Symbol_table::allocate_commons): Remove options
16770 parameter. Change caller.
16771 (Symbol_table::do_allocate_commons): Remove options parameter.
16772 Change caller. Just call do_allocate_commons_list twice.
16773 (Symbol_table::do_allocate_commons_list): New function, broken out
16774 of do_allocate_commons.
16775 * common.h (class Allocate_commons_task): Remove options_ field.
16776 Update constructor.
16777 * symtab.cc (Symbol_table::Symbol_table): Initialize
16778 tls_commons_.
16779 (Symbol_table::add_from_object): Put TLS common symbols on
16780 tls_commons_ list.
16781 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
16782 which are IN_OUTPUT_DATA.
16783 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
16784 allocate_commons and do_allocate_commons declarations. Declare
16785 do_allocate_commons_list.
16786 * gold.cc (queue_middle_tasks): Update creation of
16787 Allocate_commons_task to not pass options.
16788 * testsuite/Makefile.am (INCLUDES): Add -I.. .
16789 (TLS_TEST_C_FLAGS): New variable.
16790 (tls_test_c_pic.o): New target.
16791 (tls_test_shared.so): Link in tls_test_c_pic.o.
16792 (tls_test_c_pic_ie.o): New target.
16793 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
16794 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
16795 (tls_test_c.o): New target.
16796 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
16797 (tls_pic_test_LDADD): Likewise.
16798 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
16799 (tls_shared_gd_to_ie_test_LDADD): Likewise.
16800 (tls_test_c_gnu2.o): New target.
16801 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
16802 tls_test_c_gnu2.o.
16803 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
16804 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
16805 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
16806 * testsuite/tls_test.cc: Include "config.h".
16807 (t_last): Call t11_last.
16808 * testsuite/tls_test.h (t11, t11_last): Declare.
16809 * testsuite/tls_test_c.c: New file.
16810 * testsuite/tls_test_main.cc (thread_routine): Call t11.
16811 * configure.ac: Check for OpenMP support.
16812 * configure, config.in, Makefile.in: Rebuild.
16813 * testsuite/Makefile.in: Rebuild.
16814
edfbb029
CC
168152008-04-16 Cary Coutant <ccoutant@google.com>
16816
16817 * i386.cc (Target_i386::define_tls_base_symbol): New function.
16818 (Target_i386::tls_base_symbol_defined_): New field.
16819 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
16820 (Target_i386::Scan::global): Likewise.
16821 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
16822 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
16823 (Target_x86_64::tls_base_symbol_defined_): New field.
16824 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
16825 (Target_x86_64::Scan::global): Likewise.
16826
f3c69fca
CC
168272008-04-16 Cary Coutant <ccoutant@google.com>
16828
16829 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
16830 (Symbol::needs_plt_entry): Allow weak undefined symbols.
16831 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
16832 building shared libraries.
16833 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
16834 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
16835 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
16836 * testsuite/Makefile.in: Rebuild.
16837 * testsuite/weak_undef.h: New file.
16838 * testsuite/weak_undef_file1.cc: Add extra test cases.
16839 * testsuite/weak_undef_file2.cc: Likewise.
16840 * testsuite/weak_undef_test.cc: Likewise.
16841
7c414435
DM
168422008-04-16 David S. Miller <davem@davemloft.net>
16843
32b769e1
DM
16844 * sparc.cc (Target_sparc::Scan): Change from struct to class.
16845 Add issued_non_pic_error_ field. Declare check_non_pic.
16846 (Target_sparc::Scan::check_non_pic): New function.
16847 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
16848 (Target_sparc::Scan::global): Likewise.
16849
11936fb1
DM
16850 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
16851 * configure: Rebuild.
16852
7c414435
DM
16853 * options.h (DEFINE_enable): New macro.
16854 (new_dtags): New enable option.
16855 (initfirst, interpose, loadfltr, nodefaultlib,
16856 nodelete, nodlopen, nodump): New -z options.
16857 * layout.cc (Layout:finish_dynamic_section): If new
16858 dtags enabled, emit DT_RUNPATH. Also, emit a
16859 DT_FLAGS_1 containing any specified -z flags.
16860
85c7bf8b
ILT
168612008-04-16 Ian Lance Taylor <iant@google.com>
16862
12c0daef
ILT
16863 * copy-relocs.cc: New file.
16864 * copy-relocs.h: New file.
16865 * reloc.cc: Remove Copy_relocs code.
16866 * reloc.h: Likewise.
16867 * reloc-types.h (struct Reloc_types) [both versions]: Add
16868 get_reloc_addend_noerror.
16869 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
16870 variants of add_global which take an addend which must be zero.
16871 * i386.cc: Include "copy-relocs.h".
16872 (class Target_i386): Change type of copy_relocs_ to variable,
16873 update initializer.
16874 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
16875 Change all callers.
16876 (Target_i386::do_finalize_sections): Change handling of
16877 copy_relocs_.
16878 * sparc.cc: Include "copy-relocs.h".
16879 (class Target_sparc): Change type of copy_relocs_ to variable,
16880 update initializer.
16881 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
16882 Change all callers.
16883 (Target_sparc::do_finalize_sections): Change handling of
16884 copy_relocs_.
16885 * x86_64.cc: Include "copy-relocs.h".
16886 (class Target_x86_64): Change type of copy_relocs_ to variable,
16887 update initializer.
16888 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
16889 class. Change all callers.
16890 (Target_x86_64::do_finalize_sections): Change handling of
16891 copy_relocs_.
16892 * Makefile.am (CCFILES): Add copy-relocs.cc.
16893 (HFILES): Add copy-relocs.h.
16894
4f4995b6
ILT
16895 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
16896
85c7bf8b
ILT
16897 * testsuite/script_test_4.sh: Permit leading zeroes.
16898
4f2a9edd
ILT
168992008-04-15 Ian Lance Taylor <iant@google.com>
16900
e6188289
ILT
16901 * script-sections.cc (Script_sections::create_segments): Use
16902 header_size_adjustment even when there is enough room for the
16903 headers.
16904 * testsuite/script_test_4.sh: New file.
16905 * testsuite/script_test_4.t: New file.
16906 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
16907 (check_DATA): Add script_test_4.stdout.
16908 (MOSTLYCLEANFILES): Likewise.
16909 (script_test_4): New target.
16910 (script_test_4.stdout): New target.
16911 * testsuite/Makefile.in: Rebuild.
16912
4f2a9edd
ILT
16913 * sparc.cc: Add definitions for Output_data_plt_sparc class
16914 constants.
16915
f5314dd5
DM
169162008-04-14 David S. Miller <davem@davemloft.net>
16917
16918 * sparc.cc: New file.
16919 * Makefile.am (TARGETSOURCES): Add sparc.cc
16920 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
16921 * configure.tgt: Document targ_extra_size and
16922 targ_extra_big_endian. Add entries for sparc-* and
16923 sparc64-*.
16924 * configure.ac: Handle targ_extra_size and
16925 targ_extra_big_endian.
16926 * Makefile.in: Rebuild.
16927 * configure: Likewise.
16928 * po/POTFILES.in: Likewise.
16929 * po/gold.pot: Likewise.
16930
154e0e9a
ILT
169312008-04-14 Ian Lance Taylor <iant@google.com>
16932
16933 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
16934 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
16935 in the name/type/flags to section mapping. Don't call
16936 allocate_output_section.
16937 (Layout::choose_output_section): Change parameter from adjust_name
16938 to is_input_section. Don't permit input sections after sections
16939 are attached to segments. Don't call allocate_output_section.
16940 (Layout::layout_eh_frame): Call update_flags_for_input_section,
16941 not write_enable_output_section.
16942 (Layout::make_output_section): Don't push to
16943 unattached_section_list_ nor call attach_to_segment. Call
16944 attach_section_to_segment if sections are attached.
16945 (Layout::attach_sections_to_segments): New function.
16946 (Layout::attach_section_to_segment): New function.
16947 (Layout::attach_allocated_section_to_segment): Rename from
16948 attach_to_segment. Remove flags parameter.
16949 (Layout::allocate_output_section): Remove function.
16950 (Layout::write_enable_output_section): Remove function.
16951 * layout.h (class Layout): Update for above changes. Add new
16952 field sections_are_attached_.
16953 * output.h (Output_section::update_flags_for_input_section): New
16954 function.
16955 * output.cc (Output_section::add_input_section): Call
16956 update_flags_for_input_section.
16957 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
16958
009a67a2
CC
169592008-04-11 Cary Coutant <ccoutant@google.com>
16960
16961 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
16962 thought unnecessary.
16963 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
16964
759b1a24
ILT
169652008-04-11 Ian Lance Taylor <iant@google.com>
16966
16967 * output.h (class Output_section_data): Remove inline definition
16968 of set_addralign.
16969 * output.cc (Output_section_data::set_addralign): New function.
16970
c2b45e22
CC
169712008-04-11 Cary Coutant <ccoutant@google.com>
16972
16973 Add support for TLS descriptors for i386 and x86_64.
16974 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
16975 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
16976 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
16977 GOT_TYPE_TLS_DESC.
16978 (Target_i386::got_mod_index_entry): Remove unnecessary code.
16979 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
16980 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
16981 relocations.
16982 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
16983 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
16984 Fix problem with initial-exec relocations.
16985 (Target_i386::Relocate::relocate_tls): Likewise.
16986 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
16987 relaxation.
16988 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
16989 support for section-plus-offset dynamic table entries.
16990 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
16991 (Output_data_dynamic::Dynamic_entry): Add support for
16992 section-plus-offset dynamic table entries.
16993 (Output_data_dynamic::Classification): Likewise.
16994 (Output_data_dynamic::classification_): Renamed offset_.
16995 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
16996 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
16997 (Target_x86_64::make_plt_section): New function.
16998 (Target_x86_64::reserve_tlsdesc_entries): New function.
16999 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
17000 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
17001 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
17002 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
17003 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
17004 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
17005 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
17006 add extra PLT entry for TLS descriptors.
17007 (Output_data_plt_x86_64::got_): New field.
17008 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
17009 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
17010 fields.
17011 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
17012 descriptors.
17013 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
17014 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
17015 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
17016 R_386_TLS_DESC_CALL relocations.
17017 (Target_x86_64::Scan::global): Likewise.
17018 (Target_x86_64::do_finalize_sections): Add dynamic table entries
17019 for TLS descriptors.
17020 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
17021 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
17022 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
17023 GD-to-IE relaxation.
17024 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
17025 and TLS_DESCRIPTORS.
17026 * Makefile.in: Rebuild.
17027 * configure: Rebuild.
17028 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
17029 (tls_test_shared2.so): New target.
17030 (tls_shared_gd_to_ie_test_SOURCES): New variable.
17031 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
17032 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
17033 (tls_shared_gd_to_ie_test_LDADD): New variable.
17034 (tls_shared_gnu2_gd_to_ie_test): New target.
17035 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
17036 New targets.
17037 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
17038 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
17039 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
17040 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
17041 (tls_shared_gnu2_test): New target.
17042 (tls_test_gnu2_shared.so): New target.
17043 (tls_shared_gnu2_test_SOURCES): New variable.
17044 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
17045 (tls_shared_gnu2_test_LDFLAGS): New variable.
17046 (tls_shared_gnu2_test_LDADD): New variable.
17047 * testsuite/Makefile.in: Rebuild.
17048 * testsuite/Makefile.
17049
83bfb6b7
ILT
170502008-04-11 Ian Lance Taylor <iant@google.com>
17051
17052 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
17053 justsyms.t.
17054 * testsuite/Makefile.in: Rebuild.
17055
17056 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
17057 long.
17058 * testsuite/script_test_2.cc (main): Adjust test.
17059
706e1f5e
ILT
170602008-04-11 David S. Miller <davem@davemloft.net>
17061 Ian Lance Taylor <iant@google.com>
17062
17063 * options.h (General_options): Add entries for '-Y' and
17064 '-relax'.
17065 * options.cc (General_options:finalize): If -Y was used, add those
17066 entries to the library path instead of the default "/lib" and
17067 "/usr/lib".
17068
7c98e6bb
DM
170692008-04-11 David S. Miller <davem@davemloft.net>
17070
17071 * testsuite/justsyms.t: Start at 0x100.
17072 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
17073 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
17074 long.
17075 * testsuite/script_test_2.cc: Adjust string and section length
17076 checks.
7c98e6bb 17077
99a37bfd
ILT
170782008-04-09 Ian Lance Taylor <iant@google.com>
17079
2cefc357
ILT
17080 PR gold/5996
17081 * script-sections.cc (Sections_element::allocate_to_segment): Add
17082 orphan parameter.
17083 (Output_section_definition::allocate_to_segment): Likewise.
17084 (Orphan_output_section::allocate_to_segment): Likewise.
17085 (Script_sections::attach_sections_using_phdrs_clause): Don't
17086 propagate non-PT_LOAD segments to orphan sections.
17087 * testsuite/Makefile.am (script_test_3.stdout): Generate using
17088 readelf rather than objdump.
17089 * testsuite/script_test_3.sh: Adjust accordingly. Test that
17090 .interp section and PT_INTERP segment are the same size.
17091 * testsuite/Makefile.in: Rebuild.
17092
99a37bfd
ILT
17093 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
17094 aliases for symbols defined in the same object.
17095 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
17096 (weak_alias_test_SOURCES): New variable.
17097 (weak_alias_test_DEPENDENCIES): New variable.
17098 (weak_alias_test_LDFLAGS): New variable.
17099 (weak_alias_test_LDADD): New variable.
17100 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
17101 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
17102 (weak_alias_test_3.o): New target.
17103 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
17104 * testsuite/weak_alias_test_main.cc: New file.
17105 * testsuite/weak_alias_test_1.cc: New file.
17106 * testsuite/weak_alias_test_2.cc: New file.
17107 * testsuite/weak_alias_test_3.cc: New file.
17108
780e49c5
ILT
171092008-04-08 Ian Lance Taylor <iant@google.com>
17110
cdb0b8f5
ILT
17111 * options.h (class General_options): Add --noinhibit-exec option.
17112 * main.cc (main): Check --noinhibit-exec.
17113
0864d551
ILT
17114 * options.h (class General_options): Define --wrap as a special
17115 option. Add wrap_symbols_ field.
17116 (General_options::any_wrap_symbols): New function.
17117 (General_options::is_wrap_symbol): New function.
17118 * options.cc (General_options::parse_wrap): New function.
17119 (General_options::General_options): Initialize wrap_symbols_.
17120 * symtab.cc (Symbol_table::wrap_symbol): New function.
17121 (Symbol_table::add_from_object): Handle --wrap.
17122 * symtab.h (class Symbol_table): Declare wrap_symbol.
17123 * target.h (Target::wrap_char): New function.
17124 (Target::Target_info): Add wrap_char field.
17125 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
17126 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
17127 * testsuite/testfile.cc (Target_test::test_target_info):
17128 Likewise.
17129
789aa6de
ILT
17130 * errors.cc (Errors::undefined_symbol): Mention symbol version if
17131 there is one.
17132
2c38906f
ILT
17133 * layout.h (class Layout): Add added_eh_frame_data_ field.
17134 * layout.cc (Layout::Layout): Initialize new field.
17135 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
17136 output section until we find a section we merged successfully.
17137 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
17138 that the size be non-zero.
17139
780e49c5
ILT
17140 * merge.cc (Object_merge_map::get_output_offset): Remove inline
17141 qualifier.
17142
7fcd0256
ILT
171432008-04-08 Craig Silverstein <csilvers@google.com>
17144
17145 * configure.ac: Export new conditional variable HAVE_ZLIB.
17146 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
17147 on HAVE_ZLIB.
17148 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
17149 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17150
6835af53
ILT
171512008-04-07 Ian Lance Taylor <iant@google.com>
17152
e24f324c
ILT
17153 * version.cc (version_string): Set to "1.5".
17154
a036edd8
ILT
17155 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
17156 Add issued_non_pic_error_ field. Declare check_non_pic.
17157 (Target_x86_64::Scan::check_non_pic): New function.
17158 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
17159 (Target_x86_64::Scan::global): Likewise.
17160
624f8810
ILT
17161 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
17162 addend parameter. Change caller. Handle merge sections.
17163 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
17164 Address to Addend. Don't add in the result of
17165 local_section_offset, pass down the addend and use the returned
17166 value.
17167 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
17168 Update declarations of local_section_offset and symbol_value.
17169 * testsuite/two_file_test_1.cc (t18): New function.
17170 * testsuite/two_file_test_2.cc (f18): New function.
17171 * testsuite/two_file_test_main.cc (main): Call t18.
17172 * testsuite/two_file_test.h (t18, f18): Declare.
17173
6835af53
ILT
17174 * configure.ac: Don't test for objdump, c++filt, or readelf.
17175 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
17176 conditionals.
17177 (TEST_READELF): New variable.
17178 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
17179 (check_PROGRAMS): Add two_file_strip_test.
17180 (two_file_strip_test): New target.
17181 (check_PROGRAMS): Add two_file_same_shared_strip_test.
17182 (two_file_same_shared_strip_test_SOURCES): New variable.
17183 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
17184 (two_file_same_shared_strip_test_LDFLAGS): New variable.
17185 (two_file_same_shared_strip_test_LDADD): New variable.
17186 (two_file_shared_strip.so): New target.
17187 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
17188 (ver_test_5.syms, ver_test_7.syms): Likewise.
17189 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
17190 (strip_test_3.stdout): Use TEST_OBJDUMP.
17191 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17192
86925eef
CC
171932008-04-04 Cary Coutant <ccoutant@google.com>
17194
17195 * symtab.h (Symbol::is_weak_undefined): New function.
17196 (Symbol::is_strong_undefined): New function.
17197 (Symbol::is_absolute): New function.
17198 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
17199 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
17200 absolute symbols.
17201 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
17202 (weak_undef_test): New target.
17203 * testsuite/Makefile.in: Rebuild.
17204 * testsuite/weak_undef_file1.cc: New file.
17205 * testsuite/weak_undef_file2.cc: New file.
17206 * testsuite/weak_undef_test.cc: New file.
17207
126f3ece
ILT
172082008-04-03 Craig Silverstein <csilvers@google.com>
17209
17210 * compressed_output.h (class Output_compressed_section): Use
17211 unsigned buffer.
17212 * compressed_output.cc (zlib_compress): Use unsigned buffers,
17213 add zlib header.
17214 (zlib_compressed_suffix): Removed.
17215 (Output_compressed_section::set_final_data_size): Use unsigned
17216 buffers.
17217 * testsuite/Makefile.am (flagstest_compress_debug_sections):
17218 Fix linker invocation.
17219 (flagstest_o_specialfile_and_compress_debug_sections):
17220 Likewise.
17221 * testsuite/Makefile.in: Regenerated.
17222
deae2a14
DM
172232008-04-02 David S. Miller <davem@davemloft.net>
17224
17225 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
17226 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
17227
70752818
ILT
172282008-04-02 Craig Silverstein <csilvers@google.com>
17229
17230 * TODO: New file.
17231
39d0cb0e
ILT
172322008-04-02 Ian Lance Taylor <iant@google.com>
17233
17234 * fileread.cc (File_read::find_view): Add byteshift and vshifted
17235 parameters. Update for new key type to views_. Change all
17236 callers.
17237 (File_read::read): Adjust for byteshift in returned view.
17238 (File_read::add_view): New function, broken out of
17239 find_and_make_view.
17240 (File_read::make_view): New function, broken out of
17241 find_and_make_view.
17242 (File_read::find_or_make_view): Add offset and aligned
17243 parameters. Rewrite accordingly. Change all callers.
17244 (File_read::get_view): Add offset and aligned parameters. Adjust
17245 for byteshift in return value.
17246 (File_read::get_lasting_view): Likewise.
17247 * fileread.h (class File_read): Update declarations.
17248 (class File_read::View): Add byteshift_ field. Add byteshift to
17249 constructor. Add byteshift method.
17250 * archive.h (Archive::clear_uncached_views): New function.
17251 (Archive::get_view): Add aligned parameter. Change all callers.
17252 * object.h (Object::get_view): Add aligned parameter. Change all
17253 callers.
17254 (Object::get_lasting_view): Likewise.
17255
17256 * fileread.cc (File_read::release): Don't call clear_views if
17257 there are multiple objects.
17258 * fileread.h (File_read::clear_uncached_views): New function.
17259 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
17260 on the archive.
17261
a1207466
CC
172622008-03-31 Cary Coutant <ccoutant@google.com>
17263
17264 Add thin archive support.
17265 * archive.cc (Archive::armagt): New const.
17266 (Archive::setup): Remove task parameter and calls to unlock.
17267 (Archive::unlock_nested_archives): New function.
17268 (Archive::read_header): Add nested_off parameter. Change
17269 all callers.
17270 (Archive::interpret_header): Likewise.
17271 (Archive::include_all_members): Change to handle thin
17272 archives.
17273 (Archive::include_member): Likewise.
17274 * archive.h (Archive::Archive): Add new parameters and
17275 initializers.
17276 (Archive::armagt): New const.
17277 (Archive::setup): Remove task parameter.
17278 (Archive::unlock_nested_archives): New function.
17279 (Archive::read_header): Add nested_off parameter.
17280 (Archive::interpret_header): Likewise.
17281 (Archive::Nested_archive_table): New typedef.
17282 (Archive::is_thin_archive_): New field.
17283 (Archive::nested_archives_): New field.
17284 (Archive::options_): New field.
17285 (Archive::dirpath_): New field.
17286 (Archive::task_): New field.
17287 * readsyms.cc (Read_symbols::do_read_symbols): Add check
17288 for thin archives. Pass additional parameters to
17289 Archive::Archive. Unlock the archive file after calling
17290 Archive::setup.
cd536b21 17291
479f6503
ILT
172922008-03-29 Ian Lance Taylor <iant@google.com>
17293
686c8caf
ILT
17294 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
17295 version symbol to be local.
17296 * testsuite/ver_test_4.sh: New file.
17297 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
17298 (check_DATA): Add ver_test_4.syms.
17299 (ver_test_4.syms): New target.
17300 * testsuite/Makefile.in: Rebuild.
17301
ab794b6b
ILT
17302 * output.cc
17303 (Output_section::Input_section_sort_entry::has_priority): New
17304 function.
17305 (Output_section::Input_section_sort_entry::match_file_name): New
17306 function.
17307 (Output_section::Input_section_sort_entry::match_section_name):
17308 Remove.
17309 (Output_section::Input_section_sort_entry::match_section_name_prefix):
17310 Remove.
17311 (Output_section::Input_section_sort_entry::match_section_file):
17312 Remove.
17313 (Output_section::Input_section_sort_compare::operator()): Rewrite
17314 using new Input_section_sort_entry functions. Sort crtbegin and
17315 crtend first. Sort sections with no priority before sections with
17316 a priority.
17317 * testsuite/initpri1.c (d3): Check j != 4.
17318 (cd5): New constructor/destructor function.
17319 (main): Check j != 2.
17320
479f6503
ILT
17321 * symtab.cc (Symbol_table::add_from_object): If we don't use the
17322 new symbol when resolving, don't call set_is_default.
17323 * testsuite/ver_test_7.cc: New file.
17324 * testsuite/ver_test_7.sh: New file.
17325 * testsuite/Makefile.am (ver_test_7.so): New target.
17326 (ver_test_7.o): New target.
17327 (check_SCRIPTS): Add ver_test_7.sh.
17328 (check_DATA): Add ver_test_7.syms.
17329 (ver_test_7.syms): New target.
17330
2fd32231
ILT
173312008-03-28 Ian Lance Taylor <iant@google.com>
17332
17333 * layout.cc (Layout::layout): If we see an input section with a
17334 name that needs sorting, set the must_sort flag for the output
17335 section.
17336 (Layout::make_output_section): If the name of the output section
17337 indicates that it might require sorting, set the may_sort flag.
17338 * output.h (Output_section::may_sort_attached_input_sections): New
17339 function.
17340 (Output_section::set_may_sort_attached_input_sections): New
17341 function.
17342 (Output_section::must_sort_attached_input_sections): New
17343 function.
17344 (Output_section::set_must_sort_attached_input_sections): New
17345 function.
17346 (class Output_section): Declare Input_section_sort_entry. Define
17347 Input_section_sort_compare. Declare
17348 sort_attached_input_sections. Add new fields:
17349 may_sort_attached_input_sections_,
17350 must_sort_attached_input_sections_,
17351 attached_input_sections_are_sorted_.
17352 * output.cc (Output_section::Output_section): Initialize new
17353 fields.
17354 (Output_section::add_input_section): Add an entry to
17355 input_sections_ if may_sort or must_sort are true.
17356 (Output_section::set_final_data_size): Call
17357 sort_attached_input_sections if necessary.
17358 (Output_section::Input_section_sort_entry): Define new class.
17359 (Output_section::Input_section_sort_compare::operator()): New
17360 function.
17361 (Output_section::sort_attached_input_sections): New function.
17362 * configure.ac: Check whether the compiler supports constructor
17363 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
17364 * testsuite/initpri1.c: New file.
17365 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
17366 CONSTRUCTOR_PRIORITY.
17367 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
17368 (initpri1_LDFLAGS): New variable.
17369 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17370
18e6b24e
ILT
173712008-03-27 Ian Lance Taylor <iant@google.com>
17372
49bdd526
ILT
17373 * common.cc (Sort_commons::operator): Correct sorting algorithm.
17374 * testsuite/common_test_1.c: New file.
17375 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
17376 (common_test_1_SOURCES): New variable.
17377 (common_test_1_DEPENDENCIES): New variable.
17378 (common_test_1_LDFLAGS): New variable.
17379
18e6b24e
ILT
17380 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
17381 and commons_ correctly when NAME/VERSION does not override
17382 NAME/NULL.
17383 * testsuite/ver_test_6.c: New file.
17384 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
17385 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
17386 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
17387
04bf7072
ILT
173882008-03-26 Ian Lance Taylor <iant@google.com>
17389
5871526f
ILT
17390 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
17391 of an undefined symbol from a version script.
17392 * testsuite/Makefile.am (ver_test_5.so): New target.
17393 (ver_test_5.o): New target.
17394 (check_SCRIPTS): Add ver_test_5.sh.
17395 (check_DATA): Add ver_test_5.syms.
17396 (ver_test_5.syms): New target.
17397 * testsuite/ver_test_5.cc: New file.
17398 * testsuite/ver_test_5.script: New file.
17399 * testsuite/ver_test_5.sh: New file.
17400 * Makefile.in, testsuite/Makefile.in: Rebuild.
17401
04bf7072
ILT
17402 PR gold/5986
17403 Fix problems building gold with gcc 4.3.0.
17404 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
17405 (gold_error_at_location, gold_warning_at_location): Use it.
17406 * configure.ac: Check whether we can compile and use a template
17407 function with a printf attribute.
17408 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
17409 when jumping over bytes.
17410 * object.cc: Instantiate Object::read_section_data.
17411 * debug.h: Include <cstring>
17412 * dwarf_reader.cc: Include <algorithm>
17413 * main.cc: Include <cstring>.
17414 * options.cc: Include <cstring>.
17415 * output.cc: Include <cstring>.
17416 * script.cc: Include <cstring>.
17417 * script.h: Include <string>.
17418 * symtab.cc: Include <cstring> and <algorithm>.
17419 * target-select.cc: Include <cstring>.
17420 * version.cc: Include <string>.
17421 * testsuite/testmain.cc: Include <cstdlib>.
17422 * configure, config.in: Rebuild.
17423
874c5b28
ILT
174242008-03-25 Ian Lance Taylor <iant@google.com>
17425
819d6c3a
ILT
17426 * options.cc: Include "../bfd/bfdver.h".
17427 (options::help): Print bug reporting address.
17428
f4b2c6f5
ILT
17429 * version.cc (print_version): Adjust output for current value of
17430 BFD_VERSION_STRING.
17431
17432 * NEWS: New file.
17433
e96caa79
ILT
17434 * options.cc (options::help): Print list of supported targets.
17435 * target-select.h: Include <vector>.
17436 (class Target_selector): Make machine_, size_, and is_big_endian_
17437 fields const. Add bfd_name_ and instantiated_target_ fields.
17438 (Target_selector::Target_selector): Add bfd_name parameter.
17439 (Target_selector::recognize): Make non-virtual, call
17440 do_recognize.
17441 (Target_selector::recognize_by_name): Make non-virtual, call
17442 do_recognize_by_name.
17443 (Target_selector::supported_names): New function.
17444 (Target_selector::bfd_name): New function.
17445 (Target_selector::do_instantiate_target): New pure virtual
17446 function.
17447 (Target_selector::do_recognize): New virtual function.
17448 (Target_selector::do_recognize_by_name): New virtual function.
17449 (Target_selector::instantiate_target): New private function.
17450 (supported_target_names): Declare.
17451 * target-select.cc (Target_selector::Target_selector): Update for
17452 new parameter and fields.
17453 (select_target_by_name): Check that the name matches before
17454 calling recognize_by_name.
17455 (supported_target_names): New function.
17456 * i386.cc (class Target_selector_i386): Update Target_selector
17457 constructor call. Remove recognize and recognize_by_name. Add
17458 do_instantiate_target.
17459 * x86_64.cc (class Target_selector_x86_64): Likewise.
17460 * testsuite/testfile.cc (class Target_selector_test): Update for
17461 changes to Target_selector.
17462
874c5b28
ILT
17463 * README: Rewrite, with some notes on unsupported features.
17464
0a65a3a7
CC
174652008-03-24 Cary Coutant <ccoutant@google.com>
17466
17467 * i386.cc (Target_i386::Got_type): New enum declaration.
17468 (Target_i386::Scan::local): Updated callers of Output_data_got
17469 member functions.
17470 (Target_i386::Scan::global): Likewise.
17471 (Target_i386::Relocate::relocate): Likewise.
17472 (Target_i386::Relocate::relocate_tls): Likewise.
17473 * object.h (Got_offset_list): New class.
17474 (Sized_relobj::local_has_got_offset): Added got_type parameter.
17475 (Sized_relobj::local_got_offset): Likewise.
17476 (Sized_relobj::set_local_got_offset): Likewise.
17477 (Sized_relobj::local_has_tls_got_offset): Removed.
17478 (Sized_relobj::local_tls_got_offset): Removed.
17479 (Sized_relobj::set_local_tls_got_offset): Removed.
17480 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
17481 * output.cc (Output_data_got::add_global): Added got_type parameter.
17482 (Output_data_got::add_global_with_rel): Likewise.
17483 (Output_data_got::add_global_with_rela): Likewise.
17484 (Output_data_got::add_global_pair_with_rel): New function.
17485 (Output_data_got::add_global_pair_with_rela): New function.
17486 (Output_data_got::add_local): Added got_type parameter.
17487 (Output_data_got::add_local_with_rel): Likewise.
17488 (Output_data_got::add_local_with_rela): Likewise.
17489 (Output_data_got::add_local_pair_with_rel): New function.
17490 (Output_data_got::add_local_pair_with_rela): New function.
17491 (Output_data_got::add_global_tls): Removed.
17492 (Output_data_got::add_global_tls_with_rel): Removed.
17493 (Output_data_got::add_global_tls_with_rela): Removed.
17494 (Output_data_got::add_local_tls): Removed.
17495 (Output_data_got::add_local_tls_with_rel): Removed.
17496 (Output_data_got::add_local_tls_with_rela): Removed.
17497 * output.h (Output_data_got::add_global): Added got_type parameter.
17498 (Output_data_got::add_global_with_rel): Likewise.
17499 (Output_data_got::add_global_with_rela): Likewise.
17500 (Output_data_got::add_global_pair_with_rel): New function.
17501 (Output_data_got::add_global_pair_with_rela): New function.
17502 (Output_data_got::add_local): Added got_type parameter.
17503 (Output_data_got::add_local_with_rel): Likewise.
17504 (Output_data_got::add_local_with_rela): Likewise.
17505 (Output_data_got::add_local_pair_with_rel): New function.
17506 (Output_data_got::add_local_pair_with_rela): New function.
17507 (Output_data_got::add_global_tls): Removed.
17508 (Output_data_got::add_global_tls_with_rel): Removed.
17509 (Output_data_got::add_global_tls_with_rela): Removed.
17510 (Output_data_got::add_local_tls): Removed.
17511 (Output_data_got::add_local_tls_with_rel): Removed.
17512 (Output_data_got::add_local_tls_with_rela): Removed.
17513 * resolve.cc (Symbol::override_base_with_special): Removed
17514 reference to has_got_offset_ field.
17515 * symtab.cc (Symbol::init_fields): Replaced initialization
17516 of got_offset_ with got_offsets_. Removed initialization
17517 of has_got_offset_
53fcba31 17518 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
17519 (Symbol::got_offset): Likewise.
17520 (Symbol::set_got_offset): Likewise.
17521 (Symbol::has_tls_got_offset): Removed.
17522 (Symbol::tls_got_offset): Removed.
17523 (Symbol::set_tls_got_offset): Removed.
17524 (Symbol::got_offset_): Removed.
17525 (Symbol::tls_mod_got_offset_): Removed.
17526 (Symbol::tls_pair_got_offset_): Removed.
17527 (Symbol::got_offsets_): New field.
17528 (Symbol::has_got_offset): Removed.
17529 (Symbol::has_tls_mod_got_offset): Removed.
17530 (Symbol::has_tls_pair_got_offset): Removed.
17531 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
17532 (Target_x86_64::Scan::local): Updated callers of Output_data_got
17533 member functions.
17534 (Target_x86_64::Scan::global): Likewise.
17535 (Target_x86_64::Relocate::relocate): Likewise.
17536 (Target_x86_64::Relocate::relocate_tls): Likewise.
17537
bd52eafb
BE
175382008-03-25 Ben Elliston <bje@au.ibm.com>
17539
17540 * yyscript.y: Fix spelling error in comment.
17541
8b105e34
ILT
175422008-03-24 Ian Lance Taylor <iant@google.com>
17543
8ed814a9
ILT
17544 * options.h (class General_options): Define build_id option.
17545 * layout.h (class Layout): Declare write_build_id, create_note,
17546 create_build_id. Add build_id_note_ member.
17547 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
17548 "libiberty.h", "md5.h", "sha1.h".
17549 (Layout::Layout): Initialize eh_frame_data_,
17550 eh_frame_hdr_section_, and build_id_note_.
17551 (Layout::finalize): Call create_build_id.
17552 (Layout::create_note): New function, broken out of
17553 Layout::create_gold_note.
17554 (Layout::create_gold_note): Call create_note.
17555 (Layout::create_build_id): New function.
17556 (Layout::write_build_id): New function.
17557 (Close_task_runner::run): Call write_build_id.
17558
8b105e34
ILT
17559 * x86_64.cc: Correct license to GPLv3.
17560
086a1841
ILT
175612008-03-23 Ian Lance Taylor <iant@google.com>
17562
17563 * options.cc: Include "demangle.h".
17564 (parse_optional_string): New function.
17565 (parse_long_option): Handle takes_optional_argument.
17566 (parse_short_option): Update dash_z initializer. Handle
17567 takes_optional_argument.
17568 (General_options::General_options): Initialize do_demangle_.
17569 (General_options::finalize): Set do_demangle_. Handle demangling
17570 style.
17571 * options.h (parse_optional_string): Declare.
17572 (struct One_option): Add optional_arg field. Update constructor.
17573 Update call constructor calls. Add takes_optional_argument
17574 function.
17575 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
17576 (DEFINE_optional_string): Define.
17577 (General_options::demangle): Change from DEFINE_bool to
17578 DEFINE_optional_string.
17579 (General_options::no_demangle): New function.
17580 (General_options::do_demangle): New function.
17581 (General_options::set_do_demangle): New function.
17582 (General_options::execstack_status_): Move definition to end of
17583 class definition.
17584 (General_options::static_): Likewise.
17585 (General_options::do_demangle_): New field.
17586 * object.cc (big_endian>::get_symbol_location_info): Call
17587 Options::do_demangle, not Options::demangle.
17588 * symtab.cc (demangle): Likewise.
17589
cbb93e63
ILT
175902008-03-22 Ian Lance Taylor <iant@google.com>
17591
17592 * gold.h: Include <cstddef> and <sys/types.h>
17593 * options.h: Include <cstring>.
17594
ec531623
ILT
175952008-03-21 Ian Lance Taylor <iant@google.com>
17596
17597 * Added source code to GNU binutils.
752937aa 17598\f
b90efa5b 17599Copyright (C) 2008-2015 Free Software Foundation, Inc.
752937aa
NC
17600
17601Copying and distribution of this file, with or without modification,
17602are permitted in any medium without royalty provided the copyright
17603notice and this notice are preserved.
17604
17605Local Variables:
17606mode: change-log
17607left-margin: 8
17608fill-column: 74
17609version-control: never
17610End:
This page took 1.166115 seconds and 4 git commands to generate.