Fix ppc64 ELFv1 assertion failure
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
f945ba50
AM
12015-07-22 Alan Modra <amodra@gmail.com>
2
3 * aarch64.cc (try_fix_erratum_843419_optimized): Warning fix.
4
5417c94d
CC
52015-07-21 Cary Coutant <ccoutant@gmail.com>
6
7 PR gold/18548
8 * symtab.cc (Symbol_table::do_define_in_output_data): Check for
9 forced local symbol even when oldsym != NULL.
10 (Symbol_table::do_define_in_output_segment): Likewise.
11 (Symbol_table::do_define_as_constant): Likewise.
12
cb5cf5e2
CC
132015-07-21 Cary Coutant <ccoutant@gmail.com>
14
b8c6c5ef 15 PR gold/18698
cb5cf5e2
CC
16 * archive.cc (Library_base::should_include_member): Don't use entry
17 point for relocatable links, or if target is not yet valid.
18 * parameters.cc (Parameters::entry): Check target_valid().
19
0ef3814f
HS
202015-07-20 Han Shen <shenhan@google.com>
21
22 Optimize erratum 843419 fix.
23
24 * aarch64.cc (AArch64_insn_utilities::is_adr): New method.
25 (AArch64_insn_utilities::aarch64_adr_encode_imm): New method.
26 (AArch64_insn_utilities::aarch64_adrp_decode_imm): New method.
27 (E843419_stub): New sub-class of Erratum_stub.
28 (AArch64_relobj::try_fix_erratum_843419_optimized): New method.
29 (AArch64_relobj::section_needs_reloc_stub_scanning): Try optimized fix.
30 (AArch64_relobj::create_erratum_stub): Add 1 argument.
31 (Target_aarch64::scan_erratum_843419_span): Pass in adrp insn offset.
32
2bca0377
HS
332015-07-20 Han Shen <shenhan@google.com>
34
35 Fix arm elf header flags wrt hardfp bit.
36
37 * arm.cc (Target_arm::do_adjust_elf_header): Set flags into view.
38
f54f5e31
L
392015-07-20 H.J. Lu <hongjiu.lu@intel.com>
40
41 PR gold/18689
42 * layout.cc (Layout::layout): Clear the SHF_COMPRESSED flag bit
43 from input group section for relocatable link.
44 * testsuite/Makefile.am (check_SCRIPTS): Add pr18689.sh.
45 (check_DATA): Add pr18689.stdout.
46 (MOSTLYCLEANFILES): Add pr18689a.o pr18689b.o.
47 (pr18689.stdout): New rule.
48 (pr18689a.o): Likewise.
49 (pr18689b.o): Likewise.
50 (pr18689.o): Likewise.
51 * testsuite/pr18689.c: New file.
52 * testsuite/pr18689.sh: Likewise.
53 * testsuite/Makefile.in: Regenerated.
54
c20ceeb2
YW
552015-07-20 Yiran Wang <yiran@google.com>
56 Cary Coutant <ccoutant@gmail.com>
57
58 PR gold/15574
59 * resolve.cc (Symbol_table): Remove warning about references
60 from shared objects to hidden symbols.
61 * testsuite/Makefile.am (hidden_test): Add hidden_test.syms.
62 * testsuite/Makefile.in: Regenerate.
63 * testsuite/hidden_test.sh: Check dynamic symbol table; update
64 expected error messages.
65
19a7fe52
L
662015-07-14 H.J. Lu <hongjiu.lu@intel.com>
67
68 * compressed_output.cc (Output_compressed_section::set_final_data_size):
69 Make --compress-debug-sections=zlib the same as
70 --compress-debug-sections=zlib-gabi.
71 * testsuite/Makefile.am (flagstest_compress_debug_sections.check):
72 Expect ".debug_.*" with the SHF_COMPRESSED bit, instead of
73 ".zdebug_".
74 * testsuite/Makefile.in: Regenerated.
75
fb8b9dbc
L
762015-07-12 H.J. Lu <hongjiu.lu@intel.com>
77
78 PR gold/18322
79 * compressed_output.cc (zlib_compress): Add argument for
80 compression header size. Set header size to compression header
81 size if it isn't 0. Don't write out the zlib header here.
82 (Output_compressed_section::set_final_data_size): Support
83 zlib-gnu and zlib-gabi compressions. Pass compression header
84 size to zlib_compress and write out compression header. Set
85 the SHF_COMPRESSED bit for zlib-gabi compression. Otherwise
86 clear the SHF_COMPRESSED bit
87 * options.h (compress_debug_sections): Add zlib-gnu and
88 zlib-gabi.
89 * output.h (Output_section::set_flags): New.
90 * testsuite/Makefile.am (check_PROGRAMS): Add
91 flagstest_compress_debug_sections_none,
92 flagstest_compress_debug_sections_gnu and
93 flagstest_compress_debug_sections_gabi.
94 (check_DATA): Add flagstest_compress_debug_sections_none.stdout.
95 flagstest_compress_debug_sections.stdout,
96 flagstest_compress_debug_sections.cmp,
97 flagstest_compress_debug_sections.check,
98 flagstest_compress_debug_sections_gnu.stdout,
99 flagstest_compress_debug_sections_gnu.cmp,
100 flagstest_compress_debug_sections_gnu.check,
101 flagstest_compress_debug_sections_gabi.stdout,
102 flagstest_compress_debug_sections_gabi.cmp and
103 flagstest_compress_debug_sections_gabi.check.
104 (flagstest_compress_debug_sections_none): New.
105 (flagstest_compress_debug_sections_none.stdout): Likewise.
106 (flagstest_compress_debug_sections.stdout): Likewise.
107 (flagstest_compress_debug_sections.check): Likewise.
108 (flagstest_compress_debug_sections.cmp): Likewise.
109 (flagstest_compress_debug_sections_gnu): Likewise.
110 (flagstest_compress_debug_sections_gnu.stdout): Likewise.
111 (flagstest_compress_debug_sections_gnu.check): Likewise.
112 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
113 (flagstest_compress_debug_sections_gabi): Likewise.
114 (flagstest_compress_debug_sections_gabi.stdout): Likewise.
115 (flagstest_compress_debug_sections_gnu.check): Likewise.
116 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
117 * testsuite/Makefile.in: Regenerated.
118
48058663
L
1192015-07-12 H.J. Lu <hongjiu.lu@intel.com>
120
121 PR gold/18321
122 * compressed_output.h (decompress_input_section): Add arguments
123 for ELF class, big endian and sh_flags.
124 * compressed_output.cc (decompress_input_section): Likewise.
125 Support the SHF_COMPRESSED section.
126 * dynobj.h (Dynobj): Add elfsize and is_big_endian member
127 functions.
128 * plugin.h (Pluginobj): Likewise.
129 * layout.cc (Layout::get_output_section_flags): Also clear the
130 SHF_COMPRESSED bit.
131 * object.h (Compressed_section_info): Add flag to store sh_flags.
132 (Object): Add pure virtual elfsize and is_big_endian member
133 functions.
134 * object.cc (need_decompressed_section): Don't skip the ".zdebug"
135 prefix here.
136 (build_compressed_section_map): Check SHF_COMPRESSED for
137 uncompressed size. Store sh_flags in Compressed_section_info.
138 Pass size, big_endian and sh_flags to decompress_input_section.
139 Skip the ".debug"/".zdebug" prefix when passing section name to
140 need_decompressed_section.
141 (Sized_relobj_file<size, big_endian>::do_find_special_section):
142 Don't check ".zdebug_*" sections.
143 (Object::decompressed_section_contents): Pass ELF class, big
144 endian and sh_flags to decompress_input_section.
145 * reloc.cc (Sized_relobj_file<size, big_endian>::write_sections):
146 Likewise.
147 * testsuite/Makefile.am (check_DATA): Add
148 debug_msg_cdebug_gabi.err and gdb_index_test_2_gabi.stdout.
149 (MOSTLYCLEANFILES): Add debug_msg_cdebug_gabi.err and
150 gdb_index_test_2_gabi.stdout.
151 (debug_msg_cdebug_gabi.o): New.
152 (odr_violation1_cdebug_gabi.o): Likewise.
153 (odr_violation2_cdebug_gabi.o): Likewise.
154 (debug_msg_cdebug_gabi.err): Likewise.
155 (check_SCRIPTS): Add gdb_index_test_2_gabi.sh.
156 (gdb_index_test_cdebug_gabi.o): Likewise.
157 (gdb_index_test_2_gabi): Likewise.
158 (gdb_index_test_2_gabi.stdout): Likewise.
159 * testsuite/gdb_index_test_2_gabi.sh: New file.
160 * testsuite/Makefile.in: Regenerated.
161
73854cdd
HS
1622015-07-09 Han Shen <shenhan@google.com>
163
164 Use "gold_info" instead of "gold_warning" for erratum fix.
165
166 * aarch64.cc (Target_aarch64::scan_erratum_843419_span): Use
167 'gold_info'.
168 (Target_aarch64::scan_erratum_835769_span): USe 'gold_info'.
169
61163dfa
HS
1702015-07-09 Han Shen <shenhan@google.com>
171
172 Drop missing symbol warning for arm/aarch64.
173
174 * aarch64.cc (AArch64_relobj::scan_errata): Drop missing symbol warning.
175 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Drop missing
176 symbol warning.
177
b91deca9
HS
1782015-07-07 Han Shen <shenhan@google.com>
179
180 Make gold aarch64 accept long form of mapping symbols.
181
182 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Make legal
183 of mapping symbols.
184
15162bef
DK
1852015-06-29 Doug Kwan <dougkwan@google.com>
186
187 * testsuite/arm_bl_out_of_range.s: Align stub table so that it appears
188 at address expected by test.
189 * testsuite/arm_cortex_a8_b.s: Ditto.
190 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
191 * testsuite/arm_cortex_a8_bl.s: Ditto.
192 * testsuite/arm_cortex_a8_blx.s: Ditto.
193 * testsuite/arm_cortex_a8_local.s: Ditto.
194 * testsuite/arm_fix_v4bx.s: Ditto.
195 * testsuite/arm_unaligned_reloc.s: Ditto.
196 * testsuite/thumb_bl_out_of_range.s: Ditto.
197 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
198 * testsuite/thumb_blx_out_of_range.s: Ditto.
b91deca9 199
56b06706
HS
2002015-06-29 Han Shen <shenhan@google.com>
201
202 Patch for erratum 843419 internal error.
203
b91deca9 204 * aarch64.cc (Erratum_stub::Insn_utilities): New typedef.
56b06706
HS
205 (Erratum_stub::update_erratum_insn): New method.
206 (Stub_table::relocate_stubs): Modified to place relocated insn.
207 (AArch64_relobj::fix_errata): Modified gold_assert.
208
2f0c79aa
HS
2092015-06-12 Han Shen <shenhan@google.com>
210
211 Fix erratum 835769.
212
213 * aarch64.cc (AArch64_insn_utilities::BYTES_PER_INSN): Move
214 defintion outside class definition.
215 (AArch64_insn_utilities::AARCH64_ZR): New static constant.
216 (AArch64_insn_utilities::aarch64_op31): New member.
217 (AArch64_insn_utilities::aarch64_ra): New member.
218 (AArch64_insn_utilities::aarch64_mac): New member.
219 (AArch64_insn_utilities::aarch64_mlxl): New member.
220 (ST_E_835769): New global enum member.
221 (Stub_table::relocate_stubs): Add 835769 handler.
222 (Stub_template_repertoire::Stub_template_repertoire): Install new
223 stub type.
224 (AArch64_relobj::scan_errata): This func is renamed from
225 scan_erratum_843419.
226 (AArch64_relobj::do_count_local_symbols): Add 835769 handler.
227 (AArch64_relobj::do_relocate_sections): Add 835769 handler.
228 (AArch64_relobj::scan_sections_for_stubs): Add 835769 handler.
229 (Target_aarch64::scan_erratum_835769_span): New method.
230 (Target_aarch64::create_erratum_stub): New method.
231 (Target_aarch64::is_erratum_835769_sequence): New method.
232 (Target_aarch64::scan_erratum_843419_sequence): Move part of the
233 code into create_erratum_stub.
234 * options.h (fix_cortex_a53_835769): New option.
235
5d7908e0
CC
2362015-06-11 Cary Coutant <ccoutant@gmail.com>
237
238 * aarch64.cc (Erratum_stub::STUB_ADDR_ALIGN): Move initialization
239 outside class body.
240 (Reloc_stub::STUB_ADDR_ALIGN): Likewise.
241
dd68f8fa
CC
2422015-06-11 Cary Coutant <ccoutant@gmail.com>
243
244 PR gold/17731
245 * layout.cc (corresponding_uncompressed_section_name): New function.
246 (Layout::choose_output_section): Call it.
247 * layout.h (corresponding_uncompressed_section_name): New function.
248 * script-sections.cc (Input_section_info::set_section_name): Check
249 for compressed debug section (.zdebug style).
250
a3a0c391
JY
2512015-06-11 Jing Yu <jingyu@google.com>
252
253 * testsuite/Makefile.am: Add -O0 for script_test_12 test.
254 * testsuite/Makefile.in: Regenerate.
255
970cdef2
DI
2562015-06-11 Davide Italiano <dccitaliano@gmail.com>
257
258 * gold.h (is_cident): Correct typo.
259
a48d0c12
HS
2602015-06-10 Han Shen <shenhan@google.com>
261 Patch for erratum-843419 (2 of 2 - fix erratum occurrences).
262
263 Now fixing for 843419 is fully functional.
264
265 The first part of the erratum fix CL is here -
266 https://sourceware.org/ml/binutils/2015-04/msg00229.html
267
268 * aarch64.cc(global enum): New constants representing stub types.
269 (Stub_template): New POD struct.
270 (Stub_template_repertoire): New class.
271 (Stub_base): New class.
272 (Erratum_stub): New class.
273 (Reloc_stub): Refactored to be a subclass of Stub_base.
274 (Reloc_stub::Stub_type): Removed.
275 (Reloc_stub::offset): Moved to Stub_base.
276 (Reloc_stub::set_offset): Moved to Stub_base.
277 (Reloc_stub::destination_address): Moved to Stub_base.
278 (Reloc_stub::set_destination_address): Moved to Stub_base.
279 (Reloc_stub::reset_destination_address): Moved to Stub_base.
280 (Reloc_stub::stub_type): Renamed and moved to Stub_base.
281 (Reloc_stub::stub_size): Renamed and moved to Stub_base.
282 (Reloc_stub::stub_insns): Renamed and moved to Stub_base.
283 (Reloc_stub::write): Moved to Stub_base.
284 (Reloc_stub::invalid_offset): Moved to Stub_base.
285 (Reloc_stub::invalid_address): Moved to Stub_base.
286 (Reloc_stub::stub_type_): Renamed and moved to Stub_base.
287 (Reloc_stub::stub_insns_): Moved to Stub_base.
288 (Reloc_stub::offset_): Moved to Stub_base.
289 (Reloc_stub::destination_address_): Moved to Stub_base.
290 (Stub_table::The_aarch64_relobj): New typedef.
291 (Stub_table::The_erratum_stub): New typedef.
292 (Stub_table::The_erratum_stub_less): New typedef.
293 (Stub_table::The_erratum_stub_set): New typedef.
294 (Stub_table::The_erratum_stub_set_iter): New typedef.
295 (Stub_table::empty): Added emptiness testing for erratum stubs.
296 (Stub_table::add_erratum_stub): New method to add an erratum stub.
297 (Stub_table::find_erratum_stub): New method.
298 (Stub_table::find_erratum_stubs_for_input_section): New method.
299 (Stub_table::erratum_stub_address): New method.
300 (Stub_table::update_date_size_changed_p): Modified to handle erratum stubs.
301 (Stub_table::do_addralign): Modified to handle erratum stubs.
302 (Stub_table::erratum_stubs_): New member.
303 (Stub_table::erratum_stub_size_): New member.
304 (Stub_table::relocate_stubs): Modified to handle erratum stubs.
305 (Stub_table::do_write): Modified to handle erratum stubs.
306 (AArch64_relobj::The_erratum_stub): New typedef.
307 (AArch64_relobj::Erratum_stub_set_iter): New typedef.
308 (AArch64_relobj::fix_errata): New method.
309 (Target_aarch64::The_reloc_stub_type): Removed.
310 (Target_aarch64::The_erratum_stub): New typede.
311 (AArch64_relocate_functions::construct_b): New method.
312
1e1b2efc
NC
3132015-06-08 Nick Clifton <nickc@redhat.com>
314
315 * po/fr.po: New French Translation.
316
b8cf5075
CC
3172015-06-07 Cary Coutant <ccoutant@gmail.com>
318
319 PR gold/18288
320 * resolve.cc (symbol_to_bits): Remove type parameter; adjust all
321 callers. Don't use STT_COMMON to check for common symbols.
322 (Symbol_table::resolve): Warn if relocatable object has STT_COMMON
323 symbol that's not in a common section.
324 * symtab.h (Symbol::is_common): Don't use STT_COMMON to check for
325 common symbols.
326
bdd2d2b7
CC
3272015-06-04 Cary Coutant <ccoutant@gmail.com>
328
329 PR gold/18200
330 * Makefile.am (diststuff): Add target.
331 * Makefile.in: Regenerate.
332
cd3c333f
CC
3332015-06-04 Cary Coutant <ccoutant@gmail.com>
334
335 PR gold/17498
336 * object.cc (Sized_relobj_file::do_count_local_symbols): Discard
337 temporary locals in merge sections.
338 * options.cc (General_options::parse_discard_all): New method.
339 (General_options::parse_discard_locals): New method.
340 (General_options::parse_discard_none): New method.
341 (General_options::General_options): Initialize discard_locals_.
342 * options.h (--discard-all): Convert to special option.
343 (--discard-locals): Likewise.
344 (--discard-none): New option.
345 (General_options::discard_all): New method.
346 (General_options::discard_locals): New method.
347 (General_options::discard_sec_merge): New method.
348 (General_options::Discard_locals): New enum.
349 (General_options::discard_locals_): New data member.
350
8086551f
CC
3512015-06-03 Cary Coutant <cary@google.com>
352
353 * script-sections.cc (Script_sections::Script_sections): Initialize
354 segments_created_.
355 (Script_sections::create_note_and_tls_segments): Set flag when
356 segments are created.
357 (Script_sections::expected_segment_count): Count PT_INTERP.
358 (Script_sections::attach_sections_using_phdrs_clause): Set flag when
359 segments are created.
360 * script-sections.h (Script_sections::segments_created_): New data
361 member.
362
374082df
CC
3632015-06-03 Cary Coutant <ccoutant@gmail.com>
364
365 PR gold/15370
366 * script-sections.cc
367 (Output_section_element_input::set_section_addresses): When there
368 are several patterns with no sort spec, put all sections in the same
369 bin.
370 * testsuite/Makefile.am (script_test_12): New testcase.
371 (script_test_12i): New testcase.
372 * testsuite/Makefile.in: Regenerate.
373 * testsuite/script_test_12.t: New test linker script.
374 * testsuite/script_test_12i.t: New test linker script.
375 * testsuite/script_test_12a.c: New test source file.
376 * testsuite/script_test_12b.c: New test source file.
377
775ed62e
CC
3782015-06-02 Cary Coutant <ccoutant@gmail.com>
379
380 * nacl.h (Sniff_file): Switch parameters to get_view to get an
381 aligned view.
382
9c7fe3c5
CC
3832015-06-03 Cary Coutant <ccoutant@gmail.com>
384
385 PR gold/17819
386 * gold.cc (queue_final_tasks): When --build-id=tree, queue a
387 separate task to schedule the build id computation.
388 * layout.cc (Hash_task::Hash_task): Remove build_id_blocker,
389 add Output_file and offset.
390 (Hash_task::run): Get and release the input views.
391 (Hash_task::is_runnable): Always return NULL (always runnable).
392 (Layout::queue_build_id_tasks): Remove.
393 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
394 parameters; use them instead of class members.
395 (Build_id_task_runner::run): New function.
396 (Close_task_runner::run): Pass array_of_hashes and size_of_hashes
397 to write_build_id.
398 * layout.h (Layout::queue_build_id_tasks): Remove.
399 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
400 parameters.
401 (Layout::array_of_hashes_): Remove.
402 (Layout::size_of_array_of_hashes_): Remove.
403 (Layout::input_view_): Remove.
404 (Build_id_task_runner): New class.
405 (Close_task_runner::Close_task_runner): Add array_of_hashes and
406 size_of_hashes parameters.
407 (Close_task_runner::array_of_hashes_): New data member.
408 (Close_task_runner::size_of_hashes_): New data member.
409 * testsuite/Makefile.am
410 (flagstest_compress_debug_sections_and_build_id_tree): New test.
411 * testsuite/Makefile.in: Regenerate.
412
400f8944
RÁE
4132015-06-01 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
414
415 * merge.cc (get_input_merge_map): Update for data structure change.
416 (get_or_make_input_merge_map): Update for data structure change.
417 * merge.h (Object_merge_map): Use a std::vector<std::pair>> instead of
418 a std::map. Remove first_shnum_, first_map_, second_shnum_, second_map_.
419
bbec1a5d
AM
4202015-05-16 Alan Modra <amodra@gmail.com>
421
422 * reloc.cc (Sized_relobj_file::find_functions): Use function_location.
423 * powerpc.cc (Target_powerpc::do_calls_non_split): New function.
424 (addi_12_1, addis_2_12, addis_12_1, cmpld_7_12_0): New constants.
425 (lis_0): Rename from lis_0_0.
426
efc6fa12
CC
4272015-04-29 Cary Coutant <cary@google.com>
428 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
429
430 * gc.h (Garbage_collection::is_section_garbage): Change Object*
431 to Relobj*.
432 (Garbage_collection::add_reference): Likewise.
433 (Garbage_collection::gc_process_relocs): Likewise. Don't push
434 object/shndx pair onto *secvec for dynamic objects. Don't follow
435 relocations pointing to dynamic objects for GC.
436 * icf.cc (Icf::find_identical_sections): Change Object* to Relobj*.
437 (Icf::unfold_section): Likewise.
438 (Icf::is_section_folded): Likewise.
439 (Icf::get_folded_section): Likewise.
440 * icf.h: (Icf::get_folded_section): Likewise.
441 (Icf::unfold_section): Likewise.
442 (Icf::is_section_folded): Likewise.
443 (Icf::section_has_function_pointers): Likewise.
444 (Icf::set_section_has_function_pointers): Likewise.
445 * object.h (Section_id): Likewise.
446 (Const_section_id): Likewise.
447 * output.cc (Output_section::update_section_layout): Likewise.
448 * output.h: (Output_section_lookup_maps::find_relaxed_input_section):
449 Likewise.
450 * plugin.cc (update_section_order): Likewise.
451 (unique_segment_for_sections): Likewise.
452 * powerpc.cc (Powerpc_relobj::add_reference): Likewise.
453 (Target_powerpc::do_gc_add_reference): Likewise.
454 (Target_powerpc::gc_process_relocs): Likewise.
455 (Target_powerpc::do_gc_add_reference): Likewise.
456 * symtab.cc (Symbol_table::is_section_folded): Likewise.
457 (Symbol_table::gc_mark_symbol): Likewise.
458 * symtab.h: (Symbol_table::is_section_folded): Likewise.
459 * target.h: (Sized_target::gc_add_reference): Likewise.
460 (Sized_target::do_gc_add_reference): Likewise.
461
f9d3ecaa
NC
4622015-04-29 Nick Clifton <nickc@redhat.com>
463
464 * po/fi.po: Updated Finnish translation.
465
faa2211d
AM
4662015-04-28 Alan Modra <amodra@gmail.com>
467
468 * powerpc.cc (Target_powerpc::do_dynsym_value): Use Address rather
469 than unsigned int for find_global_entry result temp. Compare
470 against invalid_address.
471 (Target_powerpc::do_plt_address_for_global): Likewise.
472 (Target_powerpc::Relocate::relocate): Likewise. Don't assert
473 on plt call stub existence for debug info. Do assert for plt
474 and global entry stub existence if an alloc section.
475
6ec65f28
AM
4762015-04-28 Alan Modra <amodra@gmail.com>
477
478 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't assert
479 on missing global entry stub due to bogus debug info.
480
7a2a1c79
HS
4812015-04-27 Han Shen <shenhan@google.com>
482
483 * options.h (--fix-cortex-a53-843419): Rename option.
484 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Use renamed
485 option.
486 (AArch64_relobj::scan_sections_for_stubs): Use renamed option.
487
cfbf0e3c
RÁE
4882015-04-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
489
490 PR gold/18327
491 * output.cc (Output_section::is_input_address_mapped): Assume a missing
492 entry is mapped.
493 * testsuite/Makefile.am: Add the eh_test test.
494 * testsuite/Makefile.in: Regenerate.
495 * testsuite/eh_test_a.cc: New test.
496 * testsuite/eh_test_b.cc: New test.
497
6ec65f28
AM
4982015-04-23 Sriraman Tallam <tmsriram@google.com>
499
a100d66f
ST
500 * options.h (--weak-unresolved-symbols): New option.
501 * symtab.cc (Symbol_table::sized_write_globals): Change symbol
502 binding to weak with new option.
503 * symtab.h (is_weak_undefined): Check for new option.
504 (is_strong_undefined): Check for new option.
505 * testsuite/Makefile.am (weak_unresolved_symbols_test): New test.
506 * testsuite/Makefile.in: Regenerate.
507 * testsuite/weak_unresolved_symbols_test.cc: New file.
508
4b889c30
IC
5092015-04-20 Ian Coolidge <icoolidge@google.com>
510
511 * symtab.cc (Symbol::should_add_dynsym_entry): Return true for
512 GNU_UNIQUE.
513
4277535c
RÁE
5142015-04-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
515
516 * gc.cc (Garbage_collection::do_transitive_closure): Use back and
517 push_back.
518 * gc.h (Garbage_collection): Use a std::vector instead of a std::queue.
519 * object.cc (Sized_relobj_file::do_layout): Use push_back.
520 * powerpc.cc (process_gc_mark): Use push_back.
521 (Target_powerpc::do_gc_mark_symbol): Use push_back.
522 * symtab.cc (Symbol_table::gc_mark_symbol): Use push_back.
523
7a2a1c79 5242015-04-16 Han Shen <shenhan@google.com>
5019d64a 525
6ec65f28
AM
526 * aarch64.cc (AArch64_insn_utilities): New utility class.
527 (AArch64_relobj::Mapping_symbol_position): New struct.
528 (AArch64_relobj::Mapping_symbol_info): New typedef.
529 (AArch64_relobj::do_count_local_symbols): New function overriding
530 parent's implementation.
531 (AArch64_relobj::mapping_symbol_info_): New member
532 (AArch64_relobj::scan_erratum_843419): New method.
533 (Target_aarch64::scan_erratum_843419_span): New method.
534 (Target_aarch64::is_erratum_843419_sequence): New method.
535 * options.h (fix_cortex_a53): New option.
5019d64a 536
a6a17750
CC
5372015-04-09 Cary Coutant <ccoutant@google.com>
538
539 * symtab.cc (Symbol::final_value_is_known): Check for TLS symbol
540 in a PIE link.
541 * testsuite/Makefile.am (tls_pie_test.sh): New test.
542 * testsuite/Makefile.in: Regenerate.
543 * testsuite/tls_pie_test.sh: New.
544
437ddf0c
CC
5452015-04-09 Cary Coutant <ccoutant@google.com>
546
547 * debug.h (DEBUG_LOCATION): New.
548 (DEBUG_ALL): Include DEBUG_LOCATION.
549 (debug_string_to_enum): Add DEBUG_LOCATION.
550 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Fix debug
551 output to print correct context.
552 (Sized_dwarf_line_info::do_addr2line): Add debug output. Return
553 up to 4 more locations at the beginning of the function.
554 * symtab.cc (Symbol_table::detect_odr_violations): Get canonical
555 result before sorting list of line numbers.
556 * testsuite/debug_msg.sh: Allow range of line numbers for
557 canonical results on optimized code.
558
24491327
HS
5592015-04-07 HC Yen <hc.yen@mediatek.com>
560
561 Add AArch32 support for gold linker.
562 gold/
563 * arm.cc: Add V8 arch combine table.
564
7fa5525f
RÁE
5652015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
566
567 * aarch64.cc (do_reloc_addend): Fix signature to match the parent one.
568
5368dcf2
RÁE
5692015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
570
571 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a call
572 to find by using the return value of insert.
573
9dbb4b02
RÁE
5742015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
575
576 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a copy
577 constructor call.
578
1fa29f10
IT
5792015-04-06 Ilya Tocar <ilya.tocar@intel.com>
580
581 PR gold/17641
582 * x86_64.cc (Target_x86_64::can_convert_mov_to_lea): New.
583 (Target_x86_64::Scan::local): Don't create GOT entry, when we
584 can convert mov to lea.
585 (Target_x86_64::Scan::global): Ditto.
586 (Target_x86_64::Relocate::relocate): Convert mov foo@GOTPCREL(%rip),
587 %reg to lea foo(%rip), %reg if possible.
588 * testsuite/Makefile.am (x86_64_mov_to_lea): New test.
589 * testsuite/x86_64_mov_to_lea1.s: New.
590 * testsuite/x86_64_mov_to_lea2.s: Ditto.
591 * testsuite/x86_64_mov_to_lea3.s: Ditto.
592 * testsuite/x86_64_mov_to_lea4.s: Ditto.
593 * testsuite/x86_64_mov_to_lea.sh: Ditto.
594
39f3de7c
L
5952015-04-02 H.J. Lu <hongjiu.lu@intel.com>
596
597 * configure: Regenerated.
598
c4fc4724
IT
5992015-04-01 Ilya Tocar <ilya.tocar@intel.com>
600
601 PR gold/17640
602 * i386.cc (Target_i386::can_convert_mov_to_lea): New.
603 (Target_i386::Scan::local): Don't create GOT entry, when we
604 can convert GOT to GOTOFF.
605 (Target_i386::Scan::global): Ditto.
606 (Target_i386::Relocate::relocate): Convert mov foo@GOT(%reg), %reg to
607 lea foo@GOTOFF(%reg), %reg if possible.
608 * testsuite/Makefile.am (i386_mov_to_lea): New test.
609 * testsuite/i386_mov_to_lea1.s: New.
610 * testsuite/i386_mov_to_lea2.s: Ditto.
611 * testsuite/i386_mov_to_lea3.s: Ditto.
612 * testsuite/i386_mov_to_lea4.s: Ditto.
613 * testsuite/i386_mov_to_lea5.s: Ditto.
614 * testsuite/i386_mov_to_lea.sh: Ditto.
615
918357b9
L
6162015-04-01 H.J. Lu <hongjiu.lu@intel.com>
617
618 * Makefile.am (ZLIB): New.
619 (ZLIBINC): Likewise.
620 (AM_CFLAGS): Add $(ZLIBINC).
621 (AM_CXXFLAGS): Likewise.
622 (ldadd_varldadd_var): Add $(ZLIB).
623 (incremental_dump_LDADD): Likewise.
624 (dwp_LDADD): Likewise.
625 * compressed_output.cc: Don't check HAVE_ZLIB_H to include
626 <zlib.h>.
627 (zlib_compress): Don't check HAVE_ZLIB_H.
628 (zlib_decompress): Likewise.
629 * options.h (compress_debug_sections): Likewise.
630 * configure.ac (AM_CONDITIONAL): Removed.
631 * testsuite/Makefile.am (ZLIB): New.
632 (LDADD): Add $(ZLIB).
633 Don't check HAVE_ZLIB.
634 * Makefile.in: Regenerated.
635 * config.in: Likewise.
636 * configure: Likewise.
637 * testsuite/Makefile.in: Likewise.
638
6b0ad2eb
JY
6392015-03-30 Jing Yu <jingyu@google.com>
640
641 * aarch64-reloc.def: New TLSLD_ADD_DTPREL_HI12,
642 TLSLD_ADD_DTPREL_LO12_NC.
643 * aarch64.cc (Target_aarch64::define_tls_base_symbol): Always let
644 _TLS_MODULE_BASE_ point to the start of tls segment.
645 (Target_aarch64::optimize_tls_reloc): Add cases for
646 R_AARCH64_TLSLD_ADD_DTPREL_HI12 and
647 R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
648 (Target_aarch64::Scan::local): Likewise.
649 (Target_aarch64::Scan::global): Likewise.
650 (Target_aarch64::Relocate::relocate): Likewise.
651 (Target_aarch64::Relocate::relocate_tls): Likewise. And remove
652 subtracting tls segment size from symbol value for TLSLD_*_DTPREL
653 relocations.
654
0916f9e7
RÁE
6552015-03-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
656
657 * merge.cc (Object_merge_map::add_mapping): call
658 Object_merge_map::Input_merge_map::add_mapping.
659 (Object_merge_map::Input_merge_map::add_mapping): New.
660 (Output_merge_data::do_add_input_section): Call
661 get_or_make_input_merge_map before a loop.
662 (Output_merge_string<Char_type>::finalize_merged_data): Call
663 get_or_make_input_merge_map before a loop.
664 * merge.h (Object_merge_map): Make Input_merge_map public.
665 * object.cc (Relobj::add_merge_mapping): Use get_or_create_merge_map.
666 (Relobj::get_or_create_merge_map): New.
667 * object.h (Relobj::get_or_create_merge_map): New.
668
282c9750
AM
6692015-03-24 Alan Modra <amodra@gmail.com>
670
671 PR 18147
672 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't report
673 relocation errors for branches to strong undefined symbols.
674
67f95b96
RÁE
6752015-03-23 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
676
677 * merge.cc (Object_merge_map::get_input_merge_map): Make it const.
678 (Object_merge_map::is_merge_section_for): Remove.
679 (Object_merge_map::find_merge_section): New.
680 * merge.h (Object_merge_map::is_merge_section_for): Remove.
681 (Object_merge_map::find_merge_section): New.
682 (Object_merge_map::get_input_merge_map): Add a const version.
683 * object.cc (Relobj::is_merge_section_for): Remove.
684 (Relobj::find_merge_section): New.
685 * object.h (Relobj::is_merge_section_for): Remove.
686 (Relobj::find_merge_section): New.
687 * output.cc
688 (Output_section::Input_section::is_merge_section_for): Remove.
689 (Output_section::add_merge_input_section): Don't call
690 add_merge_input_section.
691 (Output_section::find_merge_section): Return const. Use
692 object->find_merge_section.
693 (Output_section::build_lookup_maps): Don't build a map for
694 merge sections.
695 (Output_section::is_input_address_mapped): Return false if
696 section is not found.
697 (Output_section::find_starting_output_address): Use
698 find_merge_section instead of is_merge_section_for.
699 (Output_section::add_script_input_section): Don't build a map for
700 merge sections.
701 * output.h (Output_section_lookup_maps::merge_sections_by_id_): Remove.
702 (Output_section_lookup_maps::find_merge_section): Remove.
703 (Output_section_lookup_maps::add_merge_input_section) Remove.
704 (Output_section::find_merge_section): Return const.
705
152f7024
CC
7062015-03-22 Cary Coutant <cary@google.com>
707
708 PR gold/18106
709 * i386.cc (Target_i386::Relocate::tls_gd_to_ie): Fix support for
710 non-SIB form of lea, with nop after the call.
711
bccffdfd
CC
7122015-03-21 Cary Coutant <cary@google.com>
713
714 PR gold/14217
715 * output.cc (Output_segment::is_first_section_relro): Don't ignore
716 .tdata section.
717 (Output_segment::set_section_addresses): Don't align size of relro
718 segment for .tbss.
719
1c582fe7
CC
7202015-03-21 Cary Coutant <cary@google.com>
721
722 PR gold/18010
723 * stringpool.cc (Stringpool_template): Don't optimize if section
724 alignment is greater than sizeof(char).
725
410da591
CC
7262015-03-21 Cary Coutant <cary@google.com>
727
728 PR gold/18048
729 * script-c.h (script_include_directive): Add first_token parameter.
730 * script.cc (script_include_directive): Add first_token parameter, and
731 pass it to read_script_file.
732 * yyscript.y (PARSING_SECTIONS_BLOCK, PARSING_SECTION_CMDS)
733 (PARSING_MEMORY_DEF): New tokens.
734 (top): Add new productions for INCLUDE files.
735 (file_cmd): Replace file_or_sections_cmd with copy of its productions.
736 Pass PARSING_LINKER_SCRIPT to script_include_directive.
737 (section_block_cmd): Likewise; pass PARSING_SECTIONS_BLOCK.
738 (section_cmd): Pass PARSING_SECTION_CMDS.
739 (file_or_sections_cmd): Remove.
740 (memory_def): Pass PARSING_MEMORY_DEF.
741 * testsuite/Makefile.am (memory_test_2): New test.
742 * testsuite/Makefile.in: Regenerate.
743 * testsuite/memory_test_inc.t: New script file.
744 * testsuite/memory_test_inc_1.t.src: New script file.
745 * testsuite/memory_test_inc_2.t.src: New script file.
746 * testsuite/memory_test_inc_3.t.src: New script file.
747
0d5bbdb0
CC
7482015-03-21 Cary Coutant <cary@google.com>
749
750 * dwp.cc (Sized_relobj_dwo::do_section_contents): Delete.
751 (Sized_relobj_dwo::setup): Build compressed section map.
752 (Sized_relobj_dwo::do_decompressed_section_contents): Delete.
753 * dynobj.cc (Sized_dynobj::base_read_symbols): Build compressed
754 section map.
755 * object.cc (Sized_relobj_file::Sized_relobj_file): Remove
756 compressed_sections_ field.
757 (build_compressed_section_map): Take Object instead of
758 Sized_relobj_file parameter; add decompress_if_needed parameter.
759 (Sized_relobj_file::do_find_special_sections): Store compressed
760 section map in parent Object.
761 (Sized_relobj_file::do_decompressed_section_contents): Move
762 implementation to Object::decompressed_section_contents.
763 (Sized_relobj_file::do_discard_decompressed_sections): Move
764 implementation to Object::discard_decompressed_sections.
765 * object.h (build_compressed_section_map): Declare.
766 (Object::Object): Add compressed_sections_ field.
767 (Object::section_is_compressed): Move implementation here.
768 (Object::decompressed_section_contents): De-virtualize.
769 (Object::discard_decompressed_sections): De-virtualize.
770 (Object::do_section_is_compressed): Delete.
771 (Object::do_decompressed_section_contents): Delete.
772 (Object::set_compressed_sections): New method.
773 (Object::compressed_sections): New method.
774 (Object::compressed_sections_): New data member.
775 (Compressed_section_info, Compressed_section_map): Move to top of file.
776 (Sized_relobj_file::do_section_is_compressed): Delete.
777 (Sized_relobj_file::do_decompressed_section_contents): Delete.
778 (Sized_relobj_file::do_discard_decompressed_sections): Delete.
779 (Sized_relobj_file::compressed_sections_): Move to Object class.
780
bd9e0d46
CC
7812015-03-21 Cary Coutant <ccoutant@google.com>
782
783 PR gold/18152
784 * gold.cc (queue_middle_tasks): Finalize .eh_frame after laying out
785 deferred objects.
786
943c8b43
CC
7872015-03-11 Cary Coutant <ccoutant@google.com>
788
789 * options.cc (General_options::finalize): Don't allow -z relro
790 with incremental linking.
791 * testsuite/Makefile.am (incremental_test): Add -z norelro.
792 (incremental_test_2): Likewise.
793 (incremental_test_3): Likewise.
794 (incremental_test_4): Likewise.
795 (incremental_test_5): Likewise.
796 (incremental_test_6): Likewise.
797 (incremental_copy_test): Likewise.
798 (incremental_common_test_1): Likewise.
799 (incremental_comdat_test_1): Likewise.
800 * testsuite/Makefile.in: Regenerate.
801
e1663197
CC
8022015-03-09 Cary Coutant <ccoutant@google.com>
803
804 PR gold/14675
805 * ehframe.cc (Eh_frame::add_ehframe_input_section): Change return type;
806 return enum indicating whether .eh_frame section is empty, optimizable,
807 unrecognized, or an end marker. Adjust explicit instantiations.
808 * ehframe.h (Eh_frame::Eh_frame_section_disposition): New enum type.
809 (Eh_frame::add_ehframe_input_section): Change return type.
810 * gold.cc (queue_middle_tasks): Call Layout::finalize_eh_frame_section.
811 * layout.cc (Layout::layout_eh_frame): Don't add optimized sections
812 to the .eh_frame output section until we see the end marker.
813 (Layout::finalize_eh_frame_section): New.
814 * layout.h: (Layout::finalize_eh_frame_section): New.
815
beb8418f
L
8162015-03-05 H.J. Lu <hongjiu.lu@intel.com>
817
818 * output.cc (Relobj::initialize_input_to_output_map<size>):
819 Remove typename on elfcpp::Elf_types<size>::Elf_Addr.
820
48c73428
CC
8212015-03-04 Cary Coutant <ccoutant@google.com>
822
823 * parameters.cc (Parameters::set_target_once): Call
824 Target::select_as_default_target just once from here...
825 (set_parameters_target): ...instead of from here.
826
8272015-03-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
dbe40a88
RÁE
828
829 * ehframe.cc (Cie::set_output_offset): Pass in and use a
830 Output_section_data instead of a Merge_map.
831 (Eh_frame::Eh_frame): Don't initialize merge_map_.
832 (Eh_frame::read_cie): Use add_merge_mapping instead of
833 Merge_map::add_mapping.
834 (Eh_frame::read_fde): Ditto.
835 (Eh_frame::set_final_data_size): Use this instead of this->merge_map_.
836 (Eh_frame::do_output_offset): Use merge_output_offset istead of
837 merge_map_->get_output_offset.
838 (Eh_frame::do_is_merge_section_for): Delete.
839 * ehframe.h (Fde::add_mapping): Pass in and use a Output_section_data
840 instead of a Merge_map.
841 (Cie::set_output_offset): Pass in a Output_section_data instead of a
842 Merge_map.
843 (Eh_frame::do_is_merge_section_for): Delete.
844 (Eh_frame::merge_map_): Delete.
845 * merge.cc (Object_merge_map::get_or_make_input_merge_map): Pass in
846 and use a Output_section_data instead of a Merge_map.
847 (Object_merge_map::add_mapping): Ditto.
848 (Object_merge_map::get_output_offset): Remove the merge_map argument.
849 (Object_merge_map::is_merge_section_for): Pass in and use a
850 Output_section_data instead of a Merge_map.
851 (Merge_map): Delete.
852 (Output_merge_base::do_output_offset): Use merge_output_offset instead
853 of merge_map_.get_output_offset.
854 (Output_merge_base::do_is_merge_section_for): Delete.
855 (Output_merge_data::do_add_input_section): Use
856 object->add_merge_mapping instead of add_mapping.
857 (Output_merge_string<Char_type>::finalize_merged_data): Ditto.
858 * merge.h (Merge_map): Delete forward declaration.
859 (Object_merge_map::add_mapping): Pass in and use a Output_section_data
860 instead of a Merge_map.
861 (Object_merge_map::get_output_offset): Remove the merge_map argument.
862 (Object_merge_map::is_merge_section_for): Pass in and use a
863 Output_section_data instead of a Merge_map.
864 (Input_merge_map::Object_merge_map::merge_map): Replace with
865 output_data.
866 (Object_merge_map::get_or_make_input_merge_map): Pass in and use a
867 Output_section_data instead of a Merge_map.
868 (Merge_map): Delete.
869 (Output_merge_base::Output_merge_base): Don't initialize merge_map_.
870 (Output_merge_base::do_is_merge_section_for): Delete.
871 (Output_merge_base::add_mapping): Delete.
872 (Output_merge_base::merge_map_): Delete.
873 * object.cc (Relobj::initialize_input_to_output_map): New.
874 (Relobj::initialize_input_to_output_map): New.
875 (Relobj::merge_output_offset): New.
876 (Relobj::is_merge_section_for): New.
877 (Relobj::initialize_input_to_output_map): Instantiate for 32 and 64
878 bits.
879 * object.h (Relobj::merge_map): Delete.
880 (initialize_input_to_output_map): New.
881 (set_merge_map): Delete.
882 (add_merge_mapping): New.
883 (merge_output_offset): New.
884 (is_merge_section_for): New.
885 * output.cc (Output_section::Input_section::is_merge_section_for):
886 Use object->is_merge_section_for.
887 * output.h (Output_section_data::is_merge_section_for): Delete.
888 (Output_section_data::do_is_merge_section_for): Delete.
889 * reloc.cc (Merged_symbol_value<size>::initialize_input_to_output_map):
890 Use object->initialize_input_to_output_map.
891 (Merged_symbol_value<size>::value_from_output_section): Use
892 object->merge_output_offset.
893
48c73428 8942015-03-02 Peter Collingbourne <pcc@google.com>
2c7b626c
CC
895 Cary Coutant <ccoutant@google.com>
896
897 * output.cc (Output_section::add_merge_input_section): Do not
898 attempt to merge sections with an entsize of 0.
899
48c73428 9002015-03-02 Khem Raj <raj.khem@gmail.com>
5b07cd84
CC
901
902 * attributes.h (class Output_attributes_section_data ): Add
903 do_print_to_mapfile function.
904
ec86f434
AM
9052015-02-24 Alan Modra <amodra@gmail.com>
906
907 PR 18010
908 * powerpc.cc (Powerpc_relocate_functions::addr16_ds): Always
909 complain if value is not a multiple of four.
910 (Target_powerpc::Relocate::relocate): Correct handling of
911 R_POWERPC_GOT_TPREL16 and R_POWERPC_GOT_TPREL16_LO for ppc64.
912
be66981e
L
9132015-02-21 H.J. Lu <hongjiu.lu@intel.com>
914
915 * configure.ac (default_size): Set to 32 for x32.
916 * configure: Regenerated.
917
e3ee8ed4
AM
9182015-02-18 Alan Modra <amodra@gmail.com>
919
920 PR 17954
921 * powerpc.cc (Global_symbol_visitor_opd::operator()): Set default
922 visibility.
923
3a935c6c
RÁE
9242015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
925
926 * gc.h (Garbage_collection::add_reference): Don't use find.
927
e0a1e121
RÁE
9282015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
929
930 * object.cc (write_local_symbols): avoid std::vector copy.
931
45a4fb1a
RÁE
9322015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
933
934 * merge.cc (get_output_offset): Use upper_bound instead of lower_bound.
935
2d9afefe
MW
9362015-02-09 Mark Wielaard <mjw@redhat.com>
937
938 * gdb-index.cc (Gdb_index_info_reader::visit_top_die): Recognize
939 DW_LANG_Fortran03 and DW_LANG_Fortran08.
940
e9c1bdad
CC
9412015-02-16 Cary Coutant <ccoutant@google.com>
942
943 PR gold/13577
944 PR gold/16992
945 * layout.cc (Layout::finish_dynamic_section): Don't set DT_SYMBOLIC or
946 DF_SYMBOLIC if --dynamic-list option is used.
947 * options.cc (General_options::finalize): --dynamic-list is not
948 mutually exclusive with -Bsymbolic.
949 * symtab.h (Symbol::is_preemptible): Don't exclude dynamic symbols not
950 listed in --dynamic-list.
951 * testsuite/Makefile.am (dynamic_list_lib2.so): Add
952 -Bsymbolic-functions.
953 * testsuite/Makefile.in: Regenerate.
954
0ed4b0bf
CC
9552015-02-16 Cary Coutant <ccoutant@google.com>
956
957 PR gold/17971
958 * incremental.cc: Remove redundant include of "output.h".
959
1a920511
JY
9602015-02-12 Jing Yu <jingyu@google.com>
961
962 * aarch64-reloc.def (TLSLE_MOVW_TPREL_G2, TLSLE_MOVW_TPREL_G1,
963 TLSLE_MOVW_TPREL_G1_NC, TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC,):
964 New relocation.
965 * aarch64.cc (Target_aarch64::Scan::local): Add cases for new
966 TLSLE_MOVW_* relocations.
967 (Target_aarch64::Scan::global): Likewise.
968 (Target_aarch64::Relocate::relocate): Likewise.
969 (Target_aarch64::Relocate::relocate_tls): Add cases and handlings
970 for new TLSLE_MOVW_* relocations.
971
07f107f3
WN
9722015-02-11 Will Newton <will.newton@linaro.org>
973
974 PR gold/13321
975 * arm.cc (Target_arm::make_plt_section): Create an ARM
976 state mapping symbol at the start of the PLT.
977
e051a5b5
L
9782015-02-09 H.J. Lu <hongjiu.lu@intel.com>
979
980 * testsuite/Makefile.am (two_file_shared_2_pic_1_test_DEPENDENCIES):
981 Replace two_file_shared_2.so with two_file_shared_1.so.
982 * testsuite/Makefile.in: Regenerated.
983
dddcc5b9
AM
9842015-02-09 Alan Modra <amodra@gmail.com>
985
986 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add libweak_undef_2.a,
987 plugin_test_thin.a and defsym_test.
988 * testsuite/Makefile.in: Regenerate.
989
b39b8b9d
RÁE
9902015-02-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
991
992 * merge.cc (do_add_input_section): Combine loop epilogue into main loop
993 body.
994
b66d1c52
CC
9952015-02-04 Peter Collingbourne <pcc@google.com>
996
997 * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve
998 forwarding symbols when computing symbol resolution info for plugins.
999 * plugin.h (Plugin_manager::symtab): New method.
1000 (Pluginobj::get_symbol_resolution_info): Add symtab parameter.
1001
23081de0
CC
10022015-02-03 Cary Coutant <ccoutant@google.com>
1003 Peter Collingbourne <pcc@google.com>
1004
1005 PR gold/15660
1006 * archive.cc (Thin_archive_object_unlocker): New class.
1007 (Archive::include_member): Unlock external members of thin archives.
1008 * testsuite/Makefile.am (plugin_test_1): Rename .syms files.
1009 (plugin_test_2): Likewise.
1010 (plugin_test_3): Likewise.
1011 (plugin_test_4): Likewise.
1012 (plugin_test_5): Likewise.
1013 (plugin_test_6): Likewise.
1014 (plugin_test_7): Likewise.
1015 (plugin_test_8): Likewise.
1016 (plugin_test_9): Likewise.
1017 (plugin_test_10): Likewise.
1018 (plugin_test_11): New test case.
1019 * testsuite/Makefile.in: Regenerate.
1020 * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms
1021 file to decide whether to claim file.
1022 (all_symbols_read_hook): Likewise.
1023 * testsuite/plugin_test_1.sh: Adjust expected output.
1024 * testsuite/plugin_test_2.sh: Likewise.
1025 * testsuite/plugin_test_3.sh: Likewise.
1026 * testsuite/plugin_test_6.sh: Likewise.
1027 * testsuite/plugin_test_tls.sh: Likewise.
1028 * testsuite/plugin_test_11.sh: New testcase.
1029
10302015-02-03 Cary Coutant <ccoutant@google.com>
1031
1032 * descriptors.cc (Descriptors::open): Set artificially-low limit for
1033 file descriptors when debugging enabled. Add debug output.
1034 (Descriptors::release): Add debug output.
1035 (Descriptors::close_some_descriptor): Likewise.
1036 (Descriptors::close_all): Likewise.
1037 * fileread.cc (File_read::lock): Likewise.
1038 (File_read::unlock): Likewise.
1039
24dd5808
CC
10402015-02-02 Cary Coutant <ccoutant@google.com>
1041
1042 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
1043 executable output file.
1044
fa89cc82
HS
10452015-01-22 Han Shen <shenhan@google.com>
1046
1047 * arm.cc (Target_arm::Target_arm): Add initialization for new members.
1048 (Target_arm::do_plt_address_for_global): New method.
1049 (Target_arm::do_plt_address_for_local): New method.
1050 (Target_arm::rel_irelative_section): New method.
1051 (Target_arm::make_data_plt): Add more parameters for plt ctor.
1052 (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
1053 (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
1054 (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
1055 (Target_arm::Scan::check_non_pic): Add ifunc support.
1056 (Target_arm::Scan::local): Add ifunc support.
1057 (Target_arm::Scan::global): Add ifunc support.
1058 (Target_arm::make_plt_section): New method.
1059 (Target_arm::make_plt_entry): Change to call to make_plt_section.
1060 (Target_arm::make_local_ifunc_plt_entry): New method.
1061 (Target_arm::got_irelative_): New member.
1062 (Target_arm::rel_irelative_): New member.
1063 (Target_arm::got_section): Add creation for got_irelative_.
1064 (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
1065 (Target_arm::Relocate::relocate): Properly set local ifunc address.
1066 (Target_arm::do_dynsym_value): Properly set global ifunc address.
1067 (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
1068 (Output_data_plt_arm::IRelative_data): New type.
1069 (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
1070 (Output_data_plt_arm::add_entry): Add more parameters.
1071 (Output_data_plt_arm::add_relocation): New method.
1072 (Output_data_plt_arm::add_local_ifunc_entry): New method.
1073 (Output_data_plt_arm::rel_irelative): New method.
1074 (Output_data_plt_arm::entry_count): Modified.
1075 (Output_data_plt_arm::address_for_global): New method.
1076 (Output_data_plt_arm::address_for_local): New method.
23081de0 1077gold/
fa89cc82
HS
1078 (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
1079 (Output_data_plt_arm::insert_irelative_data): New method.
1080 (Output_data_plt_arm::irelative_rel_): New member.
1081 (Output_data_plt_arm::got_): New member.
1082 (Output_data_plt_arm::got_irelative_): New member.
1083 (Output_data_plt_arm::irelative_count_): New member.
1084 (Output_data_plt_arm::IRelative_data_vec): New typedef.
1085 (Output_data_plt_arm::irelative_data_vec_): New member.
1086 (Output_data_plt_arm::do_write): Write out irelative entries.
1087 (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
1088 more parameters to ctor.
1089 (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
1090 more parameters to ctor.
1091 * output.h (Output_data_reloc::add_local_relative): New method.
1092 * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
1093
0f81d3f0
AM
10942015-01-29 Alan Modra <amodra@gmail.com>
1095
1096 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
1097 and GOT_TLSGD to LE optimization.
1098
65d92137
CC
10992015-01-28 Cary Coutant <ccoutant@google.com>
1100
1101 * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
1102 for undef TLS symbols.
1103 (Target_x86_64::Relocate::relocate_tls): Likewise.
1104 (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
1105
5485698a
CC
11062015-01-25 Cary Coutant <ccoutant@google.com>
1107
1108 * output.cc (Output_segment::set_section_addresses): Fix calculation
1109 of size of relro segment.
1110
b01a4b04
AM
11112015-01-22 Alan Modra <amodra@gmail.com>
1112
1113 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
1114 condition for need of ifunc plt entry.
1115 (Target_powerpc::Scan::global <got relocs>): Likewise.
1116
3d0064a9
CC
11172015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1118
1119 * mips.cc (reloc_high): Add r_sym.
1120 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
1121 reloc_high constructor.
1122 (Mips_relocate_functions::relgot16_local): Likewise.
1123 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
1124 r_type to decide whether LO16 matches HI16.
1125 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
1126 rello16 and relgot16_local.
1127
a5cd8f05
CC
11282015-01-09 Cary Coutant <ccoutant@google.com>
1129
1130 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
1131 unless alignment is larger than page size.
1132
4fc1b9d4
L
11332015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1134 Cary Coutant <ccoutant@google.com>
1135
1136 PR gold/17729
1137 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
1138 (DEFAULT_TARGET_X32): Set for x32.
1139 * x86_64.cc (cmp_insn_32): New.
1140 (lea_r10_insn_32): Likewise.
1141 (lea_r11_insn_32): Likewise.
1142 (cmp_insn_64): Likewise.
1143 (lea_r10_insn_64): Likewise.
1144 (lea_r11_insn_64): Likewise.
1145 (Target_x86_64<size>::do_calls_non_split): Handle x32.
1146 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
1147 (check_DATA): Add split_x32 files.
1148 (split_x32_[1234n].o): New targets.
1149 (split_x32_[124]): New targets.
1150 (split_x32_[1234r].stdout): New targets.
1151 * testsuite/split_x32.sh: New file.
1152 * testsuite/split_x32_1.s: Likewise.
1153 * testsuite/split_x32_2.s: Likewise.
1154 * testsuite/split_x32_3.s: Likewise.
1155 * testsuite/split_x32_4.s: Likewise.
1156 * testsuite/split_x32_n.s: Likewise.
1157 * configure: Regenerated.
1158 * testsuite/Makefile.in: Likewise.
1159
e749cab8
L
11602015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1161
1162 PR gold/17809
1163 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
1164 x32.
1165
af759df0
AM
11662015-01-02 Alan Modra <amodra@gmail.com>
1167
1168 * version.cc (print_version): Just print current year.
1169 * dwp.cc (print_version): Likewise.
1170
b90efa5b
AM
11712015-01-01 Alan Modra <amodra@gmail.com>
1172
1173 Update year range in copyright notice of all files.
1174
f12d1e8a
AM
11752014-12-25 Alan Modra <amodra@gmail.com>
1176
1177 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
1178 new enums.
1179 (Target_arm::merge_object_attributes, ): Likewise.
1180
5c294fee
TG
11812014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
1182
1183 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
1184 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
1185 AEABI_VFP_args_vfp to check that.
1186 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
1187 value and replace hardcoded values by enum values.
1188
e30880c2
CC
11892014-12-22 Cary Coutant <ccoutant@google.com>
1190
1191 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
1192
bd040da1
L
11932014-12-20 H.J. Lu <hongjiu.lu@intel.com>
1194
1195 PR gold/14608
1196 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
1197 to "return i * i * 3;".
1198
e02a4046
CC
11992014-12-16 Cary Coutant <ccoutant@google.com>
1200
1201 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
1202 (Mapfile::print_output_data): Use current_data_size() to avoid
1203 assert for sections requiring postprocessing; if address is not valid,
1204 print 0.
1205 (Mapfile::print_output_section): Use current_data_size(); print note
1206 that addresses and sizes are before compression.
1207
add6016b
L
12082014-12-14 H.J. Lu <hongjiu.lu@intel.com>
1209
1210 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1211 Cast current_group_size to unsigned long when reporting error.
1212
0bf32ea9
JY
12132014-12-10 Jing Yu <jingyu@google.com>
1214
1215 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
1216 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
1217 Update error message.
1218 (Target_aarch64::do_relax): Use absolute value of option
1219 stub_group_size. Replace local variable with class member
1220 stub_group_size_.
1221
cbcb23fa
AM
12222014-12-04 Alan Modra <amodra@gmail.com>
1223
1224 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
1225 addend of PLTREL24 reloc when not generating a plt stub. Make
1226 max_branch_offset an "Address".
fbad6518 1227 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
cbcb23fa
AM
1228 (Target_powerpc::Relocate::relocate): Likewise.
1229
1611bc4a
AM
12302014-12-04 Alan Modra <amodra@gmail.com>
1231
1232 PR 17670
1233 * symtab.cc (Symbol::set_undefined): Remove assertion.
1234 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1235 on symbols defined in discarded sections, instead return false.
1236 Rearrange params, update all callers.
1237 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
1238 branches to syms in discarded sections.
1239 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
1240 undefined and flag as discarded.
1241 (Target_powerpc::Relocate::relocate): Localize variable.
1242
4759c34e
L
12432014-12-03 H.J. Lu <hongjiu.lu@intel.com>
1244
1245 PR gold/17675
1246 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
1247 * testsuite/Makefile.in: Regenerated.
1248
1f98a074
AM
12492014-12-03 Alan Modra <amodra@gmail.com>
1250
1251 PR 17566
1252 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
1253 when adding dynamic relocations against section symbols.
1254
fb257835
DI
12552014-12-01 Dimitry Ivanov <dimitry@google.com>
1256
1257 * layout.cc (Layout::finish_dynamic_section): When '-z global'
1258 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
1259 * options.h (General_options): New -z option (global).
1260
d8e60314
CC
12612014-12-01 Cary Coutant <ccoutant@google.com>
1262
1263 PR gold/17578
1264 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
1265 is given.
1266 (Layout::create_executable_stack_info): Warn when -z noexecstack is
1267 given but some inputs require executable stack.
1268
982bbd97
CC
12692014-11-26 Cary Coutant <ccoutant@google.com>
1270
1271 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
1272 .debug_str_offsets; strip .debug_gnu_pubnames and
1273 .debug_gnu_pubtypes.
1274 (lines_only_debug_sections): Strip all four new sections.
1275
bb779192
HS
12762014-11-26 Jing Yu <jingyu@google.com>
1277
1278 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
1279 register to be x0 when to relax TLSDESC_LD64_LO12.
1280
a3e60ddb
AM
12812014-11-26 Alan Modra <amodra@gmail.com>
1282
1283 * powerpc.cc (struct Stub_table_owner): New.
1284 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
1285 unsigned int vector. Update all references.
1286 (powerpc_relobj::set_stub_table): Take an unsigned int param
1287 rather than a Stub_table. Update callers.
1288 (Powerpc_relobj::clear_stub_table): New function.
1289 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
1290 stub_group_size_ vars.
1291 (Target_powerpc::new_stub_table): Delete.
1292 (max_branch_delta): New function, extracted from..
1293 (Target_powerpc::Relocate::relocate): ..here..
1294 (Target_powerpc::Branch_info::make_stub): ..and here. Return
1295 status on whether stub created successfully.
1296 (Stub_control::Stub_control): Add "no_size_errors" param. Move
1297 default sizing to..
1298 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
1299 reduce on relax failure.
1300 (Target_powerpc::group_sections): Add "no_size_errors" param.
1301 Use stub_group_size_. Set up group info in a temp vector,
1302 before building Stub_table vector. Account for input sections
1303 possibly already converted to relaxed sections.
1304 (Stub_table::init): Delete. Merge into..
1305 (Stub_table::Stub_table): ..here.
1306 (Stub_table::can_reach_stub): New function.
1307 (Stub_table::add_plt_call_entry): Add "from" parameter and
1308 return true iff stub could be reached.
1309 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
1310 param too.
1311 (Stub_table::clear_stubs): Add "all" param.
1312
a20605cf
AM
13132014-11-26 Alan Modra <amodra@gmail.com>
1314
1315 * powerpc.cc (Stub_control::set_output_and_owner): New function.
1316 (Target_powerpc::group_sections): Use it.
1317
43b64deb
CC
13182014-11-25 Cary Coutant <ccoutant@google.com>
1319
1320 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
1321 (Binary_to_elf::write_symbol): Add st_size parameter.
1322 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
1323
c924eb67
CC
13242014-11-25 Cary Coutant <ccoutant@google.com>
1325
1326 PR gold/17639
1327 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
1328 (Sized_relobj_file::do_layout): Handle deferred sections properly
1329 during GC pass 1. Don't add reloc sections to deferred list twice.
1330 * object.h (Sized_relobj_file::is_deferred_layout): New function.
1331 (Sized_relobj_file::is_deferred_layout_): New data member.
1332
9d585188
L
13332014-11-21 H.J. Lu <hongjiu.lu@intel.com>
1334
1335 PR gold/17619
1336 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
1337 Check PC-relative offset overflow in PLT entry.
1338
3ffaac20
AM
13392014-11-21 Alan Modra <amodra@gmail.com>
1340
1341 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
1342 for undefined weaks.
1343
0cfb0717
AM
13442014-11-20 Alan Modra <amodra@gmail.com>
1345
1346 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
1347 from --stub-group-size parameter divided by 1024.
1348 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
1349 template parameter. Update all uses.
1350 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
1351 has_stub_value. Set for long branches. Don't report overflow for
1352 branch to undefined weak symbols. Print info message on
1353 overflowing branch to stub.
1354
f9dffbf0
AM
13552014-11-20 Alan Modra <amodra@gmail.com>
1356
1357 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
1358
e88ba8d5
L
13592014-11-13 H.J. Lu <hongjiu.lu@intel.com>
1360
1361 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
1362 entry for R_X86_64_GOTPLT64.
1363 (Target_x86_64<size>::Relocate::relocate): Update comments for
1364 R_X86_64_GOTPLT64.
1365
d37ffe25
ED
13662014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
1367
1368 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
1369 * plugin.h: add lock definition
1370
9726c3c1
HS
13712014-10-29 Han Shen <shenhan@google.com>
1372 Jing Yu <jingyu@google.com>
1373
1374 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
1375 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1376 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
1377 Symbol::TLS_REF.
1378 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
1379 method.
1380 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
1381 (Target_aarch64::tls_ld_to_le): New method.
1382 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
1383 for 64bit targets.
1384 (Output_data_plt_aarch64::irelative_rel_): New data member.
1385 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
1386 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
1387 (Output_data_plt_aarch64::add_relocation): New method.
1388 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
1389 offset. Add got_irelative size to got size.
1390 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
1391 type string with the new typename.
1392 (AArch64_relocate_functions::update_adr): Replace parameter x with
1393 immed.
1394 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
1395 (AArch64_relocate_functions::reloc_common): New method.
1396 (AArch64_relocate_funcsions::rela_general): Extract common part out
1397 into reloc_common method.
1398 (AArch64_relocate_functions::rela_general): Likewise.
1399 (AArch64_relocate_functions::pcrela_general): Likewise.
1400 (AArch64_relocate_functions::adr): New method.
1401 (AArch64_relocate_functions::adrp): Calculate immed before calling
1402 update_adr.
1403 (AArch64_relocate_functions::adrp): Likewise.
1404 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
1405 comparing x to 0. Calculate immed from ~x when x < 0.
1406 (Target_aarch64::optimize_tls_reloc): Add new cases for
1407 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1408 TLSLD_MOVW_DTPREL_G0_NC.
1409 (Target_aarch64::possible_function_pointer_reloc): Implement this
1410 method.
1411 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
1412 comment.
1413 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
1414 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1415 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1416 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
1417 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1418 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1419 (Target_aarch64::make_plt_entry): Call add_entry with two more
1420 parameters.
1421 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1422 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
1423 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1424 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1425 (Target_aarch64::Relocate::relocate_tls): Add cases for
1426 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1427 TLSLD_MOVW_DTPREL_G0_NC.
1428 * testsuite/icf_safe_so_test.cc: Correct test comment.
1429 * testsuite/icf_safe_test.sh: Add AArch64 arch.
1430
80272b8c
AM
14312014-10-22 Alan Modra <amodra@gmail.com>
1432
1433 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
1434 thread_starter.
1435
998a69f4
AS
14362014-10-18 Andreas Schwab <schwab@linux-m68k.org>
1437
1438 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
1439
aed56ec5
CC
14402014-10-17 Cary Coutant <ccoutant@google.com>
1441
1442 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1443 Add "typename" keyword.
1444
bb779192 14452014-10-15 Han Shen <shenhan@google.com>
83a01957
HS
1446 Jing Yu <jingyu@google.com>
1447
1448 Patch for gold aarch64 backend to support relaxation.
1449 * aarch64-reloc.def: Change format.
1450 * aarch64.cc (class Reloc_stub): New class.
1451 (class Stub_table): New class.
1452 (class AArch64_relobj): New class.
1453 (class AArch64_input_section): New class.
1454 (class AArch64_output_section): New class.
1455 (Target_aarch64::new_stub_table): New method.
1456 (Target_aarch64::new_aarch64_input_section): New method.
1457 (Target_aarch64::find_aarch64_input_section): New method.
1458 (Target_aarch64::scan_section_for_stubs): New method.
1459 (Target_aarch64::scan_reloc_section_for_stubs): New method.
1460 (Target_aarch64::relocate_stub): New method.
1461 (Target_aarch64::current_target): New method.
1462 (Target_aarch64::do_make_elf_object): New method.
1463 (Target_aarch64::do_may_relax): New method.
1464 (Target_aarch64::do_relax): New method.
1465 (Target_aarch64::group_sections): New method.
1466 (Target_aarch64::scan_reloc_for_stub): New method.
1467 (Target_aarch64::do_make_output_section): New method.
1468 (Target_aarch64::stub_tables_): New data member.
1469 (Target_aarch64::aarch64_input_section_map_): New data member.
1470 (AArch64_relocate_functions::maybe_apply_stub): New method.
1471
db4c9594
CC
14722014-09-30 Cary Coutant <ccoutant@google.com>
1473
1474 PR gold/17432
1475 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
1476
cd6da036
KC
14772014-09-30 Kito Cheng <kito@0xlab.org>
1478
1479 PR gold/13597
1480 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
1481 hash table before sysv-style hash table.
1482
5f772412
ST
14832014-09-29 Sriraman Tallam <tmsriram@google.com>
1484
1485 * options.h (--pic-executable): Add negative to alias to -no-pie.
1486
5efeedf6
CC
14872014-09-26 Cary Coutant <ccoutant@google.com>
1488
1489 PR gold/16773
1490 * object.cc (Sized_relobj_file): Compute value of section symbols
1491 for TLS sections the same as TLS symbols.
1492
1707f183
CC
14932014-09-25 Cary Coutant <ccoutant@google.com>
1494
1495 PR gold/17432
1496 * resolve.cc (Symbol_table::resolve): Override common placeholder
1497 symbols, but adjust sizes.
1498 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
1499 symbols to common lists.
1500
00cac886
AM
15012014-09-24 Alan Modra <amodra@gmail.com>
1502
1503 * po/POTFILES.in: Regenerate.
1504
635aa30e
CC
15052014-09-23 Taiju Tsuiki <tzik@google.com>
1506 Cary Coutant <ccoutant@google.com>
1507
71b9b91b 1508 PR gold/14860
635aa30e
CC
1509 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
1510 on input_sections_blocker.
1511 * layout.cc (Write_sections_task::locks): Unblock
1512 input_sections_blocker_.
1513 * layout.h (Write_sections_task::Write_sections_task): Add
1514 input_sections_blocker.
1515 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
1516 to DEPENDENCIES.
1517 * testsuite/Makefile.in: Regenerate.
1518
c0c71592
RÁE
15192014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1520
1521 * testsuite/Makefile.am (plugin_test_10): New test.
1522 * testsuite/Makefile.in: Regenerate
1523 * testsuite/plugin_common_test_2.c (c1): Align to 8.
1524 * testsuite/plugin_test_10.sh: New file.
1525
6168c2a1
RÁE
15262014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1527
1528 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
1529 * resolve.cc (Symbol_table::resolve): Don't override common symbols
1530 during the replacement phase.
1531
3a531937
JY
15322014-09-17 Han Shen <shenhan@google.com>
1533 Jing Yu <jingyu@google.com>
1534
1535 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
1536 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
1537 * aarch64.cc (Target_aarch64): Add data members
1538 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
1539 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
1540 constructor.
1541 (Target_aarch64::do_reloc_symbol_index): New method.
1542 (Target_aarch64::do_reloc_addend): New method.
1543 (Target_aarch64::add_tlsdesc_info): New method.
1544 (Target_aarch64::do_dynsym_value): New method.
1545 (Target_aarch64::do_make_data_plt): Add new parameters: got,
1546 got_irelative. Pass them to Output_data_plt_aarch64_standard.
1547 (Target_aarch64::make_data_plt): Add new parameters: got,
1548 got_irelative. Pass them to do_make_data_plt.
1549 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
1550 (Target_aarch64::Relocate:tls_gd_to_le): New method.
1551 (Target_aarch64::Relocate:tls_ie_to_le): New method.
1552 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
1553 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
1554 (Target_aarch64::got_tlsdesc_section): New method.
1555 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1556 (Target_aarch64::define_tls_base_symbol): New method.
1557 (Target_aarch64::reserve_tlsdesc_entries): New method.
1558 (Target_aarch64::got_mod_index_entry): New method.
1559 (Target_aarch64::rela_tlsdesc_section): New method.
1560 (Target_aarch64::rela_irelative_section): New method.
1561 (Target_aarch64::Tlsdesc_info): New struct.
1562 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
1563 relocations and tlsdesc relocations.
1564 (Target_aarch64::optimize_tls_reloc): Implement method.
1565 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
1566 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
1567 in constructor.
1568 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
1569 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
1570 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
1571 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
1572 (Output_data_plt_aarch64::rela_tlsdesc): New method.
1573 (Output_data_plt_aarch64::rela_irelative): New method.
1574 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
1575 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
1576 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
1577 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
1578 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
1579 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
1580 (Output_data_plt_aarch64_standard): New member variables:
1581 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
1582 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
1583 New parameter: got, got_irelative.
1584 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
1585 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
1586 (Output_data_plt_aarch64::do_write): Replace got_address with
1587 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
1588 (AArch64_relocate_functions::update_movnz): New method.
1589 (AArch64_relocate_functions): Correct format.
1590 (AArch64_relocate_functions::movnz): New method.
1591 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
1592 before the switch. Add new cases to switch.
00cac886 1593 Check ie_to_le relaxation on tlsie relocations. Add code handling
3a531937
JY
1594 tlsgd tlsdesc cases.
1595 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
1596 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
1597 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
1598 Call reloc_name_in_error_message to print unsupported reloc.
1599 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
1600 make_data_plt.
1601 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
1602 relocs. Fill in some more dynamic tags.
1603 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
1604 Skip call tls_get_addr when tlsgd is relaxed.
1605 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
1606 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
1607 tlsdesc->ie relaxation.
1608
62661c93
SS
16092014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1610
1611 * mips.cc (Target_mips_nacl): New class.
1612 (Target_selector_mips_nacl): New class.
1613 (target_selector_mips32): Rename from target_selector_mips32be and use
1614 Target_selector_mips_nacl instead of Target_selector_mips.
1615 (target_selector_mips32el): Rename from target_selector_mips32 and use
1616 Target_selector_mips_nacl instead of Target_selector_mips.
1617 (target_selector_mips64): Rename from target_selector_mips64be and use
1618 Target_selector_mips_nacl instead of Target_selector_mips.
1619 (target_selector_mips64el): Rename from target_selector_mips64 and use
1620 Target_selector_mips_nacl instead of Target_selector_mips.
1621 (Target_mips::mips_info): Add const attribute.
1622
54674d38
CC
16232014-09-02 Cary Coutant <ccoutant@google.com>
1624
1625 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
1626 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
1627 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
1628 (Sized_incr_dynobj::do_section_name): Likewise.
1629 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
1630 (Sized_incr_dynobj::do_section_name): Likewise.
1631 * object.h (Object::section_name): Likewise.
1632 (Object::do_section_name): Likewise.
1633 (Sized_relobj_file::do_section_name): Likewise.
1634 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
1635 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
1636
9860cbcf
CC
16372014-09-02 Cary Coutant <ccoutant@google.com>
1638
1639 PR gold/17005
1640 * ehframe.cc (Fde::write): Add output_offset parameter.
1641 (Cie::write): Likewise.
1642 (Eh_frame::set_final_data_size): Account for offset within output
1643 section.
1644 (Eh_frame::do_sized_write): Likewise.
1645 * ehframe.h (Fde::write): Add output_offset parameter.
1646 (Cie::write): Likewise.
1647 * output.cc (Output_section::Input_section_sort_entry): Remove
1648 section_has_name_; add output_section_name parameter. Use
1649 output section name for non-input sections.
1650 (Output_section::Input_section_sort_entry::section_has_name): Remove.
1651 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
1652 (Output_section::Input_section_sort_compare): Remove logic for
1653 sections without names.
1654 (Output_section::Input_section_sort_init_fini_compare): Likewise.
1655 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
1656 Likewise.
1657 (Output_section::Input_section_sort_section_name_compare): Likewise.
1658
8e33481e
HS
16592014-08-29 Han Shen <shenhan@google.com>
1660 Jing Yu <jingyu@google.com>
1661
1662 * aarch64-reloc-property.cc
1663 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
1664 reference reloc property in the table.
1665 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
1666 3 other entries.
1667 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
1668 2 new overloaded methods.
1669 (Output_data_got_aarch64::do_write): Add code to write out
1670 static relocs.
1671 (class Output_data_got_aarch64::Static_reloc): New class to wrap
1672 static relocs.
1673 (Output_data_got_aarch64::static_relocs): New vector to
1674 hold static relocs.
1675 (Target_aarch64::TCB_SIZE): New const static memeber.
1676 (Target_aarch64::tcb_size): New method.
1677 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
1678 (Target_aarch64::Relocate::relocate_tls): New method.
1679 (Target_aarch64::Scan::local): Add code handling new reloc types.
1680 (Target_aarch64::Scan::global): Add code handling new reloc types.
1681
81233653
ST
16822014-08-13 Sriraman Tallam <tmsriram@google.com>
1683
1684 * options.h (-no-pie): Add option.
1685
9363c7c3
JY
16862014-08-08 Jing Yu <jingyu@google.com>
1687 Han Shen <shenhan@google.com>
1688
1689 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
1690 (DEFFILES): add aarch64-reloc.def.
1691 (TARGETSOURCES): Add aarch64-reloc-property.cc.
1692 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
1693 * Makefile.in: Regenerate.
1694 * aarch64-reloc-property.cc: New file.
1695 * aarch64-reloc-property.h: New file.
1696 * aarch64-reloc.def: New file.
1697 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
1698 with tab to make the format consistent.
1699 (Output_data_got_aarch64::symbol_table_): New method.
1700 (Target_aarch64::do_plt_address_for_global): New method.
1701 (Target_aarch64::do_plt_address_for_local): New method.
1702 (Target_aarch64::do_select_as_default_target): New method.
1703 (Target_aarch64::do_make_data_plt): New method.
1704 (Target_aarch64::make_data_plt): New method.
1705 (Output_data_plt_aarch64::has_irelative_section): New method.
1706 (Output_data_plt_aarch64::address_for_global): New method.
1707 (Output_data_plt_aarch64::address_for_local): New method.
1708 (Output_data_plt_aarch64::irelative_rel_): New parameter.
1709 (Output_data_plt_aarch64::add_entry): Implement contents.
1710 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
1711 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
1712 the got_pov entry to plt0.
1713 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
1714 Implement contents.
1715 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
1716 (AArch64_howto): New struct.
1717 (aarch64_howto[]): New static const array.
1718 (AArch64_relocate_functions): New class.
1719 (Target_aarch64::Scan::get_reference_flags): Remove method.
1720 (Target_aarch64::Scan::local): Implement to support a few relocations.
1721 (Target_aarch64::Scan::global): Implement to support a few relocations.
1722 (Target_aarch64::make_plt_section): Implement contents.
1723 (Target_aarch64::make_plt_entry): Implement contents.
1724 (Target_aarch64::do_finalize_sections): Implement contents.
1725 (Target_aarch64::Relocate::relocate): Implement a few relocations.
1726 (Target_aarch64::relocate_section): Implement contents.
1727
ad9fe6c1
AM
17282014-08-06 Alan Modra <amodra@gmail.com>
1729
1730 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
1731
7cd4e5b7
AM
17322014-08-06 Alan Modra <amodra@gmail.com>
1733
1734 PR 13227
1735 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
1736
5ad9b0a7
ST
17372014-07-21 Sriraman Tallam <tmsriram@google.com>
1738
1739 * object.cc (Relobj::is_section_name_included): Add
7c16d96e 1740 ".rodata.nptl_version" to not garbage collect this section.
5ad9b0a7 1741
e051745c
CC
17422014-07-08 Cary Coutant <ccoutant@google.com>
1743
1744 * expression.cc (struct Expression::Expression_eval_info): Add
1745 new fields type_pointer, vis_pointer, and nonvis_pointer.
1746 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
1747 nonvis_pointer parameters. Adjust all calls.
1748 (Symbol_expression::value): Update type, visibility, and nonvis bits
1749 in caller.
1750 * script.cc (Symbol_assignment::sized_finalize): Update type,
1751 visibility, and remaining st_other bits for new symbol.
1752 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
1753 vis_pointer, and nonvis_pointer parameters.
1754 * symtab.h (Symbol::set_type): New method.
1755
1756 * testsuite/Makefile.am (defsym_test): New test.
1757 * testsuite/Makefile.in: Regenerate.
1758 * testsuite/defsym_test.c: New file.
1759 * testsuite/defsym_test.sh: New file.
1760
f35c4853
CC
17612014-07-08 Cary Coutant <ccoutant@google.com>
1762
1763 PR gold/15639
1764 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
1765 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
1766 (Sized_dynobj::base_read_symbols): ...new method.
1767 * object.h (Sized_relobj_file::base_read_symbols): New method.
1768 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
1769 (Sized_relobj_file::base_read_symbols): ...new method.
1770 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
1771 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
1772 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
1773
2900af2d
AM
17742014-07-04 Alan Modra <amodra@gmail.com>
1775
1776 * po/POTFILES.in: Regenerate.
1777
053a4d68
JY
17782014-07-02 Jing Yu <jingyu@google.com>
1779
1780 * aarch64.cc: New file
1781 * Makefile.am (TARGETSOURCES): Add aarch64.cc
1782 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
1783 * Makefile.in: Regenerate.
1784 * configure.tgt: Add entries for aarch64*.
1785 * configure.ac: Likewise.
1786 * configure: Likewise.
1787
7b549045
AM
17882014-06-27 Alan Modra <amodra@gmail.com>
1789
1790 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
1791
cb818dbf
CC
17922014-06-24 Cary Coutant <ccoutant@google.com>
1793
1794 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
1795 sections.
1796 (Dwo_file::sized_read_unit_index): Likewise.
1797
9810d34d
SS
17982014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1799
1800 * mips.cc: New file.
1801 * Makefile.am (TARGETSOURCES): Add mips.cc
1802 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
1803 * configure.tgt: Add entries for mips*.
1804 * configure.ac: Likewise.
1805 * Makefile.in: Regenerate.
1806 * configure: Likewise.
1807
9baa787b
CC
18082014-06-09 Cary Coutant <ccoutant@google.com>
1809
1810 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
1811 unit_length is within section bounds.
1812
8f89af0a
CC
18132014-06-09 Cary Coutant <ccoutant@google.com>
1814
1815 PR gold/16980
1816 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
1817 map.
1818
a47622ac
AM
18192014-06-07 Alan Modra <amodra@gmail.com>
1820
1821 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
1822
4320c691
CC
18232014-06-06 Cary Coutant <ccoutant@google.com>
1824
1825 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
1826 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
1827 (Dwarf_pubnames_table::read_header): Likewise.
1828 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
1829 .debug_gnu_pubtypes.
1830
270c9937
JB
18312014-06-05 Joel Brobecker <brobecker@adacore.com>
1832
1833 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
1834 * Makefile.in, configure: Regenerate.
1835
397998fc
AM
18362014-06-03 Alan Modra <amodra@gmail.com>
1837
1838 * powerpc.cc (addis_12_2): Define.
1839 (Stub_table::do_write): Support fusion on ELFv2 stubs.
1840
61f5c66f
AM
18412014-06-03 Alan Modra <amodra@gmail.com>
1842
1843 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
1844 st_other output.
1845
f6971787
AM
18462014-06-02 Alan Modra <amodra@gmail.com>
1847
1848 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
1849 Only ignore relocs on ELFv1.
1850 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
1851
f6fb8322
CC
18522014-05-30 Cary Coutant <ccoutant@google.com>
1853
1854 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
1855 * testsuite/Makefile.in: Regenerate.
1856 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
1857
c23dd342
L
18582014-05-27 H.J. Lu <hongjiu.lu@intel.com>
1859
1860 PR gold/16945
1861 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
1862 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
1863
5fe7ffdc
AM
18642014-05-15 Alan Modra <amodra@gmail.com>
1865
1866 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
1867 Compare FDE contents with DW_CFA_nop rather than 0.
1868
a82bef93
ST
18692014-05-13 Sriraman Tallam <tmsriram@google.com>
1870
1871 * symtab.h (may_need_copy_reloc): Remove check for position independent
1872 code.
1873 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
1874 position independence before pc absolute may_need_copy_reloc call.
1875 Add check for executable output befor pc relative may_need_copy_reloc
1876 call.
1877 * i386.cc: Ditto.
1878 * arm.cc: Ditto.
1879 * sparc.cc: Ditto.
1880 * tilegx.cc: Ditto.
1881 * powerpc.cc: Add check for no position independence before
1882 may_need_copy_reloc calls.
1883 * testsuite/pie_copyrelocs_test.cc: New file.
1884 * testsuite/pie_copyrelocs_shared_test.cc: New file.
1885 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 1886 * Makefile.in: Regenerate.
a82bef93 1887
53c66605
ML
18882014-05-08 Martin Liška <mliska@suse.cz>
1889
1890 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
1891
57b2284c
CC
18922014-05-06 Cary Coutant <ccoutant@google.com>
1893
1894 PR gold/16900
1895 * i386.cc (Output_data_got_plt_i386): New class.
1896 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
1897 parameter. Change all callers.
1898 (Output_data_plt_i386::layout_): Remove.
1899 (Output_data_plt_i386::got_plt_): Change type.
1900 (Target_i386::got_plt_): Change type. Change all references.
1901 (Target_i386::got_section): Create instance of new class.
1902 (Output_data_got_plt_i386::do_write): New function.
1903 * x86_64.cc (Output_data_got_plt_x86_64): New class.
1904 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
1905 parameter. Change all callers.
1906 (Output_data_plt_x86_64::layout_): Remove.
1907 (Output_data_plt_x86_64::got_plt_): Change type.
1908 (Target_x86_64::got_plt_): Change type. Change all references.
1909 (Target_x86_64::got_section): Create instance of new class.
1910 (Output_data_got_plt_x86_64::do_write): New function.
1911 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
1912 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
1913 class.
1914
6b97515d 19152014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 1916
6b97515d
CC
1917 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
1918 if we have pubnames/pubtypes.
1919
d1bddd3c
CC
19202014-05-02 Cary Coutant <ccoutant@google.com>
1921
5fe7ffdc
AM
1922 * defstd.cc (in_segment): Define __ehdr_start here...
1923 * layout.cc (Layout::finalize): ...Instead of here. Set the
1924 output segment when known.
1925 * resolve.cc (Symbol::override_base_with_special): Remember
1926 the original binding.
1927 * symtab.cc (Symbol::set_output_segment): New function.
1928 (Symbol::set_undefined): New function.
1929 * symtab.h (Symbol::is_weak_undefined): Check original undef
1930 binding.
1931 (Symbol::is_strong_undefined): New function.
1932 (Symbol::set_output_segment): New function.
1933 (Symbol::set_undefined): New function.
1934 * target-reloc.h (is_strong_undefined): Remove.
1935 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
1936 Check for hidden undefs.
1937 (relocate_section): Call Symbol::is_strong_undefined.
1938
1939 * testsuite/Makefile.am (ehdr_start_test_1)
1940 (ehdr_start_test_2, ehdr_start_test_3)
1941 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
1942 * testsuite/Makefile.in: Regenerate.
1943 * testsuite/ehdr_start_def.cc: New source file.
1944 * testsuite/ehdr_start_test.cc: New source file.
1945 * testsuite/ehdr_start_test.t: New linker script.
1946 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 1947
7849f6d8
CC
19482014-04-23 Cary Coutant <ccoutant@google.com>
1949
bf2cc635 1950 PR gold/16870
7849f6d8
CC
1951 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
1952
99fd8cff
CC
19532014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1954
1955 * layout.cc (Layout::include_section): Allow a target to decide
1956 whether to include a section.
1957 * target.h (Target::should_include_section): New function.
1958 (Target::do_should_include_section): New function.
1959
91f43acd
CC
19602014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1961
1962 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
1963 inline into ...
1964 (Copy_relocs::emit): ... here.
1965 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
1966 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
1967 (Copy_reloc_entry::entries_): Change from private to protected.
1968
c4eb27e1
ST
19692014-04-02 Sriraman Tallam <tmsriram@google.com>
1970
1971 * icf.cc (get_section_contents): Replace copies of reloc
1972 vectors with const references.
1973
ae447ddd
CC
19742014-04-02 Cary Coutant <ccoutant@google.com>
1975
1976 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
1977 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
1978 * configure: Regenerate.
1979 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
1980 -fno-use-linker-plugin.
1981 (LINK1, CXXLINK1): Add it to the link command.
1982 * testsuite/Makefile.in: Regenerate.
1983
fa47fa92
AM
19842014-03-12 Alan Modra <amodra@gmail.com>
1985
1986 * Makefile.in: Regenerate.
1987
9b12c500
CC
19882014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1989
1990 * symtab.h (Symbol::set_nonvis): New function.
1991
beacaa96
CC
19922014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1993
1994 * symtab.cc (Sized_symbol<32>::init_output_data):
1995 Instantiate the template.
1996 (Sized_symbol<64>::init_output_data): Likewise.
1997
800d9823
CC
19982014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1999
2000 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
2001 adjust dynamic symbol value.
2002 * target.h (Target::adjust_dyn_symbol): New function.
2003 (Target::do_adjust_dyn_symbol): New function.
2004
918fc1f8 20052014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 2006
918fc1f8
CC
2007 * output.cc (Output_data_dynamic::Dynamic_entry::write):
2008 Get the value of DYNAMIC_CUSTOM dynamic entry.
2009 * output.h (Output_data_dynamic::add_custom): New function.
2010 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
2011 dynamic entry.
2012 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
2013 * target.h (Target::dynamic_tag_custom_value): New function.
2014 (Target::do_dynamic_tag_custom_value): New function.
2015
98ff9231
CC
20162014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2017
2018 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
2019 dynsym indexes.
2020 * target.h (Target::has_custom_set_dynsym_indexes): New function.
2021 (Target::do_has_custom_set_dynsym_indexes): New function.
2022 (Target::set_dynsym_indexes): New function.
2023 (Target::do_set_dynsym_indexes): New function.
2024
b80eed39
AM
20252014-03-07 Alan Modra <amodra@gmail.com>
2026
2027 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
2028 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
2029 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
2030 (Powerpc_relocate_functions::has_overflow_bitfield,
2031 overflowed): Use the above.
2032 (Target_powerpc::Relocate::relocate): Correct overflow checking
2033 for a number of relocations. Modify overflow test for 16-bit
2034 fields in instructions to signed/unsigned according to whether
2035 the field takes a signed or unsigned value.
2036
4b95cf5c
AM
20372014-03-05 Alan Modra <amodra@gmail.com>
2038
2039 Update copyright years.
2040
45965137
AM
20412014-03-05 Alan Modra <amodra@gmail.com>
2042
2043 * powerpc.cc (Target_powerpc::Scan::local, global): Support
2044 R_PPC64_ADDR64_LOCAL.
2045 (Target_powerpc::Relocate::relocate): Likewise.
2046
2c80b753
AM
20472014-03-03 Alan Modra <amodra@gmail.com>
2048
2049 * dwp.cc (print_version): Update copyright year to current.
2050
c1c69e83
AM
20512014-02-10 Alan Modra <amodra@gmail.com>
2052
2053 * po/gold.pot: Regenerate.
2054
dd0c4e70
CC
20552014-02-06 Cary Coutant <ccoutant@google.com>
2056
2057 Fix problem where -u is ignored when a weak undef is seen.
2058
2059 * archive.cc (Library_base::should_include_member): Reorder
2060 code to check for -u option if a weak undef has already been seen.
2061 * testsuite/Makefile.am (weak_undef_test_2): New test case.
2062 * testsuite/Makefile.in: Regenerate.
2063 * testsuite/weak_undef_file3.cc: New file.
2064 * testsuite/weak_undef_file4.cc: New file.
2065 * testsuite/weak_undef_test_2.cc: New file.
2066
1a221d3d
CC
20672014-02-05 Cary Coutant <ccoutant@google.com>
2068
2069 Fix issues with gold undefined symbol diagnostics.
2070
2071 PR binutils/15435
2072 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
2073 check to here.
2074 * target-reloc.h (is_strong_undefined): New function.
2075 (relocate_section): Move undef vtable symbol check from here.
2076 Check for is_strong_undefined.
2077
e889f0a4 20782014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 2079
e889f0a4
CC
2080 Fix problems with the --dynamic-list option.
2081
2082 PR gold/13577
2083 * options.cc (General_options::parse_dynamic_list):
2084 Set have_dynamic_list_.
2085 (General_options::General_options): Initialize have_dynamic_list_.
2086 (General_options::finalize): Turn off -Bsymbolic and
2087 -Bsymbolic-functions if --dynamic-list provided.
2088 * options.h (General_options::have_dynamic_list): New function.
2089 (General_options::have_dynamic_list_): New data member.
2090 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
2091 correctly.
5fe7ffdc 2092
e889f0a4
CC
2093 PR gold/16530
2094 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
2095 in --dynamic-list, mark it.
5fe7ffdc 2096
e889f0a4
CC
2097 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
2098 (dynamic_list_2): New test case.
2099 * testsuite/Makefile.in: Regenerate.
2100 * testsuite/dynamic_list_2.cc: New file.
2101 * testsuite/dynamic_list_2.t: New file.
2102 * testsuite/dynamic_list_lib1.cc: New file.
2103 * testsuite/dynamic_list_lib2.cc: New file.
2104 * testsuite/gc_dynamic_list_test.c: New file.
2105 * testsuite/gc_dynamic_list_test.sh: New file.
2106 * testsuite/gc_dynamic_list_test.t: New file.
2107
ec673e64
CC
21082014-01-28 Cary Coutant <ccoutant@google.com>
2109
2110 Add .gdb_index version 7 support.
2111
2112 * gold/dwarf_reader.cc: include <utility> (for make_pair).
2113 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
2114 debug sections.
2115 (Dwarf_ranges_table::read_ranges_table): Likewise.
2116 (Dwarf_pubnames_table::read_section): Check for GNU-style
2117 sections, and for compressed debug sections.
2118 (Dwarf_pubnames_table::read_header): Compute end address of table.
2119 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
2120 for end of list by offset, not by offset == 0.
2121 (Dwarf_info_reader::do_read_string_table): Check for compressed
2122 debug sections.
2123 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2124 Initialize new data members.
2125 (Dwarf_pubnames_table::next_name): return flag_byte.
2126 (Dwarf_pubnames_table::end_of_table_): New data member.
2127 (Dwarf_pubnames_table::is_gnu_style_): New data member.
2128 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
2129 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
2130 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
2131 read skeleton type unit DIEs.
2132 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
2133 (Gdb_index::do_write): Write flag_byte.
2134 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
2135 (Gdb_index::Cu_vector): Store flags along with cu indexes.
2136 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
2137 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
2138
221fd5d5
L
21392014-01-08 H.J. Lu <hongjiu.lu@intel.com>
2140
2141 * version.cc (print_version): Update copyright year to 2014.
2142
6c09fb0b
ILT
21432013-12-19 Dimitry Andric <dimitry@andric.com>
2144
2145 * stringpool.cc (Stringpool_template::reserve): Add
2146 HAVE_UNORDERED_MAP case.
2147 * stringpool.cc (Stringpool_template::print_stats): Likewise.
2148
8356f2d0
CC
21492013-12-18 Cary Coutant <ccoutant@google.com>
2150
2151 * configure.ac: Check for <unordered_set> and <unordered_map>.
2152 * config.in: Regenerate.
2153 * configure: Regenerate.
2154 * system.h: Use <unordered_set> and <unordered_map> if available.
2155
f2c7d7ee
RM
21562013-12-10 Roland McGrath <mcgrathr@google.com>
2157
2158 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
2159 with $(INSTALL_PROGRAM_ENV).
2160 * Makefile.in: Regenerate.
2161
6632e8cc
CC
21622013-11-22 Cary Coutant <ccoutant@google.com>
2163
2164 * configure.ac: Add check for which library is needed for
2165 dlopen.
2166 * configure: Regenerate.
2167
0c075858
CC
21682013-11-22 Cary Coutant <ccoutant@google.com>
2169
2170 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
2171 assembler.
2172 * testsuite/Makefile.in: Regenerate.
2173
f49fe902
L
21742013-11-17 H.J. Lu <hongjiu.lu@intel.com>
2175
2176 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
2177 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
2178 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
2179 (Target_x86_64<size>::Scan::local): Likewise.
2180 (Target_x86_64<size>::Scan::global): Likewise.
2181 (Target_x86_64<size>::Relocate::relocate): Likewise.
2182 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
2183 Likewise.
2184 (Target_x86_64<size>::Scan::check_non_pic(): Handle
2185 R_X86_64_PC32_BND.
2186
2187 * testsuite/Makefile.am (check_PROGRAMS): Add
2188 exception_x86_64_bnd_test.
2189 (exception_x86_64_bnd_test_SOURCES): New macro.
2190 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
2191 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
2192 (exception_x86_64_bnd_test_LDADD): Likewise.
2193 (exception_x86_64_bnd_1.o): New rule.
2194 (exception_x86_64_bnd_2.o): Likewise.
2195 * testsuite/Makefile.in: Regenerated.
2196
9055360d
AM
21972013-11-15 Alan Modra <amodra@gmail.com>
2198
2199 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
2200 accessor.
2201 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
2202 Only call ppc64_local_entry_offset for 64-bit. Restrict
2203 symval_for_branch lookup to ELFv1.
2204 (Stub_table::add_plt_call_entry): Use unsigned int off.
2205 (Output_data_glink::Address, invalid_address): New.
2206 (Output_data_glink::add_eh_frame): Move out of line. Add
2207 support for ELFv2.
2208 (Output_data_glink::add_global_entry, find_global_entry,
2209 global_entry_address): New functions.
2210 (Output_data_glink::global_entry_stubs_, end_branch_table_,
2211 ge_size): New variables.
2212 (Output_data_glink::set_final_data_size): Add global entry
2213 stub sizing.
2214 (Output_data_glink::do_write): Write global entry stubs.
2215 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
2216 parameter. Return true for ELFv2. Adjust callers.
2217 (Target_powerpc::Scan::local, global): Restrict opd lookup to
2218 ELFv1. Similarly for ifunc and dynamic relocation processing
2219 specific to ELFv1. Recognize that symbols are defined on
2220 their plt entries for ELFv2.
2221 (Target_powerpc::symval_for_branch): Assert if called for
2222 ELFv2 or ppc32.
2223 (Target_powerpc::Relocate::relocate): Use global entry plt
2224 stub for symbol value if such exists on ELFv2.
2225 (Target_powerpc::Relocate::relocate): Don't call
2226 symval_for_branch when ELFv2. Do adjust for local entry
2227 offset when ELFv2.
2228 (Target_powerpc::do_dynsym_value): Set symbols to global entry
2229 plt stub for ELFv2.
2230 (Target_powerpc::do_plt_address_for_global): Similarly.
2231
cafdd569
CC
22322013-11-14 Cary Coutant <ccoutant@google.com>
2233
2234 Revert patch -- this did not fix the problem, and there is
2235 no race there.
2236
2237 2013-11-14 Cary Coutant <ccoutant@google.com>
2238
2239 PR gold/14860
2240 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2241 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2242 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2243 updating fde_offsets_.
2244 (Eh_frame_hdr::lock_): New data member.
2245
94e49e16
CC
22462013-11-14 Cary Coutant <ccoutant@google.com>
2247
2248 * dwp.cc (Dwo_file_entry): New type.
2249 (File_list): Use Dwo_file_entry.
2250 (Dwo_file::verify): New function.
2251 (Dwo_file::verify_dwo_list): New function.
2252 (Dwo_file::sized_verify_dwo_list): New function.
2253 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
2254 list.
2255 (Dwp_options): New enum type.
2256 (dwp_options): Add --verify-only.
2257 (usage): Likewise.
2258 (main): Likewise.
2259 * dwp.h (gold_info): Add declaration.
2260
7cdd7d57
CC
22612013-11-14 Cary Coutant <ccoutant@google.com>
2262
2263 PR gold/14860
2264 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2265 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2266 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2267 updating fde_offsets_.
2268 (Eh_frame_hdr::lock_): New data member.
2269
1d946cb3
CC
22702013-11-06 Cary Coutant <ccoutant@google.com>
2271
2272 PR gold/15758
2273 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
2274 before reloc sections.
2275
4f65b40e
AM
22762013-11-04 Alan Modra <amodra@gmail.com>
2277
2278 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
2279 (Symbol::needs_dynamic_reloc): Test new flag.
2280 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
2281 (Target_powerpc::Scan::get_reference_flags): Add target param.
2282 Return FUNC_DESC_ABI for 64-bit ELFv1.
2283 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
2284 call.
2285 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
2286 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
2287
908794a9
CC
22882013-10-31 Cary Coutant <ccoutant@google.com>
2289
2290 Restore support for dwp v2 DWARF package file format.
2291
2292 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2293 tu_length parameter. Adjust all callers.
2294 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2295 * dwp.cc: Include dwarf.h.
2296 (Section_bounds): New struct type.
2297 (Unit_set): New struct type.
2298 (Dwo_file::Dwo_file): Initialize new data member.
2299 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2300 Combine and rename to...
2301 (Dwo_file::read_unit_index): ...this.
2302 (Dwo_file::sized_read_compunit_index)
2303 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2304 (Dwo_file::sized_read_unit_index): ...this.
2305 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2306 parameters; add section_id parameter.
2307 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2308 (Dwo_file::add_unit_set): ...this.
2309 (Dwo_file::shndx_map_): Remove.
2310 (Dwo_file::sect_offsets_): New data member.
2311 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2312 (Dwp_output_file::add_section): Rename to...
2313 (Dwp_output_file::add_contribution): ...this.
2314 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2315 (Dwp_output_file::add_tu_set): Likewise.
2316 (Dwp_output_file::Contribution): New type.
2317 (Dwp_output_file::Section::contributions): New data member.
2318 (Dwp_output_file::Cu_or_tu_set): Remove.
2319 (Dwp_output_file::Section::Section): New ctor.
2320 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2321 (Dwp_output_file::Dwp_index::Section_table): New type.
2322 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2323 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2324 parameter.
2325 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2326 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2327 (Dwp_output_file::Dwp_index::section_table): New member function.
2328 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2329 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2330 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2331 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2332 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2333 (Dwp_output_file::Dwp_index::section_table_): New data member.
2334 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2335 (Dwp_output_file::add_output_section): New member function.
2336 (Dwp_output_file::write_new_section): New member function.
2337 (Dwp_output_file::write_contributions): New member function.
2338 (Dwp_output_file::section_id_map_): New data member.
2339 (class Dwo_id_info_reader): Remove.
2340 (class Unit_reader): New class.
2341 (get_dwarf_section_name): New function.
2342 (Dwo_file::read_executable): Adjust initializations of class data.
2343 (Dwo_file::read): Add support for v2 package file format.
2344 (Dwo_file::read_unit_index): Likewise.
2345 (Dwo_file::sized_read_unit_index): Likewise.
2346 (Dwo_file::copy_section): Likewise.
2347 (Dwo_file::add_unit_set): Likewise.
2348 (Dwp_output_file::add_output_section): Likewise.
2349 (Dwp_output_file::add_contribution): Likewise.
2350 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2351 for empty slot.
2352 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2353 file format.
2354 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2355 slot.
2356 (Dwp_output_file::initialize): Remove unused function.
2357 (Dwp_output_file::finalize): Add support for v2 package file format.
2358 (Dwp_output_file::write_index): Likewise.
2359 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2360 function prototype.
2361
2500c017
CC
23622013-10-31 Cary Coutant <ccoutant@google.com>
2363
2364 * configure.ac: Fix check for -fmerge-constants.
2365 * configure.ac: Regenerate.
2366
dd0845d7
RM
23672013-10-30 Roland McGrath <mcgrathr@google.com>
2368
2369 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
2370 Correct 9-byte nop sequence to match what the assembler generates.
2371
b4f7960d
AM
23722013-10-30 Alan Modra <amodra@gmail.com>
2373
2374 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
2375 ppc64_local_entry_offset, ppc64_local_entry_offset,
2376 do_read_symbols): New functions.
2377 (Powerpc_relobj::e_flags_, st_other_): New vars.
2378 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
2379 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
2380 (Powerpc_relobj::e_flags_): New var.
2381 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
2382 and adjust for ELFv2.
2383 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
2384 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
2385 (Powerpc_dynobj::do_find_special_sections): Likewise.
2386 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
2387 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
2388 to ELFv2 local entry.
2389 (Target_powerpc::do_relax): No thread safe barriers needed for
2390 ELFv2.
2391 (Output_data_plt_powerpc::initial_plt_entry_size_,
2392 plt_entry_size): Delete. Replace all uses with
2393 first_plt_entry_offset() and plt_entry_size().
2394 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
2395 reserved_size parm. Update callers.
2396 (Output_data_plt_powerpc::entry_count): Update.
2397 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
2398 and use Target_powerpc::first_plt_entry_offset().
2399 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
2400 rename to plt_entry_size.
2401 (Output_data_plt_powerpc::add_ifunc_entry,
2402 add_local_ifunc_entry): Adjust reloc for ELFv2.
2403 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
2404 (glink_eh_frame_fde_64v2): New.
2405 (Stub_table::plt_call_size): Support ELFv2 sizing.
2406 (Output_data_glink::add_eh_frame): Use the new FDE.
2407 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
2408 (Stub_table::do_write): Write ELFv2 stubs and glink.
2409 (Target_powerpc::Relocate::relocate): Replaces nop after call
2410 with ld 2,24(1) and adjust local offset destination for ELFv2.
2411
f9c6b907
AM
24122013-10-30 Alan Modra <amodra@gmail.com>
2413
2414 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
2415 (Target_powerpc::Scan::global, local): Likewise.
2416 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
2417 on all ppc64 @h and @ha relocs.
2418
e84fe78f
AM
24192013-10-14 Alan Modra <amodra@gmail.com>
2420
2421 * output.h (Output_data_got::add_constant): Tidy.
2422 (Output_data_got::add_constant_pair): New function.
2423 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
2424 methods used so as to first call reserve_ent().
2425
679e4abf
RM
24262013-10-11 Roland McGrath <mcgrathr@google.com>
2427
44dcb735
RM
2428 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
2429 add_got_entry and add_got_entry_pair.
2430
13323c49
RM
2431 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
2432 (HAVE_PUBNAMES): Likewise.
2433 * configure: Regenerate.
2434
1496b446
RM
2435 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
2436 * testsuite/Makefile.in: Regenerate.
2437
cc84c10b
RM
2438 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
2439 Remove const from declaration.
2440 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
2441 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
2442 * output.h (Output_file_header): Remove const from member target_
2443 and corresponding constructor argument.
2444 * output.cc (Output_file_header::Output_file_header): Update prototype.
2445 (Output_file_header::do_sized_write): Use this->target_ in place
2446 of parameters()->target().
2447
52f66a2c
RM
2448 * testsuite/undef_symbol.cc (Foo::get_a): New method.
2449
2b64b551
RM
2450 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
2451 * configure: Regenerate.
2452 * Makefile.in: Regenerate.
2453 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
2454 * testsuite/merge_string_literals_2.c: Likewise.
2455 * testsuite/Makefile.am
2456 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
2457 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
2458 literal -fmerge-constants.
2459 * testsuite/Makefile.in: Regenerate.
2460
43819297
RM
2461 * i386.cc (Target_i386): Remove unused member dynbss_.
2462 * arm.cc (Target_arm): Likewise.
2463 * powerpc.cc (Target_powerpc): Likewise.
2464 * sparc.cc (Target_sparc): Likewise.
2465 * tilegx.cc (Target_tilegx): Likewise.
2466 * x86_64.cc (Target_x86_64): Likewise.
2467 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
2468 type_signature_, type_offset_.
2469 * plugin.h (Plugin_hook): Remove unused member layout_.
2470 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
2471 mapfile_.
2472 (Read_member): Remove unused members input_objects_, symtab_,
2473 mapfile_, layout_.
2474 (Check_library): Remove unused member symtab_.
2475 * archive.h (Lib_group): Remove unused member lib_.
2476 * archive.cc (Lib_group::Lib_group): Update initializer.
2477 * incremental.h (Incremental_binary): Remove unused member target_.
2478 (Incremental_script_entry): Removed unused member script_.
2479 * layout.h (Write_symbols_task): Remove unused member input_objects_.
2480 * icf.h (Icf): Remove unused member num_tracked_relocs.
2481
39d9ead7
RM
2482 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
2483 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
2484 its only use.
2485 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
2486
679e4abf
RM
2487 * archive.h: Use struct rather than class for forward declaration
2488 of Read_symbols_data.
2489
54de2ea6
CC
24902013-10-07 Cary Coutant <ccoutant@google.com>
2491
2492 PR gold/16010
2493 * testsuite/Makefile.am (icf_test): Fix dependencies.
2494 (icf_safe_test): Likewise.
2495 (icf_safe_so_test): Likewise.
2496 (large_symbol_alignment): Add empty _LDADD rule.
2497 * testsuite/Makefile.in: Regenerate.
2498
b14016f0
L
24992013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
2500
2501 PR gold/15927
2502 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
2503 relocation for R_X86_64_32 on x32.
2504
eb426534
RM
25052013-08-27 Roland McGrath <mcgrathr@google.com>
2506
2507 * output.cc (Output_segment::set_section_addresses): Take new
2508 Target* argument. If target->isolate_execinstr() and the segment
2509 is executable and starts at a target->abi_pagesize() boundary,
2510 pad its end out to a target->abi_pagesize() boundary with code fill.
2511 * output.h (Output_segment::set_section_addresses): Update decl.
2512 * layout.h (Layout::check_output_data_for_reset_values): Take new
2513 argument RELAX_OUTPUTS.
2514 (Layout): New member relax_output_list_.
2515 (Layout::add_relax_output): New method.
2516 * layout.cc (Layout::Layout): Update constructor.
2517 (Layout::reset_relax_output): New method.
2518 (Layout::clean_up_after_relaxation): Call it.
2519 (Layout::prepare_for_relaxation): Update caller.
2520 (Layout::set_segment_offsets): Update callers of set_section_addresses.
2521 Call reset_relax_output before re-processing segments for
2522 isolate_execinstr case.
2523 (Layout::write_data): Handle relax_output_list_.
2524 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
2525 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
2526
9aff4b7a
NC
25272013-08-23 Yuri Chornoivan <yurchor@ukr.net>
2528
2529 PR binutils/15834
2530 * object.h: Fix typos.
2531
93f8221c
RM
25322013-08-16 Roland McGrath <mcgrathr@google.com>
2533
2534 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
2535 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
2536
e44c3715
CC
25372013-08-07 Cary Coutant <ccoutant@google.com>
2538
2539 Revert support for v2 DWP files:
2540
2541 2013-03-01 Cary Coutant <ccoutant@google.com>
2542
2543 Add dwp support for v2 DWARF package file format.
2544 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2545 tu_length parameter. Adjust all callers.
2546 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2547 * dwp.cc: Include dwarf.h.
2548 (Section_bounds): New struct type.
2549 (Unit_set): New struct type.
2550 (Dwo_file::Dwo_file): Initialize new data member.
2551 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2552 Combine and rename to...
2553 (Dwo_file::read_unit_index): ...this.
2554 (Dwo_file::sized_read_compunit_index)
2555 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2556 (Dwo_file::sized_read_unit_index): ...this.
2557 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2558 parameters; add section_id parameter.
2559 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2560 (Dwo_file::add_unit_set): ...this.
2561 (Dwo_file::shndx_map_): Remove.
2562 (Dwo_file::sect_offsets_): New data member.
2563 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2564 (Dwp_output_file::add_section): Rename to...
2565 (Dwp_output_file::add_contribution): ...this.
2566 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2567 (Dwp_output_file::add_tu_set): Likewise.
2568 (Dwp_output_file::Contribution): New type.
2569 (Dwp_output_file::Section::contributions): New data member.
2570 (Dwp_output_file::Cu_or_tu_set): Remove.
2571 (Dwp_output_file::Section::Section): New ctor.
2572 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2573 (Dwp_output_file::Dwp_index::Section_table): New type.
2574 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2575 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2576 parameter.
2577 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2578 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2579 (Dwp_output_file::Dwp_index::section_table): New member function.
2580 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2581 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2582 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2583 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2584 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2585 (Dwp_output_file::Dwp_index::section_table_): New data member.
2586 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2587 (Dwp_output_file::add_output_section): New member function.
2588 (Dwp_output_file::write_new_section): New member function.
2589 (Dwp_output_file::write_contributions): New member function.
2590 (Dwp_output_file::section_id_map_): New data member.
2591 (class Dwo_id_info_reader): Remove.
2592 (class Unit_reader): New class.
2593 (get_dwarf_section_name): New function.
2594 (Dwo_file::read_executable): Adjust initializations of class data.
2595 (Dwo_file::read): Add support for v2 package file format.
2596 (Dwo_file::read_unit_index): Likewise.
2597 (Dwo_file::sized_read_unit_index): Likewise.
2598 (Dwo_file::copy_section): Likewise.
2599 (Dwo_file::add_unit_set): Likewise.
2600 (Dwp_output_file::add_output_section): Likewise.
2601 (Dwp_output_file::add_contribution): Likewise.
2602 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2603 for empty slot.
2604 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2605 file format.
2606 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2607 slot.
2608 (Dwp_output_file::initialize): Remove unused function.
2609 (Dwp_output_file::finalize): Add support for v2 package file format.
2610 (Dwp_output_file::write_index): Likewise.
2611 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2612 function prototype.
2613
c6905c28
CC
26142013-07-31 Cary Coutant <ccoutant@google.com>
2615
2616 * object.cc (Sized_relobj::do_output_section_address): New function.
2617 (Sized_relobj): Instantiate explicitly.
2618 * object.h (Object::output_section_address): New function.
2619 (Object::do_output_section_address): New function.
2620 (Sized_relobj::do_output_section_address): New function.
2621 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
2622
26232013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 2624 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
2625
2626 * parameters.cc (Parameters::entry): Return target-specific entry
2627 symbol name.
2628 * target.h (Target::entry_symbol_name): New function.
2629 (Target_info::entry_symbol_name): New data member.
2630
2631 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
2632 * i386.cc (Target_i386::i386_info): Likewise.
2633 (Target_i386_nacl::i386_nacl_info): Likewise.
2634 * sparc.cc (Target_sparc::sparc_info): Likewise.
2635 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
2636 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
2637 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
2638 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
2639
234d4ab8
SA
26402013-07-22 Sterling Augustine <saugustine@google.com>
2641
2642 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
2643 Convert parameter shndx to local variable. Add parameters symtab
2644 and symtab_size. Scan over section names. Find relocation
2645 section corresponding to current section. Create and initialize
2646 reloc_mapper_ and reloc_type_.
2647 (Dwarf_pubnames_table::read_header): Add assertion. Change
2648 unit_length to off_t. Initialize member unit_length_. Fill in field
2649 cu_offset_.
2650 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2651 Initialize new fields unit_length_ and cu_offset_.
2652 (Dwarf_pubnames_table::read_section): Update prototype.
2653 (Dwarf_pubnames_table::cu_offset): New member function.
2654 (Dwarf_pubnames_table::subsection_size): Likewise.
2655 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
2656 New fields.
2657 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
2658 member functions public.
2659 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
2660 Update comment. Rework logic. Move repeated parts to...
2661 (Gdb_index_info_reader::read_pubtable): ...here. New function.
2662 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
2663 pubtypes_table_, and stmt_list_offset.
2664 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2665 Gdb_index::find_pubtype_offset,
2666 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
2667 (Gdb_index::pubnames_read): Update prototype and rework logic.
2668 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
2669 Forward declare.
2670 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2671 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
2672 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
2673 Gdb_index::map_pubtable_to_dies):
2674 Declare functions.
2675 (Gdb_index::pubnames_read): Update declaration.
2676 (Gdb_index::Pubname_offset_map): New type.
2677 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
2678 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
2679 Gdb_index::stmt_list_offset): Declare.
2680 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
2681 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
2682 Gdb_index::pubtypes_offset_): Remove.
2683
a3ed37d8
RM
26842013-07-19 Roland McGrath <mcgrathr@google.com>
2685
2686 * options.h (General_options): Add -Trodata-segment option.
2687 * parameters.cc (Parameters::check_rodata_segment): New function.
2688 (Parameters::set_target_once): Call it.
2689 * parameters.h (Parameters): Declare it (private member function).
2690 * layout.cc (load_seg_unusable_for_headers): New function, broken
2691 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
2692 then validate rodata segment rather than text segment.
2693 (relaxation_loop_body): Call that.
2694 (is_text_segment): New function. Don't admit a non-executable
2695 segment if TARGET->isolate_execinstr().
2696 (set_segment_offsets): Call it. Honor -Trodata-segment option.
2697
eb5b4ded
CC
26982013-07-15 Shawn Landden <shawnlandden@gmail.com>
2699
2700 PR gold/15070
2701 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
2702 * nacl.h (Sniff_file::View::View): Request aligned view.
2703
4d5effb9
CC
27042013-07-11 Cary Coutant <ccoutant@google.com>
2705
2706 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
2707 correct BRLT entry size.
2708
ba8ca3e7
AM
27092013-07-03 Alan Modra <amodra@gmail.com>
2710
2711 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
2712 comment.
2713
267257d2
CC
27142013-07-01 Cary Coutant <ccoutant@google.com>
2715
2716 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
2717 reloc_type_.
2718 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
2719 (Dwarf_ranges_table::lookup_reloc): New function.
2720 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
2721 reloc_type_.
2722 (Dwarf_ranges_table::lookup_reloc): New function.
2723 (Dwarf_ranges_table::reloc_type_): New data member.
2724
06f30c9d
CC
27252013-06-27 Jing Yu <jingyu@google.com>
2726
2727 PR gold/15662
2728 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
2729 function.
2730 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
2731 (Target_powerpc::do_relax): Call the above.
2732
a2d7bf59
AM
27332013-06-27 Cary Coutant <ccoutant@google.com>
2734
2735 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
2736 on garbage collected .opd section.
2737
27382013-06-27 Alan Modra <amodra@gmail.com>
2739
2740 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
2741 is non-zero.
2742 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
2743 (Target_powerpc::do_function_location): Likewise for loc->shndx.
2744
32364e50
CC
27452013-06-14 Cary Coutant <ccoutant@google.com>
2746
2747 * resolve.cc (Symbol::override_base): Don't override st_type
2748 from plugin placeholder symbols.
2749 (Symbol_table::resolve): Likewise.
2750 (Symbol_table::should_override): Don't complain about TLS mismatch
2751 if the TO symbol is a plugin placeholder.
2752 * testsuite/Makefile.am (plugin_test_tls): New test.
2753 * testsuite/Makefile.in: Regenerate.
2754 * testsuite/plugin_test_tls.sh: New test script.
2755 * testsuite/two_file_test_2_tls.cc: New test source.
2756 * testsuite/two_file_test_tls.cc: New test source.
2757
7fb47cc9
CC
27582013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
2759
2760 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
2761 the maximum segment alignment is larger than the page size.
2762 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
2763 correctly aligns the symbols with large alignemnt.
2764 * testsuite/Makefile.in: Regenerate.
2765 * testsuite/large_symbol_alignment.cc: New file.
2766
6934001a
CC
27672013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
2768 Sriraman Tallam <tmsriram@google.com>
2769
2770 * options.h (sort_section): New option.
2771 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
2772 Rename from Input_section_sort_section_name_special_ordering_compare.
2773 (Input_section_sort_section_name_compare): New struct.
2774 * output.cc (Output_section::Input_section_sort_section_name_compare::
2775 operator()): New function.
2776 (Output_section::sort_attached_input_sections): Use new sort function
2777 for .text if --sort-section=name is specified.
2778 * layout.cc (Layout::make_output_section):
2779 Add sorting by name when --sort-section=name is specified.
2780 * testsuite/Makefile.am (text_section_grouping): Test option
2781 --sort-section=name.
2782 * testsuite/Makefile.in: Regenerate.
2783 * testsuite/section_sorting_name.cc: New file.
2784 * testsuite/section_sorting_name.sh: New file.
2785
93acabad
CC
27862013-05-21 Cary Coutant <ccoutant@google.com>
2787
2788 * symtab.h (Symbol::is_cxx_vtable): New function.
2789 * target-reloc.h (relocate_section): Check for vtable symbol.
2790 * testsuite/Makefile.am (missing_key_func.sh): New test case.
2791 * testsuite/Makefile.in: Regenerate.
2792 * testsuite/missing_key_func.cc: New test source.
2793 * testsuite/missing_key_func.sh: New test script.
2794
60e8b3fc
CC
27952013-05-21 Cary Coutant <ccoutant@google.com>
2796
2b64b551
RM
2797 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
2798 type of enclosing symbol.
2799 (Relocate_info::location): Check symbol type when describing symbol.
2800 * object.h (Symbol_location_info): Remove unused line_number;
2801 add enclosing_symbol_type.
2802 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 2803
9df9de2c
CC
28042013-05-13 Cary Coutant <ccoutant@google.com>
2805
2b64b551
RM
2806 * configure.ac: Export DEFAULT_TARGET.
2807 * configure: Regenerate.
2808 * Makefile.in: Regenerate.
2809 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
2810 * testsuite/Makefile.in: Regenerate.
2811 * testsuite/debug_msg.sh: Delete duplicate tests.
2812 Don't check undef_int error message match for powerpc where the
2813 source file and line number aren't available.
9df9de2c 2814
bbc5ae17
RM
28152013-05-10 Roland McGrath <mcgrathr@google.com>
2816
2817 * options.h (General_options): Add --rosegment-gap option.
2818 * options.cc (finalize): --rosegment-gap implies --rosegment.
2819 * layout.cc (set_segment_offsets): Let user option override
2820 target->rosegment_gap().
2821
0c6e6c39
RM
28222013-05-10 Roland McGrath <mcgrathr@google.com>
2823
2824 * options.h (General_options): Remove leading space from help
2825 messages for -nostdlib and --rosegment.
2826
cde7cb01
MR
28272013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
2828
2829 PR ld/15365
2830 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
2831
f31ae5b8
AM
28322013-05-03 Alan Modra <amodra@gmail.com>
2833
2834 * merge.cc (Output_merge_string::do_add_input_section): Correct
2835 scan for number of strings. Rename vars to avoid shadowing.
2836 Include missing terminator in input_size_.
2837
d3a7cd45
L
28382013-05-01 H.J. Lu <hongjiu.lu@intel.com>
2839
2840 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
2841 Restore empty string handling.
2842
6ad3daba
CC
28432013-05-01 Cary Coutant <ccoutant@google.com>
2844
2845 * stringpool.cc (Stringpool_template::new_key_offset): Fix
2846 uninitialized warning.
2847
e31908b6
CC
28482013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
2849
2850 * output.cc (Output_section::add_merge_input_section): Allow
2851 to merge sections if the alignment is more than character size.
2852 * merge.h (Output_merge_string::Output_merge_string): Remove
2853 assert.
2854 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
2855 only not-null strings. Check the alignment of strings.
2856 * stringpool.h
2857 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
2858 alignment as the argument.
2859 (Stringpool_template<Stringpool_char>::addralign_): New class member.
2860 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
2861 Align non-zero length strings according to the addralign_.
2862 (Stringpool_template<Stringpool_char>::set_string_offsets):
2863 Updating offsets according to the given alignment.
2864 * testsuite/Makefile.am (text_section_grouping): Test if string
2865 literals are getting merged.
2866 * testsuite/Makefile.in: Regenerate.
2867 * testsuite/merge_string_literals_1.c: New file.
2868 * testsuite/merge_string_literals_2.c: Ditto.
2869 * testsuite/merge_string_literals.sh: Ditto.
2870
0e804863
ILT
28712013-04-26 Ian Lance Taylor <iant@google.com>
2872
2873 * target-reloc.h (relocate_section): If the reloc offset is out of
2874 range, pass VIEW as NULL to relocate.relocate.
2875 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
2876 * i386.cc (Target_i386::Relocate::relocate): Likewise.
2877 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
2878 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
2879 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
2880 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
2881
e7c5ea40
CC
28822013-04-26 Geoff Pike <gpike@chromium.org>
2883
2884 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
2885 * layout.cc (Hash_task): New class.
2886 (Layout::queue_build_id_tasks): New function.
2887 (Layout::write_build_id): Handle single-thread portion of build ID
2888 computation. (In some cases, all of it is single-threaded.) Replace
2889 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
2890 functionality in fewer lines of code.
2891 * layout.h (Layout::queue_build_id_tasks): New function declaration.
2892 * options.h (General_options): make "--build-id" default to tree
2893 rather than sha1. Add two new options related to --build-id=tree:
2894 --build-id-chunk-size-for-treehash and
2895 --build-id-min-file-size-for-treehash.
2896 * Makefile.am: add testing of --build-id=tree and related new options
2897 (these tests will be invoked by "make check").
2898 * Makefile.in: Regenerate.
2899
49926cd0
AM
29002013-04-25 Alan Modra <amodra@gmail.com>
2901
2902 * configure.tgt: Add powerpcle and powerpc64le.
2903
a4034750
AM
29042013-04-22 Alan Modra <amodra@gmail.com>
2905
2906 PR gold/15355
2907 * layout.cc (Layout::segment_precedes): Allow more than one
2908 segment with the same type and flags.
2909
e79c84aa
CC
29102013-04-15 Cary Coutant <ccoutant@google.com>
2911
2912 * layout.cc (Layout::set_relocatable_section_offsets): Don't
2913 allocate space in file for BSS sections.
2914
2199fbe7
CC
29152013-04-15 Cary Coutant <ccoutant@google.com>
2916
2917 * script-sections.cc (Orphan_output_section): Reset address
2918 to zero after each orphaned section for relocatable links.
2919
502e8a84
CC
29202013-04-15 Cary Coutant <ccoutant@google.com>
2921
a4034750
AM
2922 * symtab.cc (Symbol_table::sized_write_globals): Subtract
2923 section starting address for relocatable link.
2924 * testsuite/Makefile.am (script_test_11): New test.
2925 * testsuite/Makefile.in: Regenerate.
2926 * testsuite/script_test_11.c: New source file.
2927 * testsuite/script_test_11.t: New linker script.
502e8a84 2928
0cfdc767
AM
29292013-04-13 Alan Modra <amodra@gmail.com>
2930
2931 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
2932 owner when sections are not adjacent and exceed group size.
2933 (Target_powerpc::group_sections): Handle corner case.
2934 (Target_powerpc::Branch_info::make_stub): Handle case where
2935 stub table doesn't exist due to branches in non-exec sections.
2936 (Target_powerpc::Relocate::relocate): Likewise.
2937
6830ee24
AM
29382013-04-11 Alan Modra <amodra@gmail.com>
2939
2940 PR gold/15354
2941 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
2942 .branch_lt to match bfd ld. Adjust comments throughout file.
2943
54a3d865
ILT
29442013-04-04 Ian Lance Taylor <iant@google.com>
2945
2946 GCC PR c++/56840
2947 * object.cc (do_layout_deferred_sections): Handle .eh_frame
2948 sections before checking whether they are included in the link.
2949
9993ba11
ST
29502013-03-29 Sriraman Tallam <tmsriram@google.com>
2951
2952 * archive.cc (Archive::get_elf_object_for_member): Create the elf
2953 object before calling the plugin claim_file handler. Pass the elf
2954 object of the archive to the plugin. Delete the elf object if the
2955 plugin claims the file.
2956
ebacd51e
AM
29572013-03-21 Alan Modra <amodra@gmail.com>
2958
2959 * layout.cc (Layout::set_segment_offsets): Accept writable .text
2960 segment when omagic.
2961
117be58f
AM
29622013-03-21 Alan Modra <amodra@gmail.com>
2963
2964 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
2965 comparison warning.
2966 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
2967 uninitialized" warning.
2968
32e2b61d
AM
29692013-03-20 Alan Modra <amodra@gmail.com>
2970
2971 * symtab.h (Symbol::clear_version): New function.
2972 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
2973 is_needed by weak references. Clear version for symbols defined
2974 in as-needed objects that are not needed.
2975
b3ccdeb5
AM
29762013-03-15 Alan Modra <amodra@gmail.com>
2977
2978 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
2979 static and public. Add report_err param. Return false for data refs.
2980 (Target_powerpc::rela_dyn_section): New overloaded function.
2981 (Target_powerpc::plt_, iplt_): Elucidate.
2982 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
2983 (Output_data_plt_powerpc::do_write): Don't write .iplt.
2984 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
2985 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
2986 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
2987 push_branch and make_plt_entry for ifunc syms when
2988 reloc_needs_plt_for_ifunc.
2989 (Target_powerpc::Relocate::relocate): Don't use plt entry value
2990 for ifunc unless reloc_needs_plt_for_ifunc.
2991
ad3d8a2f
AM
29922013-03-15 Alan Modra <amodra@gmail.com>
2993
2994 * gc.h (gc_process_relocs): Don't look through function descriptors.
2995 * icf.cc (get_section_contents): Do so here instead.
2996
4d9aa155
AM
29972013-03-13 Alan Modra <amodra@gmail.com>
2998
2999 * powerpc.cc (is_branch_reloc): Forward declare.
3000 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
3001 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
3002 false for 64-bit, true for 32-bit non-branch relocs.
3003 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
3004 * testsuite/Makefile.am (icf_test): Use linker map file instead of
3005 nm output.
3006 (icf_safe_test): Generate linker map file as well as nm output.
3007 (icf_safe_so_test): Likewise.
3008 * testsuite/Makefile.in: Regenerate.
3009 * testsuite/icf_test.sh: Parse linker map file to determine
3010 section folding.
3011 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
3012 * testsuite/icf_safe_so_test.sh: Likewise.
3013 (X86_32_or_ARM_specific_safe_fold): Merge into..
3014 (arch_specific_safe_fold): ..this.
3015 (X86_64_specific_safe_fold): Delete unused function.
3016
57420c20
AM
30172013-03-12 Alan Modra <amodra@gmail.com>
3018
3019 * gc.h (gc_process_relocs): Look through function descriptors
3020 to determine shndx, symvalue and addend used by ICF. Tidy
3021 variable duplication.
3022
dc3714f3
AM
30232013-03-11 Alan Modra <amodra@gmail.com>
3024
3025 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
3026 * layout.cc (Layout_task_runner::run): ..to here.
3027 * symtab.h (struct Symbol_location): Extract from..
3028 (class Symbol_table): ..here.
3029 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
3030 * target.h (class Target): Add function_location and
3031 do_function_location functions.
3032 (class Sized_target): Add do_function_location.
3033 * object.h (class Sized_relobj_file): Move find_shdr..
3034 (class Object): ..to here.
3035 * object.cc: Likewise. Update to suit. Instantiate.
3036 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
3037 * powerpc.cc (class Powerpc_dynobj): New.
3038 (Target_powerpc::do_function_location): New function.
3039 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
3040 (Powerpc_dynobj::do_read_symbols): New function.
3041 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
3042
956b03bb
ILT
30432013-03-08 Ian Lance Taylor <iant@google.com>
3044
3045 * options.cc (General_options::string_to_object_format): Accept
3046 "default".
3047
4bead2d5
AM
30482013-03-08 Alan Modra <amodra@gmail.com>
3049
3050 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
3051 pointer to Post_fde.
3052 (struct Post_fde): Move definition to here..
3053 * ehframe.cc (struct Post_fde): ..from here.
3054 (Cie::write): Don't alloc Post_fde.
3055 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
3056
02e60bf7
AM
30572013-03-07 Alan Modra <amodra@gmail.com>
3058
3059 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
3060 relocation referencing .LC0.
3061 * testsuite/discard_locals_test.sh: Remove FIXMEs.
3062
8343f03a
AM
30632013-03-07 Alan Modra <amodra@gmail.com>
3064
3065 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
3066 always_inline. Add assembly for powerpc to avoid GOT.
3067
3366d57c
AM
30682013-03-07 Alan Modra <amodra@gmail.com>
3069
3070 * testsuite/script_test_10.sh: Don't test .bss section
3071 header number.
3072
6c77229c
AM
30732013-03-06 Alan Modra <amodra@gmail.com>
3074
3075 * powerpc.cc (class Powerpc_relobj): Move some member functions.
3076 (Target_powerpc::symval_for_branch): Add symtab param. Update
3077 all callers. Handle folded sections.
3078 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
3079 to Powerpc_relobj.
3080 (Global_symbol_visitor_opd::operator()): Likewise.
3081
a39e4af6
AM
30822013-03-04 Alan Modra <amodra@gmail.com>
3083
3084 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
3085 * testsuite/Makefile.in: Regenerate.
3086
d5834edb
CC
30872013-03-01 Cary Coutant <ccoutant@google.com>
3088
3089 Add dwp support for v2 DWARF package file format.
3090 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
3091 tu_length parameter. Adjust all callers.
3092 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
3093 * dwp.cc: Include dwarf.h.
3094 (Section_bounds): New struct type.
3095 (Unit_set): New struct type.
3096 (Dwo_file::Dwo_file): Initialize new data member.
3097 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
3098 Combine and rename to...
3099 (Dwo_file::read_unit_index): ...this.
3100 (Dwo_file::sized_read_compunit_index)
3101 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
3102 (Dwo_file::sized_read_unit_index): ...this.
3103 (Dwo_file::copy_section): Remove section_name, is_str_offsets
3104 parameters; add section_id parameter.
3105 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
3106 (Dwo_file::add_unit_set): ...this.
3107 (Dwo_file::shndx_map_): Remove.
3108 (Dwo_file::sect_offsets_): New data member.
3109 (Dwp_output_file::Dwp_output_file): Initialize new data members.
3110 (Dwp_output_file::add_section): Rename to...
3111 (Dwp_output_file::add_contribution): ...this.
3112 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
3113 (Dwp_output_file::add_tu_set): Likewise.
3114 (Dwp_output_file::Contribution): New type.
3115 (Dwp_output_file::Section::contributions): New data member.
3116 (Dwp_output_file::Cu_or_tu_set): Remove.
3117 (Dwp_output_file::Section::Section): New ctor.
3118 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
3119 (Dwp_output_file::Dwp_index::Section_table): New type.
3120 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
3121 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
3122 parameter.
3123 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
3124 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
3125 (Dwp_output_file::Dwp_index::section_table): New member function.
3126 (Dwp_output_file::Dwp_index::section_table_end): New member function.
3127 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
3128 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
3129 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
3130 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
3131 (Dwp_output_file::Dwp_index::section_table_): New data member.
3132 (Dwp_output_file::Dwp_index::section_mask_): New data member.
3133 (Dwp_output_file::add_output_section): New member function.
3134 (Dwp_output_file::write_new_section): New member function.
3135 (Dwp_output_file::write_contributions): New member function.
3136 (Dwp_output_file::section_id_map_): New data member.
3137 (class Dwo_id_info_reader): Remove.
3138 (class Unit_reader): New class.
3139 (get_dwarf_section_name): New function.
3140 (Dwo_file::read_executable): Adjust initializations of class data.
3141 (Dwo_file::read): Add support for v2 package file format.
3142 (Dwo_file::read_unit_index): Likewise.
3143 (Dwo_file::sized_read_unit_index): Likewise.
3144 (Dwo_file::copy_section): Likewise.
3145 (Dwo_file::add_unit_set): Likewise.
3146 (Dwp_output_file::add_output_section): Likewise.
3147 (Dwp_output_file::add_contribution): Likewise.
3148 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
3149 for empty slot.
3150 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
3151 file format.
3152 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
3153 slot.
3154 (Dwp_output_file::initialize): Remove unused function.
3155 (Dwp_output_file::finalize): Add support for v2 package file format.
3156 (Dwp_output_file::write_index): Likewise.
3157 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
3158 function prototype.
3159
a68a081d
CC
31602013-03-01 Cary Coutant <ccoutant@google.com>
3161
3162 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
3163 function into class definition in header file.
3164 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
3165 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
3166 New function.
3167 (Dwarf_info_reader::check_buffer): Move here from .cc file.
3168
9d5781f8
AM
31692013-02-28 Alan Modra <amodra@gmail.com>
3170
3171 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
3172 * target.cc (Target::do_plt_fde_location): New function.
3173 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
3174 accessor function, and constructor param.
3175 (struct Post_fde, Post_fdes): Declare.
3176 (Cie::write): Add post_fdes param.
3177 * ehframe.cc (Fde::write): Use plt_fde_location.
3178 (struct Post_fde): Define.
3179 (Cie::write): Stash FDEs added post merge mapping.
3180 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
3181 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
3182 (Eh_frame::do_sized_write): Arrange to write post map FDES after
3183 other FDEs.
3184 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
3185 (Target_powerpc::has_glink): New function.
3186 (Target_powerpc::do_relax): Add eh_frame info for stubs.
3187 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
3188 glink_eh_frame_fde_32, default_fde): New data.
3189 (Stub_table::eh_frame_added_): New var.
3190 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
3191 Make const.
3192 (Stub_table::add_eh_frame): New function.
3193 (Output_data_glink::add_eh_frame): New function.
3194 (Target_powerpc::make_glink_section): Call add_eh_frame.
3195
214383dd
ILT
31962013-02-15 Ian Lance Taylor <iant@google.com>
3197
3198 * options.h (DEFINE_uint64_alias): Define.
3199 (class General_options): Add -Ttext-segment as an alias for
3200 -Ttext.
3201
91c2b899
AM
32022013-02-15 Alan Modra <amodra@gmail.com>
3203
3204 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
3205 (Stub_table::do_write): ..here, two places.
3206 (Stub_table::plt_call_size): Use it here too.
3207
20e2a8aa
ILT
32082013-02-11 Ian Lance Taylor <iant@google.com>
3209
3210 * descriptors.cc (Descriptors::close_all): New function.
3211 * descriptors.h (class Descriptors): Declare close_all.
3212 (close_all_descriptors): New inline function.
3213 * plugin.cc: Include "descriptors.h".
3214 (Plugin_manager::cleanup): Call close_all_descriptors.
3215
8952bc69
AM
32162013-02-06 Alan Modra <amodra@gmail.com>
3217
3218 * README: Update coding style link.
3219
29bd8b6b
CC
32202013-01-28 Cary Coutant <ccoutant@google.com>
3221
a4034750
AM
3222 * dwp.cc (File_list): New typedef.
3223 (Dwo_name_info_reader): New class.
3224 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
3225 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
3226 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
3227 (Dwo_file::read_executable): New function.
3228 (Dwo_file::read): Move common setup code to ...
3229 (Dwo_file::make_object): ... here.
3230 (dwp_options): Add --exec/-e.
3231 (usage): Likewise.
3232 (main): Likewise.
29bd8b6b 3233
c6ac678d
ST
32342013-01-24 Sriraman Tallam <tmsriram@google.com>
3235
3236 * layout.cc (Layout::layout): Check for option text_reorder.
3237 (Layout::make_output_section): Ditto.
3238 * options.h (text_reorder): New option.
3239 * output.cc (Input_section_sort_compare): Remove special ordering
3240 of section names.
3241 (Output_section::
3242 Input_section_sort_section_name_special_ordering_compare::
3243 operator()): New function.
3244 (Output_section::sort_attached_input_sections): Use new sort function
3245 for .text.
3246 * output.h (Input_section_sort_section_name_special_ordering_compare):
3247 New struct.
3248 * testsuite/Makefile.am (text_section_grouping): Test option
3249 --no-text-reorder
3250 * testsuite/Makefile.in: Regenerate.
3251 * testsuite/text_section_grouping.sh: Check order of functions without
3252 default text reordering.
3253
50701cc1
MF
32542013-01-18 Mike Frysinger <vapier@gentoo.org>
3255
3256 * options.h (General_options): Change default to true for new_dtags.
3257
b1b00fcc
MF
32582013-01-18 Mike Frysinger <vapier@gentoo.org>
3259
3260 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
3261 when enable_new_dtags is false. Only add DT_RUNPATH when
3262 enable_new_dtags is true.
3263
ec5b8187
AM
32642013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
3265
3266 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
3267 used in declaration and definition consistent.
3268 (Target_powerpc::symval_for_branch): Ditto.
3269
a880d4c4
ST
32702013-01-16 Sriraman Tallam <tmsriram@google.com>
3271
3272 * testsuite/plugin_final_layout.cc: Fix comment.
3273
7c381248
ST
32742013-01-16 Sriraman Tallam <tmsriram@google.com>
3275
3276 * layout.cc (Layout::layout): Do not do default sorting for
3277 text sections when section ordering is specified.
3278 (make_output_section): Ditto.
3279 * testsuite/plugin_final_layout.cc: Name the function sections
3280 to catch reordering issues.
3281
e2458743
AM
32822013-01-15 Alan Modra <amodra@gmail.com>
3283
3284 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
3285 plt-thread-safe.
3286
431ed302
AM
32872013-01-15 Alan Modra <amodra@gmail.com>
3288
3289 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
3290 * testsuite/Makefile.in: Regenerate.
3291
0ec6429b
AM
32922013-01-14 Alan Modra <amodra@gmail.com>
3293
3294 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
3295 * testsuite/Makefile.in: Regenerate.
3296
0bf402d5
ILT
32972013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
3298
36af3926 3299 PR bfd/14430
0bf402d5
ILT
3300 Fix mingw gold build with plugins enabled
3301 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
3302 * configure.ac: Export DLOPEN_LIBS and add headers check.
3303 * plugin.cc: Handle non-dlfcn case.
3304 * Makefile.in: Regenerate.
3305 * config.in: Regenerate.
3306 * configure: Regenerate.
3307 * testsuite/Makefile.in: Regenerate.
3308
9e9143bc
ST
33092013-01-09 Sriraman Tallam <tmsriram@google.com>
3310
3311 * output.h (sort_attached_input_sections): Change to be public.
3312 * script-sections.cc
3313 (Output_section_definition::set_section_addresses): Sort
3314 attached input sections according to section order before linker
3315 script assigns section addresses.
3316 (Orphan_output_section::set_section_addresses): Sort
3317 attached input sections according to section order before linker
3318 script assigns section addresses.
3319 * Makefile.am (final_layout.sh): Use a simple linker script to
3320 check if section ordering still works.
3321 * Makefile.in: Regenerate.
3322
679af368
ILT
33232013-01-09 Ben Cheng <bccheng@google.com>
3324
3325 * arm.cc (Target_arm::attributes_accept_div): New function.
3326 (Target_arm::attributes_forbid_div): New function.
3327 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
3328 attribute using the same new functions as what bfd/elf32_arm.c
3329 does.
3330
3136a00e
CC
33312013-01-07 Cary Coutant <ccoutant@google.com>
3332
3333 PR gold/14993
3334 * output.cc (Output_section::add_input_section): For incremental
3335 updates, don't track input sections that are allocated from patch
3336 space.
3337
f2a6224b
L
33382013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3339 Ian Lance Taylor <iant@google.com>
3340
3341 PR gold/14897
3342 * configure.ac (--enable-ld): Removed.
3343 (install_as_default): Set to yes only for --enable-gold=default
3344 or --disable-ld.
3345 * configure: Regenerated.
3346
4f46f626
L
33472013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3348
3349 * options.h (General_options): Add -fuse-ld= for GCC linker
3350 option compatibility.
3351
26e4ef59
CC
33522013-01-04 Cary Coutant <ccoutant@google.com>
3353
3354 * configure.ac: Fix typo restoring CXXFLAGS.
3355 * configure: Regenerate.
3356
3d587466
CC
33572013-01-04 Cary Coutant <ccoutant@google.com>
3358
4f46f626
L
3359 * testsuite/Makefile.am (CXXLINK_S): New macro.
3360 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
3361 * testsuite/Makefile.in: Regenerate.
3d587466 3362
44db6695
L
33632013-01-02 H.J. Lu <hongjiu.lu@intel.com>
3364
3365 * version.cc (print_version): Update copyright year to 2013.
3366
edcac0c1
ILT
33672012-12-20 Ian Lance Taylor <iant@google.com>
3368
3369 * layout.cc (Layout::special_ordering_of_input_section): New
3370 function.
3371 (Layout::layout): If input section requires special ordering, must
3372 sort input sections.
3373 (Layout::make_output_section): May sort .text input sections.
3374 (Layout::is_section_name_prefix_grouped): Remove.
3375 * layout.h (class Layout): Declare
3376 special_ordering_of_input_section. Don't declare
3377 is_section_name_prefix_grouped.
3378 * output.cc (Output_section::add_input_section): Revert last
3379 change.
3380 (Output_section::Input_section_sort::match_file_name): Don't crash
3381 if called on output section data.
3382 (Output_section::Input_section_sort_compare): Sort based on
3383 special ordering.
3384 (Output_section::Input_section_sort_section_order_index_compare):
3385 Revert last patch.
3386 (Output_section::sort_attached_input_sections): Likewise.
3387
28f2a4ac
ST
33882012-12-18 Sriraman Tallam <tmsriram@google.com>
3389
edcac0c1 3390 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
3391 * layout.h (Layout::is_section_name_prefix_grouped): New function.
3392 * output.cc (Output_section::add_input_section): Check if section
3393 name contains special prefix. Keep input sections to sort such
3394 sections.
3395 (Output_section::Input_section_sort_section_order_index_compare
3396 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
3397 (Output_section::sort_attached_input_sections): Add condition to
3398 Input_section_entry constructor call.
28f2a4ac
ST
3399 * testsuite/Makefile.am (text_section_grouping): New test.
3400 * testsuite/Makefile.in: Regenerate.
3401 * testsuite/text_section_grouping.cc: New file.
3402 * testsuite/text_section_grouping.sh: New file.
3403
5bf135a7
NC
34042012-12-17 Nick Clifton <nickc@redhat.com>
3405
3406 * Makefile.am: Add copyright notice.
3407 * NEWS: Likewise.
3408 * README: Likewise.
3409 * configure.ac: Likewise.
3410 * ftruncate.c: Likewise.
3411 * Makefile.in: Regenerate.
3412
59965708
CC
34132012-12-14 Cary Coutant <ccoutant@google.com>
3414
a4034750
AM
3415 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
3416 --no-as-needed flag.
3417 (exception_separate_shared_12_test): Likewise.
3418 (incremental_copy_test): Likewise.
3419 * testsuite/Makefile.in: Regenerate.
59965708 3420
2a77e2ab
CC
34212012-12-14 Cary Coutant <ccoutant@google.com>
3422
3423 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
3424 (Dwp_output_file::Dwp_index::enter_set): Add assert.
3425
e3deeb9c
AM
34262012-12-12 Alan Modra <amodra@gmail.com>
3427
3428 * powerpc.cc (class Track_tls): New.
3429 (class Relocate, class Scan): Inherit Track_tls.
3430 (Target_powerpc::Scan::local, global): Track tls optimization
3431 and avoid creating plt entry for __tls_get_addr if all uses
3432 are optimized away.
3433 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
3434
d8f5a274
AM
34352012-12-12 Alan Modra <amodra@gmail.com>
3436
3437 * options.h (General_options): Add --toc-sort/--no-toc-sort.
3438 Replace no_toc_optimize with toc_optimize.
3439 * output.h (Output_section::input_sections): Provide non-const variant.
3440 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
3441 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
3442 accessors.
3443 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
3444 (class Sort_toc_sections): New.
3445 (Target_powerpc::do_finalize_sections): Sort toc sections.
3446 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
3447
4c8a1de1
RM
34482012-12-10 Roland McGrath <mcgrathr@google.com>
3449
3450 * testsuite/binary_unittest.cc (read_all): New function.
3451 (Sized_binary_test): Use it instead of ::read.
3452 * fileread.cc (do_read): Don't assume pread always reads the whole
3453 amount in a single call.
3454
edc27beb
AM
34552012-12-10 Alan Modra <amodra@gmail.com>
3456
3457 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
3458 Set EM_PPC64 or EM_PPC here.
3459 (Target_selector_powerpc::do_recognize): Delete.
3460
906b9150
AM
34612012-12-10 Alan Modra <amodra@gmail.com>
3462
3463 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
3464 stub_table_.
3465 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
3466
418c15ae
RM
34672012-12-07 Roland McGrath <mcgrathr@google.com>
3468
3469 * testsuite/binary_unittest.cc (Sized_binary_test):
3470 Use open_descriptor rather than ::open.
3471
decdd3bc
AM
34722012-12-07 Alan Modra <amodra@gmail.com>
3473
3474 * powerpc.cc (Stub_table::do_write): Delete redundant Address
3475 typedef and invalid_address constant.
3476 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
3477 instantiate constants.
3478
db399005
ILT
34792012-12-06 Roland McGrath <mcgrathr@google.com>
3480
3481 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
3482 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
3483 * aclocal.m4: Regenerate.
3484 * configure: Regenerate.
3485 * Makefile.in: Regenerate.
3486 * testsuite/Makefile.in: Regenerate.
3487
aba6bc71
AM
34882012-12-07 Alan Modra <amodra@gmail.com>
3489
3490 * options.h (General_options): Add no_toc_optimize.
3491 * powerpc.cc (ok_lo_toc_insn): New function.
3492 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
3493
9e69ed50
AM
34942012-12-06 Alan Modra <amodra@gmail.com>
3495
3496 * options.h (General_options): Add plt_align, plt_static_chain,
3497 plt_thread_safe. Update stub_group_size help text.
3498 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
3499 for new plt_thread_safe_ var.
3500 (use_plt_offset): Correct comments.
3501 (Target_powerpc::do_relax): Look for thread creation symbols to
3502 determine default plt_thread_safe value. Clear plt call stubs
3503 as well as branch stubs each iteration.
3504 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
3505 insn constants.
3506 (l, hi, ha, write_insn): Move earlier.
3507 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
3508 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
3509 plt stubs too.
3510 (Stub_table::update_size): Adjust.
3511 (Stub_table::prev_size, set_prev_size): Delete.
3512 (Stub_table::stub_align): Let --plt-align affect result.
3513 (Stub_table::plt_call_size): Calculate sizes for various stubs.
3514 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
3515 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
3516 (Stub_table::do_write): Support more stub variants.
3517
f43ba157
AM
35182012-12-04 Alan Modra <amodra@gmail.com>
3519
3520 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
3521 (Target_powerpc::do_define_standard_symbols): New function.
3522
34171bc5
AM
35232012-12-03 Alan Modra <amodra@gmail.com>
3524
3525 * output.h: Formatting, whitespace.
3526
dc9589e9 35272012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
3528
3529 * layout.h (Layout::get_executable_sections): Declare.
3530 * layout.cc (Layout::get_executable_sections): New function.
3531 * arm.cc (Target_arm::group_sections): Use it.
3532 (Arm_output_section::group_sections): Delete now redundant test.
3533 * output.cc (Output_reloc::Output_reloc): Add is_relative.
3534 param to handle relative relocs.
3535 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
3536 (Output_data_reloc::add_absolute): Adjust.
3537 (Output_data_reloc::add_relative): New function.
3538 (Output_data::reset_data_size): New function.
3539 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
3540 (Output_section::set_addralign): New function.
3541 (Output_section::checkpoint_set_addralign): New function.
3542 (Output_section::clear_section_offsets_need_adjustment): New function.
3543 (Output_section::input_sections): Make public.
3544 * powerpc.cc (class Output_data_brlt_powerpc): New.
3545 (class Stub_table, class Stub_control): New.
3546 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
3547 stub_table_, set_stub_table, stub_table): New vectors and accessor
3548 functions.
3549 (Target_powerpc::do_may_relax, do_relax, push_branch,
3550 new_stub_table, stub_tables, brlt_section, group_sections,
3551 add_branch_lookup_table, find_branch_lookup_table,
3552 write_branch_lookup_table, make_brlt_section): New functions.
3553 (Target_powerpc::struct Sort_sections, class Branch_info): New.
3554 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
3555 branch_info_): New vars.
3556 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
3557 make call stubs here.
3558 (Output_data_glink): Remove all call stub handling from this class.
3559 (Target_powerpc::Scan::local, global): Save interesting branch
3560 relocs and relocs for ifunc. Adjust calls to plt entry functions.
3561 (Target_powerpc::do_finalize_sections): Only make reg save/restore
3562 functions on final link.
3563 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
3564 Handle long branch destinations too.
3565 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
3566 do_plt_address_for_local): Adjust lookup of plt call stubs.
3567
627b30b7
AM
35682012-11-30 Alan Modra <amodra@gmail.com>
3569
3570 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
3571 relocs against protected symbols when building 32-bit shared libs.
3572
40b469d7
AM
35732012-11-30 Alan Modra <amodra@gmail.com>
3574
3575 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
3576 param. Call got_section() to make .got. Update all callers
3577 and their callers and so on.
3578
bb66a627
AM
35792012-11-30 Alan Modra <amodra@gmail.com>
3580
3581 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
3582 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
3583 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
3584 value if it already exists.
3585
d2cf1c6c
L
35862012-11-19 H.J. Lu <hongjiu.lu@intel.com>
3587
3588 PR gold/14858
3589 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
3590
edccdf7c
RM
35912012-11-14 Roland McGrath <mcgrathr@google.com>
3592
3593 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
3594 than bfc instruction for data sandboxing.
3595
6febeb74
AM
35962012-11-08 Alan Modra <amodra@gmail.com>
3597
3598 * po/POTFILES.in: Regenerate.
3599
0a6f1bf2
AM
36002012-11-05 Alan Modra <amodra@gmail.com>
3601
3602 * configure.ac: Apply 2012-09-10 change to config.in here.
3603 * configure: Regenerate.
3604
26a4e9cb
AM
36052012-11-05 Alan Modra <amodra@gmail.com>
3606
3607 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
3608 (struct Opd_ent): Use "Address" rather than "Offset".
3609 (Output_data_got_powerpc::got_base_offset): Return Valtype.
3610 (Target_powerpc::got_section): Make public.
3611 (Target_powerpc::scan_relocs): Move code setting symbols..
3612 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
3613 Create _SDA_BASE_ only when referenced.
3614
cc928013
RM
36152012-11-02 Roland McGrath <mcgrathr@google.com>
3616
3617 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
3618 from last change.
3619
50ed5eb1
RM
36202012-11-01 Roland McGrath <mcgrathr@google.com>
3621
62fe925a
RM
3622 * target.h (Sized_target::relocate_relocs): Use Elf_Off
3623 for offset_in_output_section parameter.
3624 (Sized_target::relocate_special_relocatable): Likewise.
3625 * arm.cc (Target_arm::relocate_relocs): Likewise.
3626 (Target_arm::relocate_special_relocatable): Likewise.
3627 * i386.cc (Target_i386::relocate_relocs): Likewise.
3628 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
3629 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
3630 * target-reloc.h (relocate_relocs): Likewise.
3631 * testsuite/testfile.cc (Target_test): Likewise.
3632 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
3633 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
3634
3635 * system.h: Move inclusion of <clocale> to after <libintl.h> in
3636 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
3637
3638 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
3639 parameter, which is unused in the [!F_SETFD] case.
3640
50ed5eb1
RM
3641 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
3642 SYMNDX to off_t before comparing it to this->data_size().
3643 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
3644 * incremental.cc (Output_section_incremental_inputs::do_write):
3645 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
3646
2cadc0bf
RM
3647 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
3648
3bfcb652
NC
36492012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
3650
3651 * gold.cc (Target_arm::do_adjust_elf_header): Add the
3652 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
3653 in EABI_VER5.
3654
c1a8d56e
CC
36552012-10-29 Cary Coutant <ccoutant@google.com>
3656
3657 * dwp.cc (usage): Add file and exit status parameters;
3658 add --help and --version options.
3659 (print_version): New function.
3660 (main): Add --help and --version options.
3661
b2490a7b
L
36622012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3663
3664 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
3665 final_layout_sequence.txt.
3666 * testsuite/Makefile.in: Regenerated.
3667
aa543512
L
36682012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3669
3670 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
3671 COMPILE generated by automake.
3672 (LINK1): Likewise.
3673 (CXXCOMPILE1): Likewise.
3674 (CXXLINK1): Likewise.
3675 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
3676 (LINK): Likewise.
3677 (CXXCOMPILE): Likewise.
3678 (CXXLINK): Likewise.
3679 * testsuite/Makefile.in: Regenerated.
3680
d361fafb
L
36812012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3682
3683 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
3684 on bad fwrite return.
3685
598c7410
L
36862012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3687
3688 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
3689 on val.
3690
35c813e2
CC
36912012-10-23 Cary Coutant <ccoutant@google.com>
3692
3693 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
3694 * testsuite/Makefile.in: Regenerate.
3695 * testsuite/dwp_test.h: New source file.
3696 * testsuite/dwp_test_1.cc: New source file.
3697 * testsuite/dwp_test_1.s: New source file.
3698 * testsuite/dwp_test_1.sh: New source file.
3699 * testsuite/dwp_test_1b.cc: New source file.
3700 * testsuite/dwp_test_1b.s: New source file.
3701 * testsuite/dwp_test_2.cc: New source file.
3702 * testsuite/dwp_test_2.s: New source file.
3703 * testsuite/dwp_test_2.sh: New source file.
3704 * testsuite/dwp_test_main.cc: New source file.
3705 * testsuite/dwp_test_main.s: New source file.
3706
77429909
CC
37072012-10-23 Cary Coutant <ccoutant@google.com>
3708
3709 * dwp.h: New header file.
3710 * dwp.cc: New source file.
3711 * gold.h: Move shared declarations to system.h.
3712 * system.h: New header file.
3713 * Makefile.am: Add dwp.
3714 * Makefile.in: Regenerate.
3715
ed5d6712
CC
37162012-10-23 Cary Coutant <ccoutant@google.com>
3717
3718 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
3719 Dwarf_info_reader::read_from_pointer.
3720 (Dwarf_pubnames_table::read_header): Likewise.
3721 (Dwarf_pubnames_table::next_name): Likewise.
3722 (Dwarf_die::read_attributes): Likewise.
3723 (Dwarf_die::skip_attributes): Likewise.
3724 (Dwarf_info_reader::read_from_pointer): New function template.
3725 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
3726 (Dwarf_pubnames_table): Likewise.
3727 (Dwarf_info_reader::read_from_pointer): New function template.
3728 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
3729 Dwarf_pubnames_table ctor.
3730
8787852d
CC
37312012-10-23 Cary Coutant <ccoutant@google.com>
3732
3733 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
3734 abbrev_shndx.
3735 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
3736 abbrev_shndx_.
3737 (Dwarf_info_reader::set_abbrev_shndx): New method.
3738 (Dwarf_info_reader::abbrev_shndx_): New data member.
3739
9fc236f3
CC
37402012-10-23 Cary Coutant <ccoutant@google.com>
3741
3742 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
3743 from object, not parameters.
3744 (Dwarf_info_reader::parse): Likewise.
3745 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
3746 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
3747 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
3748 methods.
3749
effe8365
CC
37502012-10-23 Cary Coutant <ccoutant@google.com>
3751
3752 * fileread.cc (Input_file::Input_file): New constructor.
3753 * fileread.h (class Input_file): Add new constructor.
3754
1698990d
AM
37552012-10-18 Alan Modra <amodra@gmail.com>
3756
3757 PR gold/14727
3758 * object.cc (Relobj::is_section_name_included): Also match
3759 .sdata personality section.
3760
168a4726
AM
37612012-10-18 Alan Modra <amodra@gmail.com>
3762
3763 * target-reloc.h (class Default_comdat_behavior): New, package up..
3764 (get_comdat_behaviour): ..this.
3765 (relocate_section): Add Relocate_comdat_behavior template arg,
3766 adjust code to suit.
3767 * arm.cc (Target_arm::relocate_section): Adjust to suit.
3768 (Target_arm::scan_reloc_section): Likewise.
3769 * i386.cc (Target_i386::relocate_section): Likewise.
3770 * sparc.cc (Target_sparc::relocate_section): Likewise.
3771 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
3772 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
3773 * powerpc.cc (class Relocate_comdat_behavior): New.
3774 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
3775 gold::relocate_section with new template arg.
3776
acc276d8
AM
37772012-10-18 Alan Modra <amodra@gmail.com>
3778
3779 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
3780 dynamic relocs for GOT_TPREL got entries, without symbol if
3781 resolving locally.
3782 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
3783 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
3784 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
3785
e10f9870
AM
37862012-10-17 Alan Modra <amodra@gmail.com>
3787
3788 PR gold/14726
3789 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
3790
ae034989
ST
37912012-10-16 Sriraman Tallam <tmsriram@google.com>
3792
3793 * layout.cc (Layout::include_section): Keep sections marked
3794 SHF_EXCLUDE when doing relocatable links.
3795
f3a0ed29
AM
37962012-10-16 Alan Modra <amodra@gmail.com>
3797
3798 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
3799 (Target_powerpc::do_finalize_sections): Call it.
3800 (Output_data_save_res): New class and supporting functions.
3801 (Target_powerpc::symval_for_branch): Only look up .opd entry for
3802 normal symbols defined in object files.
3803
c6de8ed4
AM
38042012-10-12 Alan Modra <amodra@gmail.com>
3805
3806 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
3807 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
3808 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
3809 section if scan_opd_relocs not yet called.
3810 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
3811
03e25981
AM
38122012-10-12 Alan Modra <amodra@gmail.com>
3813
3814 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
3815 add_local_ifunc_entry): Revert last change.
3816 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
3817
c9824451
AM
38182012-10-05 Alan Modra <amodra@gmail.com>
3819
3820 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
3821 do_plt_address_for_global): New functions.
3822 (Output_data_got_powerpc::do_write): Don't segfault when linking
3823 statically.
3824 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
3825 add_local_ifunc_entry): Return true on adding entry..
3826 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
3827 glink->add_entry call. Remove unused symtab param. Adjust calls.
3828 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
3829 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
3830 set up symbols here.
3831 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
3832 syms here. Do so even when no .iplt. Don't segfault when linking
3833 statically.
3834 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
3835 new variants without reloc param.
3836 (Glink_sym_ent::Glink_sym_ent): Likewise.
3837 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
3838 reloc when refs will resolve to plt call stub.
3839 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
3840 R_PPC_PLTREL24 to resolve locally.
3841 (Target_powerpc::Scan::global): Correct ifunc handling.
3842 (Target_powerpc::Relocate::relocate): Correct local sym glink
3843 lookup. Don't destroy "value" when we have a plt call stub,
3844 and when checking plt call validity.
3845 (Target_powerpc::do_dynsym_value): Simplify.
3846
19fec8c1
AM
38472012-10-05 Alan Modra <amodra@gmail.com>
3848
3849 * i386.cc (Output_data_plt_i386::address_for_global,
3850 address_for_local): Add plt offset to returned value. Adjust uses.
3851 * sparc.cc (Output_data_plt_sparc::address_for_global,
3852 address_for_local): Likewise.
3853 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
3854 address_for_local): Likewise.
3855 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
3856 address_for_local): Likewise.
3857 * target.h (Target::plt_address_for_global, plt_address_for_local):
3858 Update comment.
3859 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
3860 (Output_data_got::Got_entry::write): Nor here.
3861 * output.h: Comment fix.
3862
e867b647
WL
38632012-10-02 Jiong Wang <jiwang@tilera.com>
3864
3865 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
3866 global_offset_table_ value for larget got.
3867 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
3868
e5d5f5ed
AM
38692012-09-29 Alan Modra <amodra@gmail.com>
3870
3871 * powerpc.cc (Target_powerpc::iplt_): New output section.
3872 (Target_powerpc::iplt_section, make_iplt_section,
3873 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
3874 (Target_powerpc::make_plt_entry): Handle ifunc syms.
3875 Target_powerpc::plt_entry_count): Count iplt entries too.
3876 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
3877 reloc section in constructor. New params.
3878 (Target_powerpc::make_plt_section): Create reloc section here instead.
3879 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
3880 functions.
3881 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
3882 (Output_data_glink::add_entry, find_entry): New functions to
3883 deal with local syms.
3884 (Glink_sym_ent): Add support for local syms.
3885 (Output_data_glink::do_write): Handle ifunc plt entries.
3886 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3887 (Target_powerpc::Scan::local, global): Handle ifunc syms.
3888 (Target_powerpc::Relocate::relocate): Likewise.
3889 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
3890
ec4dbad3
AM
38912012-09-25 Alan Modra <amodra@gmail.com>
3892
3893 * object.h (Sized_relobj_file::adjust_local_symbol,
3894 do_adjust_local_symbol): New functions.
3895 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
3896 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
3897 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
3898 and irregular opd entry spacing.
3899 (Powerpc_relobj::do_read_relocs): Add opd size checks.
3900 (Global_symbol_visitor_opd): New functor.
3901 (Target_powerpc::do_finalize_sections): Omit global symbols defined
3902 on deleted opd entries.
3903
5c0b3823
WL
39042012-09-15 Jiong Wang <jiwang@tilera.com>
3905
3906 * tilegx.cc: New file.
3907 * Makefile.am (TARGETSOURCES): Add tilegx.cc
3908 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
3909 * configure.tgt: Add entries for tilegx*.
3910 * configure.ac: Likewise.
3911 * Makefile.in: Rebuild.
3912 * configure: Likewise.
3913 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
3914 tilegx.
3915
bfdfa4cd
AM
39162012-09-13 Alan Modra <amodra@gmail.com>
3917
3918 * target-reloc.h (scan_relocs): Call scan.local for relocs
3919 against symbols in discarded sections. Pass is_discarded
3920 param.
3921 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
3922 Add is_discarded param.
3923 * powerpc (Target_powerpc::Scan::local): Likewise. Use
3924 is_discarded to flag opd entry as discarded. Don't emit dyn
3925 relocs on such entries.
3926 (Target_powerpc::Scan::global): Similarly detect and handle
3927 such opd entries.
3928 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
3929 opd_ent_. Update all uses.
3930 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
3931 (Target_powerpc::relocate_section): Zero out discarded opd
3932 entry relocs.
3933
d77a0555
ILT
39342012-09-12 Ian Lance Taylor <iant@google.com>
3935
3936 PR gold/14570
3937 * output.cc: Rename Output_data_got template parameter from size
3938 to got_size for all functions. Compile all variants of
3939 Output_data_got.
3940 (Output_data_got::Got_entry::write): Correct use of size for
3941 symbol value. Use local_is_tls rather than casting to
3942 Sized_relobj_file.
3943 * object.h (class Object): Add local_is_tls and do_local_is_tls.
3944 (class Sized_relobj_file): Add do_local_is_tls.
3945 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
3946
815a1205
AM
39472012-09-11 Alan Modra <amodra@gmail.com>
3948
3949 PR gold/14566
3950 * layout.cc (Layout::set_segment_offsets): When using
3951 common-page-size alignment, ensure we are on a new max-page-size
3952 page.
3953 * output.cc (Output_segment::set_section_addresses): Use
3954 abi_pagesize, not common_pagesize for relro boundary.
3955 (Output_segment::set_offset): Likewise.
3956
bd73a62d
AM
39572012-09-11 Alan Modra <amodra@gmail.com>
3958
3959 * output.h (Output_data_got::add_global_tls, add_local_tls,
3960 add_local_tls_pair): New functions.
3961 (Output_data_got::add_local_pair_with_rel): Remove second
3962 reloc param. Expand comment.
3963 (Output_data_got::Got_entry): Rename use_plt_offset_ to
3964 use_plt_or_tls_offset_, similarly for constructor param.
3965 (Output_data_got::Got_entry::write): Add got_index param.
3966 * output.cc (Output_data_got::add_global_tls, add_local_tls,
3967 add_local_tls_pair): New functions.
3968 (Output_data_got::Got_entry::write): Handle tls symbols
3969 with use_plt_or_tls_offset_ set specially.
3970 (Output_data_got::add_local_pair_with_rel): Only one reloc.
3971 (Output_data_got::do_write): Replace iterator with index, pass
3972 index to entry write function.
3973 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
3974 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
3975 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
3976 call.
3977 * i386.cc (Target_i386::Scan::local): Likewise.
3978 * sparc.cc (Target_sparc::Scan::local): Likewise.
3979 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
3980 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
3981 do_tls_offset_for_global): New functions.
3982 (Target_powerpc::Scan::local): Correct TLS relocations and got
3983 entry values.
3984 (Target_powerpc::Scan::global): Don't emit unnecessary
3985 dynamic relocations on TLS GOT entries.
3986
00716ab1
AM
39872012-09-10 Matthias Klose <doko@ubuntu.com>
3988
3989 * config.in: Disable sanity check for kfreebsd.
3990
c891b3f9
SA
39912012-09-10 Sterling Augustine <saugustine@google.com>
3992
3993 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
3994 (Gdb_index::pubtypes_read): New parameter.
3995 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
3996 to calls.
3997 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
3998 pubtypes_object_.
3999
e81fea4d
AM
40002012-09-09 Alan Modra <amodra@gmail.com>
4001
4002 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
4003 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
4004 * gc.h (gc_process_relocs): Call target gc_add_reference.
4005 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
4006 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
4007 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
4008 unnecessary cast.
4009 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
4010 to cater for when we don't need code offset. Update use.
4011 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
4012 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
4013 set_opd_valid): New functions.
4014 (Target_powerpc::do_gc_add_reference): New function.
4015 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
4016 stashed refs.
4017 (Target_powerpc::do_gc_mark_symbol): New function.
4018
d2d60eef
CC
40192012-09-06 Cary Coutant <ccoutant@google.com>
4020
4021 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
4022 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
4023 (Dwarf_die::skip_attributes): Likewise.
4024 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
4025 * testsuite/gdb_index_test.cc (inline_func_1): New function.
4026 (main): Call it.
4027 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
4028
32ed4573
L
40292012-09-05 H.J. Lu <hongjiu.lu@intel.com>
4030
4031 * testsuite/script_test_3.t: Add .got.plt output section
4032 statement.
4033 * testsuite/script_test_4.t: Likewise.
4034
f4baf0d4
AM
40352012-09-05 Alan Modra <amodra@gmail.com>
4036
4037 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
4038 update all uses and lose "enum" when using type.
4039
864a1b56
AM
40402012-09-05 Alan Modra <amodra@gmail.com>
4041
4042 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
4043 * configure: Regenerate.
4044 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
4045 (plugin_final_layout.stdout): Likewise.
4046 (memory_test): Set page sizes to 0x1000.
4047 * testsuite/Makefile.in: Regenerate.
4048 * testsuite/discard_locals_test.sh: Add FIXME comment.
4049 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
4050 * testsuite/pr14265.t: Add .got output section statement.
4051 * testsuite/script_test_2.t: Likewise.
4052 * testsuite/script_test_3.t: Likewise.
4053 * testsuite/script_test_4.t: Likewise.
4054 * testsuite/script_test_5.t: Likewise.
4055 * testsuite/script_test_6.t: Likewise.
4056 * testsuite/script_test_7.t: Likewise.
4057 * testsuite/script_test_9.t: Likewise.
4058
3ea0a085
AM
40592012-09-05 Alan Modra <amodra@gmail.com>
4060
4061 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
4062 (Powerpc_relocate_functions::Status): New typedef.
4063 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4064 (Target_powerpc::Scan::local): Handle REL64.
4065 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
4066 for REL32 and REL64.
4067 (Target_powerpc::symval_for_branch): New function, extracted from..
4068 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
4069 checks. Report overflow errors.
4070
7404fe1b
AM
40712012-09-05 Alan Modra <amodra@gmail.com>
4072
4073 * object.h (Sized_relobj_file::emit_relocs): Delete.
4074 (Sized_relobj_file::emit_relocs_reltype): Delete.
4075 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
4076 relocate_relocs for --emit-relocs.
4077 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
4078 * output.h: Update comment.
4079 (Output_segment::first_section): New function.
4080 (Output_segment::first_section_load_address): Use first_section.
4081 * output.cc (Output_segment::first_section): New function extracted..
4082 (Output_segment::first_section_load_address): ..from here. Delete.
4083 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
4084 * target.h (Sized_target::relocate_for_relocatable): Likewise.
4085 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
4086 adjust call to target.h function.
4087 * i386.cc (Target_i386): Likewise.
4088 * sparc.cc (Target_sparc): Likewise.
4089 * x86_64.cc (Target_x86_64): Likewise.
4090 * powerpc.cc (Target_powerpc): Likewise.
4091 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
4092 first tls section has section symbol for optimised local dynamic
4093 output relocs.
4094 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
4095 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
4096 optimised tls code.
4097 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
4098 Rename to relocate_relocs. Update error message.
4099
957564c9
AS
41002012-09-04 Andreas Schwab <schwab@linux-m68k.org>
4101
4102 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
4103 --just-symbols.
4104
dd93cd0a
AM
41052012-08-31 Alan Modra <amodra@gmail.com>
4106
4107 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
4108 (Powerpc_relobj::toc_base_offset): New stub function.
4109 (Target_powerpc): Add tp_offset, dtp_offset. Rename
4110 got_mod_index_offset to tlsld_got_offset. Update all refs.
4111 (Target_powerpc::Relocate::enum skip_tls): New.
4112 (Target_powerpc::call_tls_get_addr_): New var.
4113 (Target_powerpc::is_branch_reloc): Move to file scope.
4114 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
4115 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
4116 New functions.
4117 (Target_powerpc::enum Got_type): Delete old values, add new ones.
4118 (powerpc_info): Correct common_pagesize for ppc64.
4119 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
4120 (Powerpc_relocate_functions): Add overflow check enums and functions.
4121 Add non-shift version of rela, rela_ua. Delete all rel public
4122 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
4123 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
4124 addr16_ha3, addr14 functions.
4125 (Output_data_got_powerpc::add_constant_pair): New function.
4126 (Output_data_got_powerpc::got_base_offset): Likewise.
4127 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
4128 (instruction constants): Sort, add some more.
4129 (Output_data_glink::do_write): Add and use Address typedef. Use
4130 object->toc_base_offset() stub for 64-bit.
4131 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
4132 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4133 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
4134 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
4135 Always treat .opd relocs as against locally defined symbol.
4136 Correct condition for RELATIVE relocs.
4137 (Target_powerpc::do_finalize_sections): Test for NULL sections.
4138 (Target_powerpc::Relocate::relocate): Use plt call stub as value
4139 for 32-bit syms with a plt entry. Correct ppc64 toc base
4140 calculations. Handle TLS relocs, and more. Add overflow
4141 checking and adjust for Powerpc_relocate_functions changes.
4142 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
4143 Reinstate --emit-relocs code with FIXME.
4144
a1373b60
AM
41452012-08-30 Alan Modra <amodra@gmail.com>
4146
4147 * layout.cc (Layout::set_segment_offsets): Set p_align to
4148 abi_pagesize, not common_pagesize.
4149 (Layout::relaxation_loop_body): Similarly use abi_pagesize
4150 to determine whether file header can go in segment.
4151
703d02da
AM
41522012-08-30 Alan Modra <amodra@gmail.com>
4153
4154 * output.h (Output_reloc::Output_reloc <output section>): Add
4155 is_relative param. Adjust calls.
4156 (Output_reloc::add_output_section_relative): New functions.
4157 * output.cc (Output_reloc::Output_reloc <output section>): Handle
4158 is_relative.
4159 (Output_reloc::symbol_value): Handle SECTION_CODE.
4160
16164a6b
ST
41612012-08-24 Sriraman Tallam <tmsriram@google.com>
4162
4163 * gold.cc (queue_middle_tasks): Call layout again when unique
4164 segments for sections is desired.
4165 * layout.cc (Layout::Layout): Initialize new members.
4166 (Layout::get_output_section_flags): New function.
4167 (Layout::choose_output_section): Call get_output_section_flags.
4168 (Layout::layout): Make output section for mapping to a unique segment.
4169 (Layout::insert_section_segment_map): New function.
4170 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 4171 output sections marked so.
16164a6b
ST
4172 (Layout::segment_precedes): Check for unique segments when sorting.
4173 * layout.h (Layout::Unique_segment_info): New struct.
4174 (Layout::Section_segment_map): New typedef.
4175 (Layout::insert_section_segment_map): New function.
4176 (Layout::get_output_section_flags): New function.
4177 (Layout::is_unique_segment_for_sections_specified): New function.
4178 (Layout::set_unique_segment_for_sections_specified): New function.
4179 (Layout::unique_segment_for_sections_specified_): New member.
4180 (Layout::section_segment_map_): New member.
4181 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
4182 Rename is_gc_pass_one to is_pass_one.
4183 Rename is_gc_pass_two to is_pass_two.
4184 Rename is_gc_or_icf to is_two_pass.
4185 Check for which pass based on whether symbols data is present.
4186 Make it two pass when unique segments for sections is desired.
4187 * output.cc (Output_section::Output_section): Initialize new
4188 members.
4189 * output.h (Output_section::is_unique_segment): New function.
4190 (Output_section::set_is_unique_segment): New function.
4191 (Output_section::is_unique_segment_): New member.
4192 (Output_section::extra_segment_flags): New function.
4193 (Output_section::set_extra_segment_flags): New function.
4194 (Output_section::extra_segment_flags_): New member.
4195 (Output_section::segment_alignment): New function.
4196 (Output_section::set_segment_alignment): New function.
4197 (Output_section::segment_alignment_): New member.
4198 (Output_segment::Output_segment): Initialize is_unique_segment_.
4199 (Output_segment::is_unique_segment): New function.
4200 (Output_segment::set_is_unique_segment): New function.
4201 (Output_segment::is_unique_segment_): New member.
4202 * plugin.cc (allow_unique_segment_for_sections): New function.
4203 (unique_segment_for_sections): New function.
4204 (Plugin::load): Add new functions to transfer vector.
4205 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
4206 * Makefile.in: Regenerate.
4207 * testsuite/plugin_final_layout.sh: Check if unique segment
4208 functionality works.
4209 * testsuite/plugin_section_order.c (onload): Check if new interfaces
4210 are available.
4211 (allow_unique_segment_for_sections): New global.
4212 (unique_segment_for_sections): New global.
4213 (claim_file_hook): Call allow_unique_segment_for_sections.
4214 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 4215
1e2bee4f
CC
42162012-08-22 Cary Coutant <ccoutant@google.com>
4217
4218 * layout.cc (Layout::include_section): Don't assert on GROUP
4219 sections with --emit-relocs.
4220
1d5dfe78
CC
42212012-08-21 Cary Coutant <ccoutant@google.com>
4222
4223 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
4224 if --export-dynamic-symbol names an undef symbol.
4225
c9269dff
AM
42262012-08-18 Alan Modra <amodra@gmail.com>
4227
4228 * powerpc.cc: Formatting and white space.
4229 (Powerpc_relobj): Rename got2_section_ to special_.
4230 Add opd_ent_shndx_ and opd_ent_off_ vectors.
4231 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
4232 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
4233 (Target_powerpc): Add Address typedef and invalid_address. Use
4234 throughout.
4235 (Target_powerpc::is_branch_reloc): New function.
4236 (Powerpc_relocate_functions): Add Address typedef, use throughout.
4237 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
4238 for dst_mask, value and addend.
4239 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
4240 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
4241 (Output_data_glink::do_write): Correct toc base. Don't try to use
4242 uint16_t for 24-bit offset. Use get_output_section_offset and
4243 check return.
4244 (Target_powerpc::Scan::local): Handle more relocs.
4245 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
4246 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
4247 Plug in toc restoring insn after plt calls. Translate branches
4248 to function descriptor symbols to corresponding entry point.
4249 (Target_powerpc::relocate_for_relocatable): Check return from
4250 get_output_section_offset.
4251 * symtab.h: Comment typo.
4252
b1759dce
ILT
42532012-08-14 Ian Lance Taylor <iant@google.com>
4254
4255 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
4256 unsupported_relocal_local to call unsupported_reloc_global.
4257
b9b2ae8b
NC
42582012-08-14 Nick Clifton <nickc@redhat.com>
4259
4260 PR ld/14265
4261 * script-sections.cc (Sections_element::output_section_name): Add
4262 keep return parameter.
4263 (Output_section_element::match_name): Add keep return parameter.
4264 Return the value of the keep_ member.
4265 * script-sections.h (class Output_section): Update
4266 output_section_name prototype.
4267 * layout.cc (Layout::keep_input_section): New public member
4268 function.
4269 (Layout::choose_output_section): Pass keep parameter to
4270 output_section_name.
4271 * layout.h (class Layout): Add keep_input_section.
4272 * object.cc (Sized_relobj_file::do_layout): Check for kept input
4273 sections.
4274 * testsuite/Makefile.am: Add a test.
4275 * testsuite/Makefile.in: Regenerate.
4276 * testsuite/pr14265.c: Source file for the test.
4277 * testsuite/pr14265.t: Linker script for the test.
4278 * testsuite/pr14265.sh: Shell script for the test.
4279
921b5322
AM
42802012-08-14 Alan Modra <amodra@gmail.com>
4281
4282 * target.h (Target::output_section_name): New function.
4283 (Target::do_output_section_name): New function.
4284 * layout.cc (Layout::choose_output_section): Call the above.
4285 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
4286
6ce78956
AM
42872012-08-14 Alan Modra <amodra@gmail.com>
4288
4289 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
4290 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
4291 for replace_constant call.
4292 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
4293 (Output_data_glink::do_print_to_mapfile): New function.
4294 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
4295 (Target_powerpc::Relocate::relocate): Likewise.
4296
d1a8cabd
AM
42972012-08-14 Alan Modra <amodra@gmail.com>
4298
4299 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
4300 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
4301 (Output_data_glink::add_entry,find_entry): Remove shndx param.
4302 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
4303 all references to shndx_. Handle special case for R_PPC_PLTREL24
4304 here.
4305 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
4306 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
4307 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
4308 here.
4309 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
4310 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
4311
d83ce4e3
AM
43122012-08-12 Alan Modra <amodra@gmail.com>
4313
4314 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
4315 (glink insn constants): Use uint32_t.
4316 (Output_data_glink::add_entry): Use insert, not [] operator.
4317
cf43a2fe
AM
43182012-08-11 Alan Modra <amodra@gmail.com>
4319
4320 * object.h (Sized_relobj_file::find_shdr): New function.
4321 (Sized_relobj_file::find_special_sections): New function.
4322 * object.cc (Sized_relobj_file::find_shdr): New function.
4323 (Sized_relobj_file::find_eh_frame): Use find_shdr.
4324 (Sized_relobj_file::find_special_sections): New function, split out..
4325 (Sized_relobj_file::do_read_symbols): ..from here.
4326 * output.h (Output_data_got::replace_constant): New function.
4327 (Output_data_got::num_entries): New function.
4328 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
4329 (Output_data_got::got_offset): Protected rather than private.
4330 (Output_data_got::replace_got_entry): New function.
4331 * output.cc (Output_data_got::replace_got_entry): New function.
4332 * powerpc.cc (class Powerpc_relobj): New.
4333 (class Powerpc_relocate_functions): Delete all psymval variants or
4334 convert to value,addend type. Delete pcrela, pcrela_unaligned.
4335 Implement _ha functions using corresponding _hi function.
4336 (Powerpc_relobj::find_special_sections): New function.
4337 (Target_powerpc::do_make_elf_object): New function.
4338 (class Output_data_got_powerpc): New.
4339 (class Output_data_glink): New.
4340 (class Powerpc_scan_relocatable_reloc): New.
4341 Many more changes througout file.
4342
3c892704
NC
43432012-08-09 Nick Clifton <nickc@redhat.com>
4344
4345 * po/vi.po: Updated Vietnamese translation.
4346
82435b3b
ILT
43472012-08-07 Ian Lance Taylor <iant@google.com>
4348
4349 * layout.cc (Layout::add_target_dynamic_tags): If
4350 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
4351 plt_rel.
4352
a6dc81d2
NC
43532012-07-30 Nick Clifton <nickc@redhat.com>
4354
4355 * po/gold.pot: Updated template.
4356 * po/es.po: Updated Spanish translation.
4357
f1415016
CC
43582012-07-18 Cary Coutant <ccoutant@google.com>
4359
4360 PR gold/14344
4361 * configure.ac: Add check for -gpubnames support.
4362 * configure: Regenerate.
4363 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
4364 support; force -gno-pubnames.
4365 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
4366 support.
4367 (gdb_index_test_4): New test.
4368 * testsuite/Makefile.in: Regenerate.
4369 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
4370 * testsuite/gdb_index_test_2.sh: Likewise.
4371 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
4372 * testsuite/gdb_index_test_4.sh: New script.
4373 * testsuite/gdb_index_test_comm.sh: New script with common code;
4374 don't look for space after colon.
4375
b7fd7c37
ST
43762012-07-16 Sriraman Tallam <tmsriram@google.com>
4377
4378 * gold.cc (queue_middle_tasks): Update function order only after
4379 deferred objects due to plugins are processed.
4380
1f3212db
ILT
43812012-07-11 Ian Lance Taylor <iant@google.com>
4382
4383 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
4384 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
4385 (Target_arm::scan_reloc_for_stub): Likewise.
4386 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
4387 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
4388 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
4389 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
4390 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
4391
81c82a68
ILT
43922012-07-10 Dodji Seketeli <dodji@redhat.com>
4393 Ian Lance Taylor <iant@google.com>
4394
4395 PR gold/14309
4396 * configure.ac: Test whether std::tr1::hash<off_t> works.
4397 * gold.h: Add a specialization for std::tr1::hash<off_t> if
4398 needed.
4399 * output.h (class Output_fill): Add virtual destructor.
4400 * configure, config.in: Rebuild.
4401
eabc84f4
RM
44022012-06-22 Roland McGrath <mcgrathr@google.com>
4403
4404 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
4405
370e30b6
RÁE
44062012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
4407
4408 * plugin.cc (Plugin::load): Handle position independent executables.
4409
fb1b895d
CC
44102012-06-06 Cary Coutant <ccoutant@google.com>
4411
4412 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
4413 add .debug_macro.
4414 (lines_only_debug_sections): Likewise.
4415 (gdb_fast_lookup_sections): New static array.
4416 (is_gdb_debug_section): Rename formal parameter.
4417 (is_lines_only_debug_section): Likewise.
4418 (is_gdb_fast_lookup_section): New function.
4419 (Layout::include_section): Check for ".zdebug_" prefix; pass
4420 section name suffix to is_gdb_debug_section, et al.; check for
4421 fast-lookup sections when building .gdb_index.
4422 * options.h (--strip-debug-gdb): Update GDB version number.
4423
7c0640fa
CC
44242012-06-06 Cary Coutant <ccoutant@google.com>
4425
4426 * configure.ac: Add check for fallocate.
4427 * configure: Regenerate.
4428 * config.in: Regenerate.
4429
4430 * options.h (class General_options): Add --mmap-output-file and
4431 --posix-fallocate options.
4432 * output.cc: (posix_fallocate): Remove; replace with...
4433 (gold_fallocate): New function.
4434 (Output_file::map_no_anonymous): Call gold_fallocate.
4435 (Output_file::map): Check --mmap-output-file option.
4436
2a49eb69
DK
44372012-06-05 Jing Yu <jingyu@google.com>
4438
4439 * gold.h (textdomain): Add do {} to empty while(0).
4440 (bindtextdomain): Likewise.
4441
fad072ac
CC
44422012-06-04 Cary Coutant <ccoutant@google.com>
4443
4444 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
4445 has_dynsym_index.
4446
8cc69fb6
ST
44472012-05-25 Sriraman Tallam <tmsriram@google.com>
4448
4449 * symtab.cc (Symbol_table::define_special_symbol):
4450 Initialize *poldsym to prevent uninitialized variable errors.
4451
1be75daa
CC
44522012-05-23 Cary Coutant <ccoutant@google.com>
4453
4454 * layout.cc (Layout::section_name_mapping): Add rules to handle
4455 exact match on .data.rel.ro.local or .data.rel.ro.
4456 (Layout::output_section_name): Check for exact matches.
4457
9b689de0
CC
44582012-05-23 Cary Coutant <ccoutant@google.com>
4459
4460 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
4461 more carefully.
4462
b24fdbf5
CC
44632012-05-22 Cary Coutant <ccoutant@google.com>
4464
4465 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
4466 object before exporting symbol.
4467
e550e1a2
L
44682012-05-21 H.J. Lu <hongjiu.lu@intel.com>
4469
4470 * testsuite/tls_test.cc: Include "config.h" first.
4471 * testsuite/tls_test_c.c: Likewise.
4472
df7b86aa
NC
44732012-05-17 Daniel Richard G. <skunk@iskunk.org>
4474 Nick Clifton <nickc@redhat.com>
4475
4476 PR 14072
4477 * configure.in: Add check that sysdep.h has been included before
4478 any system header files.
4479 * configure: Regenerate.
4480 * config.in: Regenerate.
4481
1007b503
CC
44822012-05-14 Cary Coutant <ccoutant@google.com>
4483
4484 * layout.cc (Layout::make_output_section): Mark .tdata section
4485 as RELRO.
4486 * testsuite/relro_test.cc: Add a TLS variable.
4487
fd885f3a
L
44882012-05-10 H.J. Lu <hongjiu.lu@intel.com>
4489
4490 PR gold/14091
4491 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
4492 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
4493 R_X86_64_64.
4494
80f5885c
CC
44952012-05-08 Cary Coutant <ccoutant@google.com>
4496
4497 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
4498 (lines_only_debug_sections): Likewise.
4499
2e702c99
RM
45002012-05-02 Roland McGrath <mcgrathr@google.com>
4501
4502 * nacl.cc: New file.
4503 * nacl.h: New file.
4504 * Makefile.am (CCFILES, HFILES): Add them.
4505 * Makefile.in: Regenerate.
4506 * i386.cc (Output_data_plt_i386_nacl): New class.
4507 (Output_data_plt_i386_nacl_exec): New class.
4508 (Output_data_plt_i386_nacl_dyn): New class.
4509 (Target_i386_nacl): New class.
4510 (Target_selector_i386_nacl): New class.
4511 (target_selector_i386): Use it instead of Target_selector_i386.
4512 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
4513 (Target_x86_64_nacl): New class.
4514 (Target_selector_x86_64_nacl): New class.
4515 (target_selector_x86_64, target_selector_x32): Use it instead of
4516 Target_selector_x86_64.
4517 * arm.cc (Output_data_plt_arm_nacl): New class.
4518 (Target_arm_nacl): New class.
4519 (Target_selector_arm_nacl): New class.
4520 (target_selector_arm, target_selector_armbe): Use it instead of
4521 Target_selector_arm.
4522
4523 * target-select.cc (select_target): Take new Input_file* and off_t
4524 arguments, pass them on to recognize method of selector.
4525 * object.cc (make_elf_sized_object): Update caller.
4526 * parameters.cc (parameters_force_valid_target): Likewise.
4527 * incremental.cc (make_sized_incremental_binary): Likewise.
4528 * target-select.h: Update decl.
4529 (Target_selector::recognize): Take new Input_file* argument,
4530 pass it on to do_recognize.
4531 (Target_selector::do_recognize): Take new Input_file* argument.
4532 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
4533 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
4534 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
4535 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
4536
4537 * target.h (Target::Target_info): New members isolate_execinstr
4538 and rosegment_gap.
4539 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
4540 * arm.cc (Target_arm::arm_info): Update initializer.
4541 * i386.cc (Target_i386::i386_info): Likewise.
4542 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
4543 * sparc.cc (Target_sparc::sparc_info): Likewise.
4544 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
4545 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
4546 * layout.cc (Layout::attach_allocated_section_to_segment):
4547 Take new const Target* argument. If target->isolate_execinstr(), act
4548 like --rosegment.
4549 (Layout::find_first_load_seg): Take new const Target* argument;
4550 if target->isolate_execinstr(), reject PF_X segments.
4551 (Layout::relaxation_loop_body): Update caller.
4552 (Layout::set_segment_offsets): If target->isolate_execinstr(),
4553 reset file offset to zero when we hit LOAD_SEG, and then do a second
4554 loop over the segments before LOAD_SEG to reassign offsets after
4555 addresses have been determined. Handle target->rosegment_gap().
4556 (Layout::attach_section_to_segment): Take new const Target* argument;
4557 pass it to attach_allocated_section_to_segment.
4558 (Layout::make_output_section): Update caller.
4559 (Layout::attach_sections_to_segments): Take new const Target* argument;
4560 pass it to attach_section_to_segment.
4561 * gold.cc (queue_middle_tasks): Update caller.
4562 * layout.h (Layout): Update method decls with new arguments.
4563
4564 * arm.cc (Target_arm::Target_arm): Take optional argument for the
4565 Target_info pointer to use.
4566 (Target_arm::do_make_data_plt): New virtual method.
4567 (Target_arm::make_data_plt): New method that calls it.
4568 (Target_arm::make_plt_entry): Use it.
4569 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
4570 for the section alignment.
4571 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
4572 method.
4573 (Output_data_plt_arm::first_plt_entry_offset): Call it.
4574 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
4575 method.
4576 (Output_data_plt_arm::get_plt_entry_size): Call it.
4577 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
4578 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
4579 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
4580 method.
4581 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
4582 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
4583 method instead of sizeof(plt_entry).
4584 (Output_data_plt_arm::add_entry): Likewise.
4585 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
4586 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
4587 than static method.
4588 (Target_arm::plt_entry_size): Likewise.
4589 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
4590 Move to ...
4591 (Output_data_plt_arm_standard): ... here, new class.
4592 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
4593 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
4594 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
4595
4596 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
4597 Take additional argument for the PLT entry size.
4598 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
4599 Use get_plt_entry_size method rather than plt_entry_size variable.
4600 (Output_data_plt_x86_64::reserve_slot): Likewise.
4601 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
4602 (Output_data_plt_x86_64::add_entry): Likewise.
4603 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
4604 (Output_data_plt_x86_64::address_for_global): Likewise.
4605 (Output_data_plt_x86_64::address_for_local): Likewise.
4606 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4607 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
4608 Make method non-static.
4609 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
4610 method.
4611 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
4612 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
4613 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
4614 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
4615 virtual method.
4616 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
4617 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
4618 virtual method.
4619 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
4620 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
4621 virtual method.
4622 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
4623 (Output_data_plt_x86_64::plt_entry_size)
4624 (Output_data_plt_x86_64::first_plt_entry)
4625 (Output_data_plt_x86_64::plt_entry)
4626 (Output_data_plt_x86_64::tlsdesc_plt_entry)
4627 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
4628 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
4629 (Output_data_plt_x86_64_standard): ... here, new class.
4630 (Target_x86_64::Target_x86_64): Take optional argument for the
4631 Target_info pointer to use.
4632 (Target_x86_64::do_make_data_plt): New virtual method.
4633 (Target_x86_64::make_data_plt): New method to call it.
4634 (Target_x86_64::init_got_plt_for_update): Use that.
4635 Call this->plt_->add_eh_frame method here.
4636 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
4637 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
4638 rather than static method.
4639 (Target_x86_64::plt_entry_size): Likewise.
4640 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
4641 rather than plt_entry_size variable. Move guts of PLT filling to...
4642 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
4643 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
4644 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
4645
4646 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
4647 additional argument for the section alignment.
4648 Don't do add_eh_frame_for_plt here.
4649 (Output_data_plt_i386::first_plt_entry_offset): Make the method
4650 non-static. Use get_plt_entry_size method rather than plt_entry_size
4651 variable.
4652 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
4653 method.
4654 (Output_data_plt_i386::get_plt_entry_size): Call it.
4655 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
4656 (Output_data_plt_i386::add_eh_frame): New method to call it.
4657 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
4658 method.
4659 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
4660 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
4661 method.
4662 (Output_data_plt_i386::fill_plt_entry): New method to call it.
4663 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
4664 method instead of plt_entry_size.
4665 (Output_data_plt_i386::plt_entry_size)
4666 (Output_data_plt_i386::plt_eh_frame_fde_size)
4667 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
4668 (Output_data_plt_i386_standard): ... here, new class.
4669 (Output_data_plt_i386_exec): New class.
4670 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
4671 (Output_data_plt_i386_exec::first_plt_entry): ... here.
4672 (Output_data_plt_i386::exec_plt_entry): Move to ...
4673 (Output_data_plt_i386_exec::plt_entry): ... here.
4674 (Output_data_plt_i386_dyn): New class.
4675 (Output_data_plt_i386::first_plt_entry): Move to ...
4676 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
4677 (Output_data_plt_i386::dyn_plt_entry): Move to ...
4678 (Output_data_plt_i386_dyn::plt_entry): ... here.
4679 (Target_i386::Target_i386): Take optional argument for the Target_info
4680 pointer to use.
4681 (Target_i386::do_make_data_plt): New virtual method.
4682 (Target_i386::make_data_plt): New method to call it.
4683 (Target_i386::make_plt_section): Use that.
4684 Call this->plt_->add_eh_frame method here.
4685 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
4686 rather than plt_entry_size variable.
4687 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
4688 (Output_data_plt_i386::address_for_local): Likewise.
4689 (Output_data_plt_i386::do_write): Likewise.
4690 Move guts of PLT filling to...
4691 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
4692 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
4693 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
4694 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
4695
b9b9f2ee
CC
46962012-05-01 Cary Coutant <ccoutant@google.com>
4697
4698 * dwarf_reader.cc (Dwarf_die::read_attributes)
4699 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
4700 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
4701 * reduced_debug_output.cc
4702 (Output_reduced_debug_info_section::get_die_end): Remove
4703 DW_FORM_GNU_ref_index. Add default case.
4704
57923f48
MW
47052012-04-26 Mark Wielaard <mjw@redhat.com>
4706
4707 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
4708 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
4709 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
4710 DW_AT_high_pc as offset from DW_AT_low_pc.
4711
4712 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
4713 * testsuite/Makefile.in: Regenerate.
4714 * testsuite/gdb_index_test_3.c: New test source file.
4715 * testsuite/gdb_index_test_3.sh: New test source file.
4716
2c54b4f4
ILT
47172012-04-25 Ian Lance Taylor <iant@google.com>
4718
4719 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
4720 pointer.
4721 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
4722 as a class, not a struct.
4723 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
4724 (Target_arm::apply_cortex_a8_workaround): Likewise.
4725 * gc.h: Declare Reloc_types as a struct, not a class.
4726 * object.h: Declare Symbols_data as a struct.
4727 * reloc.h: Declare Read_relocs_data as a struct.
4728 * target.h: Declare Relocate_info as a struct.
4729
a5a5f7a3
DM
47302012-04-24 David S. Miller <davem@davemloft.net>
4731
4732 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
4733 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
4734 and R_SPARC_WPLT30.
4735
f038d496
CC
47362012-04-24 Cary Coutant <ccoutant@google.com>
4737
4738 * incremental-dump.cc (find_input_containing_global): Replace
4739 magic number with symbolic constant.
4740 (dump_incremental_inputs): Update version number.
4741 * incremental.cc (Output_section_incremental_inputs): Update version
4742 number; import symbolic constants from Incremental_inputs_reader.
4743 (Incremental_inputs::create_data_sections): Align relocations
4744 section correctly for 64-bit targets.
4745 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
4746 constants; add padding.
4747 (Output_section_incremental_inputs::write_header): Add assert for
4748 header_size.
4749 (Output_section_incremental_inputs::write_input_files): Add assert
4750 for input_entry_size.
4751 (Output_section_incremental_inputs::write_info_blocks): Add padding;
4752 add assert for object_info_size, input_section_entry_size,
4753 global_sym_entry_size.
4754 * incremental.h (Incremental_inputs_reader): Add symbolic constants
4755 for data structure sizes; use them.
4756 (Incremental_input_entry_reader): Import symbolic constants from
4757 Incremental_inputs_reader; use them.
4758
a4d85145
DM
47592012-04-23 David S. Miller <davem@davemloft.net>
4760
4761 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
4762 and elf_flags_set_.
4763 (Target_sparc::Target_sparc): Initialize new fields.
4764 (Target_sparc::do_make_elf_object): New function.
4765 (Target_sparc::do_adjust_elf_header): New function.
4766
1d509098
CC
47672012-04-23 Cary Coutant <ccoutant@google.com>
4768
4769 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
4770 CU range table of gdb index.
4771
7ebeff7f
DM
47722012-04-20 David S. Miller <davem@davemloft.net>
4773
4774 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
4775 instead of false.
4776
13cf9988
DM
47772012-04-16 David S. Miller <davem@davemloft.net>
4778
2a1079e8
DM
4779 * sparc.cc (Target_sparc::got_address): New function.
4780 (Sparc_relocate_functions::gdop_hix22): New function.
4781 (Sparc_relocate_functions::gdop_lox10): New function.
4782 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
4783 relocs.
4784 (Target_sparc::Scan::local): Likewise if the global symbol is not
4785 preemptible and is not IFUNC.
4786 (Target_sparc::Relocate::relocate): Perform GOTDATA code
4787 transformations for local and non-preemptible non-IFUNC global
4788 symbols.
4789
0bc964fc
DM
4790 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
4791 writing out 64-bit part of ranges.
4792
661d7a80
DM
4793 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
4794 -fpic and -fpie respectively.
4795 * Makefile.in: Regenerate.
4796
8c2bf391
DM
4797 * sparc.cc (class Target_sparc): Add rela_ifunc_.
4798 (Target_sparc::Target_sparc): Initialize new field.
4799 (Target_sparc::do_plt_section_for_global): New function.
4800 (Target_sparc::do_plt_section_for_local): New function.
4801 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
4802 (Target_sparc::make_plt_section): New function, broken out of
4803 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
4804 (Target_sparc::make_plt_entry): Call make_plt_section.
4805 (Target_sparc::make_local_ifunc_plt_entry): New function.
4806 (Target_sparc::rela_ifunc_section): New function.
4807 (Target_sparc::plt_section): Remove const.
4808 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
4809 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
4810 and ifunc_count_ fields.
4811 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
4812 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
4813 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
4814 (Output_data_plt_sparc::rela_ifunc): New function.
4815 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
4816 (Output_data_plt_sparc::has_ifunc_section): New function.
4817 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
4818 (Output_data_plt_sparc::address_for_global): New function.
4819 (Output_data_plt_sparc::address_for_local): New function.
4820 (Output_data_plt_sparc::plt_index_to_offset): New function.
4821 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
4822 and entry_count.
4823 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
4824 entry_count.
4825 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
4826 R_SPARC_JMP_IREL to switch.
4827 (Target_sparc::Scan::check_non_pic): Likewise.
4828 (Target_sparc::Scan::local): Handle IFUNC symbols.
4829 (Target_sparc::Scan::local): Likewise.
4830 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
4831 and plt_address_for_local.
4832 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
4833 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
4834
13cf9988
DM
4835 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
4836 (class Output_data_reloc): Adjust calls to Output_reloc_type.
4837 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
4838 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
4839 global relocs too.
4840 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
4841 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
4842 calls.
4843 * sparc.cc (Target_sparc::Scan::global): Likewise.
4844 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4845
31821be0
CC
48462012-04-16 Cary Coutant <ccoutant@google.com>
4847
4848 * archive.cc (Library_base::should_include_member): Check for
4849 --export-dynamic-symbol.
4850 * options.h (class General_options): Add --export-dynamic-symbol.
4851 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
4852 --export-dynamic-symbol.
4853 (Symbol_table::gc_mark_undef_symbols): Likewise.
4854 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
4855
2615994e
DM
48562012-04-12 David S. Miller <davem@davemloft.net>
4857
4858 * sparc.cc (Reloc::wdisp10): New relocation method.
4859 (Reloc::h34): Likewise.
4860 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
4861 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
4862 R_SPARC_WDISP10.
4863 (Target_sparc::Scan::local): Likewise.
4864 (Target_sparc::Scan::global): Likewise.
4865 (Target_sparc::Relocate::relocate): Likewise.
4866
6782735d
CC
48672012-04-09 Cary Coutant <ccoutant@google.com>
4868
4869 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
4870 low_pc == 0.
4871
8c7a0b00
ILT
48722012-04-06 Ian Lance Taylor <iant@google.com>
4873
4874 * timer.cc: #include <unistd.h>.
4875
58797674
RM
48762012-04-06 Roland McGrath <mcgrathr@google.com>
4877
4878 * configure.in (AC_CHECK_HEADERS): Add locale.h.
4879 * config.in: Regenerate.
4880 * configure: Regenerate.
4881
44350750
NC
48822012-04-05 Nick Clifton <nickc@redhat.com>
4883
4884 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
4885 (AM_LC_MESSAGES): Add.
4886 * aclocal.m4: Regenerate.
4887 * config.in: Regenerate.
4888 * configure: Regenerate.
4889
c1027032
CC
48902012-03-21 Cary Coutant <ccoutant@google.com>
4891
4892 * Makefile.am: Add gdb-index.cc, gdb-index.h.
4893 * Makefile.in: Regenerate.
4894 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
4895 (Sized_elf_reloc_mapper::symbol_section): New function.
4896 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
4897 (make_elf_reloc_mapper): New function.
4898 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
4899 (Dwarf_abbrev_table::do_read_abbrevs): New function.
4900 (Dwarf_abbrev_table::do_get_abbrev): New function.
4901 (Dwarf_ranges_table::read_ranges_table): New function.
4902 (Dwarf_ranges_table::read_range_list): New function.
4903 (Dwarf_pubnames_table::read_section): New function.
4904 (Dwarf_pubnames_table::read_header): New function.
4905 (Dwarf_pubnames_table::next_name): New function.
4906 (Dwarf_die::Dwarf_die): New function.
4907 (Dwarf_die::read_attributes): New function.
4908 (Dwarf_die::skip_attributes): New function.
4909 (Dwarf_die::set_name): New function.
4910 (Dwarf_die::set_linkage_name): New function.
4911 (Dwarf_die::attribute): New function.
4912 (Dwarf_die::string_attribute): New function.
4913 (Dwarf_die::int_attribute): New function.
4914 (Dwarf_die::uint_attribute): New function.
4915 (Dwarf_die::ref_attribute): New function.
4916 (Dwarf_die::child_offset): New function.
4917 (Dwarf_die::sibling_offset): New function.
4918 (Dwarf_info_reader::check_buffer): New function.
4919 (Dwarf_info_reader::parse): New function.
4920 (Dwarf_info_reader::do_parse): New function.
4921 (Dwarf_info_reader::do_read_string_table): New function.
4922 (Dwarf_info_reader::lookup_reloc): New function.
4923 (Dwarf_info_reader::get_string): New function.
4924 (Dwarf_info_reader::visit_compilation_unit): New function.
4925 (Dwarf_info_reader::visit_type_unit): New function.
4926 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
4927 Sized_elf_reloc_mapper.
4928 (Sized_dwarf_line_info::symbol_section): Remove function.
4929 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
4930 (Sized_dwarf_line_info::read_line_mappings): Remove object
4931 parameter, adjust callers.
4932 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
4933 * dwarf_reader.h: Include <sys/types.h>.
4934 (class Track_relocs): Remove forward declaration.
4935 (class Elf_reloc_mapper): New class.
4936 (class Sized_elf_reloc_mapper): New class.
4937 (class Dwarf_abbrev_table): New class.
4938 (class Dwarf_range_list): New class.
4939 (class Dwarf_ranges_table): New class.
4940 (class Dwarf_pubnames_table): New class.
4941 (class Dwarf_die): New class.
4942 (class Dwarf_info_reader): New class.
4943 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
4944 (Sized_dwarf_line_info::symbol_section): Remove member function.
4945 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
4946 base class.
4947 * gdb-index.cc: New source file.
4948 * gdb-index.h: New source file.
4949 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
4950 and .debug_types sections, call Layout::add_to_gdb_index.
4951 (Sized_relobj_incr::do_section_name): Implement.
4952 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
4953 return type; Implement.
4954 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
4955 return type.
4956 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
4957 parameter list and return type.
4958 (Sized_incr_dynobj::do_section_contents): Likewise.
4959 * layout.cc: Include gdb-index.h.
4960 (Layout::Layout): Initialize gdb_index_data_.
4961 (Layout::init_fixed_output_section): Check for .gdb_index section.
4962 (Layout::add_to_gdb_index): New function. Instantiate.
4963 * layout.h: Add forward declaration for class Gdb_index.
4964 (Layout::add_to_gdb_index): New member function.
4965 (Layout::gdb_index_data_): New data member.
4966 * main.cc: Include gdb-index.h.
4967 (main): Print statistics for gdb index.
4968 * object.cc (Object::section_contents): Move code into
4969 do_section_contents.
4970 (need_decompressed_section): Check for sections needed when building
4971 gdb index.
4972 (build_compressed_section_map): Likewise.
4973 (Sized_relobj_file::do_read_symbols): Need local symbols when building
4974 gdb index.
4975 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
4976 sections; call Layout::add_to_gdb_index.
4977 (Sized_relobj_file::do_decompressed_section_contents): Call
4978 do_section_contents directly.
4979 * object.h (Object::do_section_contents): Adjust parameter list and
4980 return type.
4981 (Object::do_decompressed_section_contents): Call do_section_contents
4982 directly.
4983 (Sized_relobj_file::do_section_contents): Adjust parameter list and
4984 return type.
4985 * options.h (class General_options): Add --gdb-index option.
4986 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
4987 list and return type.
4988 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
4989 * reloc.h (Track_relocs::checkpoint): New function.
4990 (Track_relocs::reset): New function.
4991
4992 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
4993 New test cases.
4994 * testsuite/Makefile.in: Regenerate.
4995 * testsuite/gdb_index_test.cc: New test source file.
4996 * testsuite/gdb_index_test_1.sh: New test source file.
4997 * testsuite/gdb_index_test_2.sh: New test source file.
4998
647f1574
DK
49992012-03-19 Doug Kwan <dougkwan@google.com>
5000
5001 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 5002 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
5003 __exidx_start and __exidx_end. Make symbol table parameter
5004 anonymous as it is not used.
5005 * gold.cc (queue_middle_tasks): Call target hook to define any
5006 target-specific symbols.
5007 * target.h (Target::define_standard_symbols): New method.
5008 (Target::do_define_standard_symbols): Same.
5009 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
5010 * testsuite/Makefile.in: Regenerate.
5011 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
5012 and __exidx_end.
5013 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
5014 relocations are generated for __exidx_start and __exidx_end.
5015
7c6109da
DK
50162012-03-16 Doug Kwan <dougkwan@google.com>
5017
5018 * testsuite/Makefile.am: Disable test initpri3b.
5019 * testsuite/Makefile.in: Regenerate.
5020
7b8957f8
DK
50212012-03-15 Doug Kwan <dougkwan@google.com>
5022
5023 * arm.cc (Target_arm::got_section): Make .got section read-only
5024 if -z now is given.
5025
14dc9ef7
ILT
50262012-03-15 Ian Lance Taylor <iant@google.com>
5027
5028 PR gold/13850
5029 * layout.cc (Layout::make_output_section): Correctly mark
5030 SHT_INIT_ARRAY, et. al., as relro.
5031
fa40b62a
DK
50322012-03-14 Doug Kwan <dougkwan@google.com>
5033
5034 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
5035 dynamic relocations for protected symbols in shared objects.
5036
fd325007
ILT
50372012-03-13 Ian Lance Taylor <iant@google.com>
5038
5039 * resolve.cc (Symbol_table::resolve): When merging common symbols,
5040 keep the larger alignment.
5041
e8dd54e1
CC
50422012-03-12 Cary Coutant <ccoutant@google.com>
5043
5044 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
5045 handling of DW_LNE_define_file.
5046
feb5f3b0
CC
50472012-03-12 Cary Coutant <ccoutant@google.com>
5048
5049 * reduced_debug_output.cc
5050 (Output_reduced_debug_info_section::get_die_end): Add new FORM
5051 codes to switch.
5052
a1fb4256
CC
50532012-02-29 Cary Coutant <ccoutant@google.com>
5054
5055 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
5056
5dd8762a
CC
50572012-02-29 Cary Coutant <ccoutant@google.com>
5058
5059 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
5060 Call Object::decompressed_section_contents.
5061 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
5062 New dtor.
5063 (Sized_dwarf_line_info::buffer_start_): New data member.
5064 * merge.cc (Output_merge_data::do_add_input_section): Call
5065 Object::decompressed_section_contents.
5066 (Output_merge_string::do_add_input_section): Likewise.
5067 * object.cc (need_decompressed_section): New function.
5068 (build_compressed_section_map): Decompress sections needed later.
5069 (Sized_relobj_file::do_decompressed_section_contents): New function.
5070 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5071 * object.h (Object::decompressed_section_contents): New function.
5072 (Object::discard_decompressed_sections): New function.
5073 (Object::do_decompressed_section_contents): New function.
5074 (Object::do_discard_decompressed_sections): New function.
5075 (Compressed_section_info): New type.
5076 (Compressed_section_map): Include decompressed section contents.
5077 (Sized_relobj_file::do_decompressed_section_contents): New function.
5078 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5079
7b5de7ee
CC
50802012-02-16 Cary Coutant <ccoutant@google.com>
5081
5082 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
5083 * testsuite/Makefile.in: Regenerate.
5084
f9fa4a63
CC
50852012-02-14 Cary Coutant <ccoutant@google.com>
5086
5087 * options.cc (General_options::finalize): Disallow -pie and -static.
5088
2c175ebc
DK
50892012-02-03 Doug Kwan <dougkwan@google.com>
5090
5091 * arm.cc (Arm_relocate_functions::abs8,
5092 Arm_relocate_functions::abs16): Use
5093 Bits::has_signed_unsigned_overflow32.
5094 (Arm_relocate_functions::thm_abs8): Correct range of
5095 overflow check.
5096 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
5097 in assertions.
5098
90cff06f
DK
50992012-02-02 Doug Kwan <dougkwan@google.com>
5100
5101 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
5102 position independent outputs, not just shared objects.
5103
63887f3d
L
51042012-01-30 H.J. Lu <hongjiu.lu@intel.com>
5105
5106 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
5107 * configure: Regenerated.
5108
bef2b434
ILT
51092012-01-27 Ian Lance Taylor <iant@google.com>
5110
5111 * reloc.h (Bits): New class with static functions, copied from
5112 namespace utils in arm.cc.
5113 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
5114 instead.
5115
c335b55d
L
51162012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5117
5118 * incremental.cc (write_info_blocks): Correct relocation offset.
5119
41194d9f
L
51202012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5121
5122 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
5123 (Relocate::tls_gd_to_le): Likewise.
5124
1bae613c
L
51252012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5126
5127 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
5128
24482ca0
L
51292012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5130
5131 * configure.ac: Check if -mcmodel=medium works.
5132 * configure: Regenerated.
5133
c2c7840a
CC
51342012-01-24 Cary Coutant <ccoutant@google.com>
5135
5136 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
5137 definition and ...
5138 (read_unsigned_LEB_128_x): ... this new function.
5139 (read_signed_LEB_128): Replaced with inline definition and ...
5140 (read_signed_LEB_128_x): ... this new function.
5141 * int_encoding.h (read_unsigned_LEB_128_x): New function.
5142 (read_unsigned_LEB_128): Add inline definition.
5143 (read_signed_LEB_128_x): New function.
5144 (read_signed_LEB_128): Add inline definition.
5145 * testsuite/Makefile.am (leb128_unittest): New unit test.
5146 * testsuite/Makefile.in: Regenerate.
5147 * testsuite/leb128_unittest.cc: New unit test.
5148
833de760 51492012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
5150
5151 PR gold/13617
5152 * i386.cc (Target_i386::do_code_fill): When using a jmp
5153 instruction, pad with nop instructions.
5154 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5155
618d6666
L
51562012-01-22 H.J. Lu <hongjiu.lu@intel.com>
5157
5158 * x86_64.cc (gc_process_relocs): Add typename on types used in
5159 template.
5160 (scan_relocs): Likewise.
5161 (relocate_section): Likewise.
5162 (apply_relocation): Likewise.
5163
3660ff06
L
51642012-01-10 H.J. Lu <hongjiu.lu@intel.com>
5165
5166 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
5167 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
5168 under x32.
5169
fc51264f
L
51702012-01-09 H.J. Lu <hongjiu.lu@intel.com>
5171
5172 * x86_64.cc: Initial support for x32.
5173
dd74ae06
CC
51742012-01-03 Cary Coutant <ccoutant@google.com>
5175
5176 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
5177 Use abstract base class for GOT.
5178 * gold/output.h (class Output_data_got_base): New abstract base class.
5179 (class Output_data_got): Derive from new base class, adjust ctors.
5180 (Output_data_got::reserve_slot): Make virtual; rename to
5181 do_reserve_slot; Adjust callers.
5182 * gold/target.h (Sized_target::init_got_plt_for_update): Return
5183 pointer to abstract base class.
5184 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
5185
83896202
ILT
51862011-12-18 Ian Lance Taylor <iant@google.com>
5187
5188 * object.h (Relobj::local_symbol_value): New function.
5189 (Relobj::local_plt_offset): New function.
5190 (Relobj::local_has_got_offset): New function.
5191 (Relobj::local_got_offset): New function.
5192 (Relobj::set_local_got_offset): New function.
5193 (Relobj::do_local_symbol_value): New pure virtual function.
5194 (Relobj::do_local_plt_offset): Likewise.
5195 (Relobj::do_local_has_got_offset): Likewise.
5196 (Relobj::do_local_got_offset): Likewise.
5197 (Relobj::do_set_local_got_offset): Likewise.
5198 (Sized_relobj::do_local_has_got_offset): Rename from
5199 local_has_got_offset.
5200 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
5201 (Sized_relobj::do_set_local_got_offset): Rename from
5202 set_local_got_offset.
5203 (Sized_relobj_file::do_local_plt_offset): Rename from
5204 local_plt_offset.
5205 (Sized_relobj_file::do_local_symbol_value): New function.
5206 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
5207 local_plt_offset.
5208 * output.cc (Output_data_got::Got_entry::write): Change object to
5209 Relobj. Use local_symbol_value.
5210 (Output_data_got::add_global_with_rel): Change rel_dyn to
5211 Output_data_reloc_generic*. Use add_global_generic.
5212 (Output_data_got::add_global_with_rela): Remove. Change all
5213 callers to use add_global_with_rel.
5214 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
5215 Output_data_reloc_generic*. Use add_global_generic.
5216 (Output_data_got::add_global_pair_with_rela): Remove. Change all
5217 callers to use add_global_pair_with_rel.
5218 (Output_data_got::add_local): Change object to Relobj*.
5219 (Output_data_got::add_local_plt): Likewise.
5220 (Output_data_got::add_local_with_rel): Change object to Relobj*,
5221 change rel_dyn to Output_data_reloc_generic*. Use
5222 add_local_generic.
5223 (Output_data_got::add_local_with_rela): Remove. Change all
5224 callers to use all_local_with_rel.
5225 (Output_data_got::add_local_pair_with_rel): Change object to
5226 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
5227 add_output_section_generic.
5228 (Output_data_got::add_local_pair_with_rela): Remove. Change all
5229 callers to use add_local_pair_with_rel.
5230 (Output_data_got::reserve_local): Change object to Relobj*.
5231 * output.h: (class Output_data_reloc_generic): Add pure virtual
5232 declarations for add_global_generic, add_local_generic,
5233 add_output_section_generic.
5234 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
5235 functions for Output_data_reloc_generic. Update declarations for
5236 changes listed in output.cc.
5237 (class Output_data_got): Change template parameter to got_size.
5238 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
5239 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
5240 function.
5241 (Sized_relobj_incr::do_local_plt_offset): New function.
5242 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
5243 add_global_generic.
5244
76677ad0
CC
52452011-12-17 Cary Coutant <ccoutant@google.com>
5246
5247 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
5248 * resolve.cc (Symbol_table::resolve): Likewise.
5249 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
5250 arrays.
5251 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5252
8b8dd8d5
ILT
52532011-12-16 Ian Lance Taylor <iant@google.com>
5254
5255 * output.h (Output_data_reloc_generic::add): Only call
5256 add_dynamic_reloc if this is a dynamic reloc section.
5257
d55525b9
L
52582011-12-15 H.J. Lu <hongjiu.lu@intel.com>
5259
5260 PR gold/13505
5261 * target-reloc.h (apply_relocation): Replace <64, false> with
5262 <size, big_endian>.
5263
ff81c7c1
NC
52642011-11-25 Nick Clifton <nickc@redhat.com>
5265
5266 * po/it.po: New Italian translation.
5267
628f39be
SA
52682011-11-17 Sterling Augustine <saugustine@google.com>
5269
5270 * script.cc (script_include_directive): Implement.
5271 (read_script_file): New local variables name and search_path. Update
5272 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
5273 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
5274 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
5275
98ef3ea4
SA
52762011-11-11 Sterling Augustine <saugustine@google.com>
5277
5278 * yyscript.y (section_cmd): Add support for INCLUDE directive.
5279 (file_or_sections_cmd): Likewise.
5280
f4a8b6d7
DK
52812011-11-11 Doug Kwan <dougkwan@google.com>
5282
5283 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
5284 if --just-symbols is given.
5285
29ab395d
DK
52862011-11-10 Doug Kwan <dougkwan@google.com>
5287
5288 PR gold/13362
5289 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
5290 when processing data relocs.
5291 * reloc.h (Relocate_functions::rel_unaligned): New method.
5292 (Relocate_functions::pcrel_unaligned): Ditto.
5293 (Relocate_functions::rel32_unaligned): Ditto.
5294 (Relocate_functions::pcrel32_unaligned): Ditto.
5295
2c339f71
DK
52962011-11-09 Doug Kwan <dougkwan@google.com>
5297
5298 PR gold/13362
5299 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
5300 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
5301 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
5302 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5303 (Relocate_functions::rel_unaligned): New.
5304 (Relocate_functions::rel32_unaligned): New.
5305 * target-reloc.h (relocate_for_relocatable): Add code to handle
5306 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5307 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
5308 arm_unaligned_reloc_r): New targets.
5309 * testsuite/Makefile.in: Regenerate.
5310 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
5311 linking.
5312
3f3cddf1
ILT
53132011-11-02 Ian Lance Taylor <iant@google.com>
5314
5315 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
5316 NATIVE_LINKER.
5317 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
5318 * options.cc (General_options::finalize): Use library search path
5319 from configure script if specified. If not native and no sysroot,
5320 only search TOOLLIBDIR.
5321 * options.h (Search_directory::Search_directory): Change name to
5322 const std::string&.
5323 (General_options::add_to_library_path_with_sysroot): Change arg to
5324 const std::string&.
5325 * configure, Makefile.in, config.in: Rebuild.
5326
a8e2273b
ILT
53272011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5328
5329 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
5330 we are working around the ARM1176 Erratum.
5331 * options.h (General_options::fix_arm1176): Add option.
5332 * testsuite/Makefile.am: Add testcases, and keep current ones
5333 working.
5334 * testsuite/Makefile.in: Regenerate.
5335 * testsuite/arm_fix_1176.s: New file.
5336 * testsuite/arm_fix_1176.sh: Likewise.
5337
cd6eab1c
ILT
53382011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5339
5340 * arm.cc (Target_arm::Target_arm): Remove initialisation of
5341 may_use_blx_.
5342 (Target_arm::may_use_blx): Remove method.
5343 (Target_arm::set_may_use_blx): Likewise.
5344 (Target_arm::may_use_v4t_interworking): New method.
5345 (Target_arm::may_use_v5t_interworking): Likewise.
5346 (Target_arm::may_use_blx_): Remove member variable.
5347 (Arm_relocate_functions::arm_branch_common): Check for v5T
5348 interworking.
5349 (Arm_relocate_functions::thumb_branch_common): Likewise.
5350 (Reloc_stub::stub_type_for_reloc): Likewise.
5351 (Target_arm::do_finalize_sections): Correct interworking checks.
5352 * testsuite/Makefile.am: Add new tests.
5353 * testsuite/Makefile.in: Regenerate.
5354 * testsuite/arm_farcall_arm_arm.s: New test.
5355 * testsuite/arm_farcall_arm_arm.sh: Likewise.
5356 * testsuite/arm_farcall_arm_thumb.s: Likewise.
5357 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
5358 * testsuite/arm_farcall_thumb_arm.s: Likewise.
5359 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
5360 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
5361 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
5362
286adcf4
CC
53632011-10-31 Cary Coutant <ccoutant@google.com>
5364
5365 PR gold/13023
5366 * expression.cc (Expression::eval_with_dot): Add
5367 is_section_dot_assignment parameter.
5368 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
5369 absolute and assigning to dot within a section.
5370 * script-sections.cc
5371 (Output_section_element_assignment::set_section_addresses): Pass
5372 dot_section to set_if_absolute.
5373 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
5374 as is_section_dot_assignment flag to eval_with_dot.
5375 (Output_section_element_dot_assignment::set_section_addresses):
5376 Likewise.
5377 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
5378 parameter. Also set value if relative to dot_section; set the
5379 symbol's output_section.
5380 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
5381 parameter. Adjust all callers.
5382 (Expression::eval_maybe_dot): Likewise.
5383 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
5384 Adjust all callers.
5385 * testsuite/script_test_2.t: Test assignment of an absolute value
5386 to dot within an output section element.
5387
9634ed06
CC
53882011-10-31 Cary Coutant <ccoutant@google.com>
5389
5390 * options.h (class General_options): Add --[no-]gnu-unique options.
5391 * symtab.cc (Symbol_table::sized_write_globals): Convert
5392 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
5393
de4101c7
CC
53942011-10-31 Cary Coutant <ccoutant@google.com>
5395
5396 PR gold/13359
5397 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
5398 unnecessary assertion.
5399 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
5400
7257cc92
ST
54012011-10-31 Sriraman Tallam <tmsriram@google.com>
5402
5403 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5404 gc_mark_symbol.
5405 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5406 gc_mark_symbol.
5407 Change to just keep the section associated with symbol.
5408 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
5409 they are externally visible and --export-dynamic is turned on.
5410 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
5411
bfc34b3f
ILT
54122011-10-19 Ian Lance Taylor <iant@google.com>
5413
5414 PR gold/13163
5415 * script-sections.cc
5416 (Output_section_element_dot_assignment::needs_output_section): New
5417 function.
5418
ea0d8c47
ILT
54192011-10-19 Ian Lance Taylor <iant@google.com>
5420
5421 PR gold/13204
5422 * layout.cc (Layout::segment_precedes): Don't assert failure if a
5423 --section-start option was seen.
5424 * options.h (General_options::any_section_start): New function.
5425
abd242a9
DM
54262011-10-18 David S. Miller <davem@davemloft.net>
5427
5428 PR binutils/13301
5429 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
5430 member to track relocation locations that have moved during TLS
5431 reloc optimizations.
5432 (Target_sparc::Relocate::Relocate): Initialize to NULL.
5433 (Target_sparc::Relocate::relocate): Adjust view down by 4
5434 bytes if it matches reloc_adjust_addr_.
5435 (Target_sparc::Relocate::relocate_tls): Always move the
5436 __tls_get_addr call delay slot instruction forward 4 bytes when
5437 performing relaxation.
5438
bab9090f
CC
54392011-10-18 Cary Coutant <ccoutant@google.com>
5440
5441 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
5442 (Output_file::map_no_anonymous): Check for non-zero
5443 return code from posix_fallocate.
5444
f7c5b166
CC
54452011-10-17 Cary Coutant <ccoutant@google.com>
5446
5447 PR gold/13245
5448 * plugin.cc (is_visible_from_outside): Check for symbols
5449 referenced from dynamic objects.
5450 * resolve.cc (Symbol_table::resolve): Don't count references
5451 from dynamic objects as references from real ELF files.
5452 * testsuite/plugin_test_2.sh: Adjust expected result.
5453
b490c0bb
CC
54542011-10-17 Cary Coutant <ccoutant@google.com>
5455
5456 * gold.cc: Include timer.h.
5457 (queue_middle_tasks): Stamp time.
5458 (queue_final_tasks): Likewise.
5459 * main.cc (main): Store timer in parameters. Print timers
5460 for each pass.
5461 * parameters.cc (Parameters::Parameters): Initialize timer_.
5462 (Parameters::set_timer): New function.
5463 (set_parameters_timer): New function.
5464 * parameters.h (Parameters::set_timer): New function.
5465 (Parameters::timer): New function.
5466 (Parameters::timer_): New data member.
5467 (set_parameters_timer): New function.
5468 * timer.cc (Timer::stamp): New function.
5469 (Timer::get_pass_time): New function.
5470 * timer.h (Timer::stamp): New function.
5471 (Timer::get_pass_time): New function.
5472 (Timer::pass_times_): New data member.
5473
f475cf7b
CC
54742011-10-17 Cary Coutant <ccoutant@google.com>
5475
5476 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
5477 task for members of lib groups.
5478
cdd7e244
CC
54792011-10-17 Cary Coutant <ccoutant@google.com>
5480
5481 PR gold/13288
4f95c8b4 5482 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
5483 (File_read::make_view): Move bounds check (replace with assert)...
5484 (File_read::find_or_make_view): ... to here.
5485
dfb45471
CC
54862011-10-12 Cary Coutant <ccoutant@google.com>
5487
4f95c8b4 5488 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
5489 ::read returns less than requested size.
5490
53bbcc1b
CC
54912011-10-10 Cary Coutant <ccoutant@google.com>
5492
4f95c8b4 5493 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
5494 Initialize defined_count_.
5495 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
5496 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
5497 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
5498 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
5499 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 5500 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
5501 member.
5502 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 5503 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
5504 Return zeroes instead of internal error.
5505
397b129b
CC
55062011-10-10 Cary Coutant <ccoutant@google.com>
5507
5508 PR gold/13249
4f95c8b4 5509 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 5510 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 5511 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
5512 (Output_reloc::type_): Adjust size of bit field.
5513 (Output_reloc::use_plt_offset_): New bit field.
5514 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
5515 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
5516 flag. Adjust all callers.
4f95c8b4 5517 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
5518 creating RELATIVE relocations.
5519
d5698657
NC
55202011-10-10 Nick Clifton <nickc@redhat.com>
5521
5522 * po/es.po: Updated Spanish translation.
5523 * po/fi.po: Updated Finnish translation.
5524
6a59a5c2
DN
55252011-10-03 Diego Novillo <dnovillo@google.com>
5526
5527 * options.cc (parse_uint): Fix dereference of RETVAL.
5528
f0558624
ST
55292011-09-29 Sriraman Tallam <tmsriram@google.com>
5530
5531 * layout.h (section_order_map_): New member.
5532 (get_section_order_map): New member function.
5533 * output.cc (Output_section::add_input_section): Check for patterns
5534 only when --section-ordering-file is specified.
5535 * gold.cc (queue_middle_tasks): Delay updating order of sections till
5536 output_sections have been formed.
5537 * layout.cc (Layout_Layout): Initialize section_order_map_.
5538 * plugin.cc (update_section_order): Store order in order_map. Do not
5539 update the order.
5540 * testsuite/Makefile.am: Add test case for plugin_final_layout.
5541 * testsuite/Makefile.in: Regenerate.
5542 * testsuite/plugin_section_order.c: New file.
5543 * testsuite/plugin_final_layout.cc: New file.
5544 * testsuite/plugin_final_layout.sh: New file.
5545
a7dac153
CC
55462011-09-29 Cary Coutant <ccoutant@google.com>
5547
4f95c8b4 5548 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 5549 Check for NULL.
4f95c8b4 5550 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
5551 symbols during incremental update.
5552 (Symbol_table::add_from_dynobj): Likewise.
5553
eebd87a5
ILT
55542011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5555 Ian Lance Taylor <iant@google.com>
5556
5557 * symtab.cc (Symbol_table::define_special_symbol): Always
5558 canonicalize version string.
5559
403a3331
CC
55602011-09-26 Cary Coutant <ccoutant@google.com>
5561
4f95c8b4
CC
5562 * gold.cc (queue_initial_tasks): Move option checks ...
5563 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
5564 some options; make others fatal.
5565
235061c2
CC
55662011-09-26 Cary Coutant <ccoutant@google.com>
5567
5568 gcc PR lto/47247
5569 * plugin.cc (get_symbols_v2): New function.
5570 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
5571 (is_referenced_from_outside): New function.
5572 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
5573 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
5574 (get_symbols): Pass version parameter.
5575 (get_symbols_v2): New function.
5576 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
5577 parameter.
5578 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
5579 (onload): Add LDPT_GET_SYMBOLS_V2.
5580 (all_symbols_read_hook): Use get_symbols_v2; check for
5581 LDPR_PREVAILING_DEF_IRONLY_EXP.
5582 * testsuite/plugin_test_3.sh: Update expected results.
5583
dc87f620
ILT
55842011-09-23 Simon Baldwin <simonb@google.com>
5585
5586 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
5587 configuration options.
5588 * configure: Regenerate.
5589 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
5590 * Makefile.in: Regenerate.
5591 * testsuite/Makefile.in: Regenerate.
5592
a8279f82
ST
55932011-09-19 Sriraman Tallam <tmsriram@google.com>
5594
5595 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
5596
0c9350c8
CC
55972011-09-19 Cary Coutant <ccoutant@google.com>
5598
5599 * incremental.cc (can_incremental_update): Fix typo in comment.
5600 * incremental.h (can_incremental_update): Likewise.
5601
aa06ae28
CC
56022011-09-18 Cary Coutant <ccoutant@google.com>
5603
5604 * incremental.cc (can_incremental_update): New function.
5605 * incremental.h (can_incremental_update): New function.
5606 * layout.cc (Layout::init_fixed_output_section): Call it.
5607 (Layout::make_output_section): Don't allow patch space in .eh_frame.
5608 * object.cc (Sized_relobj_file::do_layout): Call
5609 can_incremental_update.
5610
ebb300b2
CC
56112011-09-13 Cary Coutant <ccoutant@google.com>
5612
5613 * configure.ac: Check for glibc support for gnu_indirect_function
5614 support with static linking, setting automake conditional
5615 IFUNC_STATIC.
5616 * Makefile.in: Regenerate.
5617 * configure: Regenerate.
5618
5619 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
5620 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
5621 for IFUNC_STATIC.
5622 * testsuite/Makefile.in: Regenerate.
5623
1206d0d5
CC
56242011-09-13 Cary Coutant <ccoutant@google.com>
5625
5626 * incremental.cc (Sized_relobj_incr::do_layout): Call
5627 report_comdat_group for kept comdat sections.
5628 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
5629 * testsuite/Makefile.in: Regenerate.
5630 * testsuite/incr_comdat_test_1.cc: New source file.
5631 * testsuite/incr_comdat_test_2_v1.cc: New source file.
5632 * testsuite/incr_comdat_test_2_v2.cc: New source file.
5633 * testsuite/incr_comdat_test_2_v3.cc: New source file.
5634
40b29874
ILT
56352011-09-13 Ian Lance Taylor <iant@google.com>
5636
5637 * object.cc (Sized_relobj_file::do_layout): Remove unused local
5638 variable external_symbols_offset.
5639
1b045aac
ILT
56402011-09-12 Ian Lance Taylor <iant@google.com>
5641
5642 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
5643 triggered if object has no symbols.
5644
24c6c55a
DM
56452011-09-09 David S. Miller <davem@davemloft.net>
5646
5647 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
5648 (Output_fill_debug_line::do_write): Likewise.
5649
66570254
CC
56502011-08-29 Cary Coutant <ccoutant@google.com>
5651
5652 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
5653 casts to match formatting specs.
5654 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
5655
8ea8cd50
CC
56562011-08-26 Cary Coutant <ccoutant@google.com>
5657
5658 * layout.cc (Free_list::allocate): Provide guarantee of minimum
5659 remaining hole size when allocating.
5660 (Layout::make_output_section): Set fill methods for debug sections.
5661 * layout.h (Free_list::Free_list_node): Move from private to
5662 public.
5663 (Free_list::set_min_hole_size): New function.
5664 (Free_list::begin, Free_list::end): New functions.
5665 (Free_list::min_hole_): New data member.
5666 * output.cc: Include dwarf.h.
5667 (Output_fill_debug_info::do_minimum_hole_size): New function.
5668 (Output_fill_debug_info::do_write): New function.
5669 (Output_fill_debug_line::do_minimum_hole_size): New function.
5670 (Output_fill_debug_line::do_write): New function.
5671 (Output_section::Output_section): Initialize new data member.
5672 (Output_section::set_final_data_size): Ensure patch space is larger
5673 than minimum hole size.
5674 (Output_section::do_write): Fill holes in debug sections.
5675 * output.h (Output_fill): New class.
5676 (Output_fill_debug_info): New class.
5677 (Output_fill_debug_line): New class.
5678 (Output_section::set_free_space_fill): New function.
5679 (Output_section::free_space_fill_): New data member.
5680 * testsuite/Makefile.am (incremental_test_3): Add
5681 --incremental-patch option.
5682 (incremental_test_4): Likewise.
5683 (incremental_test_5): Likewise.
5684 (incremental_test_6): Likewise.
5685 (incremental_copy_test): Likewise.
5686 (incremental_common_test_1): Likewise.
5687 * testsuite/Makefile.in: Regenerate.
5688
7cf80422
NC
56892011-08-26 Nick Clifton <nickc@redhat.com>
5690
5691 * po/es.po: Updated Spanish translation.
5692
c3f7b0e5
CC
56932011-08-01 Cary Coutant <ccoutant@google.com>
5694
5695 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
5696 * gold/testsuite/Makefile.in: Regenerate.
5697 * gold/testsuite/justsyms_exec.c: New source file.
5698 * gold/testsuite/justsyms_lib.c: New source file.
5699
9590bf25
CC
57002011-08-01 Cary Coutant <ccoutant@google.com>
5701
5702 * layout.cc (Layout::set_segment_offsets): Don't realign text
5703 segment if -Ttext was specified.
5704 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
5705 file type.
5706 * object.h (Sized_relobj_file::e_type): New function.
5707 (Sized_relobj_file::e_type_): New data member.
5708 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
5709 base address for ET_EXEC files.
5710 * target.cc (Target::do_make_elf_object_implementation): Allow
5711 ET_EXEC files with --just-symbols option.
5712
dcd8d12e
CC
57132011-07-28 Cary Coutant <ccoutant@google.com>
5714
5715 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
5716 Add thread_number parameter.
5717 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
5718 * workqueue-threads.cc
5719 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
5720 current thread if its thread number is greater than desired thread
5721 count.
5722 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
5723 Add thread_number parameter.
5724 (Workqueue::should_cancel_thread): Likewise.
5725 (Workqueue::find_runnable_or_wait): Pass thread_number to
5726 should_cancel_thread.
5727 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
5728 parameter.
5729
804eb480
ST
57302011-07-22 Sriraman Tallam <tmsriram@google.com>
5731
5732 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
5733 only after checking if it cannot be forced local.
5734 * symtab.h (is_externally_visible): Check if the symbol is not forced
5735 local.
5736
f1ddb600
ILT
57372011-07-15 Ian Lance Taylor <iant@google.com>
5738
5739 * options.h (class General_options): Add --print-output-format.
5740 Move -EL next to -EB, for better --help output.
5741 * target-select.cc: Include <cstdio>, "options.h", and
5742 "parameters.h".
5743 (Target_selector::do_target_bfd_name): New function.
5744 (print_output_format): New function.
5745 * target-select.h (class Target_selector): Update declarations.
5746 (Target_selector::target_bfd_name): New function.
5747 (print_output_format): Declare.
5748 * main.cc: Include "target-select.h".
5749 (main): Handle --print-output-format.
5750 * gold.cc: Include "target-select.h".
5751 (queue_initial_tasks): Handle --print-output-format when there are
5752 no input files.
5753 * parameters.cc (parameters_force_valid_target): Give a better
5754 error message if -EB/-EL does not match target.
5755 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
5756 function.
5757
7d172687
ILT
57582011-07-15 Ian Lance Taylor <iant@google.com>
5759
5760 * i386.cc (class Output_data_plt_i386): Add layout_ field.
5761 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
5762 (Output_data_plt_i386::do_write): Write address of .dynamic
5763 section to first entry in .got.plt section.
5764 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
5765 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
5766 Initialize layout_.
5767 (Output_data_plt_x86_64::do_write): Write address of .dynamic
5768 section to first entry in .got.plt section.
5769 * layout.h (Layout::dynamic_section): New function.
5770
e9552f7e
ST
57712011-07-13 Sriraman Tallam <tmsriram@google.com>
5772
5773 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
5774 to claim_file call.
5775 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
5776 input_section_position_, and input_section_glob_.
5777 (read_layout_from_file): Call function section_ordering_specified.
5778 * layout.h (is_section_ordering_specified): New function.
5779 (section_ordering_specified): New function.
5780 (section_ordering_specified_): New boolean member.
5781 * main.cc(main): Call load_plugins after layout object is defined.
5782 * output.cc (Output_section::add_input_section): Use
5783 function section_ordering_specified to check if section ordering is
5784 needed.
5785 * output.cc (Output_section::add_relaxed_input_section): Use
5786 function section_ordering_specified to check if section ordering is
5787 needed.
5788 (Output_section::update_section_layout): New function.
5789 (Output_section::sort_attached_input_sections): Check if input section
5790 must be reordered.
5791 * output.h (Output_section::update_section_layout): New function.
5792 * plugin.cc (get_section_count): New function.
5793 (get_section_type): New function.
5794 (get_section_name): New function.
5795 (get_section_contents): New function.
5796 (update_section_order): New function.
58797674 5797 (allow_section_ordering): New function.
e9552f7e
ST
5798 (Plugin::load): Add the new interfaces to the transfer vector.
5799 (Plugin_manager::load_plugins): New parameter.
5800 (Plugin_manager::all_symbols_read): New parameter.
5801 (Plugin_manager::claim_file): New parameter. Save the elf object for
5802 unclaimed objects.
5803 (Plugin_manager::get_elf_object): New function.
5804 (Plugin_manager::get_view): Change to directly use the bool to check
5805 if get_view is called from claim_file_hook.
5806 * plugin.h (input_objects): New function
5807 (Plugin__manager::load_plugins): New parameter.
5808 (Plugin_manager::claim_file): New parameter.
5809 (Plugin_manager::get_elf_object): New function.
5810 (Plugin_manager::in_claim_file_handler): New function.
5811 (Plugin_manager::in_claim_file_handler_): New member.
5812 (layout): New function.
5813 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
5814 handler with an extra parameter. Make the elf object before calling
5815 claim_file handler.
5816 * testsuite/plugin_test.c (get_section_count): New function pointer.
5817 (get_section_type): New function pointer.
5818 (get_section_name): New function pointer.
5819 (get_section_contents): New function pointer.
5820 (update_section_order): New function pointer.
5821 (allow_section_ordering): New function pointer.
5822 (onload): Check if the new interfaces exist.
5823
9446efde
ILT
58242011-07-13 Ian Lance Taylor <iant@google.com>
5825
5826 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
5827 relro section.
5828 * x86_64.cc (Target_x86_64::got_section): Likewise.
5829 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
5830 (relro_now_test_SOURCES): New variable.
5831 (relro_now_test_DEPENDENCIES): New variable.
5832 (relro_now_test_LDFLAGS): New variable.
5833 (relro_now_test_LDADD): New variable.
5834 (relro_now_test.so): New target.
5835 * testsuite/Makefile.in: Rebuild.
5836
07aa62f2
ILT
58372011-07-12 Ian Lance Taylor <iant@google.com>
5838
5839 PR gold/12980
5840 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
5841 GLOB_DAT relocation rather than a RELATIVE relocation for a
5842 protected symbol when creating a shared library.
5843 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
5844 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
5845 * testsuite/protected_main_1.cc (main): Test that protected
5846 function has same address.
5847
e2153196
ILT
58482011-07-11 Ian Lance Taylor <iant@google.com>
5849
5850 PR gold/12979
5851 * options.h (class General_options): Add -Bgroup.
5852 * options.cc (General_options::finalize): If -Bgroup is set,
5853 default to --unresolved-symbols=report-all.
5854 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
5855 * target-reloc.h (issue_undefined_symbol_error): Handle
5856 --unresolved-symbols=report-all.
5857
6daf5215
ILT
58582011-07-08 Ian Lance Taylor <iant@google.com>
5859
5860 PR gold/11985
5861 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
5862 if linker script discards key sections.
5863 (Layout::create_dynamic_symtab): Likewise.
5864 (Layout::assign_local_dynsym_offsets): Likewise.
5865 (Layout::sized_create_version_sections): Likewise.
5866 (Layout::create_interp): Likewise.
5867 (Layout::finish_dynamic_section): Likewise.
5868 (Layout::set_dynamic_symbol_size): Likewise.
5869
beabb2c6
ILT
58702011-07-08 Ian Lance Taylor <iant@google.com>
5871
5872 PR gold/12386
5873 * options.h (class General_options): Add --unresolved-symbols.
5874 * target-reloc.h (issue_undefined_symbol_error): Check
5875 --unresolved-symbols. Add comments.
5876
9c16daf1
ILT
58772011-07-08 Ian Lance Taylor <iant@google.com>
5878
5879 * testsuite/odr_violation2.cc (Ordering::operator()): Make
5880 expression more complex.
5881
191f1a2d
ILT
58822011-07-08 Ian Lance Taylor <iant@google.com>
5883
5884 PR gold/11317
5885 * target-reloc.h (issue_undefined_symbol_error): New inline
5886 function, broken out of relocate_section.
5887 (relocate_section): Call issue_undefined_symbol_error.
5888 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
5889 there is no TLS segment if we are about to issue an undefined
5890 symbol error.
5891 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
5892
62855347
ILT
58932011-07-08 Ian Lance Taylor <iant@google.com>
5894
5895 PR gold/12279
5896 * resolve.cc (Symbol_table::should_override): Add fromtype
5897 parameter. Change all callers. Give error when linking together
5898 TLS and non-TLS symbol.
5899 (Symbol_table::should_override_with_special): Add fromtype
5900 parameter. Change all callers.
5901 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
5902 there is no TLS segment if we have reported some errors.
5903 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
5904
67181c72
ILT
59052011-07-08 Ian Lance Taylor <iant@google.com>
5906
5907 PR gold/12372
5908 * target.h (Target::plt_address_for_global): New function.
5909 (Target::plt_address_for_local): New function.
5910 (Target::plt_section_for_global): Remove.
5911 (Target::plt_section_for_local): Remove.
5912 (Target::do_plt_address_for_global): New virtual function.
5913 (Target::do_plt_address_for_local): New virtual function.
5914 (Target::do_plt_section_for_global): Remove.
5915 (Target::do_plt_section_for_local): Remove.
5916 (Target::register_global_plt_entry): Add Symbol_table and Layout
5917 parameters.
5918 * output.cc (Output_data_got::Got_entry::write): Use
5919 plt_address_for_global and plt_address_for_local.
5920 * layout.cc (Layout::add_target_dynamic_tags): Use size and
5921 address of output section.
5922 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
5923 got_irelative_, and irelative_count_ fields. Update
5924 declarations.
5925 (Output_data_plt_i386::has_irelative_section): New function.
5926 (Output_data_plt_i386::entry_count): Add irelative_count_.
5927 (Output_data_plt_i386::set_final_data_size): Likewise.
5928 (class Target_i386): Add got_irelative_ and rel_irelative_
5929 fields. Update declarations.
5930 (Target_i386::Target_i386): Initialize new fields.
5931 (Target_i386::do_plt_address_for_global): New function replacing
5932 do_plt_section_for_global.
5933 (Target_i386::do_plt_address_for_local): New function replacing
5934 do_plt_section_for_local.
5935 (Target_i386::got_section): Create got_irelative_.
5936 (Target_i386::rel_irelative_section): New function.
5937 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
5938 fields. Don't define __rel_iplt_{start,end}.
5939 (Output_data_plt_i386::add_entry): Add symtab and layout
5940 parameters. Change all callers. Use different PLT and GOT for
5941 IFUNC symbols.
5942 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
5943 layout parameters. Change all callers. Use different PLT and
5944 GOT.
5945 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
5946 (Output_data_plt_i386::rel_irelative): New function.
5947 (Output_data_plt_i386::address_for_global): New function.
5948 (Output_data_plt_i386::address_for_local): New function.
5949 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
5950 IRELATIVE GOT when changing IFUNC GOT entries.
5951 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
5952 reloc.
5953 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
5954 if we didn't create an IRELATIVE GOT.
5955 (Target_i386::Relocate::relocate): Use plt_address_for_global and
5956 plt_address_for_local.
5957 (Target_i386::do_dynsym_value): Use plt_address_for_global.
5958 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
5959 got_irelative_, and irelative_count_ fields. Update
5960 declarations.
5961 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
5962 Initialize new fields. Remove symtab parameter. Change all
5963 callers.
5964 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
5965 irelative_count_.
5966 (Output_data_plt_x86_64::has_irelative_section): New function.
5967 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
5968 (class Target_x86_64): Add got_irelative_ and rel_irelative_
5969 fields. Update declarations.
5970 (Target_x86_64::Target_x86_64): Initialize new fields.
5971 (Target_x86_64::do_plt_address_for_global): New function replacing
5972 do_plt_section_for_global.
5973 (Target_x86_64::do_plt_address_for_local): New function replacing
5974 do_plt_section_for_local.
5975 (Target_x86_64::got_section): Create got_irelative_.
5976 (Target_x86_64::rela_irelative_section): New function.
5977 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
5978 all callers. Don't create __rel_iplt_{start,end}.
5979 (Output_data_plt_x86_64::add_entry): Add symtab and layout
5980 parameters. Change all callers. Use different PLT and GOT for
5981 IFUNC symbols.
5982 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
5983 layout parameters. Change all callers. Use different PLT and
5984 GOT.
5985 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
5986 parameters. Change all callers. Use different PLT and GOT for
5987 IFUNC symbols.
5988 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
5989 (Output_data_plt_x86_64::rela_irelative): New function.
5990 (Output_data_plt_x86_64::address_for_global): New function.
5991 (Output_data_plt_x86_64::address_for_local): New function.
5992 (Output_data_plt_x86_64::set_final_data_size): Likewise.
5993 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
5994 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
5995 (Target_x86_64::register_global_plt_entry): Add symtab and layout
5996 parameters.
5997 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
5998 reloc.
5999 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
6000 symbols if we didn't create an IRELATIVE GOT.
6001 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
6002 plt_address_for_local.
6003 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
6004 * testsuite/ifuncvar1.c: New test file.
6005 * testsuite/ifuncvar2.c: New test file.
6006 * testsuite/ifuncvar3.c: New test file.
6007 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
6008 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
6009 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
6010 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
6011 * testsuite/Makefile.in: Rebuild.
6012
33c15b45
CC
60132011-07-07 Cary Coutant <ccoutant@google.com>
6014
6015 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
6016 (two_file_test_1_ndebug.o): Likewise.
6017 (two_file_test_1b_ndebug.o): Likewise.
6018 (two_file_test_2_ndebug.o): Likewise.
6019 (two_file_test_main_ndebug.o): Likewise.
6020 (incremental_test_2): Link with no-debug versions.
6021
f48b5fb7
CC
60222011-07-06 Cary Coutant <ccoutant@google.com>
6023
6024 * gold/incremental.cc
6025 (Output_section_incremental_inputs::write_info_blocks): Check for
6026 hidden and internal symbols.
6027
221597a5
CC
60282011-07-06 Cary Coutant <ccoutant@google.com>
6029
6030 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
6031 Check disposition for startup file.
6032 (Incremental_inputs::report_command_line): Ignore
6033 --incremental-startup-unchanged option.
6034 * options.cc (General_options::parse_incremental_startup_unchanged):
6035 New function.
6036 (General_options::General_options): Initialize new data member.
6037 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
6038 (General_options): Add --incremental-startup-unchanged option.
6039 (General_options::incremental_startup_disposition): New function.
6040 (General_options::incremental_startup_disposition_): New data member.
6041
e24719f6
CC
60422011-07-06 Cary Coutant <ccoutant@google.com>
6043
6044 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
6045 input file index to Script_info ctor.
6046 (Sized_incremental_binary::do_file_has_changed): Find the
6047 command-line argument for files named in scripts.
6048 * incremental.h (Script_info::Script_info): New ctor
6049 with input file index.
6050 (Script_info::input_file_index): New function.
6051 (Script_info::input_file_index_): New data member.
6052 (Incremental_binary::get_library): Add const.
6053 (Incremental_binary::get_script_info): Add const.
6054 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
6055 * testsuite/Makefile.am (incremental_test_5): New test case.
6056 (incremental_test_6): New test case.
6057 * testsuite/Makefile.in: Regenerate.
6058
8f7c81e8
CC
60592011-07-06 Cary Coutant <ccoutant@google.com>
6060
6061 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
6062 debug output when command lines differ.
6063
9fbd3822
CC
60642011-07-06 Cary Coutant <ccoutant@google.com>
6065
6066 * incremental.cc (Incremental_inputs::report_command_line): Ignore
6067 --incremental-patch option.
6068 * layout.cc (Free_list::allocate): Extend allocation beyond original
6069 end if enabled.
6070 (Layout::make_output_section): Mark sections that should get
6071 patch space.
6072 * options.cc (parse_percent): New function.
6073 * options.h (parse_percent): New function.
6074 (DEFINE_percent): New macro.
6075 (General_options): Add --incremental-patch option.
6076 * output.cc (Output_section::Output_section): Initialize new data
6077 members.
6078 (Output_section::add_input_section): Print section name when out
6079 of patch space.
6080 (Output_section::add_output_section_data): Likewise.
6081 (Output_section::set_final_data_size): Add patch space when
6082 doing --incremental-full.
6083 (Output_section::do_reset_address_and_file_offset): Remove patch
6084 space.
6085 (Output_segment::set_section_list_addresses): Print debug output
6086 only if --incremental-update.
6087 * output.h (Output_section::set_is_patch_space_allowed): New function.
6088 (Output_section::is_patch_space_allowed_): New data member.
6089 (Output_section::patch_space_): New data member.
6090 * parameters.cc (Parameters::incremental_full): New function.
6091 * parameters.h (Parameters::incremental_full): New function
6092 * testsuite/Makefile.am (incremental_test_2): Add test for
6093 --incremental-patch option.
6094 * testsuite/Makefile.in: Regenerate.
6095 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
6096 (t18): Remove function body.
6097
f6cccc2c
DK
60982011-07-05 Doug Kwan <dougkwan@google.com>
6099
6100 PR gold/12771
6101 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
6102 Arm_Address type for relocation result.
6103 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
6104 overflow check.
6105 (Arm_relocate_functions::abs32): Use unaligned access.
6106 (Arm_relocate_functions::rel32): Ditto.
6107 (Arm_relocate_functions::prel31): Ditto.
6108 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
6109 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
6110 static data relocations.
6111 * testsuite/Makefile.in: Regnerate.
6112 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
6113
28a13fec
ILT
61142011-07-05 Ian Lance Taylor <iant@google.com>
6115
6116 PR gold/12392
6117 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
6118 symbols if necessary.
6119 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6120
24d47b34
ILT
61212011-07-05 Ian Lance Taylor <iant@google.com>
6122
6123 PR gold/12952
6124 * resolve.cc (Symbol::override_base_with_special): Simply override
6125 version with special symbol version, ignoring previous version.
6126
41f9cbbe
ILT
61272011-07-05 Ian Lance Taylor <iant@google.com>
6128
6129 * object.cc (Sized_relobj_file::include_section_group): Add
6130 information to comment about signature location.
6131
886288f1
ILT
61322011-07-02 Ian Lance Taylor <iant@google.com>
6133
6134 PR gold/12957
6135 * options.h (class General_options): Add -f and -F.
6136 * options.cc (General_options::finalize): Fatal error if -f/-F
6137 are used without -shared.
6138 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
6139
ae3a6d4f
ILT
61402011-07-02 Ian Lance Taylor <iant@google.com>
6141
6142 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
6143
21131061
ILT
61442011-07-01 Ian Lance Taylor <iant@google.com>
6145
6146 PR gold/12525
6147 PR gold/12952
6148 * resolve.cc (Symbol::override_base_with_special): Don't override
6149 the version if the overriding symbol has a different name.
6150 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
6151 all callers. If we give an error about an undefined version,
6152 define the base version if necessary.
6153 * dynobj.h (class Versions): Update declaration.
6154 * testsuite/weak_alias_test_5.cc: New file.
6155 * testsuite/weak_alias_test.script: New file.
6156 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
6157 and versioned_alias have the right value, and call t2.
6158 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
6159 weak_alias_test_5.so.
6160 (weak_alias_test_LDADD): Likewise.
6161 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
6162 * testsuite/Makefile.in: Rebuild.
6163
611062c0
ILT
61642011-07-01 Ian Lance Taylor <iant@google.com>
6165
6166 PR gold/12525
6167 * options.h (class General_options): Support -z notext.
6168 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
6169 -Wl,-z,notext.
6170 (two_file_shared_nonpic.so): Likewise.
6171 (two_file_shared_mixed.so): Likewise.
6172 (two_file_shared_mixed_1.so): Likewise.
6173 (weak_undef_lib_nonpic.so): Likewise.
6174 (alt/weak_undef_lib_nonpic.so): Likewise.
6175 (tls_test_shared_nonpic.so): Likewise.
6176 * testsuite/Makefile.in: Rebuild.
6177
328c7c2f
ILT
61782011-07-01 Ian Lance Taylor <iant@google.com>
6179
6180 PR gold/12525
6181 * configure.ac: Test whether static linking works, setting
6182 the automake conditional HAVE_STATIC.
6183 * testsuite/Makefile.am: Disable tests using -static if
6184 HAVE_STATIC is not true.
6185 * configure, testsuite/Makefile.in: Rebuild.
6186
02d7cd44
ILT
61872011-07-01 Ian Lance Taylor <iant@google.com>
6188
6189 PR gold/12525
6190 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
6191 Assert if we see DW_EH_PE_indirect.
6192 * target.h (Target::ehframe_datarel_base): New function.
6193 (Target::do_ehframe_datarel_base): New target function.
6194 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
6195 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
6196 function.
6197
07a60597
ILT
61982011-07-01 Ian Lance Taylor <iant@google.com>
6199
6200 PR gold/12571
6201 * options.h (class General_options): Add
6202 --ld-generated-unwind-info.
6203 * ehframe.cc (Fde::write): Add address parameter. Change all
6204 callers. If associated with PLT, fill in address and size.
6205 (Cie::set_output_offset): Only add merge mapping if there is an
6206 object.
6207 (Cie::write): Add address parameter. Change all callers.
6208 (Eh_frame::add_ehframe_for_plt): New function.
6209 * ehframe.h (class Fde): Update declarations. Move shndx_ and
6210 input_offset_ fields into union u_, with new plt field.
6211 (Fde::Fde): Adjust for new union field.
6212 (Fde::Fde) [Output_data version]: New constructor.
6213 (Fde::add_mapping): Only add merge mapping if there is an object.
6214 (class Cie): Update declarations.
6215 (class Eh_frame): Declare add_ehframe_for_plt.
6216 * layout.cc (Layout::layout_eh_frame): Break out code into
6217 make_eh_frame_section, and call it.
6218 (Layout::make_eh_frame_section): New function.
6219 (Layout::add_eh_frame_for_plt): New function.
6220 * layout.h (class Layout): Update declarations.
6221 * merge.cc (Merge_map::add_mapping): Add assertion.
6222 * i386.cc: Include "dwarf.h".
6223 (class Output_data_plt_i386): Make first_plt_entry,
6224 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
6225 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6226 and plt_eh_frame_fde.
6227 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
6228 boundary. Call add_eh_frame_for_plt if appropriate.
6229 * x86_64.cc: Include "dwarf.h".
6230 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
6231 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
6232 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6233 and plt_eh_frame_fde.
6234 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
6235 appropriate.
6236
14788a3f
ILT
62372011-06-29 Ian Lance Taylor <iant@google.com>
6238
6239 PR gold/12629
6240 * object.cc (Sized_relobj_file::layout_section): Change shdr
6241 parameter to be const.
6242 (Sized_relobj_file::layout_eh_frame_section): New function, broken
6243 out of do_layout.
6244 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
6245 appropriate. Call layout_eh_frame_section.
6246 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
6247 sections.
6248 * object.h (class Sized_relobj_file): Update declarations.
6249
6c21fce1
ILT
62502011-06-29 Ian Lance Taylor <iant@google.com>
6251
37e41b03 6252 PR gold/12652
6c21fce1
ILT
6253 * script.cc (Token::integer_value): Accept trailing M/m/K/k
6254 modifier.
6255 (Lex::gather_token): Accept trailing M/m/K/k for integers.
6256
4d5e4e62
ILT
62572011-06-29 Ian Lance Taylor <iant@google.com>
6258
6259 PR gold/12675
6260 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
6261 SHT_X86_64_UNWIND.
6262 * layout.cc (Layout::layout_eh_frame): Likewise.
6263
886f533a
ILT
62642011-06-29 Ian Lance Taylor <iant@google.com>
6265
6266 PR gold/12695
6267 * layout.cc (Layout::symtab_section_shndx): New function.
6268 * layout.h (class Layout): Declare symtab_section_shndx.
6269 * output.cc (Output_section::write_header): Call it.
6270
f3ae1b28
ILT
62712011-06-29 Ian Lance Taylor <iant@google.com>
6272
6273 PR gold/12818
6274 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
6275 symbols which are not used in a relocation.
6276
aecf301f
ILT
62772011-06-28 Ian Lance Taylor <iant@google.com>
6278
6279 PR gold/12898
6280 * layout.cc (Layout::segment_precedes): Don't crash if a linker
6281 script create indistinguishable segments.
6282 (Layout::set_segment_offsets): Use stable_sort when sorting
6283 segments. Pass this to Compare_segments constructor.
6284 * layout.h (class Layout): Make segment_precedes non-static.
6285 (class Compare_segments): Change from struct to class. Add
6286 layout_ field. Add constructor.
6287 * script-sections.cc
6288 (Script_sections::attach_sections_using_phdrs_clause): Rename
6289 local orphan to is_orphan. Don't report failure to put empty
6290 section in segment. On attachment failure, report name of
6291 section, and attach to first PT_LOAD segment.
6292
03ef7571
ILT
62932011-06-28 Ian Lance Taylor <iant@google.com>
6294
6295 PR gold/12934
6296 * target-select.cc (Target_selector::Target_selector): Add
6297 emulation parameter. Change all callers.
6298 (select_target_by_bfd_name): Rename from select_target_by_name.
6299 Change all callers.
6300 (select_target_by_emulation): New function.
6301 (supported_emulation_names): New function.
6302 * target-select.h (class Target_selector): Add emulation_ field.
6303 Update declarations.
6304 (Target_selector::recognize_by_bfd_name): Rename from
6305 recognize_by_name. Change all callers.
6306 (Target_selector::supported_bfd_names): Rename from
6307 supported_names. Change all callers.
6308 (Target_selector::recognize_by_emulation): New function.
6309 (Target_selector::supported_emulations): New function.
6310 (Target_selector::emulation): New function.
6311 (Target_selector::do_recognize_by_bfd_name): Rename from
6312 do_recognize_by_name. Change all callers.
6313 (Target_selector::do_supported_bfd_names): Rename from
6314 do_supported_names. Change all callers.
6315 (Target_selector::do_recognize_by_emulation): New function.
6316 (Target_selector::do_supported_emulations): New function.
6317 (select_target_by_bfd_name): Change name in declaration.
6318 (select_target_by_emulation): Declare.
6319 (supported_emulation_names): Declare.
6320 * parameters.cc (parameters_force_valid_target): Try to find
6321 target based on emulation from -m option.
6322 * options.h (class General_options): Change doc string for -m.
6323 * options.cc (help): Print emulations.
6324 (General_options::parse_V): Likewise.
6325 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
6326 Add emulation parameter. Change all callers.
6327
200b2bb9
ILT
63282011-06-28 Ian Lance Taylor <iant@google.com>
6329
6330 * target.h (class Target): Add osabi_ field.
6331 (Target::osabi): New function.
6332 (Target::set_osabi): New function.
6333 (Target::Target): Initialize osabi_.
6334 (Target::do_adjust_elf_header): Make pure virtual.
6335 (Sized_target::do_adjust_elf_header): Declare.
6336 * target.cc (Sized_target::do_adjust_elf_header): New function.
6337 (class Sized_target): Instantiate all versions.
6338 * freebsd.h (class Target_freebsd): Remove.
6339 (Target_selector_freebsd::do_recognize): Call set_osabi on
6340 Target.
6341 (Target_selector_freebsd::do_recognize_by_name): Likewise.
6342 (Target_selector_freebsd::set_osabi): Remove.
6343 * i386.cc (class Target_i386): Inherit from Sized_target rather
6344 than Target_freebsd.
6345 * x86_64.cc (class Target_x86_64): Likewise.
6346
b3ce541e
ILT
63472011-06-28 Ian Lance Taylor <iant@google.com>
6348
6349 * target.h (Target::can_check_for_function_pointers): Rewrite.
6350 Make non-virtual.
6351 (Target::can_icf_inline_merge_sections): Likewise.
6352 (Target::section_may_have_icf_unsafe_poineters): Likewise.
6353 (Target::Target_info): Add can_icf_inline_merge_sections field.
6354 (Target::do_can_check_for_function_pointers): New virtual
6355 function.
6356 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
6357 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
6358 from can_check_for_function_pointers, move in file.
6359 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
6360 section_may_have_icf_unsafe_poineters, move in file.
6361 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
6362 * i386.cc (Target_i386::do_can_check_for_function_pointers):
6363 Rename from can_check_for_function_pointers, move in file.
6364 (Target_i386::can_icf_inline_merge_sections): Remove.
6365 (Target_i386::i386_info): Initialize
6366 can_icf_inline_merge_sections.
6367 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
6368 Initialize can_icf_inline_merge_sections.
6369 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
6370 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
6371 Rename from can_check_for_function_pointers, move in file.
6372 (Target_x86_64::can_icf_inline_merge_sections): Remove.
6373 (Target_x86_64::x86_64_info): Initialize
6374 can_icf_inline_merge_sections.
6375 * testsuite/testfile.cc (Target_test::test_target_info):
6376 Likewise.
6377 * icf.cc (get_section_contents): Correct formatting.
6378
6d1c4efb
ILT
63792011-06-27 Ian Lance Taylor <iant@google.com>
6380
6381 * symtab.cc (Symbol::versioned_name): New function.
6382 (Symbol_table::add_to_final_symtab): Use versioned_name when
6383 appropriate.
6384 (Symbol_table::sized_write_symbol): Likewise.
6385 * symtab.h (class Symbol): Declare versioned_name.
6386 * stringpool.h (class Stringpool_template): Add variant of add
6387 which takes a std::basic_string.
6388 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
6389 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
6390 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
6391 (ver_test_12.o): New target.
6392 * testsuite/Makefile.in: Rebuild.
6393
57eb9b50
DK
63942011-06-27 Doug Kwan <dougkwan@google.com>
6395
6396 * arm.cc (Arm_relocate_functions::thm_jump8,
6397 Arm_relocate_functions::thm_jump11): Use a wider signed
6398 type to compute offset.
6399 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
6400 arm_thm_jump8.
6401 * testsuite/Makefile.in: Regenerate.
6402 * testsuite/arm_branch_in_range.sh: Check test results of
6403 arm_thm_jump11 and arm_thm_jump8.
6404 * testsuite/arm_thm_jump11.s: New test source file.
6405 * testsuite/arm_thm_jump11.t: New linker script.
6406 * testsuite/arm_thm_jump8.s: New test source file.
6407 * testsuite/arm_thm_jump8.t: New linker script.
6408
487b39df
ILT
64092011-06-24 Ian Lance Taylor <iant@google.com>
6410
6411 * layout.cc: Include "object.h".
6412 (ctors_sections_in_init_array): New static variable.
6413 (Layout::is_ctors_in_init_array): New function.
6414 (Layout::layout): Add entry to ctors_sections_in_init_array if
6415 appropriate.
6416 * layout.h (class Layout): Declare is_ctors_in_init_array.
6417 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
6418 is_ctors_reverse_view is set.
6419 (Sized_relobj_file::write_sections): Add layout parameter. Change
6420 all callers. Set is_ctors_reverse_view field of View_size.
6421 (Sized_relobj_file::reverse_words): New function.
6422 * object.h (Sized_relobj_file::View_size): Add
6423 is_ctors_reverse_view field.
6424 (class Sized_relobj_file): Update declarations.
6425 * testsuite/initpri3.c: New test.
6426 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
6427 initpri3b.
6428 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
6429 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
6430 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
6431 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
6432 * testsuite/Makefile.in: Rebuild.
6433
472076e4
CC
64342011-06-24 Cary Coutant <ccoutant@google.com>
6435
6436 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
6437 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
6438 (debug_msg_cdebug.err): New targets.
6439 * testsuite/Makefile.in: Regenerate.
6440 * testsuite/debug_msg.sh: Check output of link with compressed debug.
6441 Fix checks for link with shared library.
6442
a60af0db
DK
64432011-06-24 Doug Kwan <dougkwan@google.com>
6444
6445 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
6446 skip empty text sections.
6447 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
6448
5393d741
ILT
64492011-06-22 Ian Lance Taylor <iant@google.com>
6450
6451 PR gold/12910
6452 * options.h (class General_options): Add --ctors-in-init-array.
6453 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
6454 friends as SHT_PROGBITS for merging sections.
6455 (Layout::layout): Remove special handling of .init_array and
6456 friends. Don't sort if doing relocatable link. Sort for .ctors
6457 and .dtors if ctors_in_init_array.
6458 (Layout::make_output_section): Force correct section types for
6459 .init_array and friends. Don't sort if doing relocatable link,
6460 Don't sort .ctors and .dtors if ctors_in_init_array.
6461 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
6462 (Layout::output_section_name): Add relobj parameter. Change all
6463 callers. Handle .ctors. and .dtors. in code rather than table.
6464 Handle .ctors and .dtors if ctors_in_init_array.
6465 (Layout::match_file_name): New function, moved from output.cc.
6466 * layout.h (class Layout): Update declarations.
6467 * output.cc: Include "layout.h".
6468 (Input_section_sort_entry::get_priority): New function.
6469 (Input_section_sort_entry::match_file_name): Just call
6470 Layout::match_file_name.
6471 (Output_section::Input_section_sort_init_fini_compare::operator()):
6472 Handle .ctors and .dtors. Sort by explicit priority rather than
6473 by name.
6474 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
6475 * testsuite/initpri2.c: New test.
6476 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
6477 (check_PROGRAMS): Add initpri2.
6478 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
6479 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
6480 * configure, testsuite/Makefile.in: Rebuild.
6481
e1f74f98
ILT
64822011-06-19 Ian Lance Taylor <iant@google.com>
6483
6484 PR gold/12880
6485 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
6486 .interp section to a PT_INTERP segment even if we have seen a
6487 --dynamic-linker option. Don't do it if we have seen a PHDRS
6488 clause in a linker script.
6489 (Layout::finalize): Don't create a .interp section if we've
6490 already create a PT_INTERP segment.
6491 (Layout::create_interp): Always call choose_output_section (revert
6492 patch of 2011-06-17). Don't create PT_INTERP segment.
6493 * script-sections.cc
6494 (Script_sections::create_note_and_tls_segments): Add a .interp
6495 section to a PT_INTERP segment even if we have seen a
6496 --dynamic-linker option.
6497
766f91bb
ILT
64982011-06-18 Ian Lance Taylor <iant@google.com>
6499
6500 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
6501 merely because a non-PT_LOAD segment has a dynamic reloc.
6502
0d212c3a
ILT
65032011-06-18 Ian Lance Taylor <iant@google.com>
6504
6505 * layout.cc (Layout::finish_dynamic_section): Don't create
6506 DT_FLAGS entry if not needed.
6507
911a5072
ILT
65082011-06-18 Ian Lance Taylor <iant@google.com>
6509
6510 PR gold/12745
6511 * layout.cc (Layout::layout_eh_frame): Correct handling of
6512 writable .eh_frame section.
6513
534b4e5f
ILT
65142011-06-17 Ian Lance Taylor <iant@google.com>
6515
6516 PR gold/12893
6517 * resolve.cc (Symbol_table::resolve): Don't give an error if a
6518 symbol is redefined with the exact same object and value.
6519
10b4f102
ILT
65202011-06-17 Ian Lance Taylor <iant@google.com>
6521
6522 PR gold/12880
6523 * layout.h (class Layout): Add interp_segment_ field.
6524 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
6525 (Layout::attach_allocated_section_to_segment): If making shared
6526 library, put .interp section in PT_INTERP segment.
6527 (Layout::finalize): Also call create_interp if -dynamic-linker
6528 option was used.
6529 (Layout::create_interp): Assert that there is no PT_INTERP
6530 segment. If not using a SECTIONS clause, use make_output_section.
6531 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
6532 * script-sections.cc
6533 (Script_sections::create_note_and_tls_segments): If making shared
6534 library, put .interp section in PT_INTERP segment.
6535
a29b0dad
ILT
65362011-06-17 Ian Lance Taylor <iant@google.com>
6537
e588ea8d
ILT
6538 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
6539 when making a shared library.
6540
65412011-06-17 Ian Lance Taylor <iant@google.com>
6542
6543 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
6544 parameter. Change all callers. Don't issue warning about PC32
6545 against locally defined symbol.
a29b0dad 6546
9d3b0698
ILT
65472011-06-16 Ian Lance Taylor <iant@google.com>
6548
6549 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
6550 occurs in same object.
6551
85b0f90c
AM
65522011-06-14 Alan Modra <amodra@gmail.com>
6553
6554 * po/POTFILES.in: Regenerate.
6555
a94907d9
ILT
65562011-06-09 Ian Lance Taylor <iant@google.com>
6557
6558 * script-sections.cc
6559 (Orphan_output_section::set_section_addresses): For a relocatable
6560 link set address to 0.
6561
4fb3a1c3
CC
65622011-06-09 Cary Coutant <ccoutant@google.com>
6563
6564 PR gold/12804
6565 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
6566 used with --compress-debug-sections.
6567 * gold/object.cc (Sized_relobj_file::do_layout): Report
6568 uncompressed size of compressed input sections.
6569
61220854
CC
65702011-06-08 Cary Coutant <ccoutant@google.com>
6571
6572 PR gold/12804
6573 * testsuite/two_file_test_2_v1.cc: Change initialization of
6574 v2 to keep it in .data.
6575
e6455dfb
CC
65762011-06-07 Cary Coutant <ccoutant@google.com>
6577
6578 * common.cc (Symbol_table::do_allocate_commons_list): Call
6579 gold_fallback.
6580 * errors.cc (Errors::fatal): Adjust call to gold_exit.
6581 (Errors::fallback): New function.
6582 (gold_fallback): New function.
6583 * errors.h (Errors::fallback): New function.
6584 * gold.cc (gold_exit): Change status parameter to enum; adjust
6585 all callers.
6586 (queue_initial_tasks): Call gold_fallback.
6587 * gold.h: Include cstdlib.
6588 (Exit_status): New enum type.
6589 (gold_exit): Change status parameter to enum.
6590 (gold_fallback): New function.
6591 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
6592 (Layout::create_symtab_sections): Likewise.
6593 (Layout::create_shdrs): Likewise.
6594 * main.cc (main): Adjust call to gold_exit.
6595 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
6596 (Output_data_got::add_got_entry_pair): Likewise.
6597 (Output_section::add_input_section): Likewise.
6598 (Output_section::add_output_section_data): Likewise.
6599 (Output_segment::set_section_list_addresses): Likewise.
6600 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
6601
fb0e076f
CC
66022011-06-07 Cary Coutant <ccoutant@google.com>
6603
6604 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
6605 for incremental links.
6606 * output.cc (Output_segment::set_section_list_addresses): Remove
6607 FIXME and test for TLS or BSS.
6608
a5ee4d5d
CC
66092011-06-07 Cary Coutant <ccoutant@google.com>
6610
6611 * testsuite/Makefile.am: Add incremental_copy_test,
6612 incremental_common_test_1.
6613 * testsuite/Makefile.in: Regenerate.
6614 * testsuite/common_test_1_v1.c: New source file.
6615 * testsuite/common_test_1_v2.c: New source file.
6616 * testsuite/copy_test_v1.cc: New source file.
6617
5146f448
CC
66182011-06-07 Cary Coutant <ccoutant@google.com>
6619
6620 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
6621 update, allocate common from bss section's free list.
6622 * incremental-dump.cc (dump_incremental_inputs): Print flag for
6623 linker-defined symbols.
6624 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
6625 Skip GOT and PLT entries that are no longer referenced.
6626 (Output_section_incremental_inputs::write_info_blocks): Mark
6627 linker-defined symbols.
6628 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
6629 * output.cc (Output_section::allocate): New function.
6630 * output.h (Output_section::allocate): New function.
6631 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
6632 linker-defined symbols.
6633 (Symbol::override_base_with_special): Copy is_predefined_ flag.
6634 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
6635 (Symbol::init_base_output_data): Likewise.
6636 (Symbol::init_base_output_segment): Likewise.
6637 (Symbol::init_base_constant): Likewise.
6638 (Sized_symbol::init_output_data): Likewise.
6639 (Sized_symbol::init_output_segment): Likewise.
6640 (Sized_symbol::init_constant): Likewise.
6641 (Symbol_table::do_define_in_output_data): Likewise.
6642 (Symbol_table::do_define_in_output_segment): Likewise.
6643 (Symbol_table::do_define_as_constant): Likewise.
6644 * symtab.h (Symbol::is_predefined): New function.
6645 (Symbol::init_base_output_data): Add is_predefined parameter.
6646 (Symbol::init_base_output_segment): Likewise.
6647 (Symbol::init_base_constant): Likewise.
6648 (Symbol::is_predefined_): New data member.
6649 (Sized_symbol::init_output_data): Add is_predefined parameter.
6650 (Sized_symbol::init_output_segment): Likewise.
6651 (Sized_symbol::init_constant): Likewise.
6652 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
6653
26d3c67d
CC
66542011-06-07 Cary Coutant <ccoutant@google.com>
6655
6656 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
6657 instead of emit_copy_reloc.
6658 (Copy_relocs::emit_copy_reloc): Refactor.
6659 (Copy_relocs::make_copy_reloc): New function.
6660 (Copy_relocs::add_copy_reloc): Remove.
6661 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
6662 section.
6663 (Copy_relocs::make_copy_reloc): New function.
6664 (Copy_relocs::add_copy_reloc): Remove.
6665 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
6666 unchanged input files.
6667 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
6668 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
6669 Reserve BSS space for COPY relocations.
6670 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6671 (Output_section_incremental_inputs::write_info_blocks): Record
6672 whether a symbol is copied from a shared object.
6673 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
6674 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
6675 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
6676 (Incremental_input_entry_reader::get_output_symbol_index): Add
6677 is_copy parameter.
6678 (Incremental_binary::emit_copy_relocs): New function.
6679 (Incremental_binary::do_emit_copy_relocs): New function.
6680 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6681 new data member.
6682 (Sized_incremental_binary::add_copy_reloc): New function.
6683 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6684 (Sized_incremental_binary::Copy_reloc): New struct.
6685 (Sized_incremental_binary::Copy_relocs): New typedef.
6686 (Sized_incremental_binary::copy_relocs_): New data member.
6687 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
6688 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
6689 * target.h (Sized_target::emit_copy_reloc): New function.
6690 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
6691
7cdb37d9
CC
66922011-06-02 Cary Coutant <ccoutant@google.com>
6693
6694 PR gold/12163
6695 * gold/archive.cc (Archive::Archive): Initialize new data member.
6696 (Archive::include_all_members): Return if archive has already been
6697 included.
6698 * gold/archive.h (Archive::include_all_members_): New data member.
6699
cc643b88
NC
67002011-06-02 Nick Clifton <nickc@redhat.com>
6701
6702 * dynobj.h: Fix spelling mistake in comment.
6703 * output.cc: Likewise.
6704
f62a3ca7 67052011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 6706 Asier Llano
f62a3ca7
DK
6707
6708 PR gold/12826
cc643b88 6709 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
6710 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
6711 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
6712 redundant arm_exidx_test.so.
6713 * testsuite/Makefile.in: Regenerate.
6714 (check_SCRIPTS): Add pr12826.sh
6715 (check_DATA): Add pr12826.stdout
6716 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
6717 * testsuite/pr12826.sh: New file.
6718 * testsuite/pr12826_1.s: Ditto.
6719 * testsuite/pr12826_1.s: Ditto.
6720
8dbe1edc
ILT
67212011-05-30 Ian Lance Taylor <iant@google.com>
6722
6723 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
6724 sections.
6725
c49875be
ILT
67262011-05-29 Ian Lance Taylor <iant@google.com>
6727
6728 PR gold/12804
6729 * testsuite/Makefile.am: Use different file name for two_file_test
6730 temporary file for each incremental test.
6731 * testsuite/Makefile.in: Rebuild.
6732
69d53f7a
ILT
67332011-05-29 Ian Lance Taylor <iant@google.com>
6734
6735 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
6736 binary input file is empty.
6737
41d0ab5f
ILT
67382011-05-27 Ian Lance Taylor <iant@google.com>
6739
6740 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
6741 (ver_test_9.so): Likewise.
6742 * testsuite/Makefile.in: Rebuild.
6743
89d8a36b
CC
67442011-05-26 Cary Coutant <ccoutant@google.com>
6745
6746 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
6747 * incremental.cc (Incremental_inputs::report_input_section): Fix
6748 comment, indentation.
6749 (Incremental_inputs::report_comdat_group): New function.
6750 (Output_section_incremental_inputs::set_final_data_size): Adjust size
6751 of data for incremental input file entry.
6752 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
6753 group count, COMDAT group signatures.
6754 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
6755 an unchanged input file.
6756 * incremental.h (Incremental_object_entry::Incremental_object_entry):
6757 Initialize new data member.
6758 (Incremental_object_entry::add_comdat_group): New function.
6759 (Incremental_object_entry::get_comdat_group_count): New function.
6760 (Incremental_object_entry::get_comdat_signature_key): New function.
6761 (Incremental_object_entry::groups_): New data member.
6762 (Incremental_inputs::report_comdat_group): New function.
6763 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
6764 data for incremental input file entry.
6765 (Incremental_input_entry_reader::get_comdat_group_count): New function.
6766 (Incremental_input_entry_reader::get_input_section): Adjust size of
6767 data for incremental input file entry.
6768 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
6769 (Incremental_input_entry_reader::get_comdat_group_signature): New
6770 function.
6771 * object.cc (Sized_relobj::include_section_group): Report kept
6772 COMDAT groups for incremental links.
6773
1706a06f
ILT
67742011-05-24 David Meyer <pdox@google.com>
6775
6776 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
6777 with name parameter. Add found_name parameter.
6778 * fileread.cc (Input_file::find_file): Adjust code accordingly.
6779 * dirsearch.h (class Dirsearch): Update declaration.
6780
a10ae760
ILT
67812011-05-24 Ian Lance Taylor <iant@google.com>
6782
6783 * archive.cc (Library_base::should_include_member): Pull in object
6784 from archive if it defines the entry symbol.
6785 * parameters.cc (Parameters::entry): New function.
6786 * parameters.h (class Parameters): Declare entry.
6787 * output.h (class Output_file_header): Remove entry_ field.
6788 * output.cc (Output_file_header::Output_file_header): Remove entry
6789 parameter. Change all callers.
6790 (Output_file_header::entry): Use parameters->entry.
6791 * gold.cc (queue_middle_tasks): Likewise.
6792 * plugin.cc (Plugin_hook::run): Likewise.
6793
aa92d6ed
CC
67942011-05-24 Cary Coutant <ccoutant@google.com>
6795
6796 * gold.cc (queue_initial_tasks): Pass incremental base filename
6797 to Output_file::open_base_file; don't print error message.
6798 * incremental-dump.cc (main): Adjust call to
6799 Output_file::open_for_modification.
6800 * incremental-dump.cc (main): Likewise.
6801 * incremental.cc (Incremental_inputs::report_command_line):
6802 Ignore --incremental-base option when comparing command lines.
6803 Ignore parameter when given as separate argument.
6804 * options.h (class General_options): Add --incremental-base.
6805 * output.cc (Output_file::Output_file):
6806 (Output_file::open_base_file): Add base_name and writable parameters;
6807 read base file into new file; print error message here.
6808 (Output_file::map_no_anonymous): Add writable parameter; adjust all
6809 callers.
6810 * output.h (Output_file::open_for_modification): Rename to...
6811 (Output_file::open_base_file): ...this; add base_name and
6812 writable parameters; adjust all callers.
6813 (Output_file::map_no_anonymous): Add writable parameter; adjust all
6814 callers.
6815 * testsuite/Makefile.am (incremental_test_4): Test
6816 --incremental-base.
6817 * testsuite/Makefile.in: Regenerate.
6818
2eedd706
CC
68192011-05-24 Cary Coutant <ccoutant@google.com>
6820
6821 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
6822 incremental_test_4.
6823 * testsuite/Makefile.in: Regenerate.
6824 * testsuite/two_file_test_1_v1.cc: New test source file.
6825 * testsuite/two_file_test_1b_v1.cc: New test source file.
6826 * testsuite/two_file_test_2_v1.cc: New test source file.
6827
0f1c85a6
CC
68282011-05-24 Cary Coutant <ccoutant@google.com>
6829
6830 * dynobj.h (Dynobj::do_dynobj): New function.
6831 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
6832 flag and soname for shared objects.
6833 * incremental.cc (Incremental_inputs::report_object): Make
6834 either Incremental_object_entry or Incremental_dynobj_entry; add
6835 soname to string table.
6836 (Incremental_inputs::report_input_section): Add assertion.
6837 (Output_section_incremental_inputs::set_final_data_size): Adjust
6838 type of input file entry for shared libraries; adjust size of
6839 shared library info entry.
6840 (Output_section_incremental_inputs::write_input_files): Write
6841 as_needed flag for shared libraries.
6842 (Output_section_incremental_inputs::write_info_blocks): Adjust type
6843 of input file entry for shared libraries; write soname.
6844 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
6845 soname from incremental info.
6846 * incremental.h (enum Incremental_input_flags): Add
6847 INCREMENTAL_INPUT_AS_NEEDED.
6848 (Incremental_input_entry::Incremental_input_entry): Initialize new
6849 data member.
6850 (Incremental_input_entry::set_as_needed): New function.
6851 (Incremental_input_entry::as_needed): New function.
6852 (Incremental_input_entry::do_dynobj_entry): New function.
6853 (Incremental_input_entry::as_needed_): New data member.
6854 (Incremental_object_entry::Incremental_object_entry): Don't check
6855 for shared library.
6856 (Incremental_object_entry::do_type): Likewise.
6857 (class Incremental_dynobj_entry): New class.
6858 (Incremental_input_entry_reader::as_needed): New function.
6859 (Incremental_input_entry_reader::get_soname): New function.
6860 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
6861 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
6862 size of shared library info entry.
58797674 6863 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
6864 incremental link when adding DT_NEEDED entries.
6865 * object.h (Object::Object): Initialize new data member.
6866 (Object::dynobj): New function.
6867 (Object::set_as_needed): New function.
6868 (Object::as_needed): New function.
6869 (Object::do_dynobj): New function.
6870 (Object::as_needed_): New data member.
6871
6fa2a40b
CC
68722011-05-24 Cary Coutant <ccoutant@google.com>
6873
6874 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
6875 info; adjust display of GOT entries.
6876 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
6877 vector of input objects; remove file_status_.
6878 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
6879 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
6880 got_plt reader; call target hooks to reserve GOT entries.
6881 (Output_section_incremental_inputs::set_final_data_size): Adjust size
6882 of input file info header and GOT info entry.
6883 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
6884 relocation info.
6885 (Got_plt_view_info::got_descriptor): Remove.
6886 (Got_plt_view_info::sym_index): New data member.
6887 (Got_plt_view_info::input_index): New data member.
6888 (Local_got_offset_visitor::visit): Write input file index.
6889 (Global_got_offset_visitor::visit): Write 0 for input file index.
6890 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
6891 with sym_index and input_index.
6892 (Output_section_incremental_inputs::write_got_plt): Adjust size of
6893 incremental info GOT entry; replace got_descriptor with input_index.
6894 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
6895 map from input file index to object.
6896 (Sized_relobj_incr::do_layout): Replace direct data member reference
6897 with accessor function.
6898 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
6899 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
6900 Adjust size of input file info header.
6901 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
6902 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
6903 (Incremental_input_entry_reader::get_input_section): Adjust size of
6904 input file info header.
6905 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
6906 of incremental info GOT entry.
6907 (Incremental_got_plt_reader::get_got_desc): Remove.
6908 (Incremental_got_plt_reader::get_got_symndx): New function.
6909 (Incremental_got_plt_reader::get_got_input_index): New function.
6910 (Sized_incremental_binary::Sized_incremental_binary): Remove
6911 file_status_; add input_objects_.
6912 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
6913 (Sized_incremental_binary::set_file_is_unchanged): Remove.
6914 (Sized_incremental_binary::file_is_unchanged): Remove.
6915 (Sized_incremental_binary::set_input_object): New function.
6916 (Sized_incremental_binary::input_object): New function.
6917 (Sized_incremental_binary::file_status_): Remove.
6918 (Sized_incremental_binary::input_objects_): New data member.
6919 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
6920 references.
6921 (Sized_relobj_incr::invalid_address): Move to base class.
6922 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
6923 class.
6924 (Sized_relobj_incr::do_output_section_offset): Likewise.
6925 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
6926 (Sized_relobj_incr::section_offsets_): Likewise.
6927 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
6928 function.
6929 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
6930 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
6931 with accessor function.
6932 (Sized_relobj_file::do_layout): Likewise.
6933 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
6934 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
6935 (Sized_relobj_file::compute_final_local_value): Replace refs to
6936 section_offsets_ with accessor function.
6937 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
6938 * object.h (Relobj::Relobj): Initialize new data members.
6939 (Relobj::add_dyn_reloc): New function.
6940 (Relobj::first_dyn_reloc): New function.
6941 (Relobj::dyn_reloc_count): New function.
6942 (Relobj::first_dyn_reloc_): New data member.
6943 (Relobj::dyn_reloc_count_): New data member.
6944 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
6945 references.
6946 (Sized_relobj::Address): New typedef.
6947 (Sized_relobj::invalid_address): Move here from child class.
6948 (Sized_relobj::Sized_relobj): Initialize new data members.
6949 (Sized_relobj::sized_relobj): New function.
6950 (Sized_relobj::is_output_section_offset_invalid): Move here from
6951 child class.
6952 (Sized_relobj::get_output_section_offset): Likewise.
6953 (Sized_relobj::local_has_got_offset): Likewise.
6954 (Sized_relobj::local_got_offset): Likewise.
6955 (Sized_relobj::set_local_got_offset): Likewise.
6956 (Sized_relobj::do_for_all_local_got_entries): Likewise.
6957 (Sized_relobj::clear_got_offsets): New function.
6958 (Sized_relobj::section_offsets): Move here from child class.
6959 (Sized_relobj::do_output_section_offset): Likewise.
6960 (Sized_relobj::do_set_section_offset): Likewise.
6961 (Sized_relobj::Local_got_offsets): Likewise.
6962 (Sized_relobj::local_got_offsets_): Likewise.
6963 (Sized_relobj::section_offsets_): Likewise.
6964 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
6965 references.
6966 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
6967 class.
6968 (Sized_relobj_file::sized_relobj): New function
6969 (Sized_relobj_file::local_has_got_offset): Move to base class.
6970 (Sized_relobj_file::local_got_offset): Likewise.
6971 (Sized_relobj_file::set_local_got_offset): Likewise.
6972 (Sized_relobj_file::get_output_section_offset): Likewise.
6973 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
6974 (Sized_relobj_file::do_output_section_offset): Likewise.
6975 (Sized_relobj_file::do_set_section_offset): Likewise.
6976 (Sized_relobj_file::Local_got_offsets): Likewise.
6977 (Sized_relobj_file::local_got_offsets_): Likewise.
6978 (Sized_relobj_file::section_offsets_): Likewise.
6979 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
6980 (all constructors).
6981 (set_needs_dynsym_index): Convert relobj to derived class pointer.
6982 (Output_reloc::get_symbol_index): Likewise.
6983 (Output_reloc::local_section_offset): Likewise.
6984 (Output_reloc::get_address): Likewise.
6985 (Output_reloc::symbol_value): Likewise.
6986 (Output_data_got::reserve_slot): Move to class definition.
6987 (Output_data_got::reserve_local): New function.
6988 (Output_data_got::reserve_slot_for_global): Remove.
6989 (Output_data_got::reserve_global): New function.
6990 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
6991 (all constructors, two instantiations).
6992 (Output_reloc::get_relobj): New function (two instantiations).
6993 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
6994 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
6995 (Output_data_reloc::add_global): Adjust type of relobj.
6996 (Output_data_reloc::add_global_relative): Likewise.
6997 (Output_data_reloc::add_symbolless_global_addend): Likewise.
6998 (Output_data_reloc::add_local): Likewise.
6999 (Output_data_reloc::add_local_relative): Likewise.
7000 (Output_data_reloc::add_symbolless_local_addend): Likewise.
7001 (Output_data_reloc::add_local_section): Likewise.
7002 (Output_data_reloc::add_output_section): Likewise.
7003 (Output_data_reloc::add_absolute): Likewise.
7004 (Output_data_reloc::add_target_specific): Likewise.
7005 (Output_data_got::reserve_slot): Move definition here.
7006 (Output_data_got::reserve_local): New function.
7007 (Output_data_got::reserve_global): New function.
7008 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
7009 section_offsets_ with accessor function.
7010 (Sized_relobj_file::write_sections): Likewise.
7011 (Sized_relobj_file::do_relocate_sections): Likewise.
7012 * target.h (Sized_target::reserve_local_got_entry): New function.
7013 (Sized_target::reserve_global_got_entry): New function.
7014 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
7015 (Target_x86_64::reserve_global_got_entry): New function.
7016 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
7017
4829d394
CC
70182011-05-23 Cary Coutant <ccoutant@google.com>
7019
7020 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
7021 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
7022 bit when checking got_type.
7023 * incremental.cc (Sized_incremental_binary::setup_readers):
7024 Store symbol table and string table locations; initialize bit vector
7025 of file status flags.
7026 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
7027 unchanged files.
7028 (Sized_incremental_binary::do_process_got_plt): New function.
7029 (Sized_incremental_binary::get_symtab_view): Use stored locations.
7030 (Output_section_incremental_inputs::set_final_data_size): Record
7031 file index for each input file.
7032 (Output_section_incremental_inputs::write_got_plt): Store file index
7033 instead of input entry offset for each GOT entry.
7034 * incremental.h
7035 (Incremental_input_entry::Incremental_input_entry): Initialize new
7036 data member.
7037 (Incremental_input_entry::set_offset): Store file index.
7038 (Incremental_input_entry::get_file_index): New function.
7039 (Incremental_input_entry::file_index_): New data member.
7040 (Incremental_binary::process_got_plt): New function.
7041 (Incremental_binary::do_process_got_plt): New function.
7042 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7043 data members.
7044 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
7045 (Sized_incremental_binary::set_file_is_unchanged): New function.
7046 (Sized_incremental_binary::file_is_unchanged): New function.
7047 (Sized_incremental_binary::do_process_got_plt): New function.
7048 (Sized_incremental_binary::file_status_): New data member.
7049 (Sized_incremental_binary::main_symtab_loc_): New data member.
7050 (Sized_incremental_binary::main_strtab_loc_): New data member.
7051 * output.cc (Output_data_got::Got_entry::write): Add case
7052 RESERVED_CODE.
7053 (Output_data_got::add_global): Call add_got_entry.
7054 (Output_data_got::add_global_plt): Likewise.
7055 (Output_data_got::add_global_with_rel): Likewise.
7056 (Output_data_got::add_global_with_rela): Likewise.
7057 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
7058 (Output_data_got::add_global_pair_with_rela): Likewise.
7059 (Output_data_got::add_local): Call add_got_entry.
7060 (Output_data_got::add_local_plt): Likewise.
7061 (Output_data_got::add_local_with_rel): Likewise.
7062 (Output_data_got::add_local_with_rela): Likewise.
7063 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
7064 (Output_data_got::add_local_pair_with_rela): Likewise.
7065 (Output_data_got::reserve_slot): New function.
7066 (Output_data_got::reserve_slot_for_global): New function.
7067 (Output_data_got::add_got_entry): New function.
7068 (Output_data_got::add_got_entry_pair): New function.
7069 (Output_section::add_output_section_data): Edit FIXME.
7070 * output.h
7071 (Output_section_data_build::Output_section_data_build): New
7072 constructor with size parameter.
7073 (Output_data_space::Output_data_space): Likewise.
7074 (Output_data_got::Output_data_got): Initialize new data member; new
7075 constructor with size parameter.
7076 (Output_data_got::add_constant): Call add_got_entry.
7077 (Output_data_got::reserve_slot): New function.
7078 (Output_data_got::reserve_slot_for_global): New function.
7079 (class Output_data_got::Got_entry): Add RESERVED_CODE.
7080 (Output_data_got::add_got_entry): New function.
7081 (Output_data_got::add_got_entry_pair): New function.
7082 (Output_data_got::free_list_): New data member.
7083 * target.h (Sized_target::init_got_plt_for_update): New function.
7084 (Sized_target::register_global_plt_entry): New function.
7085 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
7086 Initialize new data member; call init; add constructor with PLT count.
7087 (Output_data_plt_x86_64::init): New function.
7088 (Output_data_plt_x86_64::add_relocation): New function.
7089 (Output_data_plt_x86_64::reserve_slot): New function.
7090 (Output_data_plt_x86_64::free_list_): New data member.
7091 (Target_x86_64::init_got_plt_for_update): New function.
7092 (Target_x86_64::register_global_plt_entry): New function.
7093 (Output_data_plt_x86_64::add_entry): Allocate from free list for
7094 incremental updates.
7095 (Output_data_plt_x86_64::add_relocation): New function.
7096 * testsuite/object_unittest.cc (Object_test): Set default options.
7097
ec69d6da
ILT
70982011-05-16 Ian Lance Taylor <iant@google.com>
7099
7100 * options.h (class General_options): Make -i a synonym for -r.
7101
732e31de
ILT
71022011-05-16 Ian Lance Taylor <iant@google.com>
7103
7104 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
7105
403676b5
CC
71062011-05-10 Cary Coutant <ccoutant@google.com>
7107
7108 * object.cc (Sized_relobj::do_count_local_symbols): Check for
7109 strip_all (-s).
7110
5b7b7d6e
ILT
71112011-05-06 Ian Lance Taylor <iant@google.com>
7112
7113 * layout.cc (Layout::layout): If the output section flags change,
7114 update the ordering.
7115
f0f9babf
CC
71162011-04-25 Cary Coutant <ccoutant@google.com>
7117
7118 * incremental-dump.cc (dump_incremental_inputs): Print local
7119 symbol info for each input file.
7120 * incremental.cc
7121 (Output_section_incremental_inputs::set_final_data_size): Add local
7122 symbol info to input file entries in incremental info.
7123 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7124 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
7125 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
7126 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
7127 implementation.
7128 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
7129 (Sized_incr_relobj::do_relocate): Write the local symbols.
7130 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
7131 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
7132 Adjust size of input file header.
7133 (Incremental_inputs_reader::get_local_symbol_offset): New function.
7134 (Incremental_inputs_reader::get_local_symbol_count): New function.
7135 (Incremental_inputs_reader::get_input_section): Adjust size of input
7136 file header.
7137 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
7138 (Sized_incr_relobj::This): New typedef.
7139 (Sized_incr_relobj::sym_size): New const data member.
7140 (Sized_incr_relobj::Local_symbol): New struct.
7141 (Sized_incr_relobj::do_output_local_symbol_count): New function.
7142 (Sized_incr_relobj::do_local_symbol_offset): New function.
7143 (Sized_incr_relobj::local_symbol_count_): New data member.
7144 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
7145 (Sized_incr_relobj::local_symbol_index_): New data member.
7146 (Sized_incr_relobj::local_symbol_offset_): New data member.
7147 (Sized_incr_relobj::local_dynsym_offset_): New data member.
7148 (Sized_incr_relobj::local_symbols_): New data member.
7149 * object.h (Relobj::output_local_symbol_count): New function.
7150 (Relobj::local_symbol_offset): New function.
7151 (Relobj::do_output_local_symbol_count): New function.
7152 (Relobj::do_local_symbol_offset): New function.
7153 (Sized_relobj::do_output_local_symbol_count): New function.
7154 (Sized_relobj::do_local_symbol_offset): New function.
7155
d0a9ace3
ILT
71562011-04-22 Vladimir Simonov <sv@sw.ru>
7157
7158 * descriptors.cc (set_close_on_exec): New function.
7159 (Descriptors::open): Use set_close_on_exec.
7160 * output.cc (S_ISLNK): Define if not defined.
7161
94a3fc8b
CC
71622011-04-22 Cary Coutant <ccoutant@google.com>
7163
7164 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
7165 global symbol map.
7166 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7167 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
7168 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
7169 relocations.
7170 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
7171 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
7172 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
7173 * incremental.h
7174 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
7175 function.
7176 (Incremental_binary::apply_incremental_relocs): New function.
7177 (Incremental_binary::do_apply_incremental_relocs): New function.
7178 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7179 data member.
7180 (Sized_incremental_binary::add_global_symbol): New function.
7181 (Sized_incremental_binary::global_symbol): New function.
7182 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7183 (Sized_incremental_binary::symbol_map_): New data member.
7184 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
7185 * target.h (Sized_target::apply_relocation): New function.
7186 * target-reloc.h (apply_relocation): New function.
7187 * x86_64.cc (Target_x86_64::apply_relocation): New function.
7188
c87e4302
DK
71892011-04-22 Doug Kwan <dougkwan@google.com>
7190
7191 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
7192 flag of a SHT_ARM_EXIDX section.
2e702c99 7193 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
7194 * testsuite/Makefile.in: Regenerate.
7195 * testsuite/arm_exidx_test.s: New file.
7196 * testsuite/arm_exidx_test.sh: Same.
7197
e7782cf6
CC
71982011-04-20 Cary Coutant <ccoutant@google.com>
7199
7200 PR gold/12689
7201 * archive.h (Incremental_archive_entry::Archive_member):
7202 Initialize arg_serial_ (second constructor).
7203
308ecdc7
ILT
72042011-04-17 Ian Lance Taylor <iant@google.com>
7205
7206 * object.cc (Relocate_info::location): Simplify location string.
7207 * errors.cc (Errors::error_at_location): Don't print program
7208 name.
7209 (Errors::warning_at_location): Likewise.
7210 (Errors::undefined_symbol): Likewise.
7211 * testsuite/debug_msg.sh: Update accordingly.
7212
bec5b579
CC
72132011-04-14 Cary Coutant <ccoutant@google.com>
7214
7215 * gold/layout.cc (Layout::symtab_section_offset): New function.
7216 * gold/layout.h (Layout::symtab_section_offset): New function.
7217 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
7218
88597d34
ILT
72192011-04-12 Ian Lance Taylor <iant@google.com>
7220
7221 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
7222 with MREMAP_MAYMOVE.
7223 * output.h (class Output_file): Add map_is_allocated_ field.
7224 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
7225 not available, provide stubs. If mremap is not available, #define
7226 it to gold_mremap.
7227 (MREMAP_MAYMOVE): Define if not defined.
7228 (Output_file::Output_file): Initialize map_is_allocated_.
7229 (Output_file::resize): Check map_is_allocated_.
7230 (Output_file::map_anonymous): If mmap fails, use malloc.
7231 (Output_file::unmap): Don't do anything for an anonymous map.
7232 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
7233 is not available, provide stubs.
7234 (File_read::View::~View): Use free rather than delete[].
7235 (File_read::make_view): Use malloc rather than new[]. If mmap
7236 fails, use malloc.
7237 (File_read::find_or_make_view): Use malloc rather than new[].
7238 * gold.h: Remove HAVE_REMAP code.
7239 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
7240 exists. Rename mremap to gold_mremap. If mmap is not available
7241 don't do anything.
7242 * configure, config.in: Rebuild.
7243
11e361bc
ILT
72442011-04-11 Ian Lance Taylor <iant@google.com>
7245
7246 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
7247 initialize local variable v.
7248
cdc29364
CC
72492011-04-11 Cary Coutant <ccoutant@google.com>
7250
7251 * archive.cc (Archive::include_member): Adjust call to
7252 report_object.
7253 (Add_archive_symbols::run): Track argument serial numbers.
7254 (Lib_group::include_member): Likewise.
7255 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
7256 * archive.h (Incremental_archive_entry::Archive_member):
7257 Initialize arg_serial_.
7258 (Archive_member::arg_serial_): New data member.
7259 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
7260 (Sized_dynobj::do_add_symbols): Track symbols when doing an
7261 incremental link.
7262 (Sized_dynobj::do_for_all_local_got_entries): New function.
7263 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
7264 function.
7265 * fileread.cc (get_mtime): New function.
7266 * fileread.h (get_mtime): New function.
7267 * gold.cc (queue_initial_tasks): Check for incremental update.
7268 (process_incremental_input): New function.
7269 (queue_middle_tasks): Don't force valid target for incremental
7270 update.
7271 * incremental-dump.cc (find_input_containing_global): Adjust
7272 size of symbol info entry.
7273 (dump_incremental_inputs): Dump argument serial number and
7274 in_system_directory flag; bias shndx by 1; print symbol names
7275 when dumping per-file symbol lists; use new symbol info readers.
7276 * incremental.cc
7277 (Output_section_incremental_inputs:update_data_size): New function.
7278 (Sized_incremental_binary::setup_readers): Setup input readers
7279 for each input file; build maps for files added from libraries
7280 and scripts.
7281 (Sized_incremental_binary::check_input_args): New function.
7282 (Sized_incremental_binary::do_check_inputs): Build map of argument
7283 serial numbers to input arguments.
7284 (Sized_incremental_binary::do_file_has_changed): Rename
7285 do_file_is_unchanged to this; compare file modification times.
7286 (Sized_incremental_binary::do_init_layout): New function.
7287 (Sized_incremental_binary::do_reserve_layout): New function.
7288 (Sized_incremental_binary::do_get_input_reader): Remove.
7289 (Sized_incremental_binary::get_symtab_view): New function.
7290 (Incremental_checker::can_incrementally_link_output_file): Remove.
7291 (Incremental_inputs::report_command_line): Exclude --debug options.
7292 (Incremental_inputs::report_archive_begin): Add parameter; track
7293 argument serial numbers; don't put input file entry for archive
7294 before archive members.
7295 (Incremental_inputs::report_archive_end): Put input file entry
7296 for archive after archive members.
7297 (Incremental_inputs::report_object): Add parameter; track argument
7298 serial numbers and in_system_directory flag.
7299 (Incremental_inputs::report_script): Add parameter; track argument
7300 serial numbers.
7301 (Output_section_incremental_inputs::set_final_data_size): Adjust
7302 size of symbol info entry; check for forwarding symbols.
7303 (Output_section_incremental_inputs::write_input_files): Write
7304 in_system_directory flag and argument serial number.
7305 (Output_section_incremental_inputs::write_info_blocks): Map section
7306 indices between incremental info and original input file; store
7307 input section index for each symbol.
7308 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
7309 change operator() to visit().
7310 (class Global_got_offset_visitor): Likewise.
7311 (class Global_symbol_visitor_got_plt):
7312 (Output_section_incremental_inputs::write_got_plt): Use new visitor
7313 classes.
7314 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
7315 (Sized_incr_relobj::do_read_symbols): New function.
7316 (Sized_incr_relobj::do_layout): New function.
7317 (Sized_incr_relobj::do_layout_deferred_sections): New function.
7318 (Sized_incr_relobj::do_add_symbols): New function.
7319 (Sized_incr_relobj::do_should_include_member): New function.
7320 (Sized_incr_relobj::do_for_all_global_symbols): New function.
7321 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
7322 (Sized_incr_relobj::do_section_size): New function.
7323 (Sized_incr_relobj::do_section_name): New function.
7324 (Sized_incr_relobj::do_section_contents): New function.
7325 (Sized_incr_relobj::do_section_flags): New function.
7326 (Sized_incr_relobj::do_section_entsize): New function.
7327 (Sized_incr_relobj::do_section_address): New function.
7328 (Sized_incr_relobj::do_section_type): New function.
7329 (Sized_incr_relobj::do_section_link): New function.
7330 (Sized_incr_relobj::do_section_info): New function.
7331 (Sized_incr_relobj::do_section_addralign): New function.
7332 (Sized_incr_relobj::do_initialize_xindex): New function.
7333 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
7334 (Sized_incr_relobj::do_read_relocs): New function.
7335 (Sized_incr_relobj::do_gc_process_relocs): New function.
7336 (Sized_incr_relobj::do_scan_relocs): New function.
7337 (Sized_incr_relobj::do_count_local_symbols): New function.
7338 (Sized_incr_relobj::do_finalize_local_symbols): New function.
7339 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
7340 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
7341 (Sized_incr_relobj::do_relocate): New function.
7342 (Sized_incr_relobj::do_set_section_offset): New function.
7343 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
7344 (Sized_incr_dynobj::do_read_symbols): New function.
7345 (Sized_incr_dynobj::do_layout): New function.
7346 (Sized_incr_dynobj::do_add_symbols): New function.
7347 (Sized_incr_dynobj::do_should_include_member): New function.
7348 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
7349 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
7350 (Sized_incr_dynobj::do_section_size): New function.
7351 (Sized_incr_dynobj::do_section_name): New function.
7352 (Sized_incr_dynobj::do_section_contents): New function.
7353 (Sized_incr_dynobj::do_section_flags): New function.
7354 (Sized_incr_dynobj::do_section_entsize): New function.
7355 (Sized_incr_dynobj::do_section_address): New function.
7356 (Sized_incr_dynobj::do_section_type): New function.
7357 (Sized_incr_dynobj::do_section_link): New function.
7358 (Sized_incr_dynobj::do_section_info): New function.
7359 (Sized_incr_dynobj::do_section_addralign): New function.
7360 (Sized_incr_dynobj::do_initialize_xindex): New function.
7361 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
7362 (make_sized_incremental_object): New function.
7363 (Incremental_library::copy_unused_symbols): New function.
7364 (Incremental_library::do_for_all_unused_symbols): New function.
7365 * incremental.h (enum Incremental_input_flags): New type.
7366 (class Incremental_checker): Remove.
7367 (Incremental_input_entry::Incremental_input_entry): Add argument
7368 serial number.
7369 (Incremental_input_entry::arg_serial): New function.
7370 (Incremental_input_entry::set_is_in_system_directory): New function.
7371 (Incremental_input_entry::is_in_system_directory): New function.
7372 (Incremental_input_entry::arg_serial_): New data member.
7373 (Incremental_input_entry::is_in_system_directory_): New data member.
7374 (class Script_info): Move here from script.h.
7375 (Script_info::Script_info): Add filename parameter.
7376 (Script_info::filename): New function.
7377 (Script_info::filename_): New data member.
7378 (Incremental_script_entry::Incremental_script_entry): Add argument
7379 serial number.
7380 (Incremental_object_entry::Incremental_object_entry): Likewise.
7381 (Incremental_object_entry::add_input_section): Build list of input
7382 sections with map to original shndx.
7383 (Incremental_object_entry::get_input_section_index): New function.
7384 (Incremental_object_entry::shndx_): New data member.
7385 (Incremental_object_entry::name_key_): Rename; adjust all refs.
7386 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
7387 (Incremental_archive_entry::Incremental_archive_entry): Add argument
7388 serial number.
7389 (Incremental_inputs::report_archive_begin): Likewise.
7390 (Incremental_inputs::report_object): Likewise.
7391 (Incremental_inputs::report_script): Likewise.
7392 (class Incremental_global_symbol_reader): New class.
7393 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
7394 and store flags and input file type.
7395 (Incremental_input_entry_reader::arg_serial): New function.
7396 (Incremental_input_entry_reader::type): Extract type from flags.
7397 (Incremental_input_entry_reader::is_in_system_directory): New function.
7398 (Incremental_input_entry_reader::get_input_section_count): Call
7399 accessor function for type.
7400 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
7401 function for type; adjust size of global symbol entry.
7402 (Incremental_input_entry_reader::get_global_symbol_count): Call
7403 accessor function for type.
7404 (Incremental_input_entry_reader::get_object_count): Likewise.
7405 (Incremental_input_entry_reader::get_object_offset): Likewise.
7406 (Incremental_input_entry_reader::get_member_count): Likewise.
7407 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
7408 (Incremental_input_entry_reader::get_member_offset): Likewise.
7409 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
7410 (Incremental_input_entry_reader::Global_symbol_info): Remove.
7411 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
7412 (Incremental_input_entry_reader::get_global_symbol_reader): New
7413 function.
7414 (Incremental_input_entry_reader::get_output_symbol_index): New
7415 function.
7416 (Incremental_input_entry_reader::type_): Remove.
7417 (Incremental_input_entry_reader::flags_): New data member.
7418 (Incremental_inputs_reader::input_file_offset): New function.
7419 (Incremental_inputs_reader::input_file_index): New function.
7420 (Incremental_inputs_reader::input_file): Call input_file_offset.
7421 (Incremental_inputs_reader::input_file_at_offset): New function.
7422 (Incremental_relocs_reader::get_r_type): Reformat.
7423 (Incremental_relocs_reader::get_r_shndx): Reformat.
7424 (Incremental_relocs_reader::get_r_offset): Reformat.
7425 (Incremental_relocs_reader::data): New function.
7426 (Incremental_binary::Incremental_binary): Initialize new data members.
7427 (Incremental_binary::check_inputs): Add cmdline parameter.
7428 (Incremental_binary::file_is_unchanged): Remove.
7429 (Input_reader::arg_serial): New function.
7430 (Input_reader::get_unused_symbol_count): New function.
7431 (Input_reader::get_unused_symbol): New function.
7432 (Input_reader::do_arg_serial): New function.
7433 (Input_reader::do_get_unused_symbol_count): New function.
7434 (Input_reader::do_get_unused_symbol): New function.
7435 (Incremental_binary::input_file_count): New function.
7436 (Incremental_binary::get_input_reader): Change signature to use
7437 index instead of filename.
7438 (Incremental_binary::file_has_changed): New function.
7439 (Incremental_binary::get_input_argument): New function.
7440 (Incremental_binary::get_library): New function.
7441 (Incremental_binary::get_script_info): New function.
7442 (Incremental_binary::init_layout): New function.
7443 (Incremental_binary::reserve_layout): New function.
7444 (Incremental_binary::output_file): New function.
7445 (Incremental_binary::do_check_inputs): New function.
7446 (Incremental_binary::do_file_is_unchanged): Remove.
7447 (Incremental_binary::do_file_has_changed): New function.
7448 (Incremental_binary::do_init_layout): New function.
7449 (Incremental_binary::do_reserve_layout): New function.
7450 (Incremental_binary::do_input_file_count): New function.
7451 (Incremental_binary::do_get_input_reader): Change signature.
7452 (Incremental_binary::input_args_map_): New data member.
7453 (Incremental_binary::library_map_): New data member.
7454 (Incremental_binary::script_map_): New data member.
7455 (Sized_incremental_binary::Sized_incremental_binary): Initialize
7456 new data members.
7457 (Sized_incremental_binary::output_section): New function.
7458 (Sized_incremental_binary::inputs_reader): Add const.
7459 (Sized_incremental_binary::symtab_reader): Add const.
7460 (Sized_incremental_binary::relocs_reader): Add const.
7461 (Sized_incremental_binary::got_plt_reader): Add const.
7462 (Sized_incremental_binary::get_symtab_view): New function.
7463 (Sized_incremental_binary::Inputs_reader): New typedef.
7464 (Sized_incremental_binary::Input_entry_reader): New typedef.
7465 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
7466 (Sized_incremental_binary::do_file_is_unchanged): Remove.
7467 (Sized_incremental_binary::do_file_has_changed): New function.
7468 (Sized_incremental_binary::do_init_layout): New function.
7469 (Sized_incremental_binary::do_reserve_layout): New function.
7470 (Sized_input_reader::Inputs_reader): Remove.
7471 (Sized_input_reader::Input_entry_reader): Remove.
7472 (Sized_input_reader::do_arg_serial): New function.
7473 (Sized_input_reader::do_get_unused_symbol_count): New function.
7474 (Sized_input_reader::do_get_unused_symbol): New function.
7475 (Sized_incremental_binary::do_input_file_count): New function.
7476 (Sized_incremental_binary::do_get_input_reader): Change signature;
7477 use index instead of filename.
7478 (Sized_incremental_binary::section_map_): New data member.
7479 (Sized_incremental_binary::input_entry_readers_): New data member.
7480 (class Sized_incr_relobj): New class.
7481 (class Sized_incr_dynobj): New class.
7482 (make_sized_incremental_object): New function.
7483 (class Incremental_library): New class.
7484 * layout.cc (Free_list::num_lists): New static data member.
7485 (Free_list::num_nodes): New static data member.
7486 (Free_list::num_removes): New static data member.
7487 (Free_list::num_remove_visits): New static data member.
7488 (Free_list::num_allocates): New static data member.
7489 (Free_list::num_allocate_visits): New static data member.
7490 (Free_list::init): New function.
7491 (Free_list::remove): New function.
7492 (Free_list::allocate): New function.
7493 (Free_list::dump): New function.
7494 (Free_list::print_stats): New function.
7495 (Layout_task_runner::run): Resize output file for incremental updates.
7496 (Layout::Layout): Initialize new data members.
7497 (Layout::set_incremental_base): New function.
7498 (Layout::init_fixed_output_section): New function.
7499 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
7500 incremental updates.
7501 (Layout::create_gold_note): Do not create gold note section for
7502 incremental updates.
7503 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
7504 for incremental updates.
7505 (Layout::set_section_offsets): For incremental updates, allocate space
7506 from free list.
7507 (Layout::create_symtab_sections): Layout with offsets relative to
7508 start of section; for incremental updates, allocate space from free
7509 list.
7510 (Layout::create_shdrs): For incremental updates, allocate space from
7511 free list.
7512 (Layout::finish_dynamic_section): For incremental updates, do not
7513 check --as-needed (fixed in subsequent patch).
7514 * layout.h (class Free_list): New class.
7515 (Layout::set_incremental_base): New function.
7516 (Layout::incremental_base): New function.
7517 (Layout::init_fixed_output_section): New function.
7518 (Layout::allocate): New function.
7519 (Layout::incremental_base_): New data member.
7520 (Layout::free_list_): New data member.
7521 * main.cc (main): Print Free_list statistics.
7522 * object.cc (Relobj::finalize_incremental_relocs): Add
7523 clear_counts parameter; clear counts only when clear_counts is set.
7524 (Sized_relobj::Sized_relobj): Initialize new base class.
7525 (Sized_relobj::do_layout): Don't report special sections.
7526 (Sized_relobj::do_for_all_local_got_entries): New function.
7527 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
7528 symtab_off to all symbol table offsets.
7529 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
7530 * object.h (class Got_offset_list): Move to top of file.
7531 (Object::Object): Allow case where input_file == NULL.
7532 (Object::~Object): Likewise.
7533 (Object::input_file): Assert that input_file != NULL.
7534 (Object::lock): Allow case where input_file == NULL.
7535 (Object::unlock): Likewise.
7536 (Object::is_locked): Likewise.
7537 (Object::token): Likewise.
7538 (Object::release): Likewise.
7539 (Object::is_incremental): New function.
7540 (Object::get_mtime): New function.
7541 (Object::for_all_local_got_entries): New function.
7542 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
7543 (Object::set_is_in_system_directory): New function.
7544 (Object::is_in_system_directory): New function.
7545 (Object::do_is_incremental): New function.
7546 (Object::do_get_mtime): New function.
7547 (Object::do_for_all_local_got_entries): New function.
7548 (Object::is_in_system_directory_): New data member.
7549 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
7550 (class Sized_relobj_base): New class.
7551 (class Sized_relobj): Derive from Sized_relobj_base.
7552 (class Sized_relobj::Symbols): Redeclare from base class.
7553 (class Sized_relobj::local_got_offset_list): Remove.
7554 (class Sized_relobj::Output_sections): Redeclare from base class.
7555 (class Sized_relobj::do_for_all_local_got_entries): New function.
7556 (class Sized_relobj::write_local_symbols): Add offset parameter.
7557 (class Sized_relobj::local_symbol_offset_): Update comment.
7558 (class Sized_relobj::local_dynsym_offset_): Update comment.
7559 * options.cc (Input_arguments::add_file): Remove const.
7560 * options.h (Input_file_argument::Input_file_argument):
7561 Initialize arg_serial_ (all constructors).
7562 (Input_file_argument::set_arg_serial): New function.
7563 (Input_file_argument::arg_serial): New function.
7564 (Input_file_argument::arg_serial_): New data member.
7565 (Input_arguments::Input_arguments): Initialize file_count_.
7566 (Input_arguments::add_file): Remove const.
7567 (Input_arguments::number_of_input_files): New function.
7568 (Input_arguments::file_count_): New data member.
7569 (Command_line::number_of_input_files): Call
7570 Input_arguments::number_of_input_files.
7571 * output.cc (Output_segment_headers::Output_segment_headers):
7572 Set current size.
7573 (Output_section::Input_section::current_data_size): New function.
7574 (Output_section::Output_section): Initialize new data members.
7575 (Output_section::add_input_section): Don't do merge sections for
7576 an incremental link; allocate space from free list for an
7577 incremental update.
7578 (Output_section::add_output_section_data): Allocate space from
7579 free list for an incremental update.
7580 (Output_section::update_data_size): New function.
7581 (Output_section::set_fixed_layout): New function.
7582 (Output_section::reserve): New function.
7583 (Output_segment::set_section_addresses): Remove const.
7584 (Output_segment::set_section_list_addresses): Remove const; allocate
7585 space from free list for an incremental update.
7586 (Output_segment::set_offset): Adjust size of RELRO segment for an
7587 incremental update.
7588 * output.h (Output_data::current_data_size): Move here from
7589 child classes.
7590 (Output_data::pre_finalize_data_size): New function.
7591 (Output_data::update_data_size): New function.
7592 (Output_section_headers::update_data_size): new function.
7593 (Output_section_data_build::current_data_size): Move to Output_data.
7594 (Output_data_strtab::update_data_size): New function.
7595 (Output_section::current_data_size): Move to Output_data.
7596 (Output_section::set_fixed_layout): New function.
7597 (Output_section::has_fixed_layout): New function.
7598 (Output_section::reserve): New function.
7599 (Output_section::update_data_size): New function.
7600 (Output_section::has_fixed_layout_): New data member.
7601 (Output_section::free_list_): New data member.
7602 (Output_segment::set_section_addresses): Remove const.
7603 (Output_segment::set_section_list_addresses): Remove const.
7604 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
7605 New function.
7606 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
7607 New function.
7608 * readsyms.cc (Read_symbols::do_read_symbols): Add library
7609 parameter when calling Add_symbols constructor; store argument
7610 serial number for members of a lib group.
7611 (Add_symbols::locks): Allow case where token == NULL.
7612 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
7613 (Read_member::~Read_member): New function.
7614 (Read_member::is_runnable): New function.
7615 (Read_member::locks): New function.
7616 (Read_member::run): New function.
7617 (Check_script::~Check_script): New function.
7618 (Check_script::is_runnable): New function.
7619 (Check_script::locks): New function.
7620 (Check_script::run): New function.
7621 (Check_library::~Check_library): New function.
7622 (Check_library::is_runnable): New function.
7623 (Check_library::locks): New function.
7624 (Check_library::run): New function.
7625 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
7626 (Add_symbols::library_): New data member.
7627 (class Read_member): New class.
7628 (class Check_script): New class.
7629 (class Check_library): New class.
7630 * reloc.cc (Read_relocs::is_runnable): Allow case where
7631 token == NULL.
7632 (Read_relocs::locks): Likewise.
7633 (Scan_relocs::locks): Likewise.
7634 (Relocate_task::locks): Likewise.
7635 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
7636 to clear counters.
7637 (Sized_relobj::incremental_relocs_scan): Fix comment.
7638 (Sized_relobj::do_relocate): Pass output file offset to
7639 write_local_symbols.
7640 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
7641 from class declaration.
7642 * script.cc (read_input_script): Allocate Script_info; pass
7643 argument serial number to report_script.
7644 * script.h (class Script_info): Move to incremental.h.
7645 * symtab.cc (Symbol_table::add_from_incrobj): New function.
7646 * symtab.h (Symbol_table::add_from_incrobj): New function.
7647 (Symbol_table::set_file_offset): New function.
7648
b961d0d7
CC
76492011-04-05 Cary Coutant <ccoutant@google.com>
7650
7651 * incremental-dump.cc (dump_incremental_inputs): Change signature
7652 to take a Sized_incremental_binary; change caller. Use readers
7653 in Sized_incremental_binary.
7654 * incremental.cc
7655 (Sized_incremental_binary::find_incremental_inputs_sections):
7656 Rename do_find_incremental_inputs_sections to this.
7657 (Sized_incremental_binary::setup_readers): New function.
7658 (Sized_incremental_binary::do_check_inputs): Check
7659 has_incremental_info_ flag; move setup code to setup_readers;
7660 use input readers.
7661 (Sized_incremental_binary::do_file_is_unchanged): New function.
7662 (Sized_incremental_binary::do_get_input_reader): New function.
7663 * incremental.h (class Incremental_binary): Move to end of file.
7664 (Incremental_binary::file_is_unchanged): New function.
7665 (Incremental_binary::do_file_is_unchanged): New function.
7666 (Incremental_binary::Input_reader): New class.
7667 (Incremental_binary::get_input_reader): New function.
7668 (class Sized_incremental_binary): Move to end of file.
7669 (Sized_incremental_binary::Sized_incremental_binary): Setup the
7670 input section reader classes.
7671 (Sized_incremental_binary::has_incremental_info): New function.
7672 (Sized_incremental_binary::inputs_reader): New function.
7673 (Sized_incremental_binary::symtab_reader): New function.
7674 (Sized_incremental_binary::relocs_reader): New function.
7675 (Sized_incremental_binary::got_plt_reader): New function.
7676 (Sized_incremental_binary::do_file_is_unchanged): New function.
7677 (Sized_incremental_binary::Sized_input_reader): New class.
7678 (Sized_incremental_binary::get_input_reader): New function.
7679 (Sized_incremental_binary::find_incremental_inputs_sections):
7680 Rename do_find_incremental_inputs_sections to this.
7681 (Sized_incremental_binary::setup_readers): New function.
7682 (Sized_incremental_binary::has_incremental_info_): New data member.
7683 (Sized_incremental_binary::inputs_reader_): New data member.
7684 (Sized_incremental_binary::symtab_reader_): New data member.
7685 (Sized_incremental_binary::relocs_reader_): New data member.
7686 (Sized_incremental_binary::got_plt_reader_): New data member.
7687 (Sized_incremental_binary::current_input_file_): New data member.
7688
a869183f
PP
76892011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
7690
7691 PR gold/12640
7692 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
7693 violation.
7694
76952011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
7696
7697 * archive.cc (Archive::include_member): Adjust call to report_object.
7698 (Add_archive_symbols::run): Add script_info to call to
7699 report_archive_begin.
7700 (Lib_group::include_member): Adjust call to report_object.
7701 (Add_lib_group_symbols::run): Adjust call to report_object.
7702 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
7703 blocks. Add object count for script input files.
7704 * incremental.cc (Incremental_inputs::report_archive_begin): Add
7705 script_info parameter; change all callers.
7706 (Incremental_inputs::report_object): Add script_info parameter;
7707 change all callers.
7708 (Incremental_inputs::report_script): Store backpointer to
7709 incremental info entry.
7710 (Output_section_incremental_inputs::set_final_data_size): Record
7711 additional information for scripts.
7712 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7713 * incremental.h (Incremental_script_entry::add_object): New function.
7714 (Incremental_script_entry::get_object_count): New function.
7715 (Incremental_script_entry::get_object): New function.
7716 (Incremental_script_entry::objects_): New data member; adjust
7717 constructor.
7718 (Incremental_inputs::report_archive_begin): Add script_info parameter.
7719 (Incremental_inputs::report_object): Add script_info parameter.
7720 (Incremental_inputs_reader::get_object_count): New function.
7721 (Incremental_inputs_reader::get_object_offset): New function.
7722 * options.cc (Input_arguments::add_file): Return reference to
7723 new input argument.
7724 * options.h (Input_argument::set_script_info): New function.
7725 (Input_argument::script_info): New function.
7726 (Input_argument::script_info_): New data member; adjust all
7727 constructors.
7728 (Input_file_group::add_file): Return reference to new input argument.
7729 (Input_file_lib::add_file): Likewise.
7730 (Input_arguments::add_file): Likewise.
7731 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
7732 * script.cc (Parser_closure::Parser_closure): Add script_info
7733 parameter; adjust all callers.
7734 (Parser_closure::script_info): New function.
7735 (Parser_closure::script_info_): New data member.
7736 (read_input_script): Report scripts earlier to incremental info.
7737 (script_add_file): Set script_info in Input_argument.
7738 (script_add_library): Likewise.
7739 * script.h (Script_options::Script_info): Rewrite class.
7740
a869183f 77412011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
7742
7743 * archive.cc (Library_base::should_include_member): Move
7744 method here from class Archive.
7745 (Archive::Archive): Initialize base class.
7746 (Archive::should_include_member): Move to base class.
7747 (Archive::do_for_all_unused_symbols): New function.
7748 (Add_archive_symbols::run): Remove redundant access to
7749 incremental_inputs.
7750 (Lib_group::Lib_group): Initialize base class.
7751 (Lib_group::do_filename): New function.
7752 (Lib_group::include_member): Pass pointer to Lib_group to
7753 report_object.
7754 (Lib_group::do_for_all_unused_symbols): New function.
7755 (Add_lib_group_symbols::run): Report archive information for
7756 incremental links.
7757 * archive.h (class Library_base): New base class.
7758 (class Archive): Derive from Library_base.
7759 (Archive::filename): Move to base class.
7760 (Archive::set_incremental_info): Likewise.
7761 (Archive::incremental_info): Likewise.
7762 (Archive::Should_include): Likewise.
7763 (Archive::should_include_member): Likewise.
7764 (Archive::Armap_entry): Remove.
7765 (Archive::Unused_symbol_iterator): Remove.
7766 (Archive::unused_symbols_begin): Remove.
7767 (Archive::unused_symbols_end): Remove.
7768 (Archive::do_filename): New function.
7769 (Archive::do_get_mtime): New function.
7770 (Archive::do_for_all_unused_symbols): New function.
7771 (Archive::task_): Move to base class.
7772 (Archive::incremental_info_): Likewise.
7773 (class Lib_group): Derive from Library_base.
7774 (Lib_group::do_filename): New function.
7775 (Lib_group::do_get_mtime): New function.
7776 (Lib_group::do_for_all_unused_symbols): New function.
7777 (Lib_group::task_): Move to base class.
7778 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
7779 function.
7780 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
7781 function.
7782 * incremental.cc (Incremental_inputs::report_archive_begin):
7783 Use Library_base; call library's get_mtime; add incremental inputs
7784 entry before members.
7785 (class Unused_symbol_visitor): New class.
7786 (Incremental_inputs::report_archive_end): Use Library_base; use
7787 visitor class to record unused symbols; don't add incremental inputs
7788 entry after members.
7789 (Incremental_inputs::report_object): Use Library_base.
7790 * incremental.h
7791 (Incremental_archive_entry::Incremental_archive_entry): Remove
7792 unused Archive parameter.
7793 (Incremental_inputs::report_archive_begin): Use Library_base.
7794 (Incremental_inputs::report_archive_end): Likewise.
7795 (Incremental_inputs::report_object): Likewise.
7796 * object.cc (Sized_relobj::do_for_all_global_symbols): New
7797 function.
7798 * object.h (Object::for_all_global_symbols): New function.
7799 (Object::do_for_all_global_symbols): New function.
7800 (Sized_relobj::do_for_all_global_symbols): New function.
7801 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
7802 function.
7803 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
7804 function.
7805
61ab3e40
ILT
78062011-03-27 Ian Lance Taylor <iant@google.com>
7807
7808 * archive.cc (Archive::interpret_header): Return -1 if something
7809 goes wrong. Change callers accordingly.
7810
30e1f9e6
CC
78112011-03-25 Cary Coutant <ccoutant@google.com>
7812
7813 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
7814 * testsuite/Makefile.in: Regenerate.
7815
9370ce59 78162011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
7817
7818 * plugin.cc (get_view): New.
7819 (Plugin::load): Pass get_view to the plugin.
7820 (Plugin_manager::get_view): New.
7821
9312bb0a
ILT
78222011-03-21 Ian Lance Taylor <iant@google.com>
7823
7824 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 7825 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 7826
7e12ba9e
ST
78272011-03-21 Sriraman Tallam <tmsriram@google.com>
7828
7829 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
7830 Change == to -eq.
7831 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
7832 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
7833 Change == to -eq.
7834 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
7835 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
7836
fd7a005d
ILT
78372011-03-14 Ian Lance Taylor <iant@google.com>
7838
7839 * script-sections.cc (Sort_output_sections::script_compare):
7840 Rename from is_before, change return type.
7841 (Sort_output_sections::operator()): Adjust accordingly.
7842
ed16fd1b
ILT
78432011-03-11 Jeffrey Yasskin <jyasskin@google.com>
7844
7845 PR gold/12572
7846 * testsuite/odr_violation2.cc: Add comment to make all error line
7847 numbers double digits.
7848 * testsuite/debug_msg.sh: Adjust expected errors.
7849
71ff8986
ILT
78502011-03-09 Jeffrey Yasskin <jyasskin@google.com>
7851
7852 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
7853 but mark earlier ones as non-canonical
7854 (offset_to_iterator): Update search target and example
7855 (do_addr2line): Return extra lines in a vector*
7856 (format_file_lineno): Extract from do_addr2line
7857 (one_addr2line): Add vector* out-param
7858 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
7859 when a lineno entry appeared last for its instruction
7860 (Dwarf_line_info): Add vector* out-param
7861 * object.cc (Relocate_info): Pass NULL for the vector* out-param
7862 * symtab.cc (Odr_violation_compare): Include the lineno in the
7863 comparison again.
7864 (linenos_from_loc): New. Combine the canonical line for an
7865 address with its other lines.
7866 (True_if_intersect): New. Helper functor to make
7867 std::set_intersection a query.
7868 (detect_odr_violations): Compare sets of lines instead of just
7869 one line for each function. This became less deterministic, but
7870 has fewer false positives.
7871 * symtab.h: Declarations.
7872 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
7873 mix an optimized and non-optimized object in the same binary
7874 (odr_violation2.so): Same.
7875 * testsuite/Makefile.in: Regenerate from Makefile.am.
7876 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
7877 * testsuite/debug_msg.sh: Update line numbers and add
7878 assertions.
7879 * testsuite/odr_violation1.cc: Use OdrDerived, in a
7880 non-optimized context.
7881 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
7882 isn't inlined, and use OdrDerived in an optimized context.
7883 * testsuite/odr_header1.h: Defines OdrDerived, where
7884 optimization will change the
7885 first-instruction-in-the-destructor's file and line number.
7886 * testsuite/odr_header2.h: Defines OdrBase.
7887
a19fefdc
ILT
78882011-03-09 Ian Lance Taylor <iant@google.com>
7889
7890 * fileread.cc (File_read::clear_views): Don't delete the whole
7891 file view.
7892
ecb351e9
ILT
78932011-03-08 Ian Lance Taylor <iant@google.com>
7894
7895 PR gold/12525
7896 * fileread.cc: #include <climits>.
7897 (GOLD_IOV_MAX): Define.
7898 (File_read::read_multiple): Limit number of entries by iov_max.
7899 * fileread.h (class File_read): Always set max_readv_entries to
7900 128.
7901
b821d13c
ILT
79022011-03-07 Ian Lance Taylor <iant@google.com>
7903
7904 PR gold/12525
7905 * options.h (class General_options): Add -dy and -dn.
7906
89243142
CC
79072011-03-02 Cary Coutant <ccoutant@google.com>
7908
7909 * testsuite/script_test_9.t: Add TLS segment.
7910
d0773f31
ILT
79112011-03-02 Simon Baldwin <simonb@google.com>
7912
7913 * configure.ac: Add check for gnu_indirect_function support in
7914 the toolchain building binutils.
7915 * configure: Rebuild.
7916
9370ce59 79172011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
7918
7919 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
7920 plugin only symbols.
7921 (Symbol_table::sized_finalize_symbol) Mark symbol only present
7922 in plugin files as not needed in the symbol table.
7923
4cf7a849
ST
79242011-02-11 Sriraman Tallam <tmsriram@google.com>
7925
7926 * output.cc (Output_section::add_input_section): Delay fill
7927 generation for section ordering.
7928
b578bd7d
ILT
79292011-02-09 Ian Lance Taylor <iant@google.com>
7930
7931 PR gold/12316
7932 * object.h (class Sized_relobj): Remove clear_local_symbols.
7933 * reloc.cc (Sized_relobj::do_relocate): Don't call
7934 clear_local_symbols.
7935
9370ce59 79362011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
7937
7938 * plugin.cc (is_visible_from_outside): Return true for symbols
7939 in the -u option.
7940
55382fb7
ILT
79412011-02-04 Jeffrey Yasskin <jyasskin@google.com>
7942
7943 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
7944 filename.
7945
4e271fff
ST
79462011-02-02 Sriraman Tallam <tmsriram@google.com>
7947
7948 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 7949 to std::string.
4e271fff 7950 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 7951 section_name to be std::string.
4e271fff
ST
7952 (is_function_ctor_or_dtor): Change type of parameter to std::string.
7953
d433c3ac
ILT
79542011-01-25 Ian Lance Taylor <iant@google.com>
7955
7956 * script.cc (script_add_extern): Rewrite to use
7957 add_symbol_reference.
7958
880473a6
DK
79592011-01-25 Doug Kwan <dougkwan@google.com>
7960
d433c3ac 7961 * icf.cc (get_section_contents): Always lock section's object.
880473a6 7962
f30f86fa
ILT
79632011-01-24 Ian Lance Taylor <iant@google.com>
7964
7965 * options.h (class General_options): Accept
7966 --no-detect-odr-violations.
7967
8e51a0b9
ILT
79682011-01-24 Ian Lance Taylor <iant@google.com>
7969
7970 * version.cc (version_string): Bump to 1.11.
7971
0f3b89d8
ILT
79722011-01-24 Ian Lance Taylor <iant@google.com>
7973
7974 * plugin.cc (class Plugin_rescan): Define new class.
7975 (Plugin_manager::claim_file): Set any_claimed_.
7976 (Plugin_manager::save_archive): New function.
7977 (Plugin_manager::save_input_group): New function.
7978 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
7979 necessary.
7980 (Plugin_manager::new_undefined_symbol): New function.
7981 (Plugin_manager::rescan): New function.
7982 (Plugin_manager::rescannable_defines): New function.
7983 (Plugin_manager::add_input_file): Set any_added_.
7984 * plugin.h (class Plugin_manager): define new fields rescannable_,
7985 undefined_symbols_, any_claimed_, and any_added_. Declare
7986 Plugin_rescan as friend. Declare new functions.
7987 (Plugin_manager::Rescannable): Define type.
7988 (Plugin_manager::Rescannable_list): Define type.
7989 (Plugin_manager::Undefined_symbol_list): Define type.
7990 (Plugin_manager::Plugin_manager): Initialize new fields.
7991 * archive.cc (Archive::defines_symbol): New function.
7992 (Add_archive_symbols::run): Pass archive to plugins if any.
7993 * archive.h (class Archive): Declare defines_symbol.
7994 * readsyms.cc (Input_group::~Input_group): New function.
7995 (Finish_group::run): Pass input_group to plugins if any.
7996 * readsyms.h (class Input_group): Declare destructor.
7997 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
7998 any.
7999
3bb951e5
ILT
80002011-01-10 Ian Lance Taylor <iant@google.com>
8001
8002 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
8003 section as relro.
8004 (Layout::set_segment_offsets): Reset increase_relro before calling
8005 set_section_addresses a second time.
8006
0aa45fac
CC
80072011-01-04 Cary Coutant <ccoutant@google.com>
8008
8009 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
8010 sections before NOBITS sections.
8011
0db46eb4
L
80122011-01-01 H.J. Lu <hongjiu.lu@intel.com>
8013
8014 * version.cc (print_version): Update copyright to 2011.
8015
829c9745
CC
80162010-12-23 Cary Coutant <ccoutant@google.com>
8017
8018 * output.h (Output_data_reloc::add_output_section): Pass OD instead
8019 of OS to this->add. Add OD parameter to second form of the function.
8020
7500420b
ILT
80212010-12-20 Ian Lance Taylor <iant@google.com>
8022
8023 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
8024 second of two consecutive entries with same offset.
8025
f8e9a930
RW
80262010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8027
8028 * testsuite/Makefile.am (ifuncmain2static_LDADD)
8029 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
8030 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
8031 to avoid unneeded links against $(LDADD).
8032 * testsuite/Makefile.in: Regenerate.
8033
2fbb4320
ILT
80342010-12-15 Ian Lance Taylor <iant@google.com>
8035
8036 PR gold/12324
8037 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
8038 for R_X86_64_32 and R_X86_64_PC32.
8039 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
8040 ver_matching_def_pic.o.
8041 (ver_matching_def_pic.o): New target.
8042
fedb228d
RW
80432010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8044
8045 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
8046 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
8047 Move definition before File_read::View member definitions.
8048 (File_read::View::~View): Initialize and hold lock before
8049 updating current_mapped_bytes.
8050
9b547ce6
RW
80512010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8052
8053 * dwarf_reader.cc: Remove outdated comment.
8054 * gold-threads.cc: Fix typo in error message.
8055 * archive.cc: Fix typos in comments.
8056 * archive.h: Likewise.
8057 * arm-reloc-property.cc: Likewise.
8058 * arm-reloc-property.h: Likewise.
8059 * arm-reloc.def: Likewise.
8060 * arm.cc: Likewise.
8061 * attributes.h: Likewise.
8062 * cref.cc: Likewise.
8063 * ehframe.cc: Likewise.
8064 * fileread.h: Likewise.
8065 * gold.h: Likewise.
8066 * i386.cc: Likewise.
8067 * icf.cc: Likewise.
8068 * incremental.h: Likewise.
8069 * int_encoding.cc: Likewise.
8070 * layout.h: Likewise.
8071 * main.cc: Likewise.
8072 * merge.h: Likewise.
8073 * object.cc: Likewise.
8074 * object.h: Likewise.
8075 * options.cc: Likewise.
8076 * readsyms.cc: Likewise.
8077 * reduced_debug_output.cc: Likewise.
8078 * reloc.cc: Likewise.
8079 * script-sections.cc: Likewise.
8080 * sparc.cc: Likewise.
8081 * symtab.h: Likewise.
8082 * target-reloc.h: Likewise.
8083 * target.cc: Likewise.
8084 * target.h: Likewise.
8085 * timer.cc: Likewise.
8086 * timer.h: Likewise.
8087 * x86_64.cc: Likewise.
8088
83e17bd5
CC
80892010-12-09 Cary Coutant <ccoutant@google.com>
8090
8091 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
8092 stack.
8093 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
8094 parameter; change all callers.
8095 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
8096 * options.h (warn_execstack): New option.
8097
017257f8
DK
80982010-12-07 Doug Kwan <dougkwan@google.com>
8099
8100 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
8101 like function call relocations.
8102
c20cbc06
ILT
81032010-12-07 Ian Lance Taylor <iant@google.com>
8104
8105 * archive.cc (Archive::get_elf_object_for_member): Permit
8106 punconfigured to be NULL.
8107 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
8108 (Archive::include_member): Pass NULL to get_elf_object_for_member
8109 if we searched for the archive and this is the first included
8110 object.
8111
4dbfafcc
ILT
81122010-12-01 Ian Lance Taylor <iant@google.com>
8113
8114 * dwarf_reader.h (class Sized_dwarf_line_info): Add
8115 track_relocs_type_ field.
8116 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8117 Set track_relocs_type_.
8118 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
8119 contents when using RELA relocs.
8120 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
8121 reloc_map_.
8122 * reloc.cc (Track_relocs::next_addend): New function.
8123 * reloc.h (class Track_relocs): Declare next_addend.
8124
e5e19edd
ILT
81252010-12-01 Ian Lance Taylor <iant@google.com>
8126
8127 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
8128 virtual destructor.
8129
9a5ce24c
ILT
81302010-12-01 Ian Lance Taylor <iant@google.com>
8131
8132 * README: Update compilers known to work and fail.
8133
c7791212
NC
81342010-11-23 Matthias Klose <doko@ubuntu.com>
8135
8136 * configure.in: For --enable-gold, handle value `default' instead of
8137 `both*'. Always install ld as ld.bfd, install as ld if gold is
8138 not the default.
8139 * configure: Regenerate.
8140
0ad220c9
DK
81412010-11-18 Doug Kwan <dougkwan@google.com>
8142
8143 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
8144 and right_alignment to be zero. Store result alignment only if it is
8145 greater than existing alignment.
8146
ab8056e0
CC
81472010-11-16 Cary Coutant <ccoutant@google.com>
8148
8149 PR gold/12220
8150 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8151 Check for ".zdebug_line".
8152
fd064a5b
CC
81532010-11-16 Doug Kwan <dougkwan@google.com>
8154 Cary Coutant <ccoutant@google.com>
8155
8156 * output.h (Output_segment::set_section_addresses): Pass increase_relro
8157 by reference; adjust all callers.
8158 * output.cc (Output_segment::set_section_addresses): Adjust references
8159 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
8160 list is empty.
8161 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
8162 end at page boundary.
8163
6fc6ea19
CC
81642010-11-16 Cary Coutant <ccoutant@google.com>
8165
8166 PR gold/12220
8167 * layout.cc (Layout::choose_output_section): Transform names of
8168 compressed sections even when using a script with a SECTIONS clause.
8169 (Layout::output_section_name): Remove code to transform
8170 compressed debug section names.
8171 * output.cc (Output_section::add_input_section): Use uncompressed
8172 section size when tracking input sections.
8173
95a2c8d6
RS
81742010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
8175
8176 * symtab.h (Symbol::NON_PIC_REF): Remove.
8177 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
8178 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
8179 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
8180 (Symbol::use_plt_offset): Take a flags argument and pass it
8181 directly to needs_dynamic_reloc. Restrict check for undefined
8182 weak symbols to function calls.
8183 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
8184 (Target_arm::Scan::global): Use it.
8185 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
8186 (Target_arm::Relocate::relocate): Likewise.
8187 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
8188 parameter with an r_type parameter. Use get_reference_flags
8189 to get the flags.
8190 (Target_arm::Relocate::relocate): Update accordingly.
8191 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
8192 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
8193 (Target_i386::Scan::global): Likewise.
8194 (Target_i386::Relocate::relocate): Likewise.
8195 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
8196 parameter with an r_type parameter. Use get_reference_flags
8197 to get the flags.
8198 (Target_i386::Relocate::relocate): Update accordingly.
8199 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
8200 (Target_powerpc::Scan::global): Use it.
8201 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
8202 (Target_powerpc::Relocate::relocate): Likewise.
8203 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
8204 (Target_sparc::Scan::global): Use it.
8205 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
8206 (Target_sparc::Relocate::relocate): Likewise.
8207 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
8208 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
8209 (Target_x86_64::Scan::global): Likewise.
8210 (Target_x86_64::Relocate::relocate): Likewise.
8211
f625ae50
DK
82122010-11-08 Doug Kwan <dougkwan@google.com>
8213 Cary Coutant <ccoutant@google.com>
8214
8215 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
8216 (Arm_exidx_merge_section::section_contents_): New data member.
8217 (Arm_input_section::Arm_input_section): Initialize original_contents_.
8218 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 8219 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
8220 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
8221 in parameters instead of calling Object::section_contents without
8222 locking.
8223 (Arm_output_section::group_section): New parameter TASK. Pass it
8224 to callees that need locking objects.
8225 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
8226 to lock EXIDX input sections. Fix a formatting issue. Call
8227 Arm_exidx_merged_section::build_contents to create merged section
8228 contents.
8229 (Arm_output_section::create_stub_group): New parameter TASK. Use it
8230 to lock object of stub table owner.
8231 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
8232 TEXT_SIZE to initialize data member TEXT_SIZE_.
8233 (Arm_exidx_input_section::addralign): Fix typo in comment.
8234 (Arm_exidx_input_section::text_size): New method.
8235 (Target_arm::do_relax): New parameter TASK. Pass it to callees
8236 that require locking objects. Lock objects before scanning for stubs
8237 and updating local symbols.
8238 (Arm_input_section<big_endian>::init): Copy contents of original
8239 input section.
2e702c99 8240 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
8241 original input section instead of calling Object::section_contents
8242 without locking.
8243 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
8244 size without calling Object::section_size().
8245 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
8246 for size. Allocate a buffer for merged EXIDX entries.
8247 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 8248 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
8249 building code to Arm_exidx_merged_section::build_contetns. Write
8250 out contetns in buffer instead of building it on the fly.
8251 (Arm_relobj::make_exidx_input_section): Also pass text section size
8252 to Arm_exidx_input_section constructor.
8253 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
8254 (Arm_dynobj::do_read_symbols): Fix memory leak.
8255 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
8256 * target.h: (class Task): Add forward declaration.
8257 (Target::relax): Add new parameter TASK and pass it to
8258 Target::do_relax().
8259 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
8260
5f9bcf58
CC
82612010-11-05 Cary Coutant <ccoutant@google.com>
8262
8263 PR gold/10708
8264 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
8265 object when reading from the file.
8266 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
8267 second layout pass.
8268 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
8269 when reading section contents.
8270 (get_section_contents): Likewise.
8271 (icf::find_identical_sections): Likewise.
8272 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
8273 object when reading from the file.
8274 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
8275 the object when doing deferred section layout.
8276
e597fa08
NC
82772010-11-03 Nick Clifton <nickc@redhat.com>
8278
8279 PR gold/12001
8280 * script.h (class Symbol_assignment: name): New member. Returns
8281 the name of the symbol.
8282 * scrfipt.cc (Script_options::is_pending_assignment): New member.
8283 Returns true if the given symbol name is on the list of
8284 assignments wating to be processed.
8285 * archive.cc (should_incldue_member): If the symbol is undefined,
8286 check to see if it is on the list of symbols pending assignment.
8287
3f9a3278
ILT
82882010-11-03 Ryan Mansfield <rmansfield@qnx.com>
8289
8290 * script-sections.cc (Script_sections::find_memory_region): Check
8291 for a NULL output section pointer.
8292
d06fb4d1
DK
82932010-10-29 Doug Kwan <dougkwan@google.com>
8294
8295 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
8296 Output_section::add_relaxed_input_section.
8297 * output.cc (Output_section::add_relaxed_input_section): Add new
8298 arguments LAYOUT and NAME. Set section order index.
8299 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
8300 Copy section order index.
8301 * output.h (Output_section::add_relaxed_input_section): Add new
8302 arguments LAYOUT and NAME.
8303
90e24de5
ILT
83042010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8305
8306 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 8307 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
8308 * testsuite/Makefile.in: Regenerate.
8309
c9484ea5
DK
83102010-10-20 Doug Kwan <dougkwan@google.com>
8311
8312 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
8313 without SHF_LINK_ORDER flags.
8314 * layout.cc (Layout::choose_output_section): Do not filter
8315 SHF_LINK_ORDER flag in a relocatable link.
8316
5bc2f5be
CC
83172010-10-17 Cary Coutant <ccoutant@google.com>
8318
8319 * output.h (Output_segment::set_section_addresses): Change function
8320 signature. Update all callers.
8321 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
8322 sections.
8323 (Output_segment::set_section_addresses): Align after last TLS
8324 section. Add padding before last relro section instead of after.
8325
0c91cf04
DK
83262010-10-17 Doug Kwan <dougkwan@google.com>
8327
8328 * gold/arm.cc (Target_arm::got_section): Use correct order and set
8329 GOT output section to be writable.
8330
8c21d9d3
CC
83312010-10-14 Cary Coutant <ccoutant@google.com>
8332
8333 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
8334 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
8335 * gold.cc (queue_initial_tasks): Check parameters for incremental link
8336 mode.
8337 * incremental.cc (report_command_line): Ignore all forms of
8338 --incremental.
8339 * layout.cc (Layout::Layout): Check parameters for incremental link
8340 mode.
8341 * options.cc (General_options::parse_incremental): New function.
8342 (General_options::parse_no_incremental): New function.
8343 (General_options::parse_incremental_full): New function.
8344 (General_options::parse_incremental_update): New function.
8345 (General_options::incremental_mode_): New data member.
8346 (General_options::finalize): Check incremental_mode_.
8347 * options.h (General_options): Update help text for --incremental.
8348 Add --no-incremental, --incremental-full, --incremental-update.
8349 (General_options::Incremental_mode): New enum type.
8350 (General_options::incremental_mode): New function.
8351 (General_options::incremental_mode_): New data member.
8352 * parameters.cc (Parameters::incremental_mode_): New data member.
8353 (Parameters::set_options): Set incremental_mode_.
8354 (Parameters::set_incremental_full): New function.
8355 (Parameters::incremental): New function.
8356 (Parameters::incremental_update): New function.
8357 (set_parameters_incremental_full): New function.
8358 * parameters.h (Parameters::set_incremental_full): New function.
8359 (Parameters::incremental): New function.
8360 (Parameters::incremental_update): New function.
8361 (Parameters::incremental_mode_): New data member.
8362 (set_parameters_incremental_full): New function.
8363 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
8364 incremental link mode.
8365 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
8366 (Sized_relobj::do_relocate_sections): Likewise.
8367 * testsuite/Makefile.am (incremental_test): Use --incremental-full
8368 option.
8369 * testsuite/Makefile.in: Regenerate.
8370 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 8371
bb32aa18 83722010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
8373
8374 * script-sections.h (class Script_sections): Make
8375 Sections_elements typedef public.
8376 * script-sections.cc (class Sort_output_sections): Add elements_
8377 field. Add constructor which sets it; change all callers.
8378 (Sort_output_sections::is_before): New function.
8379 (Sort_output_sections::operator()): Call is_before.
8380 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
8381 conditional.
8382 * testsuite/script_test_10.sh: New test. Test script section
8383 order.
8384 * testsuite/script_test_10.t: Likewise.
8385 * testsuite/script_test_10.s: Likewise.
8386 * testsuite/Makefile.am: Wrap the cross linker tests and the
8387 common tests into NATIVE_OR_CROSS_LINKER.
8388 (check_SCRIPTS): Add script_test_10.sh.
8389 (check_DATA): Add script_test_10.stdout.
8390 (script_test_10.o, script_test_10): New targets.
8391 (script_test_10.stdout): New target.
8392 * configure, testsuite/Makefile.in: Regenerate.
8393
3cef7179
ILT
83942010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8395
8396 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
8397 error for the deprecated relocations.
8398 (Target_arm::Scan::global): Likewise.
8399 (Target_arm::Relocate::relocate): Likewise.
8400
7411e9a8
RS
84012010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
8402
8403 * fileread.cc (Input_file::find_file): Initialize *found_name
8404 and *namep when using the fallback search for case 4.
8405
6a9da32a
CC
84062010-10-11 Cary Coutant <ccoutant@google.com>
8407
8408 * options.h (class General_options): Redefine -z lazy as an alias for
8409 the negation of -z now.
8410
ac897c20
ILT
84112010-10-11 Ian Lance Taylor <iant@google.com>
8412
8413 * resolve.cc (symbol_to_bits): Report the value of the unsupported
8414 binding.
8415
ea5cae92
NC
84162010-10-06 Nick Clifton <nickc@redhat.com>
8417
8418 * script-sections.cc(class Memory_region): Remove
8419 current_lma_offset_ field. Rename current_vma_offset_ to
8420 current_offset_. Add last_section_ field.
8421 (Memory_region::get_current_vma_address): Rename to
8422 get_current_address.
8423 (Memory_region::get_current_lma_address): Delete.
8424 (Memory_region::increment_vma_offset): Rename to
8425 increment_offset.
8426 (Memory_region::increment_lma_offset): Delete.
8427 (Memory_region::attributes_compatible): New method. Returns
8428 true if the provided section is compatible with the region.
8429 (Memory_region::get_last_section): New method. Returns the last
8430 section to use the region.
8431 (Memory_region::set_last_section): New method. Stores the last
8432 section to use the region.
8433 (Script_sections::block_in_region): New method. Returns true if
8434 a block of memory is contained within a region.
8435 (Script_sections::find_memory_region): New method. Locates a
8436 memory region to be used to set a VMA or LMA address.
8437 (Output_section_definition::set_section_addresses): Add code to
8438 check for addresses set by memory regions.
8439 (Output_segment::set_section_addresses): Remove memory region
8440 walking code.
8441 (Script_sections::create_segment): Add a warning if a header
8442 segment is created outside of any region.
8443 * script-sections.h (class Script_sections): Add prototypes for
8444 find_memory_region and block_in_region methods.
8445 * testsuite/memory_test.s: Use .long instead of .word.
8446 * testsuite/memory_test.t: Add some more output sections.
8447 * testsuite/memory_test.sh: Update expected output.
8448
a9bfd952
DK
84492010-10-02 Doug Kwan <dougkwan@google.com>
8450
8451 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
8452 defintion to symtab.h
8453 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
8454 declaration to defintion.
8455
bacff3ab
NC
84562010-10-01 Nick Clifton <nickc@redhat.com>
8457
8458 * expression.cc (eval): Replace dummy argument with NULL.
8459 (eval_maybe_dot): Check for a NULL result section pointer.
8460 (Symbol_expression::value): Likewise.
8461 (Dot_expression::value): Likewise.
8462 (BINARY_EXPRESSION): Likewise.
8463 (Max_expression::value): Likewise.
8464 (Min_expression::value): Likewise.
8465 (Absolute_expression::value): Likewise.
8466 (Addr_expression::value_from_output_section): Likewise.
8467 (Loaddddr_expression::value_from_output_section): Likewise.
8468 (Segment_start_expression::value): Likewise.
8469 * script-sections.cc
8470 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
8471 argument with NULL.
8472 (Sections_elememt_dot_assignment::set_section_addresses):
8473 Likewise.
8474 (Output_data_expression::do_write_to_buffer): Likewise.
8475 (Output_section_definition::finalize_symbols): Likewise.
8476 (Output_section_definition::set_section_addresses): Likewise.
8477
f81bc8b5
DK
84782010-09-30 Doug Kwan <dougkwan@google.com>
8479
8480 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
8481
c95e9f27
ST
84822010-09-28 Sriraman Tallam <tmsriram@google.com>
8483
8484 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 8485 function.
c95e9f27
ST
8486 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
8487 virtual function.
8488 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
8489 virtual function.
8490 * icf.cc (get_section_contents): Inline merge sections only when
8491 target allows it.
8492
3cac54d2
RW
84932010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8494
8495 * configure: Regenerate.
8496
2904037a
ILT
84972010-09-17 Ian Lance Taylor <iant@google.com>
8498
8499 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
8500 * testsuite/Makefile.am (memory_test.o): New target.
8501 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
8502 memory_test.t.
8503 * testsuite/Makefile.in: Rebuild.
2904037a 8504
bca7fb63
DK
85052010-09-17 Doug Kwan <dougkwan@google.com>
8506
8507 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
8508 defintion if relocation uses GOT entries of the symbol.
8509 * testsuite/icf_safe_test.sh: Fix test.
8510 * testsuite/icf_safe_so_test.sh: Fix test.
8511
4ef28648
CC
85122010-09-16 Cary Coutant <ccoutant@google.com>
8513
8514 * script_sections.cc (class Memory_region): Remove "NULL" from
8515 vector initializations.
8516
793990de
CC
85172010-09-15 Cary Coutant <ccoutant@google.com>
8518
8519 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
8520 Resolve forwarding symbols.
8521
81e015e2
DK
85222010-09-15 Doug Kwan <dougkwan@google.com>
8523
8524 * gold/testsuite/script_test_3.t: Add ARM special sections.
8525 * gold/testsuite/script_test_4.t: Same.
8526 * gold/testsuite/script_test_5.t: Same.
8527 * gold/testsuite/script_test_6.t: Same.
8528 * gold/testsuite/script_test_7.t: Same.
8529 * gold/testsuite/script_test_7.t: Same.
8530 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
8531
36171d64
CC
85322010-09-14 Cary Coutant <ccoutant@google.com>
8533
8534 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
8535 (Target_x86_64::Relocate::relocate_tls): Replace check for
8536 saw_tls_block_reloc_ with test for executable section.
8537
d89051bd
CC
85382010-09-12 Cary Coutant <ccoutant@google.com>
8539
8540 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
8541 position-independent executables to shared libraries need dynamic
8542 relocations.
8543 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
8544 position-independent executables.
8545 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
8546 * testsuite/Makefile.in: Regenerate.
8547
fca41f0f
NC
85482010-09-10 Nick Clifton <nickc@redhat.com>
8549
8550 PR gold/11997
8551 * testsuite/memory_test.t: Discard any sections that are not
8552 needed.
8553
6695e4b3
L
85542010-09-09 H.J. Lu <hongjiu.lu@intel.com>
8555
8556 PR gold/11996
8557 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
8558 "This::" to work around a bug in gcc 4.2.
8559
8560 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
8561
0f72bf6f
RÁE
85622010-09-09 Rafael Espindola <espindola@google.com>
8563
8564 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
8565 sections with different PF_X flags in the same segment.
8566 (Layout::find_first_load_seg): Search all segments to find the first
8567 one.
8568 * options.h (rosegment): New.
8569
85702010-09-08 Rafael Espindola <espindola@google.com>
a6577478 8571
05a79166 8572 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 8573
aa98ff75
DK
85742010-09-08 Doug Kwan <dougkwan@google.com>
8575
8576 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
8577 (Arm_relobj::do_relocate_sections): Add new parameter for output
8578 file to match the parent.
8579 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
8580 of local symbols instead of input values. Update code to track
8581 changes in gold::relocate_section.
8582 * object.cc (Sized_relobj::compute_final_local_value): New methods.
8583 (Sized_relobj::compute_final_local_value_internal): New methods.
8584 (Sized_relobj::do_finalize_local_symbols): Move code from loop
8585 body into private version of Sized_relobj::compute_final_local_value.
8586 Call the inline method.
8587 * object.h (Symbol_value::Symbol_value): Define destructor. Free
8588 merged symbol value if there is one.
8589 (Symbol_value::has_output_value): New method defintiion.
8590 (Sized_relobj::Compute_final_local_value_status): New enum type.
8591 (Sized_relobj::compute_final_local_value): New methods.
8592 (Sized_relobj::compute_final_local_value_internal): New methods.
8593 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
8594 and arm_cortex_a8.sh.
8595 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
8596 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
8597 New tests.
8598 * Makefile.in: Regenerate.
8599 * testsuite/arm_bl_out_of_range.s: Update test.
8600 * testsuite/thumb_bl_out_of_range.s: Ditto.
8601 * testsuite/thumb_blx_out_of_range.s: Ditto.
8602 * testsuite/arm_branch_out_of_range.sh: New file.
8603 * testsuite/arm_cortex_a8.sh: Ditto.
8604 * testsuite/arm_cortex_a8_b.s: Ditto.
8605 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
8606 * testsuite/arm_cortex_a8_b_local.s: Ditto.
8607 * testsuite/arm_cortex_a8_bl.s: Ditto.
8608 * testsuite/arm_cortex_a8_blx.s: Ditto.
8609 * testsuite/arm_cortex_a8_local.s: Ditto.
8610 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
8611 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
8612
05a79166
L
86132010-09-08 Rafael Espindola <espindola@google.com>
8614
8615 * Makefile.am (memory_test.stdout): Run readelf with -W.
8616 * Makefile.in: Regenerate.
8617 * testsuite/memory_test.sh: Make the regexps accept both 32 and
8618 64 bit output.
8619
33dbc701
RÁE
86202010-09-08 Rafael Espindola <espindola@google.com>
8621
8622 * script-sections.cc (Script_sections::add_memory_region): Convert
8623 field precision to int.
8624 * script.cc (script_set_section_region, script_set_section_region):
8625 Convert field precision to int.
8626
731ca54a
RÁE
86272010-09-08 Rafael Espindola <espindola@google.com>
8628
8629 * arm.cc (do_finalize_sections): Create the __exidx_start and
8630 __exdix_end symbols even when the section is missing.
8631
7f8cd844
NC
86322010-09-08 Nick Clifton <nickc@redhat.com>
8633
8634 * README: Remove claim that MEMORY is not supported.
8635 * expression.cc (script_exp_function_origin)
8636 (script_exp_function_length): Move from here to ...
8637 * script.cc: ... here.
8638 (script_set_section_region, script_add_memory)
8639 (script_parse_memory_attr, script_include_directive): New
8640 functions.
8641 * script-sections.cc
8642 (class Memory_region): New class.
8643 (class Output_section_definition): Add set_memory_region,
8644 set_section_vma, set_section_lma and get_section_name methods.
8645 (class Script_Sections): Add add_memory_region,
8646 find_memory_region, find_memory_region_origin,
8647 find_memory_region_length and set_memory_region methods.
8648 Have set_section_addresses method walk the list of set memory
8649 regions.
8650 Extend the print methos to display memory regions.
8651 * script-sections.h: Add prototypes for new methods.
8652 Add enum for MEMORY region attributes.
8653 * yyscript.y: Add support for parsing MEMORY regions.
8654 * script-c.h: Add prototypes for new functions.
8655 * testsuite/Makefile.am: Add test of MEMORY region functionality.
8656 * testsuite/Makefile.in: Regenerate.
8657 * testsuite/memory_test.sh: New script.
8658 * testsuite/memory_test.s: New assembler source file.
8659 * testsuite/memory_test.t: New linker script.
8660
a4649286
DK
86612010-08-27 Doug Kwan <dougkwan@google.com>
8662
8663 * gold/resolve.cc (Symbol_table::should_override): Let a weak
8664 reference override an existing dynamic weak reference.
8665 * testsuite/Makefile.am: Add new test dyn_weak_ref.
8666 * testsuite/Makefile.in: Regenerate.
8667 * testsuite/dyn_weak_ref.sh: New file.
8668 * testsuite/dyn_weak_ref_1.c: Ditto.
8669 * testsuite/dyn_weak_ref_2.c: Ditto.
8670
b56648ad
ILT
86712010-08-27 Ian Lance Taylor <iant@google.com>
8672
8673 * incremental.h (class Incremental_input_entry): Add virtual
8674 destructor.
8675
809313cb
ILT
86762010-08-27 Ian Lance Taylor <iant@google.com>
8677
8678 * testsuite/start_lib_test_3.c: Mark t3 as used.
8679
11e32464
NC
86802010-08-27 Nick Clifton <nickc@redhat.com>
8681
8682 * options.cc (version_script): Fix small typo in previous
8683 whitespace tidyup.
8684
ca09d69a
NC
86852010-08-25 Nick Clifton <nickc@redhat.com>
8686
8687 * archive.cc: Formatting fixes: Remove whitespace between
8688 typename and following asterisk. Remove whitespace between
8689 function name and opening parenthesis.
8690 * archive.h: Likewise.
8691 * arm.cc: Likewise.
8692 * attributes.cc: Likewise.
8693 * attributes.h: Likewise.
8694 * common.cc: Likewise.
8695 * copy-relocs.cc: Likewise.
8696 * dirsearch.h: Likewise.
8697 * dynobj.cc: Likewise.
8698 * ehframe.cc: Likewise.
8699 * ehframe.h: Likewise.
8700 * expression.cc: Likewise.
8701 * fileread.cc: Likewise.
8702 * fileread.h: Likewise.
8703 * gc.h: Likewise.
8704 * gold-threads.cc: Likewise.
8705 * gold.cc: Likewise.
8706 * i386.cc: Likewise.
8707 * icf.h: Likewise.
8708 * incremental-dump.cc: Likewise.
8709 * incremental.cc: Likewise.
8710 * layout.cc: Likewise.
8711 * layout.h: Likewise.
8712 * main.cc: Likewise.
8713 * merge.cc: Likewise.
8714 * merge.h: Likewise.
8715 * object.cc: Likewise.
8716 * object.h: Likewise.
8717 * options.cc: Likewise.
8718 * options.h: Likewise.
8719 * output.cc: Likewise.
8720 * output.h: Likewise.
8721 * plugin.cc: Likewise.
8722 * plugin.h: Likewise.
8723 * powerpc.cc: Likewise.
8724 * reloc.cc: Likewise.
8725 * script-c.h: Likewise.
8726 * script-sections.cc: Likewise.
8727 * script.cc: Likewise.
8728 * stringpool.cc: Likewise.
8729 * symtab.cc: Likewise.
8730 * symtab.h: Likewise.
8731 * target.cc: Likewise.
8732 * timer.cc: Likewise.
8733 * timer.h: Likewise.
8734 * version.cc: Likewise.
8735 * x86_64.cc: Likewise.
8736
b8fa8750
NC
87372010-08-24 Nick Clifton <nickc@redhat.com>
8738
8739 PR 11899
8740 * layout.cc (segment_precedes): Sort segments by their physical
8741 addresses, if they have been set.
8742
9919d93b
CC
87432010-08-23 Cary Coutant <ccoutant@google.com>
8744
8745 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
8746 symbols data.
8747 (Lib_group::include_member): Unlock object after deleting its
8748 symbols data.
8749 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
8750 the bug fixed here.
8751
97b4be1c
CC
87522010-08-19 Neil Vachharajani <nvachhar@google.com>
8753 Cary Coutant <ccoutant@google.com>
8754
8755 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
8756 constructor, and set_blocker.
8757 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
8758 readsyms_blocker_.
8759 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
8760 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
8761 * testsuite/Makefile.am (start_lib_test): New test case.
8762 * testsuite/Makefile.in: Regenerate.
8763 * testsuite/start_lib_test_main.c: New file.
8764 * testsuite/start_lib_test_1.c: New file.
8765 * testsuite/start_lib_test_2.c: New file.
8766 * testsuite/start_lib_test_3.c: New file.
8767
dd0b1884
ILT
87682010-08-19 Ian Lance Taylor <iant@google.com>
8769
8770 * Makefile.in: Rebuild with automake 1.11.1.
8771 * aclocal.m4: Likewise.
8772 * testsuite/Makefile.in: Likewise.
8773
7223e9ca
ILT
87742010-08-19 Ian Lance Taylor <iant@google.com>
8775
8776 PR 10893
8777 * i386.cc (class Output_data_plt_i386): Update declarations.
8778 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
8779 local_ifuncs_ fields.
8780 (Target_i386::do_plt_section_for_global): New function.
8781 (Target_i386::do_plt_section_for_local): New function.
8782 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
8783 parameter; change all callers. Initialize global_ifuncs_ and
8784 local_ifuncs_. If doing a static link define __rel_iplt_start and
8785 __rel_iplt_end.
8786 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
8787 (Output_data_plt_i386::add_local_ifunc_entry): New function.
8788 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
8789 symbols.
8790 (Target_i386::make_plt_section): New function, broken out of
8791 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
8792 (Target_i386::make_plt_entry): Call make_plt_section.
8793 (Target_i386::make_local_ifunc_plt_entry): New function.
8794 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
8795 (Target_i386::Scan::local): Handle IFUNC symbols. Add
8796 R_386_IRELATIVE to switch.
8797 (Target_i386::Scan::global): Likewise.
8798 (Target_i386::Relocate::relocate): Likewise.
8799 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
8800 switch.
8801 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
8802 (Target_x86_64::do_plt_section_for_global): New function.
8803 (Target_x86_64::do_plt_section_for_local): New function.
8804 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
8805 parameter; change all callers. If doing a static link define
8806 __rela_iplt_start and __rela_iplt_end.
8807 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
8808 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
8809 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
8810 to point to .plt.
8811 (Target_x86_64::make_local_ifunc_plt_entry): New function.
8812 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
8813 switch.
8814 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
8815 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
8816 R_X86_64_IRELATIVE to switch.
8817 (Target_x86_64::Scan::global): Likewise.
8818 (Target_x86_64::Relocate::relocate): Likewise.
8819 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
8820 switch.
8821 * target.h (class Target): Add plt_section_for_global and
8822 plt_section_for_local functions. Add do_plt_section_for_global
8823 and do_plt_section_for_local virtual functions.
8824 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
8825 clarifying comments.
8826 (Symbol::use_plt_offset): Handle IFUNC symbol.
8827 * object.cc (Sized_relobj::Sized_relobj): Initialize
8828 local_plt_offsets_.
8829 (Sized_relobj::local_has_plt_offset): New function.
8830 (Sized_relobj::local_plt_offset): New function.
8831 (Sized_relobj::set_local_plt_offset): New function.
8832 (Sized_relobj::do_count): Handle IFUNC symbol.
8833 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
8834 a bit away from input_shndx_ field. Add set_is_func_symbol and
8835 is_ifunc_symbol functions.
8836 (class Sized_relobj): Update declarations. Remove Tls_got_entry
8837 and Local_tls_got_offsets. Define Local_plt_offsets. Add
8838 local_plt_offsets_ field.
8839 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
8840 * output.h (class Output_section_data): Add non-const
8841 output_section function.
8842 (class Output_data_got): Update declarations.
8843 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
8844 Add use_plt_offset parameter to global and local constructors.
8845 Change all callers. Change local_sym_index_ field to 31 bits.
8846 Change GSYM_CODE and CONSTANT_CODE accordingly.
8847 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
8848 doing a static link don't set sh_link field.
8849 (Output_data_got::Got_entry::write): Use PLT offset if
8850 appropriate.
8851 (Output_data_got::add_global_plt): New function.
8852 (Output_data_got::add_local_plt): New function.
8853 * target-reloc.h (relocate_section): Handle IFUNC symbol.
8854 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
8855 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
8856 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
8857 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
8858 IFUNC conditional.
8859 * testsuite/ifunc-sel.h: New file.
8860 * testsuite/ifuncmain1.c: New file.
8861 * testsuite/ifuncmain1vis.c: New file.
8862 * testsuite/ifuncmod1.c: New file.
8863 * testsuite/ifuncdep2.c: New file.
8864 * testsuite/ifuncmain2.c: New file.
8865 * testsuite/ifuncmain3.c: New file.
8866 * testsuite/ifuncmod3.c: New file.
8867 * testsuite/ifuncmain4.c: New file.
8868 * testsuite/ifuncmain5.c: New file.
8869 * testsuite/ifuncmod5.c: New file.
8870 * testsuite/ifuncmain6pie.c: New file.
8871 * testsuite/ifuncmod6.c: New file.
8872 * testsuite/ifuncmain7.c: New file.
8873 * configure, testsuite/Makefile.in: Rebuild.
8874
56f75c03
ILT
88752010-08-18 Ian Lance Taylor <iant@google.com>
8876
8877 * incremental.cc
8878 (Output_section_incremental_inputs::write_input_files): Add cast
8879 to avoid signed/unsigned comparison warning.
8880 (Output_section_incremental_inputs::write_info_blocks): Likewise.
8881
55455f89
CC
88822010-08-12 Cary Coutant <ccoutant@google.com>
8883
8884 * common.cc (Sort_commons::operator()): Remove unnecessary code.
8885
e2054bcb
ILT
88862010-08-13 Ian Lance Taylor <iant@google.com>
8887
8888 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
8889
74f67560
DK
88902010-08-12 Cary Coutant <ccoutant@google.com>
8891 Doug Kwan <dougkwan@google.com>
8892
8893 * resolve.cc (Symbol_table::should_override): When a weak dynamic
8894 defintion overrides non-weak undef, remember that the original undef
8895 is not weak.
8896 * symtab.cc (Symbol_table::sized_write_global): For undef without
8897 an original weak binding, set binding to global in output.
8898 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
8899 * testsuite/Makefile.in: Regenerate.
8900 * testsuite/strong_ref_weak_def.sh: New file.
8901 * testsuite/strong_ref_weak_def_1.c: Ditto.
8902 * testsuite/strong_ref_weak_def_2.c: Ditto.
8903
d1238d12
CC
89042010-08-12 Cary Coutant <ccoutant@google.com>
8905
8906 * testsuite/incremental_test.sh: Rewrite.
8907 * testsuite/incremental_test_1.c: Rewrite.
8908 * testsuite/incremental_test_2.c: Rewrite.
8909
0e70b911
CC
89102010-08-12 Cary Coutant <ccoutant@google.com>
8911
8912 * arm.cc (Target_arm::got_size): Add const.
8913 (Target_arm::got_entry_count): New function.
8914 (Target_arm::plt_entry_count): New function.
8915 (Target_arm::first_plt_entry_offset): New function.
8916 (Target_arm::plt_entry_size): New function.
8917 (Output_data_plt_arm::entry_count): New function.
8918 (Output_data_plt_arm::first_plt_entry_offset): New function.
8919 (Output_data_plt_arm::get_plt_entry_size): New function.
8920 * i386.cc (Target_i386::got_size): Add const.
8921 (Target_i386::got_entry_count): New function.
8922 (Target_i386::plt_entry_count): New function.
8923 (Target_i386::first_plt_entry_offset): New function.
8924 (Target_i386::plt_entry_size): New function.
8925 (Output_data_plt_i386::entry_count): New function.
8926 (Output_data_plt_i386::first_plt_entry_offset): New function.
8927 (Output_data_plt_i386::get_plt_entry_size): New function.
8928 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
8929 find_incremental_inputs_sections. Dump incremental_got_plt section.
8930 * incremental.cc: Include target.h.
8931 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
8932 parameter. Adjust all callers. Find incremental_got_plt section.
8933 (Incremental_inputs::create_data_sections): Create incremental_got_plt
8934 section.
8935 (Output_section_incremental_inputs::set_final_data_size): Calculate
8936 size of incremental_got_plt section.
8937 (Output_section_incremental_inputs::do_write): Write the
8938 incremental_got_plt section.
8939 (Got_plt_view_info): New struct.
8940 (Local_got_offset_visitor): New class.
8941 (Global_got_offset_visitor): New class.
8942 (Global_symbol_visitor_got_plt): New class.
8943 (Output_section_incremental_inputs::write_got_plt): New function.
8944 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
8945 Add parameter. Adjust all callers.
8946 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
8947 (Incremental_inputs::got_plt_section): New function.
8948 (Incremental_inputs::got_plt_section_): New data member.
8949 (Incremental_got_plt_reader): New class.
8950 * layout.cc (Layout::create_incremental_info_sections): Add the
8951 incremental_got_plt section.
8952 * object.h (Got_offset_list::get_list): New function.
8953 (Got offset_list::for_all_got_offsets): New function.
8954 (Sized_relobj::local_got_offset_list): New function.
8955 * powerpc.cc (Target_powerpc::got_size): Add const.
8956 (Target_powerpc::got_entry_count): New function.
8957 (Target_powerpc::plt_entry_count): New function.
8958 (Target_powerpc::first_plt_entry_offset): New function.
8959 (Target_powerpc::plt_entry_size): New function.
8960 (Output_data_plt_powerpc::entry_count): New function.
8961 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
8962 (Output_data_plt_powerpc::get_plt_entry_size): New function.
8963 * sparc.cc (Target_sparc::got_size): Add const.
8964 (Target_sparc::got_entry_count): New function.
8965 (Target_sparc::plt_entry_count): New function.
8966 (Target_sparc::first_plt_entry_offset): New function.
8967 (Target_sparc::plt_entry_size): New function.
8968 (Output_data_plt_sparc::entry_count): New function.
8969 (Output_data_plt_sparc::first_plt_entry_offset): New function.
8970 (Output_data_plt_sparc::get_plt_entry_size): New function.
8971 * symtab.h (Symbol::got_offset_list): New function.
8972 (Symbol_table::for_all_symbols): New function.
8973 * target.h (Sized_target::got_entry_count): New function.
8974 (Sized_target::plt_entry_count): New function.
8975 (Sized_target::plt_entry_size): New function.
8976 * x86_64.cc (Target_x86_64::got_size): Add const.
8977 (Target_x86_64::got_entry_count): New function.
8978 (Target_x86_64::plt_entry_count): New function.
8979 (Target_x86_64::first_plt_entry_offset): New function.
8980 (Target_x86_64::plt_entry_size): New function.
8981 (Output_data_plt_x86_64::entry_count): New function.
8982 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
8983 (Output_data_plt_x86_64::get_plt_entry_size): New function.
8984
09ec0418
CC
89852010-08-12 Cary Coutant <ccoutant@google.com>
8986
8987 * archive.cc: Include incremental.h.
8988 (Archive::Archive): Initialize incremental_info_.
8989 (Archive::include_member): Record archive members in incremental info.
8990 (Add_archive_symbols::run): Record begin and end of an archive in
8991 incremental info.
8992 (Lib_group::include_member): Record objects in incremental info.
8993 * archive.h (Incremental_archive_entry): Forward declaration.
8994 (Archive::set_incremental_info): New member function.
8995 (Archive::incremental_info): New member function.
8996 (Archive::Unused_symbol_iterator): New class.
8997 (Archive::unused_symbols_begin): New member function.
8998 (Archive::unused_symbols_end): New member function.
8999 (Archive::incremental_info_): New data member.
9000 * incremental-dump.cc (find_input_containing_global): New function.
9001 (dump_incremental_inputs): Dump new incremental info sections.
9002 * incremental.cc: Include symtab.h.
9003 (Output_section_incremental_inputs): New class.
9004 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
9005 new incremental info sections.
9006 (Sized_incremental_binary::do_check_inputs): Likewise.
9007 (Incremental_inputs::report_archive): Remove.
9008 (Incremental_inputs::report_archive_begin): New function.
9009 (Incremental_inputs::report_archive_end): New function.
9010 (Incremental_inputs::report_object): New function.
9011 (Incremental_inputs::finalize_inputs): Remove.
9012 (Incremental_inputs::report_input_section): New function.
9013 (Incremental_inputs::report_script): Rewrite.
9014 (Incremental_inputs::finalize): Do nothing but finalize string table.
9015 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9016 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9017 (Incremental_inputs::create_data_sections): New function.
9018 (Incremental_inputs::relocs_entsize): New function.
9019 (Output_section_incremental_inputs::set_final_data_size): New function.
9020 (Output_section_incremental_inputs::do_write): New function.
9021 (Output_section_incremental_inputs::write_header): New function.
9022 (Output_section_incremental_inputs::write_input_files): New function.
9023 (Output_section_incremental_inputs::write_info_blocks): New function.
9024 (Output_section_incremental_inputs::write_symtab): New function.
9025 * incremental.h (Incremental_script_entry): Forward declaration.
9026 (Incremental_object_entry): Forward declaration.
9027 (Incremental_archive_entry): Forward declaration.
9028 (Incremental_inputs): Forward declaration.
9029 (Incremental_inputs_header_data): Remove.
9030 (Incremental_inputs_header): Remove.
9031 (Incremental_inputs_header_write): Remove.
9032 (Incremental_inputs_entry_data): Remove.
9033 (Incremental_inputs_entry): Remove.
9034 (Incremental_inputs_entry_write): Remove.
9035 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
9036 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
9037 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
9038 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
9039 Likewise.
9040 (Incremental_input_entry): New class.
9041 (Incremental_script_entry): New class.
9042 (Incremental_object_entry): New class.
9043 (Incremental_archive_entry): New class.
9044 (Incremental_inputs::Incremental_inputs): Initialize new data members.
9045 (Incremental_inputs::report_inputs): Remove.
9046 (Incremental_inputs::report_archive): Remove.
9047 (Incremental_inputs::report_archive_begin): New function.
9048 (Incremental_inputs::report_archive_end): New function.
9049 (Incremental_inputs::report_object): Change prototype.
9050 (Incremental_inputs::report_input_section): New function.
9051 (Incremental_inputs::report_script): Change prototype.
9052 (Incremental_inputs::get_reloc_count): New function.
9053 (Incremental_inputs::set_reloc_count): New function.
9054 (Incremental_inputs::create_data_sections): New function.
9055 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9056 (Incremental_inputs::inputs_section): New function.
9057 (Incremental_inputs::symtab_section): New function.
9058 (Incremental_inputs::relocs_section): New function.
9059 (Incremental_inputs::get_stringpool): Add const.
9060 (Incremental_inputs::command_line): Add const.
9061 (Incremental_inputs::inputs): Remove.
9062 (Incremental_inputs::command_line_key): New function.
9063 (Incremental_inputs::input_file_count): New function.
9064 (Incremental_inputs::input_files): New function.
9065 (Incremental_inputs::relocs_entsize): New function.
9066 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9067 (Incremental_inputs::finalize_inputs): Remove.
9068 (Incremental_inputs::Input_info): Remove.
9069 (Incremental_inputs::lock_): Remove.
9070 (Incremental_inputs::inputs_): Change type.
9071 (Incremental_inputs::inputs_map_): Remove.
9072 (Incremental_inputs::current_object_entry_): New data member.
9073 (Incremental_inputs::inputs_section_): New data member.
9074 (Incremental_inputs::symtab_section_): New data member.
9075 (Incremental_inputs::relocs_section_): New data member.
9076 (Incremental_inputs::reloc_count_): New data member.
9077 (Incremental_inputs_reader): New class.
9078 (Incremental_symtab_reader): New class.
9079 (Incremental_relocs_reader): New class.
9080 * layout.cc (Layout::finalize): Move finalization of incremental info
9081 and creation of incremental info sections to follow finalization of
9082 symbol table. Set offsets for postprocessing sections.
9083 (Layout::create_incremental_info_sections): Call
9084 Incremental_inputs::create_data_sections. Add incremental symtab
9085 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
9086 sections to layout after input sections.
9087 * layout.h (struct Timespec): Forward declaration.
9088 (Layout::incremental_inputs): Add const.
9089 (Layout::create_incremental_info_sections): Add parameter.
9090 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
9091 * object.cc: Include incremental.h.
9092 (Relobj::finalize_incremental_relocs): New function.
9093 (Sized_relobj::do_layout): Record input sections in incremental info.
9094 * object.h (Object::output_section): New function.
9095 (Object::output_section_offset): Moved from Relobj.
9096 (Object::get_incremental_reloc_base): New function.
9097 (Object::get_incremental_reloc_count): New function.
9098 (Object::do_output_section): New function.
9099 (Object::do_output_section_offset): Moved from Relobj.
9100 (Object::do_get_incremental_reloc_base): New function.
9101 (Object::do_get_incremental_reloc_count): New function.
9102 (Object::Object): Initialize new data members.
9103 (Relobj::output_section): Renamed do_output_section and moved to
9104 protected.
9105 (Relobj::output_section_offset): Moved to Object.
9106 (Relobj::do_get_incremental_reloc_base): New function.
9107 (Relobj::do_get_incremental_reloc_count): New function.
9108 (Relobj::allocate_incremental_reloc_counts): New function.
9109 (Relobj::count_incremental_reloc): New function.
9110 (Relobj::finalize_incremental_relocs): New function.
9111 (Relobj::next_incremental_reloc_index): New function.
9112 (Relobj::reloc_counts_): New data member.
9113 (Relobj::reloc_bases_): New data member.
9114 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
9115 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
9116 (Sized_relobj::incremental_relocs_scan): New function.
9117 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9118 (Sized_relobj::incremental_relocs_write): New function.
9119 (Sized_relobj::incremental_relocs_write_reltype): New function.
9120 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
9121 incremental link.
9122 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
9123 archives and object files elsewhere.
9124 (Add_symbols::run): Report object files here.
9125 (Finish_group::run): Report end of archive at end of group.
9126 * reloc.cc: Include layout.h, incremental.h.
9127 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
9128 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
9129 (Sized_relobj::incremental_relocs_scan): New function.
9130 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9131 (Sized_relobj::do_relocate_sections): Write incremental relocations.
9132 (Sized_relobj::incremental_relocs_write): New function.
9133 (Sized_relobj::incremental_relocs_write_reltype): New function.
9134 * script.cc (read_input_script): Rewrite test for incremental link.
9135 Change call to Incremental_inputs::report_script.
9136 * symtab.h (Symbol_table::first_global_index): New function.
9137 (Symbol_table::output_count): New function.
9138
ce0d1972
DK
91392010-08-12 Doug Kwan <dougkwan@google.com>
9140
9141 * arm.cc (Target_arm::merge_object_attributes): Check command line
9142 options --no-wchar-size-warning and --no-enum-size-warning.
9143 * options.h (General_options): Add ld-compatible options
9144 --no-enum-size-warning and --no-wchar-size-warning.
9145
6e5710ce
ILT
91462010-08-04 Ian Lance Taylor <iant@google.com>
9147
9148 * x86_64.cc (Target_x86_64::Scan::local): Use
9149 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
9150 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
9151 (Target_x86_64::Scan::global): Likewise.
9152 (Target_x86_64::Relocate::relocate): Likewise.
9153 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
9154 Likewise.
9155
fef830db
CC
91562010-08-03 Cary Coutant <ccoutant@google.com>
9157
9158 * merge.cc (Output_merge_string::do_add_input_section): Count strings
9159 to reserve space in merged_strings vector. Keep total input size
9160 for stats.
9161 (Output_merge_string::do_print_merge_stats): Print total input size.
9162 * merge.h (Output_merge_string): Add input_size_ field.
9163 * stringpool.cc (Stringpool_template::string_length): Move
9164 implementations out of Stringpool_template class and place in
9165 stringpool.h.
9166 * stringpool.h (string_length): Move out of Stringpool_template.
9167
1e3811b0
ILT
91682010-08-03 Ian Lance Taylor <iant@google.com>
9169
9170 PR 11712
9171 * layout.cc (relaxation_loop_body): If address of load segment is
9172 set, adjust address to include headers if possible.
9173
7af0c620
ILT
91742010-08-03 Ian Lance Taylor <iant@google.com>
9175
9176 * version.cc (version_string): Bump to 1.10.
9177
22f0da72
ILT
91782010-08-03 Ian Lance Taylor <iant@google.com>
9179
9180 PR 11805
9181 * layout.h (enum Output_section_order): Define.
9182 (class Layout): Update declarations.
9183 * layout.cc (Layout::get_output_section): Add order parameter.
9184 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
9185 is_first_non_relro parameters. Change all callers.
9186 (Layout::choose_output_section): Likewise.
9187 (Layout::add_output_section_data): Likewise.
9188 (Layout::make_output_section): Likewise. Set order.
9189 (Layout::default_section_order): New function.
9190 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
9191 * output.cc (Output_section::Output_section): Initialize order_.
9192 Don't initialize deleted fields.
9193 (Output_segment::Output_segment): Don't initialize deleted
9194 fields.
9195 (Output_segment::add_output_section_to_load): New function
9196 replacing add_output_section. Change all callers to call this or
9197 add_output_section_to_nonload.
9198 (Output_segment::add_output_section_to_nonload): New function.
9199 (Output_segment::remove_output_section): Rewrite.
9200 (Output_segment::add_initial_output_data): Likewise.
9201 (Output_segment::has_any_data_sections): Likewise.
9202 (Output_segment::is_first_section_relro): Likewise.
9203 (Output_segment::maximum_alignment): Likewise.
9204 (Output_segment::has_dynamic_reloc): New function replacing
9205 dynamic_reloc_count. Change all callers.
9206 (Output_segment::has_dynamic_reloc_list): New function replacing
9207 dynamic_reloc_count_list. Change all callers.
9208 (Output_segment::set_section_addresses): Rewrite.
9209 (Output_segment::set_offset): Rewrite.
9210 (Output_segment::find_first_and_last_list): Remove.
9211 (Output_segment::set_tls_offsets): Rewrite.
9212 (Output_segment::first_section_load_address): Likewise.
9213 (Output_segment::output_section_count): Likewise.
9214 (Output_segment::section_with_lowest_load_address): Likewise.
9215 (Output_segment::write_section_headers): Likewise.
9216 (Output_segment::print_sections_to_map): Likewise.
9217 * output.h (class Output_data): Remove dynamic_reloc_count_
9218 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
9219 (Output_data::add_dynamic_reloc): Rewrite.
9220 (Output_data::has_dynamic_reloc): New function.
9221 (Output_data::dynamic_reloc_count): Remove.
9222 (class Output_section): Add order_ field. Remvoe is_relro_local_,
9223 is_last_relro_, is_first_non_relro_, is_interp_,
9224 is_dynamic_linker_section_ fields. Add order and set_order
9225 functions. Remove is_relro_local, set_is_relro_local,
9226 is_last_relro, set_is_last_relro, is_first_non_relro,
9227 set_is_first_non_relro functions, is_interp, set_is_interp,
9228 is_dynamic_linker_section, and set_is_dynamic_linker_section
9229 functions.
9230 (class Output_segment): Change Output_data_list from std::list to
9231 std:;vector. Add output_lists_ field. Remove output_data_ and
9232 output_bss_ fields. Update declarations.
9233
3ff2ccb0
ILT
92342010-08-02 Ian Lance Taylor <iant@google.com>
9235
9236 * arm.cc (Target_arm::gc_process_relocs): Use typename.
9237 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
9238 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
9239
88a4108b
ILT
92402010-08-02 Ian Lance Taylor <iant@google.com>
9241
9242 PR 11855
9243 * script.cc (Script_options::Script_options): Initialize
9244 symbol_definitions_ and symbol_references_.
9245 (Script_options::add_symbol_assignment): Update
9246 symbol_definitions_ and symbol_references_.
9247 (Script_options::add_symbol_reference): New function.
9248 (script_symbol): New function.
9249 * script.h (class Script_options): Add symbol_definitions_ and
9250 symbol_references_ fields.
9251 (Script_options::referenced_const_iterator): New type.
9252 (Script_options::referenced_begin): New function.
9253 (Script_options::referenced_end): New function.
9254 (Script_options::is_referenced): New function.
9255 (Script_options::any_unreferenced): New function.
9256 * script-c.h (script_symbol): Declare.
9257 * yyscript.y (exp): Call script_symbol.
9258 * symtab.cc: Include "script.h".
9259 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
9260 Change all callers. Check symbols referenced by scripts.
9261 (Symbol_table::add_undefined_symbols_from_command_line): Add
9262 layout parameter. Change all callers.
9263 (Symbol_table::do_add_undefined_symbols_from_command_line):
9264 Likewise. Break out loop body. Check symbols referenced by
9265 scripts.
9266 (Symbol_table::add_undefined_symbol_from_command_line): New
9267 function broken out of
9268 do_add_undefined_symbols_from_command_line.
9269 * symtab.h (class Symbol_table): Update declarations.
9270 * archive.cc: Include "layout.h".
9271 (Archive::should_include_member): Add layout parameter. Change
9272 all callers. Check for symbol mentioned in expression.
9273 * archive.h (class Archive): Update declaration.
9274 * object.cc (Sized_relobj::do_should_include_member): Add layout
9275 parameter.
9276 * object.h (Object::should_include_member): Add layout parameter.
9277 Change all callers.
9278 (Object::do_should_include_member): Add layout parameter.
9279 (class Sized_relobj): Update declaration.
9280 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
9281 parameter.
9282 * dynobj.h (class Sized_dynobj): Update declaration.
9283 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
9284 layout parameter.
9285 * plugin.h (class Sized_pluginobj): Update declaration.
9286
5f1ab67a
ILT
92872010-08-02 Ian Lance Taylor <iant@google.com>
9288
9289 PR 11866
9290 * output.cc (Output_segment::set_offset): Search for the first and
9291 last sections rather than assuming that the list is in order.
9292 (Output_segment::find_first_and_last_list): New function.
9293 * output.h (class Output_segment): Update declarations.
9294 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
9295 (relro_strip_test_SOURCES): New variable.
9296 (relro_strip_test_DEPENDENCIES): New variable.
9297 (relro_strip_test_LDFLAGS): New variable.
9298 (relro_strip_test_LDADD): New variable.
9299 (relro_strip_test.so): New target.
9300
a8df5856
ILT
93012010-08-02 Ian Lance Taylor <iant@google.com>
9302
9303 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
9304 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
9305 (Target_i386::got_tlsdesc_section): New function.
9306 (Target_i386::got_section): Create space for GOT entries for
9307 TLSDESC relocations.
9308 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
9309 R_386_TLS_GOTDESC.
9310 (Target_i386::Scan::global): Likewise.
9311 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
9312 using TLSDESC GOT.
9313 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
9314 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
9315 (Target_x86_64::got_tlsdesc_section): New function.
9316 (Target_x86_64::got_section): Create space for GOT entries for
9317 TLSDESC relocations.
9318 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
9319 R_386_TLS_GOTDESC.
9320 (Target_x86_64::Scan::global): Likewise.
9321 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
9322 using TLSDESC GOT.
9323
0c10a0a6
ILT
93242010-08-02 Ian Lance Taylor <iant@google.com>
9325
9326 * testsuite/final_layout.sh: Use dc to convert from hex to
9327 decimal.
9328
41cbeecc
ST
93292010-07-29 Sriraman Tallam <tmsriram@google.com>
9330
9331 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
9332 paramter to the call to gold::gc_process_relocs.
9333 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
9334 paramter to the call to gold::gc_process_relocs.
9335 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
9336 parameter to the call to gold::gc_process_relocs.
9337 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
9338 template parameter to the call to gold::gc_process_relocs.
9339 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
9340 paramter to the call to gold::gc_process_relocs.
9341 * gc.h (get_embedded_addend_size): New function.
9342 (gc_process_relocs): Save the size of the reloc for use by ICF.
9343 * icf.cc (get_section_contents): Get the addend from the text section
9344 for SHT_REL relocation sections.
9345 * icf.h (Icf::Reloc_addend_size_info): New typedef.
9346 (Icf::Reloc_info): Add new member reloc_addend_size_info.
9347 * int_encoding.h (read_from_pointer): New overloaded function.
9348 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
9349 * testsuite/icf_sht_rel_addend_test.sh: New file.
9350 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
9351 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
9352
6ea55b82
RW
93532010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9354
9355 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
9356 * Makefile.in: Regenerate.
9357 * testsuite/Makefile.in: Regenerate.
9358
9691462b
ILT
93592010-07-27 Jeffrey Yasskin <jyasskin@google.com>
9360
9361 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
9362 * gold/testsuite/debug_msg.cc: Likewise.
9363 * gold/testsuite/odr_violation1.cc
9364 * gold/testsuite/odr_violation2.cc
9365
76897331
CC
93662010-07-21 Cary Coutant <ccoutant@google.com>
9367
9368 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
9369 string, and length fields.
9370 (Output_merge_string::Merged_strings_list): New type.
9371 (Output_merge_string::Merged_strings_lists): New typedef.
9372 (Output_merge_string): Replace merged_strings_ with
9373 merged_strings_lists_.
9374 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
9375 Merged_strings_list per input object and section. Don't store pointer
9376 to the string. Don't store length with each merged string entry.
9377 (Output_merge_string::finalize_merged_data): Loop over list of merged
9378 strings lists. Recompute length of each merged string.
9379
78384e8f
CC
93802010-07-15 Cary Coutant <ccoutant@google.com>
9381
9382 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
9383 here.
9384
783659f9
ILT
93852010-07-14 Ian Lance Taylor <iant@google.com>
9386
9387 * descriptors.cc (Descriptors::open): Report correct name in error
9388 message.
9389
131687b4
DK
93902010-07-13 Doug Kwan <dougkwan@google.com>
9391
9392 * arm.cc (Arm_input_section::Arm_input_section): For a
9393 SHT_ARM_EXIDX section, always keeps the input sections.
9394 (Arm_input_section::set_exidx_section_link): New method.
9395 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
9396 has_errors_ to false.
9397 (Arm_exidx_input_section::has_errors,
9398 Arm_exidx_input_section::set_has_errors): New methods.
9399 (Arm_exidx_input_section::has_errors_): New data member.
9400 (Arm_relobj::get_exidx_shndx_list): New method.
9401 (Arm_output_section::append_text_sections_to_list): Do not skip
9402 section without SHF_EXECINSTR.
9403 (Arm_output_section::fix_exidx_coverage): Skip input sections with
9404 errors.
2e702c99 9405 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
9406 section header. Make error messages more verbose. Check for
9407 a non-executable section linked to an EXIDX section.
9408 (Arm_relobj::do_read_symbols): Remove error checking, which has been
9409 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
9410 check that there is no deferred EXIDX section if we exit early.
9411 Instead of not making an EXIDX section in case of an error, make one
9412 and set the has_errors flag of it.
9413 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
9414 in a relocatable link.
9415 (Target_arm::do_relax): Look for the EXIDX output section instead of
9416 assuming that it is called .ARM.exidx.
2e702c99 9417 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
9418 section list. Do not check for SHF_EXECINSTR section flags but
9419 skip any input section with errors.
9420 * output.cc (Output_section::Output_section): Initialize
9421 always_keeps_input_sections_ to false.
9422 (Output_section::add_input_section): Check for
9423 always_keeps_input_sections_.
9424 * output.h (Output_section::always_keeps_input_sections,
9425 Output_section::set_always_keeps_input_sections): New methods.
9426 (Output_section::always_keeps_input_sections): New data member.
9427
69517287
RÁE
94282010-07-13 Rafael Espindola <espindola@google.com>
9429
9430 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
9431 * fileread.h (Input_file): Add try_extra_search_path and find_file.
9432
82742395
ILT
94332010-07-13 Philip Herron <herron.philip@googlemail.com>
9434 Ian Lance Taylor <iant@google.com>
9435
9436 * output.h (Output_section_lookup_maps::add_merge_section):
9437 Correct check of whether value was inserted.
9438 (Output_section_lookup_maps::add_merge_input_section): Likewise.
9439 (Output_section_lookup_maps::add_relaxed_input_section):
9440 Likewise.
9441 * arm.cc (Target_arm::got_section): Remove used local os.
9442 * i386.cc (Target_i386::got_section): Likewise.
9443 * x86_64.cc (Target_x86_64::got_section): Likewise.
9444 * sparc.cc (Target_sparc::got_section): Likewise.
9445 (Target_sparc::relocate): Remove unused local have_got_offset.
9446 * powerpc.cc (Target_powerpc::relocate): Likewise.
9447
f2d707b5
ILT
94482010-07-13 Ian Lance Taylor <iant@google.com>
9449
241531d6
ILT
9450 * compressed_output.cc (zlib_decompress): Fix signature in
9451 !HAVE_ZLIB_H case.
9452
f2d707b5
ILT
9453 * archive.cc (Archive::include_member): Unlock an external member
9454 of a thin archive. Don't bother to delete an object we know is
9455 NULL.
9456
a2e47362
CC
94572010-07-12 Cary Coutant <ccoutant@google.com>
9458
9459 * compressed_output.cc (zlib_decompress): New function.
9460 (get_uncompressed_size): New function.
9461 (decompress_input_section): New function.
9462 * compressed_output.h (get_uncompressed_size): New function.
9463 (decompress_input_section): New function.
9464 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
9465 Handle compressed debug sections.
9466 * layout.cc (is_compressed_debug_section): New function.
9467 (Layout::output_section_name): Map compressed section names to
9468 canonical names.
9469 * layout.h (is_compressed_debug_section): New function.
9470 (is_debug_info_section): Recognize compressed debug sections.
9471 * merge.cc: Include compressed_output.h.
9472 (Output_merge_data::do_add_input_section): Handle compressed
9473 debug sections.
9474 (Output_merge_string::do_add_input_section): Handle compressed
9475 debug sections.
9476 * object.cc: Include compressed_output.h.
9477 (Sized_relobj::Sized_relobj): Initialize new data members.
9478 (build_compressed_section_map): New function.
9479 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
9480 * object.h (Object::section_is_compressed): New method.
9481 (Object::do_section_is_compressed): New method.
9482 (Sized_relobj::Compressed_section_map): New type.
9483 (Sized_relobj::do_section_is_compressed): New method.
9484 (Sized_relobj::compressed_sections_): New data member.
9485 * output.cc (Output_section::add_input_section): Handle compressed
9486 debug sections.
9487 * reloc.cc: Include compressed_output.h.
9488 (Sized_relobj::write_sections): Handle compressed debug sections.
9489
ce279a62
CC
94902010-07-08 Cary Coutant <ccoutant@google.com>
9491
9492 * resolve.cc (Symbol_table::resolve): Remember whether undef was
9493 weak when resolving to a dynamic def.
9494 (Symbol_table::should_override): Add adjust_dyndef flag; set it
9495 for weak undef/dynamic def cases. Adjust callers.
9496 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
9497 undef_binding_weak_.
9498 (Symbol_table::sized_write_globals): Adjust symbol binding.
9499 (Symbol_table::sized_write_symbol): Add binding parameter.
9500 * symtab.h (Symbol::set_undef_binding): New method.
9501 (Symbol::is_undef_binding_weak): New method.
9502 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
9503 (Symbol_table::should_override): Add new parameter.
9504 (Symbol_table::sized_write_symbol): Add new parameter.
9505
9506 * testsuite/weak_undef_file1.cc: Add new test case.
9507 * testsuite/weak_undef_file2.cc: Fix header comment.
9508 * testsuite/weak_undef_test.cc: Add new test case.
9509
b2286c10
DK
95102010-06-29 Doug Kwan <dougkwan@google.com>
9511
9512 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
9513 Initialize USE_SYMBOL_.
9514 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
9515 definition.
9516 (Arm_reloc_property::uses_symbol_): New data member declaration.
9517 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
9518 uses symbol value and symbol is undefined but not weakly undefined.
9519
4802450a
RÁE
95202010-06-28 Rafael Espindola <espindola@google.com>
9521
9522 * plugin.cc (Plugin::load): Use dlerror.
9523
e5ca47ba
ILT
95242010-06-26 Jeffrey Yaskin <jyasskin@google.com>
9525
9526 * symtab.cc (detect_odr_violations): When reporting an ODR
9527 violation, report an object where the symbol is defined.
9528
8a75a161
DK
95292010-06-25 Doug Kwan <dougkwan@google.com>
9530
9531 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
9532 (Target_arm::section_may_have_icf_unsafe_pointers): New method
9533 definition.
9534 (Target_arm::Scan::local_reloc_may_be_function_pointer,
9535 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
9536 target hook to detect function points.
9537 (Target_arm::Scan::possible_function_pointer_reloc): New method.
9538 * icf.h (Icf::check_section_for_function_pointers): Change type of
9539 parameter SECTION_NAME to const reference to std::string. Use
9540 target hook to determine if section may have unsafe pointers.
9541 * target.h (Target::section_may_have_icf_unsafe_pointers): New
9542 method definition.
9543
42218b9f
RÁE
95442010-06-21 Rafael Espindola <espindola@google.com>
9545
9546 * fileread.cc (Input_file::find_fie): New
9547 (Input_file::open): Use Input_file::find_fie.
9548 * fileread.h (Input_file::find_fie): New
9549 * plugin.cc (set_extra_library_path): New.
9550 (Plugin::load): Add set_extra_library_path to the transfer vector.
9551 (Plugin_manager::set_extra_library_path): New.
9552 (Plugin_manager::add_input_file): Use the extra search path if set.
9553 (set_extra_library_path(): New.
9554 * plugin.h (Plugin_manager): Add set_extra_library_path and
9555 extra_search_path_.
9556
a0506cca
CC
95572010-06-19 Cary Coutant <ccoutant@google.com>
9558
9559 * layout.cc (gdb_sections): Add .debug_types.
9560 (lines_only_debug_sections): Likewise.
9561
6508b958
RÁE
95622010-06-18 Rafael Espindola <espindola@google.com>
9563
9564 * plugin.cc (add_input_file,add_input_library)
9565 (Plugin_manager::add_input_file): Make filename arguments const.
9566 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
9567 const.
9568
3e235302
DK
95692010-06-16 Doug Kwan <dougkwan@google.com>
9570
9571 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
9572 .ARM.attributes section if we have not merged any input
9573 attributes sections.
9574
106e8a6c
DK
95752010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9576
9577 * arm.cc: Allow combining objects with no EABI version
9578 information.
9579
91ff43fe
RÁE
95802010-06-15 Rafael Espindola <espindola@google.com>
9581
9582 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
9583
68ed838c
ILT
95842010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9585
9586 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
9587 (struct iovec): Correct !HAVE_READV definition.
9588
f3a2388f
CC
95892010-06-10 Cary Coutant <ccoutant@google.com>
9590
9591 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
9592 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
9593 reloc sections.
9594 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
9595
9596 PR 11683
9597 * symtab.h (Symbol::is_placeholder): New member function.
9598 * target-reloc.h (relocate_section): Check for placeholder symbols.
9599
9600 * testsuite/Makefile.am (plugin_test_8): New test.
9601 (plugin_test_9): New test.
9602 * testsuite/Makefile.in: Regenerate.
9603
e1df38aa
NC
96042010-06-09 Nick Clifton <nickc@redhat.com>
9605
9606 * yyscript.y (input_list_element): Allow strings prefixed with
9607 the '-' character. Treat these as libraries.
9608 * script.cc (script_add_library): New function. Adds a library
9609 specified by "-l<name>" found in an input script.
9610 * script-c.h: Add prototype for script_add_library.
9611
25bbe950
DK
96122010-06-07 Doug Kwan <dougkwan@google.com>
9613
9614 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
9615 Restrict stub-group size to be within long conditional branch
9616 range when working around cortex-A8 erratum.
9617
0f32ea4c
ILT
96182010-06-07 Damien Diederen <dd@crosstwine.com>
9619
9620 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
9621 #ifdef typo.
9622
8fe2a369
ST
96232010-06-03 Sriraman Tallam <tmsriram@google.com>
9624
9625 PR gold/11658
9626 * output.cc
9627 (Output_section::Input_section_sort_entry::compare_section_ordering):
9628 Change to return non-zero correctly.
9629 (Output_section::Input_section_sort_section_order_index_compare
9630 ::operator()): Change to fix ambiguity in comparisons.
9631
6e9ba2ca
ST
96322010-06-01 Sriraman Tallam <tmsriram@google.com>
9633
9634 * gold.h (is_wildcard_string): New function.
9635 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
9636 (Layout::layout_eh_frame): Ditto.
9637 (Layout::find_section_order_index): New method.
9638 (Layout::read_layout_from_file): New method.
9639 * layout.h (Layout::find_section_order_index): New method.
9640 (Layout::read_layout_from_file): New method.
9641 (Layout::input_section_position_): New private member.
9642 (Layout::input_section_glob_): New private member.
9643 * main.cc (main): Call read_layout_from_file here.
9644 * options.h (--section-ordering-file): New option.
9645 * output.cc (Output_section::input_section_order_specified_): New
9646 member.
9647 (Output_section::Output_section): Initialize new member.
9648 (Output_section::add_input_section): Add new parameter.
9649 Keep input sections when --section-ordering-file is used.
9650 (Output_section::set_final_data_size): Sort input sections when
9651 section ordering file is specified.
9652 (Output_section::Input_section_sort_entry): Add new parameter.
9653 Check sorting type.
9654 (Output_section::Input_section_sort_entry::compare_section_ordering):
9655 New method.
9656 (Output_section::Input_section_sort_compare::operator()): Change to
9657 consider section_order_index.
9658 (Output_section::Input_section_sort_init_fini_compare::operator()):
9659 Change to consider section_order_index.
9660 (Output_section::Input_section_sort_section_order_index_compare
9661 ::operator()): New method.
9662 (Output_section::sort_attached_input_sections): Change to sort
9663 according to section order when specified.
e1df38aa
NC
9664 (Output_section::add_input_section<32, true>): Add new parameter.
9665 (Output_section::add_input_section<64, true>): Add new parameter.
9666 (Output_section::add_input_section<32, false>): Add new parameter.
9667 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
9668 * output.h (Output_section::add_input_section): Add new parameter.
9669 (Output_section::input_section_order_specified): New
9670 method.
9671 (Output_section::set_input_section_order_specified): New method.
9672 (Input_section::Input_section): Initialize section_order_index_.
9673 (Input_section::section_order_index): New method.
9674 (Input_section::set_section_order_index): New method.
9675 (Input_section::section_order_index_): New member.
9676 (Input_section::Input_section_sort_section_order_index_compare): New
9677 struct.
9678 (Output_section::input_section_order_specified_): New member.
9679 * script-sections.cc (is_wildcard_string): Delete and move modified
9680 method to gold.h.
9681 (Output_section_element_input::Output_section_element_input): Modify
9682 call to is_wildcard_string.
9683 (Output_section_element_input::Input_section_pattern
9684 ::Input_section_pattern): Ditto.
9685 (Output_section_element_input::Output_section_element_input): Ditto.
9686 * testsuite/Makefile.am (final_layout): New test case.
9687 * testsuite/Makefile.in: Regenerate.
9688 * testsuite/final_layout.cc: New file.
9689 * testsuite/final_layout.sh: New file.
9690
3537c84b
RÁE
96912010-06-01 Rafael Espindola <espindola@google.com>
9692
9693 * plugin.cc (Plugin::load): Pass the output name to the plugin.
9694
105b6afd
RÁE
96952010-06-01 Rafael Espindola <espindola@google.com>
9696
9697 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
9698 visibility of symbols.
9699
29e11421
DK
97002010-05-27 Doug Kwan <dougkwan@google.com>
9701
9702 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
9703 from start of output section instead of address for a local symbol
9704 in a merged or relaxed section when doing a relocatable link.
9705
5e0f337e
RÁE
97062010-05-26 Rafael Espindola <espindola@google.com>
9707
703d02da 9708 PR 11604
5e0f337e
RÁE
9709 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
9710 adding sections the garbage collector removed.
9711 * gold/testsuite/Makefile.am: Add test.
9712 * gold/testsuite/Makefile.in: Regenerate.
9713 * gold/testsuite/plugin_test_7.sh: New.
9714 * gold/testsuite/plugin_test_7_1.c: New.
9715 * gold/testsuite/plugin_test_7_2.c: New.
9716
f4187277
RÁE
97172010-05-26 Rafael Espindola <espindola@google.com>
9718
9719 * script-sections.cc (Output_section_definition::set_section_addresses):
9720 Check for --section-start.
9721
5c388529
DK
97222010-05-26 Doug Kwan <dougkwan@google.com>
9723
9724 * arm.cc (Arm_scan_relocatable_relocs): New class.
9725 (Target_arm::relocate_special_relocatable): New method.
9726 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
9727 (Arm_relocate_functions::thumb_branch_common): Same.
9728 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
9729 instead of Default_scan_relocatable_relocs.
9730 * target-reloc.h (relocate_for_relocatable): Let target handle
9731 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
9732 * target.h (Sized_target::relocate_special_relocatable): New method.
9733
bca1c3ae
ILT
97342010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9735
9736 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
9737
0439c796
DK
97382010-05-23 Doug Kwan <dougkwan@google.com>
9739
9740 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
9741 instead of a cast.
9742 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
9743 with a direct branch, not a conditional branch, to a stub.
9744 * merge.cc (Output_merge_base::record_input_section): New method
9745 defintion.
9746 (Output_merge_data::do_add_input_section): Record input section if
9747 keeps-input-sections flag is set.
9748 (Output_merge_string::do_add_input_section): Ditto.
9749 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
9750 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
9751 INPUT_SECTIONS_.
9752 (Output_merge_base::keeps_input_sections,
9753 Output_merge_base::set_keeps_input_sections,
9754 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
9755 method definitions.
9756 (Output_merge_base::Input_sections): New type declaration.
9757 (Output_merge_base::input_sections_begin,
9758 Output_merge_base::input_sections_end,
9759 Output_merge_base::do_set_keeps_input_sections): New method definitions.
9760 (Output_merge_base::bool keeps_input_sections_,
9761 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
9762 Output_merge_base::input_sections_): New data members.
9763 (Output_merge_data::do_set_keeps_input_sections): New method
9764 defintion.
9765 (Output_merge_string::do_set_keeps_input_sections): Ditto.
9766 * output.cc (Output_section::Input_section::relobj): Move method
9767 defintion from class declaration to here and handle merge sections.
9768 (Output_section::Input_section::shndx): Ditto.
9769 (Output_section::Output_section): Remove initializations of removed
9770 data members and initialize new data member LOOKUP_MAPS_.
9771 (Output_section::add_input_section): Set keeps-input-sections flag
9772 for a newly created merge output section as appropriate. Adjust code
9773 to use Output_section_lookup_maps class.
9774 (Output_section::add_relaxed_input_section): Adjst code for lookup
9775 maps code refactoring.
2e702c99 9776 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
9777 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
9778 class. If adding input section to a newly created merge output
9779 section fails, remove the new merge section.
9780 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 9781 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 9782 (Output_section::find_merge_section): Ditto.
0439c796 9783 (Output_section::build_lookup_maps): New method defintion.
2e702c99 9784 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
9785 Output_section_lookup_maps class.
9786 (Output_section::get_input_sections): Export merge sections. Adjust
9787 code to use Output_section_lookup_maps class.
9788 (Output_section:::add_script_input_section): Adjust code to use
9789 Output_section_lookup_maps class. Update lookup maps for merge
9790 sections also.
9791 (Output_section::discard_states): Use Output_section_lookup_maps.
9792 (Output_section::restore_states): Same.
9793 * output.h (Merge_section_properties): Move class defintion out of
9794 Output_section.
9795 (Output_section_lookup_maps): New class.
9796 (Output_section::Input_section::is_merge_section): New method
9797 defintion.
9798 (Output_section::Input_section::relobj): Move defintion out of class
9799 defintion. Declare method only.
9800 (Output_section::Input_section::shndx): Ditto.
9801 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 9802 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
9803 (Output_section::Merge_section_by_properties_map,
9804 Output_section::Output_section_data_by_input_section_map,
9805 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
9806 Remove types.
2e702c99 9807 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
9808 KEEPS_INPUT_SECTIONS.
9809 (Output_section::build_lookup_maps): New method declaration.
9810 (Output_section::merge_section_map_,
9811 Output_section::merge_section_by_properties_map_,
9812 Output_section::relaxed_input_section_map_,
9813 Output_section::is_relaxed_input_section_map_valid_): Remove data
9814 members.
9815 (Output_section::lookup_maps_): New data member.
9816
76295588
L
98172010-05-21 Doug Kwan <dougkwan@google.com>
9818
9819 PR gold/11619
9820 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
9821 avoid a compilation error.
9822
d103a984
RÁE
98232010-05-19 Rafael Espindola <espindola@google.com>
9824
9825 * script-sections.cc (Output_section_definition::allocate_to_segment):
9826 Update the phdrs_list even when the output section is NULL.
9827 * testsuite/Makefile.am: Add test.
9828 * testsuite/Makefile.in: Regenerate.
9829 * testsuite/script_test_9.cc: New.
9830 * testsuite/script_test_9.sh: New.
9831 * testsuite/script_test_9.t: New.
9832
6625d24e
DK
98332010-05-19 Doug Kwan <dougkwan@google.com>
9834
9835 * arm.cc (Arm_input_section::original_size): New method.
9836 (Arm_input_section::do_addralign): Add a cast.
9837 (Arm_input_section::do_output_offset): Remove static cast.
9838 (Arm_input_section::original_addralign,
9839 Arm_input_section::original_size_): Change type to uint32_t.
9840 (Arm_input_section::init): Add safe casts for section alignment
9841 and size.
9842 (Arm_input_section::set_final_data_size): Do not set address and
9843 offset of stub table.
9844 (Arm_output_section::fix_exidx_coverage): Change use of of
9845 Output_section::Simple_input_section to that of
9846 Output_section::Input_section.
9847 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
9848 except for the first pass.
9849 * output.cc (Output_section::get_input_sections): Change type of
9850 input_sections to std::list<Input_section>.
9851 (Output_section::add_script_input_section): Rename from
9852 Output_section::add_simple_input_section. Change type of SIS
9853 parameter from Simple_input_section to Input_section.
9854 * output.h (Output_section::Simple_input_section): Remove class.
9855 (Output_section::Input_section): Change class visibility to public.
9856 (Output_section::Input_section::addralign): Use stored alignments
9857 for special input sections if set.
9858 (Output_section::Input_section::set_addralign): New method.
9859 (Output_section::get_input_sections): Change parameter type from
9860 list of Simple_input_section to list of Input_section.
9861 (Output_section::add_script_input_section): Rename from
9862 Output_section::add_simple_input_section. Change first parameter's
9863 type from Simple_input_section to Input_section and remove the
9864 second and third parameters.
9865 * script-sections.cc (Input_section::Input_section_list): Change
9866 type to list of Output_section::Input_section/
9867 (Input_section_info::Input_section_info): Change parameter type of
9868 INPUT_SECTION to Output_section::Input_section.
9869 (Input_section_info::input_section): Change return type.
9870 (Input_section_info::input_section_): Change type to
9871 Output_section::Input_section.
9872 (Output_section_element_input::set_section_addresses): Adjust code
9873 to use Output_section::Input_section instead of
9874 Output_section::Simple_input_section. Adjust code for renaming
9875 of Output_section::add_simple_input_section.
9876 (Orphan_output_section::set_section_addresses): Ditto.
9877
e1e82ea4
RW
98782010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9879
9880 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
9881 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
9882
91e75c8a
RÁE
98832010-05-18 Rafael Espindola <espindola@google.com>
9884
9885 * options.cc (General_options::finalize): Handle -nostdlib.
9886 * options.h (nostdlib): New option.
9887 * script.cc (script_add_search_dir): Handle -nostdlib.
9888
da59ad79
DK
98892010-05-12 Doug Kwan <dougkwan@google.com>
9890
9891 * arm.cc (Target_arm::do_finalize_sections): Create an empty
9892 attributes section only if there no attributes section after merging.
9893 (Target_arm::merge_object_attributes): Move value of
e1df38aa 9894 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
9895 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
9896 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
9897 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
9898 and arm_attr_merge_7.stdout.
9899 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
9900 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
9901 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
9902 arm_attr_merge_7b.o): New rules.
9903 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
9904 arm_attr_merge_7
9905 * testsuite/Makefile.in: Regenerate.
9906 * testsuite/arm_attr_merge.sh: New file.
9907 * testsuite/arm_attr_merge_[67][ab].s: Same.
9908
3e01a7fd
NC
99092010-05-05 Nick Clifton <nickc@redhat.com>
9910
9911 * po/es.po: Updated Spanish translation.
9912
7ad2014a
L
99132010-04-27 H.J. Lu <hongjiu.lu@intel.com>
9914
9915 * Makefile.am (install-exec-local): Properly install gold as
9916 default cross linker.
9917 * Makefile.in: Regenerated.
9918
4fda8867
NC
99192010-04-27 H.J. Lu <hongjiu.lu@intel.com>
9920 Nick Clifton <nickc@redhat.com>
9921
9922 * configure.ac (install_as_default): Define and set to false
9923 unless --enable-gold or --enable-gold=both/gold has been
9924 specified.
9925 * configure: Regenerate.
9926
9927 * Makefile.am (install-exec-local): Install the executable as
9928 'ld.gold'. If install_as_default is true then also install it as
9929 'ld'.
9930 * Makefile.in: Regenerated.
9931
bd288ea2
ILT
99322010-04-24 Ian Lance Taylor <iant@google.com>
9933
9934 * layout.cc (Layout::layout_reloc): In relocatable link don't
9935 combine reloc sections for grouped sections.
9936
ef38fd8a
ST
99372010-04-23 Sriraman Tallam <tmsriram@google.com>
9938
9939 * gc.h (gc_process_relocs): Pass information on relocs pointing to
9940 sections that are not ordinary to icf.
9941 * icf.cc (get_section_contents): Handle relocation pointing to section
9942 with no object or shndx information.
9943 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
9944 * testsuite/Makefile.in: Regenerate.
9945 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
9946 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
9947
f6973bdc
ILT
99482010-04-22 Ian Lance Taylor <iant@google.com>
9949
9950 * expression.cc (Expression::Expression_eval_info): Add
9951 result_alignment_pointer field.
9952 (Expression::eval_with_dot): Add result_alignment_pointer
9953 parameter. Change all callers.
9954 (Expression::eval_maybe_dot): Likewise.
9955 (class Binary_expression): Add alignment_pointer parameter to
9956 left_value and right_value. Change all callers.
9957 (BINARY_EXPRESSION): Set result alignment.
9958 (class Trinary_expression): Add alignment_pointer parameter to
9959 arg2_value and arg3_value. Change all callers.
9960 (Trinary_cond::value): Set result alignment.
9961 (Max_expression::value, Min_expression::value): Likewise.
9962 (Align_expression::value): Likewise.
9963 * script-sections.cc (class Sections_element): Add dot_alignment
9964 parameter to set_section_addresses virtual function. Update
9965 instantiations.
9966 (class Output_section_element): Likewise.
9967 (Script_sections::create_segments): Add dot_alignment parameter.
9968 Change all callers.
9969 (Script_sections::create_segments_from_phdrs_clause): Likewise.
9970 (Script_sections::set_phdrs_clause_addresses): Likewise.
9971 * script-sections.h: Update declarations.
9972 * script.h: Update declarations.
9973 * output.h (Output_segment::set_minimum_p_align): Don't decrease
9974 min_p_align.
9975 * testsuite/script_test_3.t: Set large alignment.
9976 * testsuite/script_test_3.sh: Make sure that at least one LOAD
9977 segment has expected alignment.
9978
9c9c98a5
NC
99792010-04-22 Nick Clifton <nickc@redhat.com>
9980
9981 * po/gold.pot: Updated by the Translation project.
9982 * po/vi.po: Updated Vietnamese translation.
9983
2253bfba
L
99842010-04-22 H.J. Lu <hongjiu.lu@intel.com>
9985
9986 * testsuite/Makefile.am (check_PROGRAMS): Add
9987 icf_virtual_function_folding_test.
9988 * testsuite/Makefile.in: Regenerated.
9989
85fdf906
AH
99902010-04-15 Andrew Haley <aph@redhat.com>
9991
9992 * options.h (merge_exidx_entries): New option.
9993 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
9994 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
9995 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
9996 (Target_arm::merge_exidx_entries): New function.
9997 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
9998 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
9999 to Arm_exidx_fixup constructor.
10000 Add new arg, merge_exidx_entries.
10001 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
10002 Arm_output_section::fix_exidx_coverage.
10003
ce97fa81
ST
100042010-04-18 Sriraman Tallam <tmsriram@google.com>
10005
10006 * icf.cc (get_section_contents): Check for preemptible functions.
10007 Ignore addend when appropriate.
10008 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
10009 section folded.
10010 (add_from_relobj): Check for section folded.
10011 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
10012 * symtab.h (should_add_dynsym_entry): Add new parameter.
10013 * target-reloc.h (scan_relocs): Check for section folded.
10014 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
10015 Check reloc types for function pointers in shared objects.
10016 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
10017 case.
10018 (icf_preemptible_functions_test): New test case.
10019 (icf_string_merge_test): New test case.
10020 * testsuite.Makefile.in: Regenerate.
10021 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
10022 bar_glob. Refactor code.
10023 * testsuite/icf_preemptible_functions_test.cc: New file.
10024 * testsuite/icf_preemptible_functions_test.sh: New file.
10025 * testsuite/icf_string_merge_test.cc: New file.
10026 * testsuite/icf_string_merge_test.sh: New file.
10027 * testsuite/icf_virtual_function_folding_test.cc: New file.
10028 * testsuite/icf_virtual_function_folding_test.sh: New file.
10029
04ceb17c
DK
100302010-04-14 Doug Kwan <dougkwan@google.com>
10031
10032 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
10033 for local symbol recounting if we remove a section due to ICF.
10034 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
10035 there are no regular objects in input.
10036
153e7da4
DK
100372010-04-13 Doug Kwan <dougkwan@google.com>
10038
10039 * arm.cc (Arm_input_section::set_final_data_size): Compute
10040 accurate final data size instead of using current data size.
10041
4dbd9faf
DK
100422010-04-09 Doug Kwan <dougkwan@google.com>
10043
10044 * layout.cc (Layout::choose_output_section): Handle script section
10045 types.
10046 (Layout::make_output_section_for_script): Add section type parameter.
10047 Handle script section types.
10048 * layout.h (Layout::make_output_section_for_script): Add section
10049 type parameter.
10050 * output.cc (Output_section::Output_section): Initialize data member
10051 is_noload_.
10052 (Output_section::do_reset_address_and_file_offset): Do not set address
10053 to 0 if section is a NOLOAD section.
10054 * output.h (Output_section::is_noload): New method.
10055 (Output_section::set_is_noload): Ditto.
10056 (Output_section::is_noload_): New data member.
10057 * script-c.h (Script_section_type): New enum type.
10058 (struct Parser_output_section_header): Add new file section_type.
10059 * script-sections.cc (Sections_element::output_section_name): Add
10060 parameter for returning script section type.
10061 (Output_section_definition::output_section_name): Ditto.
10062 (Output_section_definition::section_type)P; New method.
10063 (Output_section_definiton::script_section_type_name): Ditto.
10064 (Output_section_definition::script_section_type_): New data member.
10065 (Output_section_definition::Output_section_definition): Initialize
10066 data member Output_section_definition::script_section_type_.
10067 (Output_section_definition::create_sections): Pass script section type
10068 to Layout::make_output_section_for_script.
10069 (Output_section_definition::output_section_name): Return script
10070 section type to caller.
10071 (Output_section_definition::set_section_address): Do not advance
10072 dot value and load address if section type is NOLOAD. Set address
10073 of NOLOAD sections regardless of section flags.
10074 (Output_section_definition::print): Print section type if it is
10075 not SCRIPT_SECTION_TYPE_NONE.
10076 (Output_section_definition::section_type): New method.
10077 (Output_section_definition::script_section_type_name): Ditto.
10078 (Script_sections::output_section_name): Add new parameter
10079 PSECTION_TYPE for returning script section type. Pass it to
10080 section elements. Handle discard sections.
10081 (Sort_output_sections::operator()): Handle NOLOAD sections.
10082 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 10083 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
10084 returning script section type.
10085 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
10086 INFO and NOLOAD.
10087 * yyscript.y (union): Add new field SECTION_TYPE.
10088 (COPY, DSECT, INFO, NOLOAD): New tokens.
10089 (opt_address_and_section_type): Change type to output_section_header.
10090 (section_type): New non-terminal
10091 (section_header): Handle section type.
2253bfba 10092 (opt_address_and_section_type): Return section type value.
4dbd9faf 10093
721ea635
L
100942010-04-09 H.J. Lu <hongjiu.lu@intel.com>
10095
10096 * testsuite/plugin_common_test_1.c (foo): Add prototype.
10097 * testsuite/plugin_common_test_2.c (foo): Likewise.
10098
6bf924b0
DK
100992010-04-08 Doug Kwan <dougkwan@google.com>
10100
10101 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
10102 Output_merge_data.
10103 * output.cc (Output_section::add_merge_input_section): Simplify
10104 code and return status of Output_merge_base::add_input_section.
e1df38aa 10105 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
10106 returns true.
10107
24af6f92
DK
101082010-04-07 Doug Kwan <dougkwan@google.com>
10109
10110 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
10111 if section is marked as containing instructions but has no mapping
10112 symbols.
10113 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
10114 correct section index.
10115 (Arm_relobj::find_linked_text_section): Ditto.
10116
00698fc5
CC
101172010-04-07 Cary Coutant <ccoutant@google.com>
10118
10119 * archive.cc (include_member): Destroy Read_symbols_data object before
10120 releasing file.
10121 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
10122 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
10123 (Read_symbols_data::~Read_symbols_data) New destructor.
10124 (Section_relocs::Section_relocs) New constructor.
10125 (Section_relocs::~Section_relocs) New destructor.
10126 (Read_relocs_data::Read_relocs_data) New constructor.
10127 (Read_relocs_data::~Read_relocs_data) New destructor.
10128 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
10129 pointers to NULL after deleting.
10130
7296d933
DK
101312010-04-07 Doug Kwan <dougkwan@google.com>
10132
10133 * arm.cc: Replace "endianity" with "endianness" in comments.
10134 (Arm_exidx_cantunwind): Ditto.
10135 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
10136 (Arm_relobj::merge_flags_and_attributes): New method.
10137 (Arm_relobj::merge_flags_and_attributes_): New data member.
10138 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
10139 (Arm_relobj::scan_sections_for_stubs): Ditto.
10140 (Arm_relobj::do_read_symbols): Check to see if we really want to
10141 merge processor-specific flags and attributes. Exit early if
10142 an object is empty except for section names and the undefined symbol.
10143 (Target_arm::do_finalize_sections): Move check for ELF format to
10144 Arm_relobj::do_read_symbols. Merge processor specific flags and
10145 attributes from a regular object only when we have determined that
10146 it is aapropriate. Do not create an .ARM.attributes section in
10147 output if there is no regular input object.
10148 (Target_arm::merge_processor_specific_flags): Check
10149 --warn-mismatch before printing any error.
10150 (Target_arm::merge_object_attributes): Ditto.
10151 * gold.cc (queue_middle_tasks): Handle the case in which there is
10152 no regular object in input.
10153 * options.cc (General_options::parse_EB): New method.
10154 (General_options::parse_EL): Same.
10155 (General_options::General_options): Initialize endianness_.
10156 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
10157 New options.
10158 (General_options::Endianness): New enum.
10159 (General_options::endianness): New method.
10160 (General_options::endianness_): New data member.
10161 * parameters.cc (Parameters::set_options): Check target endianness.
10162 (Parameters::set_target_once): Ditto.
10163 (Parameters::check_target_endianness): New method.
10164 (parameters_force_valid_target): If either -EL or -EB is specified,
10165 use it to define endianness of default target.
10166 * parameters.h (Parameters::check_target_endianness): New method
10167 declaration.
10168 * target.h (class Target): Change "endianity" to "endianness"
10169 in comments.
10170
efc8d4f2
RW
101712010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10172
10173 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
10174 * configure: Regenerate.
10175 * Makefile.in: Regenerate.
10176 * testsuite/Makefile.in: Regenerate.
10177
be234d88
CC
101782010-04-06 Cary Coutant <ccoutant@google.com>
10179
10180 gcc PR lto/42757
10181 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
10182 prevailing definitions of common symbols.
10183 * testsuite/plugin_test_6.sh: New test case.
10184 * testsuite/plugin_common_test_1.c: New test case.
10185 * testsuite/plugin_common_test_2.c: New test case.
10186 * testsuite/Makefile.am (plugin_test_6): New test case.
10187 * testsuite/Makefile.in: Regenerate.
10188
bd32c6bd
NC
101892010-04-06 Nick Clifton <nickc@redhat.com>
10190
10191 * po/vi.po: New Vietnamese translation.
10192
323c532f
DK
101932010-03-30 Doug Kwan <dougkwan@google.com>
10194
10195 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
10196
4fcd97eb
DK
101972010-03-25 Doug Kwan <dougkwan@google.com>
10198
10199 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
10200 to avoid a conversion warning on a 32-bit host.
10201
4ebf39db
ILT
102022010-03-24 Ian Lance Taylor <iant@google.com>
10203
10204 * testsuite/script_test_3.t: Add a TLS segment.
10205 * testsuite/Makefile.am (check_PROGRAMS): Add
10206 tls_phdrs_script_test.
10207 (tls_phdrs_script_test_SOURCES): Define.
10208 (tls_phdrs_script_test_DEPENDENCIES): Define.
10209 (tls_phdrs_script_test_LDFLAGS): Define.
10210 (tls_phdrs_script_test_LDADD): Define.
10211 * testsuite/Makefile.in: Rebuild.
10212
4a599bdd
CC
102132010-03-23 Cary Coutant <ccoutant@google.com>
10214
10215 * fileread.cc (find_or_make_view): Fix comment.
10216
6c93b22c
ILT
102172010-03-23 Ian Lance Taylor <iant@google.com>
10218
10219 * script-sections.cc (class Orphan_section_placement): Define
10220 PLACE_TLS and PLACE_TLS_BSS.
10221 (Orphan_section_placement::Orphan_section_placement): Initialize
10222 new places.
10223 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
10224 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
10225 (tls_script_test_SOURCES): Define.
10226 (tls_script_test_DEPENDENCIES): Define.
10227 (tls_script_test_LDFLAGS): Define.
10228 (tls_script_test_LDADD): Define.
10229 * testsuite/Makefile.in: Rebuild.
10230
a2c7281b
DK
102312010-03-22 Doug Kwan <dougkwan@google.com>
10232
10233 * arm.cc (Arm_relocate_functions::abs8,
10234 Arm_relocate_functions::abs16): Use correct check for overflow
10235 specified in the ARM ELF specs.
10236 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
10237 target of a BLX instruction specially.
10238 (Reloc_stub::stub_type_for_reloc): Ditto.
10239 (Relocate::relocate): Use symbolic names instead of numeric relocation
10240 codes to report error.
10241 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
10242 workaround.
10243 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
10244 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
10245 thumb2_blx_out_of_range.stdout
10246 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
10247 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
10248 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
10249 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
10250 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
10251 thumb2_blx_in_range, thumb2_blx_in_range.o,
10252 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
10253 thumb2_blx_out_of_range.o): New rules.
2e702c99 10254 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
10255 thumb2_blx_in_range and thumb2_blx_out_of_range.
10256 * testsuite/Makefile.in: Regenerate.
10257 * arm_branch_in_range.sh: Add tests for THUMB BLX.
10258 * testsuite/thumb_blx_in_range.s: New file.
10259 * testsuite/thumb_blx_out_of_range.s: New file.
10260
b0193076
RÁE
102612010-03-22 Rafael Espindola <espindola@google.com>
10262
10263 * archive.cc (Should_include): Move to archive.h.
10264 (should_include_member): Make it a member of Archive.
10265 (Lib_group): New.
10266 (Add_lib_group_symbols): New.
10267 * archive.h: Include options.h.
10268 (Archive_member): Moved from Archive.
10269 (Should_include): Moved from archive.cc.
10270 (Lib_group): New.
10271 (Add_lib_group_symbols): New.
10272 * dynobj.cc (do_should_include_member): New.
10273 * dynobj.h (do_should_include_member): New.
10274 * gold.cc (queue_initial_tasks): Update call to queue.
10275 * main.cc (main): Print lib group stats.
10276 * object.cc (do_should_include_member): New.
10277 * object.h: Include archive.h.
10278 (Object::should_include_member): New.
10279 (Object::do_should_include_member): New.
10280 (Sized_relobj::do_should_include_member): New.
10281 * options.cc (General_options::parse_start_lib): New.
10282 (General_options::parse_end_lib): New.
10283 (Input_arguments::add_file): Handle lib groups.
10284 (Input_arguments::start_group): Check we are not in a lib.
10285 (Input_arguments::start_lib): New.
10286 (Input_arguments::end_lib): New.
10287 * options.h (General_options): Add start_lib and end_lib.
10288 (Input_argument::lib_): New.
10289 (Input_argument::lib): New.
10290 (Input_argument::is_lib): New.
10291 (Input_file_lib): New.
10292 (Input_arguments::in_lib_): New.
10293 (Input_arguments::in_lib): New.
10294 (Input_arguments::start_lib): New.
10295 (Input_arguments::end_lib_): New.
10296 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
10297 in unused members as preempted.
10298 (Sized_pluginobj::do_should_include_member): New.
10299 * plugin.h (Sized_pluginobj::do_should_include_member): New.
10300 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
10301 return the blocker.
10302 (Read_symbols::do_whole_lib_group): New.
10303 (Read_symbols::do_lib_group): New.
10304 (Read_symbols::do_read_symbols): Handle lib groups.
10305 (Read_symbols::get_name): Handle lib groups.
10306 * readsyms.h (Read_symbols): Add an archive member pointer.
10307 (Read_symbols::do_whole_lib_group): New.
10308 (Read_symbols::do_lib_group): New.
10309 (Read_symbols::member_): New.
10310 * script.cc (read_input_script): Update call to queue_soon.
10311
d099120c
DK
103122010-03-19 Doug Kwan <dougkwan@google.com>
10313
10314 * arm.cc (Stub_table::Stub_table): Initialize new data members
10315 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10316 (Stub_table::add_reloc_stub): Assign stub offset and update
10317 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10318 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
10319 New data members.
2e702c99 10320 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
10321 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
10322 instead of going over all reloc stubs.
2e702c99 10323 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
10324 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10325 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 10326 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
10327 Stringpool_template::offset_.
10328 * stringpool.h (Stringpool_template::set_no_zero_null): Set
10329 Stringpool_template::offset_ to zero.
10330
1aa37384
DK
103312010-03-15 Doug Kwan <dougkwan@google.com>
10332
10333 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10334 offset_.
10335 (Stringpool_template::new_key_offset): New method.
10336 (Stringpool_template::add_string): Assign offsets when adding new
10337 strings.
10338 (Stringpool_template::set_string_offsets): Do not set string offsets
10339 when not optimizing.
10340 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
10341 member size_.
2e702c99
RM
10342 (Chunked_vector::clear): Clear size_.
10343 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
10344 (Chunked_vector::size): Return size_.
10345 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 10346 (Chunked_vector::size_): New data member.
1aa37384
DK
10347 (Stringpool_template::set_no_zero_null): Assert string set is empty.
10348 (Stringpool_template::new_key_offset): New method declaration.
10349 (Stringpool_template::offset_): New data member.
10350
b672b057
RÁE
103512010-03-15 Rafael Espindola <espindola@google.com>
10352
10353 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
10354 Add_symbols' constructor.
10355 * readsyms.h (Add_symbols): Remove the input_group member.
10356
b6848d3c
ILT
103572010-03-10 Ian Lance Taylor <iant@google.com>
10358
10359 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
10360 target to ask whether a reference to a symbol requires a stack
10361 split.
10362 * target.h (Target::is_call_to_non_split): New function.
10363 (Target::do_is_call_to_non_split): Declare virtual function.
10364 * target.cc: Include "symtab.h".
10365 (Target::do_is_call_to_non_split): New function.
10366 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
10367
a2a5469e
CC
103682010-03-10 Cary Coutant <ccoutant@google.com>
10369
10370 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
10371 (File_read::open[1]): Remove initial mapping of whole_file_view_.
10372 (File_read::open[2]): Add whole_file_view_ to list of views.
10373 (File_read::make_view): Remove test of whole_file_view_.
10374 (File_read::find_or_make_view): Create whole_file_view_ if
10375 necessary.
10376 (File_read::clear_views): Replace bool parameter with enum;
10377 adjust all callers. Don't delete views with permanent data;
10378 do delete cached views and views from archives if
10379 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
10380 if clearing the corresponding view.
10381 * fileread.h (File_read::Clear_views_mode): New enum.
10382 (File_read::View::is_permanent_view): New method.
10383 (File_read::clear_views): Replace bool parameter
10384 with enum; adjust all callers.
10385 * options.h (General_options): Change keep_files_mapped option;
10386 add map_whole_files.
10387 * readsyms.cc (Add_symbols::run): Delete sd_ object before
10388 releasing the file.
10389 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
10390 the file.
10391
8861f32b
DM
103922010-03-10 David S. Miller <davem@davemloft.net>
10393
10394 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
10395
d62d0f5f
ST
103962010-03-09 Sriraman Tallam <tmsriram@google.com>
10397
10398 * icf.cc (get_section_contents): Add '@' marker after processing the
10399 merge reloc.
10400
9177756d
DK
104012010-03-08 Doug Kwan <dougkwan@google.com>
10402
10403 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
10404 due to a conversion warning.
10405 (Arm_relobj::update_output_local_symbol_count): Check for local
10406 symbol with unset output index.
10407
9e9e071b
ILT
104082010-03-05 Ian Lance Taylor <iant@google.com>
10409
10410 * options.h (class General_options): Add --spare-dynamic-tags.
10411 * output.cc (Output_data_dynamic::set_final_data_size): Implement
10412 --spare-dynamic-tags.
10413
a81ee015
ILT
104142010-03-05 Ian Lance Taylor <iant@google.com>
10415
10416 * incremental.cc: Include "libiberty.h".
10417
44ec90b9
RO
104182010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
10419
10420 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
10421 function, is_info_ member.
10422 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
10423 (Versions::Versions): Update caller.
10424 (Versions::define_base_version): Likewise.
10425 (Versions::add_def): Likewise.
10426
0897ed3b
ST
104272010-03-03 Sriraman Tallam <tmsriram@google.com>
10428
10429 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
10430 (Scan::possible_function_pointer_reloc): New function.
10431 (Scan::local_reloc_may_be_function_pointer): Change to call
10432 possible_function_pointer_reloc.
10433 (Scan::global_reloc_may_be_function_pointer): Ditto.
10434 * icf.h (Icf::check_section_for_function_pointers): Change to reject
10435 relocations in ".data.rel.ro._ZTV" section.
10436 * testsuite/icf_safe_so_test.sh: Change to pass i386.
10437 * testsuite/icf_safe_so_test.cc: Ditto.
10438 * testsuite/icf_safe_test.cc: Ditto.
10439 * testsuite/icf_safe_test.sh: Ditto.
10440
d3bbad62
ILT
104412010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10442 Ian Lance Taylor <iant@google.com>
10443
10444 * target-reloc.h (relocate_section): Check the symbol table index
10445 for -1U before setting the local symbol index.
10446 (scan_relocatable_relocs): If copying the relocation, record that
10447 the local symbol is required.
10448 * object.h (Symbol_value::is_output_symtab_index_set): New
10449 function.
10450 (Symbol_value::may_be_discarded_from_output_symtab): New
10451 function.
10452 (Symbol_value::has_output_symtab_entry): New function.
10453 (Symbol_value::needs_output_symtab_entry): Remove.
10454 (Symbol_value::output_symtab_index): Make sure the symbol index is
10455 set.
10456 (Symbol_value::set_output_symtab_index): Make sure the symbol
10457 index is not set. Make sure the new index is valid.
10458 (Symbol_value::set_must_have_output_symtab_entry): New function.
10459 (Symbol_value::has_output_dynsym_entry): New function.
10460 (Symbol_value::set_output_dynsym_index): Make sure the new index
10461 is valid.
10462 (Sized_relobj::set_must_have_output_symtab_entry): New function.
10463 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
10464 local symbol if permitted.
10465 (Sized_relobj::do_finalize_local_symbols): Call
10466 is_output_symtab_index_set rather than needs_output_symtab_entry.
10467 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
10468 rather than needs_output_symtab_entry. Call
10469 has_output_dynsym_entry rather than needs_output_dynsym_entry.
10470 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
10471 is_output_symtab_index_set rather than needs_output_symtab_entry.
10472 * testsuite/discard_locals_relocatable_test.c: New file.
10473 * testsuite/discard_locals_test.sh: Test -r.
10474 * testsuite/Makefile.am (check_DATA): Add
10475 discard_locals_relocatable_test1.syms,
10476 discard_local_relocatable_test2.syms.
10477 (MOSTLYCLEANFILES): Likewise. Also add
10478 discard_locals_relocatable_test1.lout and
10479 discard_locals_relocatable_test2.out.
10480 (discard_locals_relocatable_test1.syms): New target.
10481 (discard_locals_relocatable_test.o): New target.
10482 (discard_locals_relocatable_test1.out): New target.
10483 (discard_locals_relocatable_test2.syms): New target.
10484 (discard_locals_relocatable_test2.out): New target.
10485 (various): Add missing ../ld-new dependencies.
10486 * testsuite/Makefile.in: Rebuild.
10487
7e8ccf26
NC
104882010-03-03 Nick Clifton <nickc@redhat.com>
10489
10490 * po/fi.po: New Finnish translation.
10491
2a0ff005
DK
104922010-03-01 Doug Kwan <dougkwan@google.com>
10493
10494 * layout.cc (Layout::Layout): Force section types of .init_array*,
10495 .preinit_array* and .fini_array* sections.
10496 * output.cc (Output_section::Input_section_sort_entry::has_priority):
10497 Fix check of return value of std::string::find.().
10498 (Output_section::Input_section_sort_compare::operator()): Remove
10499 comment about .init_array.
10500 (Output_section::Input_section_sort_init_fini_compare::operator()):
10501 New method.
10502 (Output_section::sort_attached_input_sections): Handle .init_array
10503 and .fini_array specially.
10504 * output.h (Output_section::Inut_section_sort_compare): Update
10505 comment.
10506 (Output_section::Input_section_sort_init_fini_compare): New struct.
10507
c3e4ae29
DK
105082010-02-26 Doug Kwan <dougkwan@google.com>
10509
10510 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
10511 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
10512 * testsuite/debug_msg.sh: Avoid matching source line number for
10513 use of global variable undef_int.
10514
2fd9ae7a
DK
105152010-02-26 Doug Kwan <dougkwan@google.com>
10516
10517 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
10518 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
10519 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
10520 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
10521 * options.cc (General_options::General_options): Initialize member
10522 fix_v4bx_.
10523 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
10524 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
10525 and rm_no_fix_v4bx.stdout
10526 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
10527 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
10528 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
10529 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
10530 and arm_no_fix_v4bx.
10531 * Makefile.in: Regenerate.
10532 * testsuite/arm_fix_v4bx.s: New file.
10533 * testsuite/arm_fix_v4bx.sh: Ditto.
10534
67ec7d0b
DK
105352010-02-24 Doug Kwan <dougkwan@google.com>
10536
10537 * arm.cc (Target_arm::got_section): Make the .got section the first
10538 non RELRO section in the data segment.
10539 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
10540 suffixes of section names.
10541
10165461
DK
105422010-02-24 Doug Kwan <dougkwan@google.com>
10543
10544 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
10545 flags and attributes merging if an input file is a binary file.
10546 * fileread.cc (Input_file::open): Record format of original file.
10547 * fileread.h (Input_file::Format): New enum type.
2e702c99 10548 (Input_file::Input_file): Initialize data member format_.
10165461
DK
10549 (Input_file::format): New method definition.
10550 (Input_file::format_):: New data member.
10551
4a54abbb
DK
105522010-02-24 Doug Kwan <dougkwan@google.com>
10553
10554 * arm.cc (Arm_output_data_got): New class.
10555 (ARM_TCB_SIZE): New constant
10556 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
10557 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
10558 If user uses a script with a SECTIONS clause, issue only a warning
10559 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 10560 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
10561 garbage collection.
10562 (Target_arm::got_mode_index_entry): Handle static linking.
10563 (Target_arm::Scan::local): Ditto.
10564 (Target_arm::Scan::global): Ditto.
10565 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
10566 all incorrectly implemented relocations.
e1df38aa 10567 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
10568 Arm_output_section::fix_exidx_coverage.
10569 * layout.cc (Layout::section_name_mapping): Remove trailing dots
10570 from ".ARM.exidx." and ".ARM.extab.".
10571
ca419a6f
ILT
105722010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10573
10574 * arm.cc (Target_arm::do_finalize_sections): Create attribute
10575 section if it does not already exist.
10576 * attributes.cc (Attributes_section_data::Attributes_section_data):
10577 Don't crash if size is zero.
10578
135b9c78
ILT
105792010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10580 Ian Lance Taylor <iant@google.com>
10581
10582 * gold.cc (queue_middle_tasks): If no input files were opened,
10583 exit.
10584 * workqueue.h (Task_function::Task_function): Assert that there is
10585 a blocker.
10586
bb0bfe4f
DK
105872010-02-22 Doug Kwan <dougkwan@google.com>
10588
10589 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
10590 * icf.cc (get_section_contents): Cast snprintf arguments to long long
10591 types to avoid warnings due to different uint64_t implementations
10592 on different hosts.
10593
2a2b6d42
DK
105942010-02-21 Doug Kwan <dougkwan@google.com>
10595
10596 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
10597 handling of the maximum backward branch offset.
2e702c99 10598 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
10599 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
10600 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 10601 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
10602 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
10603 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
10604 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
10605 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
10606 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
10607 thumb_bl_out_of_range thumb_bl_out_of_range.o,
10608 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
10609 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
10610 thumb2_bl_out_of_range.o): New rules.
10611 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
10612 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
10613 thumb2_bl_out_of_range
10614 * testsuite/Makefile.in: Regenerate.
10615 * testsuite/arm_bl_in_range.s: New file.
10616 * testsuite/arm_bl_out_of_range.s: Ditto.
10617 * testsuite/arm_branch_in_range.sh: Ditto.
10618 * testsuite/arm_branch_range.t: Ditto.
10619 * testsuite/thumb2_branch_range.t: Ditto.
10620 * testsuite/thumb_bl_in_range.s: Ditto.
10621 * testsuite/thumb_bl_out_of_range.s: Ditto.
10622 * testsuite/thumb_branch_range.t: Ditto.
10623
b487ad64
ST
106242010-02-20 Sriraman Tallam <tmsriram@google.com>
10625
10626 * gc.h (gc_process_relocs): Change vectors to point to the new list.
10627 Add reloc offset information.
10628 * icf.cc (get_section_contents): Change iterators to point to the new
10629 vectors. Add reloc offset information to the contents.
10630 * icf.h (Icf::Sections_reachable_info): New typedef.
10631 (Icf::Sections_reachable_list): New typedef.
10632 (Icf::Offset_info): New typedef.
10633 (Icf::Reloc_info): New struct typedef.
10634 (Icf::Reloc_info_list): New typedef.
10635 (Icf::symbol_reloc_list): Delete method.
10636 (Icf::addend_reloc_list): Delete method.
10637 (Icf::section_reloc_list): Delete method.
10638 (Icf::reloc_info_list): New method.
10639 (Icf::reloc_info_list_): New member.
10640
f96accdf
DK
106412010-02-19 Doug Kwan <dougkwan@google.com>
10642
10643 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
10644 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
10645 * arm.cc (Arm_relocation_functions): New forward declaration.
10646 (Target_arm::Target_arm): Initialize new data members
10647 got_mod_index_offset_ and tls_base_symbol_defined_.
10648 (Target_arm::Relocate::relocate_tls): New method.
10649 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
10650 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
10651 New methods.
2e702c99 10652 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
10653 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
10654 (Target_arm::got_mod_index_offset_,
10655 Target_arm::tls_base_symbol_defined_): New data members.
10656 (Target_arm::Scan::local, Target::Scan::global,
10657 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
10658 relocations.
10659
c8761b9a
DK
106602010-02-18 Doug Kwan <dougkwan@google.com>
10661
10662 * arm.cc (Arm_relobj::find_linked_text_section): New method.
10663 (Arm_relobj::make_exidx_input_section): Pass section index of linked
10664 text section as a parameter becuase some broken tools may not set
10665 the link in section header.
10666 (Target_arm::has_got_section): New method.
10667 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
10668 without any mapping symbol as data only. Remove warning.
10669 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
10670 link in its section header, try to discover the link by inspecting the
10671 REL31 relocation at the beginning of the section.
10672 (Target_arm::Scan::check_non_pic): Report name of offending relocation
10673 in error message.
10674 (Target_arm::Scan::global): Treat any reference to the symbol
10675 _GLOBAL_OFFSET_TABLE_ as a GOT access.
10676
21bb3914
ST
106772010-02-12 Sriraman Tallam <tmsriram@google.com>
10678
10679 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
10680 (Scan::global_reloc_may_be_function_pointer): New function.
10681 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10682 (Scan::global_reloc_may_be_function_pointer): New function.
10683 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10684 (Scan::global_reloc_may_be_function_pointer): New function.
10685 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
10686 (Scan::global_reloc_may_be_function_pointer): New function.
10687 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
10688 (Scan::global_reloc_may_be_function_pointer): New function.
10689 (Scan::possible_function_pointer_reloc): New function.
10690 (Target_x86_64::can_check_for_function_pointers): New function.
10691 * gc.h (gc_process_relocs): Scan relocation types to determine if
10692 function pointers were taken for targets that support it.
10693 * icf.cc (Icf::find_identical_sections): Include functions for
10694 folding in safe ICF whose pointer is not taken.
10695 * icf.h (Secn_fptr_taken_set): New typedef.
10696 (fptr_section_id_): New member.
10697 (section_has_function_pointers): New function.
10698 (set_section_has_function_pointers): New function.
10699 (check_section_for_function_pointers): New function.
10700 * options.h: Fix comment for safe ICF option.
10701 * target.h (can_check_for_function_pointers): New function.
10702 * testsuite/Makefile.am: Add icf_safe_so_test test case.
10703 Modify icf_safe_test for X86-64.
10704 * testsuite/Makefile.in: Regenerate.
10705 * testsuite/icf_safe_so_test.cc: New file.
10706 * testsuite/icf_safe_so_test.sh: New file.
10707 * testsuite/icf_safe_test.cc (kept_func_3): New function.
10708 (main): Change to take pointer to function kept_func_3.
10709 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
10710 folding is done correctly for X86-64.
10711
0da6fa6c
DM
107122010-02-12 David S. Miller <davem@davemloft.net>
10713
10714 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
10715 is_symbolless parameter.
10716 (Output_reloc<SHT_REL>::is_symbolless): New.
10717 (Output_reloc<SHT_REL>::is_symbolless_): New.
10718 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
10719 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
10720 (Output_reloc<SHT_RELA>::is_symbolless): New.
10721 (Output_data_reloc::add_global): Handle is_symbolless.
10722 (Output_data_reloc::add_global_relative): Likewise.
10723 (Output_data_reloc::add_local): Likewise.
10724 (Output_data_reloc::add_local_relative): Likewise.
10725 (Output_data_reloc::add_symbolless_global_addend): New.
10726 (Output_data_reloc::add_symbolless_local_addend): New.
10727 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
10728 is_symbolless.
10729 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
10730 instead of ->is_relative_
10731 (Output_reloc::write): Likewise.
10732 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
10733 (Output_reloc::write_rel): Simplify.
10734
10735 * sparc.cc (Target_sparc::Scan::local): Use
10736 ->add_symbolless_local_addend as needed.
10737 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
10738 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
10739 based upon relocation offset.
10740
e4782e83
DK
107412010-02-11 Doug Kwan <dougkwan@google.com>
10742
10743 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
10744 (Target_arm::Scan::global): Ditto. Also remove a comment before the
10745 beginning of function.
10746 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
10747 and MOVT_ABS relocations. Those are non issued in scanning. Fix
10748 parameter is_32bit in calls to should_apply_static_reloc.
10749 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
10750 (check_DATA): Add arm_abs_global.stdout.
10751 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
10752 arm_abs_global.stdout): New rules.
10753 (MOSTLLYCLEANFILES): Add arm_abs_global
10754 * Makefile.in: Regenerate.
10755 * testsuite/arm_abs_global.s: New file.
10756 * testsuite/arm_abs_global.sh: Ditto.
10757 * testsuite/arm_abs_lib.s: Ditto.
10758
93ceb764
ILT
107592010-02-11 Ian Lance Taylor <iant@google.com>
10760
10761 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
10762 Read_relocs task.
10763 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
10764 Allocate_commons_task first.
10765 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
10766 task, rather than symtab_lock_.
10767 (Gc_process_relocs::~Gc_process_relocs): New function.
10768 (Gc_process_relocs::is_runnable): Check this_blocker_.
10769 (Gc_process_relocs::locks): Use next_blocker_ rather than
10770 blocker_.
10771 (Scan_relocs::~Scan_relocs): New function.
10772 (Scan_relocs::is_runnable): Check this_blocker_ rather than
10773 symtab_lock_.
10774 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
10775 next_blocker_.
10776 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
10777 fields. Add this_blocker_ and next_blocker_ fields. Adjust
10778 constructor accordingly.
10779 (class Gc_process_relocs): Likewise.
10780 (class Scan_relocs): Likewise.
10781 * common.h (class Allocate_commons_task): Remove symtab_lock_
10782 field, and corresponding constructor parameter.
10783 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
10784 symtab_lock_.
10785 (Allocate_commons_task::locks): Likewise.
10786
114dfbe1
ILT
107872010-02-11 Ian Lance Taylor <iant@google.com>
10788
10789 * gold-threads.h (class Once): Define.
10790 (class Initialize_lock): Rewrite as child of Once.
10791 * gold-threads.cc (class Once_initialize): Define.
10792 (once_pointer_control): New static variable.
10793 (once_pointer, once_arg): New static variables.
10794 (c_run_once): New static function.
10795 (Once::Once, Once::run_once, Once::internal_run): New functions.
10796 (class Initialize_lock_once): Remove.
10797 (initialize_lock_control): Remove.
10798 (initialize_lock_pointer): Remove.
10799 (initialize_lock_once): Remove.
10800 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
10801 (Initialize_lock::initialize): Rewrite.
10802 (Initialize_lock::do_run_once): New function.
10803 * archive.cc (Archive::interpret_header): Only clear name if it is
10804 not already empty.
10805 * fileread.cc: Include "gold-threads.h"
10806 (file_counts_lock): New static variable.
10807 (file_counts_initialize_lock): Likewise.
10808 (File_read::release): Only increment counts when using --stats.
10809 Use a lock around the increment.
10810 * parameters.cc (class Set_parameters_target_once): Define.
10811 (set_parameters_target_once): New static variable.
10812 (Parameters::Parameters): Move here from parameters.h.
10813 (Parameters::set_target): Rewrite.
10814 (Parameters::set_target_once): New function.
10815 (Parameters::clear_target): Move here and rewrite.
10816 * parameters.h (class Parameters): Update declarations. Add
10817 set_parameters_target_once_ field.
10818 (Parameters::Parameters): Move to parameters.cc.
10819 (Parameters::clear_target): Likewise.
10820 * readsyms.cc (Read_symbols::do_group): Create a Start_group
10821 task.
10822 (Start_group::~Start_group): New function.
10823 (Start_group::is_runnable): New function.
10824 (Start_group::locks, Start_group::run): New functions.
10825 (Finish_group::run): Change saw_undefined to size_t.
10826 * readsyms.h (class Start_group): Define.
10827 (class Finish_group): Change saw_undefined_ field to size_t.
10828 (Finish_group::Finish_group): Remove saw_undefined and
10829 this_blocker parameters. Change all callers.
10830 (Finish_group::set_saw_undefined): New function.
10831 (Finish_group::set_blocker): New function.
10832 * symtab.h (class Symbol_table): Change saw_undefined to return
10833 size_t. Change saw_undefined_ field to size_t.
10834 * target-select.cc (Set_target_once::do_run_once): New function.
10835 (Target_selector::Target_selector): Initialize set_target_once_
10836 field. Don't initialize lock_ and initialize_lock_ fields.
10837 (Target_selector::instantiate_target): Rewrite.
10838 (Target_selector::set_target): New function.
10839 * target-select.h (class Set_target_once): Define.
10840 (class Target_selector): Update declarations. Make
10841 Set_target_once a friend. Remove lock_ and initialize_lock_
10842 fields. Add set_target_once_ field.
10843
fa17a3f4
ILT
108442010-02-10 Ian Lance Taylor <iant@google.com>
10845
10846 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
10847 queueing any tasks.
10848 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
10849 (queue_middle_tasks): Add all blockers before queueing any tasks.
10850 (queue_final_tasks): Likewise.
10851 * token.h (Task_token::add_blockers): New function.
10852 * object.h (Input_objects::number_of_relobjs): New function.
10853
c7177d31
ILT
108542010-02-10 Ian Lance Taylor <iant@google.com>
10855
5de0e392
ILT
10856 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
10857 shared, not if not position independent.
10858 * x86_64.cc (Relocate::relocate_tls): Likewise.
10859 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
10860 (tls_pie_pic_test): New target.
10861 * testsuite/Makefile.in: Rebuild.
10862
c7177d31
ILT
10863 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
10864 (tls_test_main_pie.o, tls_test_pie.o): New targets.
10865 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
10866 * testsuite/Makefile.in: Rebuild.
10867
684b268a
DM
108682010-02-09 David S. Miller <davem@davemloft.net>
10869
10870 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
10871 R_SPARC_RELATIVE using ->add_local_relative().
10872 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
10873
612a8d3d
DM
10874 * output.h (Output_data_dynamic::add_section_size): New method
10875 that takes two Output_data objects.
10876 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
10877 entry param. Handle it in initializers.
10878 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
10879 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
10880 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
10881 arg.
10882 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
10883 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
10884 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
10885 for dynrel_includes_plt.
10886 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10887 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10888 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
10889 before .rela.plt
10890 (Target_sparc::do_finalize_sections): Update to pass true for
10891 dynrel_includes_plt.
10892 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
10893 output before .rela.plt
10894 (Target_powerpc::do_finalize_sections): Update to pass true for
10895 dynrel_includes_plt when 32-bit.
10896
cb1be87e
DK
108972010-02-08 Doug Kwan <dougkwan@google.com>
10898
10899 * arm.cc (Arm_relobj::simple_input_section_output_address): New
10900 method.
10901 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
10902 Arm_relobj::scan_section_for_cortex_a8_stubs,
10903 Arm_relobj::do_relocation_section): Instead of calling
10904 Output_section::output_address, use faster
10905 Arm_relobj::simple_input_section_output_address.
10906
705b5121
DM
109072010-02-08 David S. Miller <davem@davemloft.net>
10908
10909 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
10910 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
10911 relocation helper function.
10912
024c4466
DM
10913 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
10914 just like R_SPARC_GOT{10,13,22}.
10915 (Target_sparc::Scan::local): Likewise.
10916 (Target_sparc::Relocate:relocate): Likewise.
10917
9109c078
ILT
109182010-02-06 Ian Lance Taylor <iant@google.com>
10919
10920 * configure.ac: Rewrite targetobjs duplicate removal code to use
10921 only shell constructs.
10922 * configure: Rebuild.
10923
cf846138
DK
109242010-02-05 Doug Kwan <dougkwan@google.com>
10925
10926 PR 11247
10927 * arm.cc (Arm_relobj::section_is_scannable): New method.
10928 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
10929 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
10930
6cfaf60b
DK
109312010-02-04 Doug Kwan <dougkwan@google.com>
10932
10933 PR 11247
10934 * arm-reloc-property.cc (cstdio): Include.
10935 * configure.ac (targetobjs): Remove duplicates.
10936 * configure: Regenerate.
10937 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
10938 big and little endian version for a given address size.
10939
5c57f1be
DK
109402010-02-03 Doug Kwan <dougkwan@google.com>
10941
10942 * arm-reloc-property.cc
10943 (Arm_reloc_property_table::reloc_name_in_error_message): New method
10944 definition.
10945 * arm-reloc-property.h
10946 (Arm_reloc_property_table::get_implemented_static_reloc_property):
10947 New method definition.
10948 (Arm_reloc_property_table::reloc_name_in_error_message): New method
10949 declaration.
10950 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
10951 overflow to N.
10952 (GOT_PREL): Change implemented to Y.
10953 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
10954 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
10955 (Arm_relocate_functions::movw_abs_nc): Remove method.
10956 (Arm_relocate_functions::movt_abs): Ditto.
10957 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
10958 (Arm_relocate_functions::thm_movt_abs): Ditto.
10959 (Arm_relocate_functions::movw_rel_nc): Ditto.
10960 (Arm_relocate_functions::movw_rel): Ditto.
10961 (Arm_relocate_functions::movt_rel): Ditto.
10962 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
10963 (Arm_relocate_functions:thm_movw_rel): Ditto.
10964 (Arm_relocate_functions:thm_movt_rel): Ditto.
10965 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
10966 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
10967 New method definitions.
10968 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
10969 (Arm_relocation_functions::arm_grp_ldr): Ditto.
10970 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
10971 (Arm_relocation_functions::arm_grp_ldc): Ditto.
10972 (Target_arm::Relocate::relocate): Check for non-static or
10973 unimplemented relocation code and exit early. Change calls to
10974 Target_arm::reloc_uses_thumb_bit and
10975 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
10976 instead. Refactor code to handle similar relocations to increase
10977 code sharing. Remove check for unsupported relocation code in switch
10978 statement.
10979 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
10980 relocation property table to find out size. Change error message to
10981 print out the name of a relocation code instead of the numeric value.
10982 (Target_arm::scan_reloc_for_stub): Use relocation property table
10983 instead of calling Target_arm::reloc_uses_thumb_bit().
10984
218c5831
DK
109852010-02-02 Doug Kwan <dougkwan@google.com>
10986
10987 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
10988 types of relaxed input section.
10989
0d31c79d
DK
109902010-02-02 Doug Kwan <dougkwan@google.com>
10991
10992 * Makefile.am (HFILES): Add arm-reloc-property.h.
10993 (DEFFILES): New.
2e702c99
RM
10994 (TARGETSOURCES): Add arm-reloc-property.cc
10995 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
10996 (libgold_a_SOURCES): $(DEFFILES)
10997 * Makefile.in: Regenerate.
10998 * arm-reloc-property.cc: New file.
10999 * arm-reloc-property.h: New file.
11000 * arm-reloc.def: New file.
11001 * arm.cc: Update comments.
11002 (arm-reloc-property.h): New included header.
11003 (arm_reloc_property_table): New global variable.
11004 (Target_arm::do_select_as_default_target): New method definition.
11005 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
11006 arm-reloc-property to targ_extra_obj.
11007 * parameters.cc (set_parameters_target): Call
11008 Target::select_as_default_target().
11009 * target.h (Target::select_as_default_target): New method definition.
11010 (Target::do_select_as_default_target): Same.
11011
546c7457
DK
110122010-02-01 Doug Kwan <dougkwan@google.com>
11013
11014 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
11015 first_output_text_section_.
11016 (Arm_exidx_fixup::first_output_text_section): New method definition.
11017 (Arm_exidx_fixup::first_output_text_section_): New data member.
11018 (Arm_exidx_fixup::process_exidx_section): Record the first text
11019 output section seen.
11020 (Arm_output_section::fix_exidx_coverage): Set correct linked section
11021 and entsize in output section header.
11022
11b861d5
DK
110232010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11024
11025 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
11026 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
11027 (Arm_relocate_functions::thm_alu11): New Method.
11028 (Arm_relocate_functions::thm_pc8): New Method.
11029 (Arm_relocate_functions::thm_pc12): New Method.
11030 (Target_arm::Scan::local): Handle the relocations.
11031 (Target_arm::Scan::global): Likewise.
11032 (Target_arm::Relocate::relocate): Likewise.
11033 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11034
c9a2c125
DK
110352010-01-29 Doug Kwan <dougkwan@google.com>
11036
11037 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
11038 of relocation types as ld.
11039
1521477a
DK
110402010-01-29 Doug Kwan <dougkwan@google.com>
11041
11042 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
11043 to public.
11044 (Arm_relocate_functions::thumb_branch_common): Ditto.
11045 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
11046 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
11047 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
11048 Arm_relocate_functions::jump24): Remove.
11049 (Target_arm::Relocate::relocate): Adjust code to call
11050 Arm_relocation_functions::arm_branch_common and
11051 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 11052 wrappers. Merge switch-cases together to reduce source code size.
1521477a 11053
e7eca48c
DK
110542010-01-29 Doug Kwan <dougkwan@google.com>
11055
11056 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
11057 output_local_symbol_count_needs_update_.
11058 (Arm_relobj::output_local_symbol_count_needs_update,
11059 Arm_relobj::set_output_local_symbol_count_needs_update,
11060 Arm_relobj::update_output_local_symbol_count): New methods.
11061 (Arm_relobj::output_local_symbol_count_needs_update_): New data
11062 member.
11063 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
11064 of pointed function as in a R_ARM_PREL31 relocation.
11065 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
11066 for output local symbol count updating.
11067 (Target_arm::do_relax): Update output local symbol counts in objects
11068 if necessary.
11069 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
11070
02961d7e
ILT
110712010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11072
11073 * arm.cc: Added support for the ARM relocations:
11074 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
11075 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
11076 (Arm_relocate_functions::movw_rel_nc): Renamed (was
11077 movw_prel_nc).
11078 (Arm_relocate_functions::movw_rel): New method.
11079 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
11080 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
11081 thm_movw_prel_nc).
11082 (Arm_relocate_functions::thm_movw_rel): New method.
11083 (Arm_relocate_functions::thm_movt_rel): Renamed (was
11084 thm_movt_prel).
11085 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
11086 relocations.
11087 (Target_arm::Scan::global): Likewise.
11088 (Target_arm::Relocate::relocate): Likewise.
11089 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11090 Likewise.
11091
b10d2873
ILT
110922010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11093
11094 * arm.cc: Added support for ARM group relocations.
11095 (Target_arm::reloc_needs_sym_origin): New method.
11096 (Arm_relocate_functions::calc_grp_kn): New method.
11097 (Arm_relocate_functions::calc_grp_residual): New method.
11098 (Arm_relocate_functions::calc_grp_gn): New method.
11099 (Arm_relocate_functions::arm_grp_alu): New Method.
11100 (Arm_relocate_functions::arm_grp_ldr): New Method.
11101 (Arm_relocate_functions::arm_grp_ldrs): New Method.
11102 (Arm_relocate_functions::arm_grp_ldc): New Method.
11103 (Target_arm::Scan::local): Handle the ARM group relocations.
11104 (Target_arm::Scan::global): Likewise.
11105 (Target_arm::Relocate::relocate): Likewise.
11106 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11107 Likewise.
11108
2b328d4e
DK
111092010-01-26 Doug Kwan <dougkwan@google.com>
11110
11111 * arm.cc (set): Include.
11112 (class Arm_exidx_fixup): Change type of last_input_section_ to const
11113 pointer type.
2e702c99 11114 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
11115 (Arm_output_section::append_text_sections_to_list): New method.
11116 (Arm_output_section::fix_exidx_coverage): Ditto.
11117 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 11118 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
11119 Relobj::set_section_offset() instead of
11120 Sized_relobj::invalidate_section_offset().
2e702c99 11121 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
11122 parameter for section headers. Ignore relocation sections for
11123 unallocated sections and EXIDX sections.
11124 (Target_arm::fix_exidx_coverage): New method.
11125 (Target_arm::output_section_address_less_than): New type.
11126 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
11127 linked text section instead of the EXIDX section.
11128 (Arm_output_section::create_stub_group): Add an assertion to check
11129 that this is not an EXIDX output section.
11130 (Arm_output_section::append_text_sections_to_list): New method.
11131 (Arm_output_section::fix_exidx_coverage): Ditto.
11132 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 11133 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
11134 (Target_arm::do_relax): Fix EXIDX output section coverage in the
11135 first pass.
11136 (Target_arm::fix_exidx_coverage): New method.
11137 * object.h (Relobj::set_output_section): New method.
11138 (Sized_relobj::invalidate_section_offset): Remove method.
11139 (Sized_relobj::do_invalidate_section_offset): Remove method.
11140 (Sized_relobj::do_set_section_offset): Handle offset value -1.
11141
c7f3c371
DK
111422010-01-25 Doug Kwan <dougkwan@google.com>
11143
11144 * arm.cc (Arm_exidx_merged_section::do_output_offset):
11145 Fix warning due to signed and unsigned comparison on a 32-bit host.
11146
8923b24c
DK
111472010-01-22 Doug Kwan <dougkwan@google.com>
11148
11149 * arm.cc (Target_arm::do_relax): Record an output section for section
11150 offset adjustment it contains any stub table that has changed.
11151 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
11152 offsets in an output section if necessary.
11153 * output.cc (Output_section::Output_section): Initialize
11154 section_offsets_need_adjustments_.
11155 (Output_section::add_input_section_for_script): Renamed to
11156 Output_section::add_simple_input_section.
11157 (Output_section::save_states): Add a comment.
11158 (Output_section::discard_states): New method defintion.
11159 (Output_section::adjust_section_offsets): Same.
11160 * output.h (Output_section::add_input_section_for_script): Renamed to
11161 Output_section::add_simple_input_section.
11162 (Output_section::discard_states): New method declaration.
11163 (Output_section::adjust_section_offsets): Same.
11164 (Output_section::section_offsets_need_adjustment,
11165 Output_section::set_section_offsets_need_adjustment): New method
11166 definitions.
11167 (Output_section::section_offsets_need_adjustment_): New data member.
11168 * script-sections.cc
11169 (Output_section_element_input::set_section_address): Adjust code for
11170 renaming of Output_section::add_input_section_for_script.
11171 (Orphan_output_section::set_section_address): Same.
11172
9b2fd367
DK
111732010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11174
11175 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
11176 Fix_v4bx enum values .
11177 * gold/options.h (General_options): New option definitions.
11178 (General_options::fix_v4bx): New method.
11179 (General_options::Fix_v4bx): New enum.
11180 * gold/options.cc (General_options::parse_fix_v4bx): New method.
11181 (General_options::parse_fix_v4bx_interworking): New method.
11182
80d0d023
DK
111832010-01-22 Doug Kwan <dougkwan@google.com>
11184
11185 * arm.cc (Arm_exidx_fixup): New class.
11186
af2cdeae
DK
111872010-01-21 Doug Kwan <dougkwan@google.com>
11188
11189 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
11190 classes.
11191 (Arm_exidx_section_offset_map): New type.
11192
993d07c1
DK
111932010-01-21 Doug Kwan <dougkwan@google.com>
11194
11195 * arm.cc (Arm_exidx_input_section): New class.
11196 (Arm_relobj::exidx_input_section_by_link,
11197 Arm_relobj::exidx_input_section_by_shndx,
11198 Arm_relobj::make_exidx_input_section): New methods.
11199 (read_arm_attributes_section): Remove.
11200 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
11201 information about them.
11202 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
11203 to here.
11204
5ac169d4
DK
112052010-01-20 Doug Kwan <dougkwan@google.com>
11206
11207 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
11208 Input_section_specifier to Section_id.
11209 (Target_arm::new_arm_input_section: Adjust code for change of key
11210 type.
11211 (Target_arm::find_arm_input_section): Ditto.
11212 * gc.h (object.h): Include for Section_id nand Section_id_hash.
11213 (Section_id): Remove.
11214 (Garbage_collection::Section_id_hash): Remove.
11215 * icf.h (object.h): Include for Section_id nand Section_id_hash.
11216 (Section_id): Remove.
11217 (Icf::Section_id_hash): Remove.
11218 * object.h (Section_id, Const_section_id, Section_id_hash,
11219 Const_section_id_hash): New type definitions.
11220 * output.cc (Output_section::add_relaxed_input_section): Change to
11221 use Const_section_id instead of Input_section_specifier as key type.
11222 (Output_section::add_merge_input_section): Ditto.
11223 (Output_section::build_relaxation_map): Change to use Section_id
11224 instead of Input_section_specifier as key type.
2e702c99 11225 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
11226 Ditto.
11227 (Output_section::convert_input_sections_to_relaxed_sections): Change
11228 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 11229 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
11230 (Output_section::find_relaxed_input_section): Ditto.
11231 * output.h (Input_section_specifier): Remove class.
11232 (Output_section::Output_section_data_by_input_section_map): Change
11233 key type to Const_section_id.
11234 (Output_section::Output_relaxed_input_section_by_input_section_map):
11235 Ditto.
11236 (Output_section::Relaxation_map): Change key type to Section_id.
11237
a2162063
ILT
112382010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11239
11240 * gold/arm.cc: Added support for R_ARM_V4BX relocation
11241 (class Arm_v4bx_stub): New class.
11242 (DEF_STUBS): Updated definition to support v4_veneer_bx.
11243 (Stub_factory::make_arm_v4bx_stub): New method.
11244 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
11245 (Stub_table::empty): Handle v4bx stubs.
11246 (Stub_table::add_arm_v4bx_stub): New method.
11247 (Stub_table::find_arm_v4bx_stub): New method.
11248 (Arm_relocate_functions::v4bx): New method.
11249 (Target_arm::fix_v4bx): New method.
11250 (Target_arm::Target_arm): Handle R_ARM_V4BX.
11251 (Stub_table::relocate_stubs): Likewise.
11252 (Stub_table::do_write): Likewise.
11253 (Stub_table::update_data_size_and_addralign): Likewise.
11254 (Stub_table::finalize_stubs): Likewise.
11255 (Target_arm::Scan::local): Likewise.
11256 (Target_arm::Scan::global): Likewise.
11257 (Target_arm::do_finalize_sections): Likewise.
11258 (Target_arm::Relocate::relocate): Likewise.
11259 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11260 Likewise.
11261 (Target_arm::scan_reloc_for_stub): Likewise.
11262 (Target_arm::scan_reloc_section_for_stubs): Likewise.
11263
5696ab0b
ILT
112642010-01-19 Ian Lance Taylor <iant@google.com>
11265
11266 * output.cc (Output_section_headers::do_sized_write): Write large
11267 segment count to sh_info field.
11268 (Output_file_header::do_sized_write): For large segment count,
11269 write PN_XNUM to e_phnum field.
11270
800d0f56
ILT
112712010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11272
11273 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
11274 (Arm_relocate_functions::thm_jump8): New function.
11275 (Arm_relocate_functions::thm_jump11): New function.
11276 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
11277 R_ARM_THM_JUMP11.
11278 (Target_arm::Scan::global): Likewise.
11279 (Target_arm::Relocate::relocate): Likewise.
11280 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11281 Likewise.
11282
41263c05
DK
112832010-01-14 Doug Kwan <dougkwan@google.com>
11284
11285 * arm.cc (map, utility): Include headers.
11286 (Target_arm::apply_cortex_a8_workaround): New method.
11287 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
11288 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
11289 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
11290 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
11291 the --[no-]fix-cortex-a8 command line options.
11292 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
11293 (Target_arm::relocate_stub): Use addend in instruction template.
11294 * options.h (DEFINE_bool): Set the user-set flag.
11295 (General_options): Add --[no-]-fix-cortex options.
11296 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 11297 : Update fast look-up map after conversion.
41263c05 11298
459e9b03
ST
112992010-01-14 Sriraman Tallam <tmsriram@google.com>
11300
11301 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
11302 in the first pass of do_layout.
11303
b521dfe4
DK
113042010-01-13 Doug Kwan <dougkwan@google.com>
11305
11306 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11307 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
11308 apparent compiler problem of not folding static constant integral
11309 data members of elfcpp::Elf_sizes<32>.
11310
44272192
DK
113112010-01-13 Doug Kwan <dougkwan@google.com>
11312
11313 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11314 Arm_relobj::section_needs_cortex_a8_stub_scanning,
11315 Arm_relobj::scan_section_for_cortex_a8_erratum,
11316 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
11317 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
11318 sections to scan for relocation stubs into a new method
11319 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
11320 relocation and Cortex-A8 stub scanning.
11321 (Target_arm::do_relax): Force stubs to be after stubbed sections
11322 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 11323 the beginning of a new relaxation pass. Update a comment.
44272192
DK
11324 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
11325
44b71ece
ILT
113262010-01-12 Ian Lance Taylor <iant@google.com>
11327
11328 * target-reloc.h (visibility_error): New inline function.
11329 (relocate_section): Call visibility_error.
11330 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
11331 (MOSTLYCLEANFILES): Likewise.
11332 (protected_4_pic.o, protected_3.err): New targets.
11333 * testsuite/protected_4.cc: New file.
11334
a120bc7f
DK
113352010-01-12 Doug Kwan <dougkwan@google.com>
11336
11337 * arm.cc (Cortex_a8_reloc): New class.
11338 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
11339 and cortex_a8_relocs_info_.
11340 (Target_arm::fix_cortex_a8): New method definition.
11341 (Target_arm::Cortex_a8_relocs_info): New type.
11342 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
11343 New data member declarations.
11344 (Target_arm::scan_reloc_for_stub): Record information about
11345 relocations for THUMB branches that might be exempted from the
11346 Cortex-A8 workaround.
11347 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
11348 at the beginning of a relaxation pass.
11349
20138696
DK
113502010-01-12 Doug Kwan <dougkwan@google.com>
11351
11352 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
11353 (Arm_relobj::Mapping_symbol_position,
11354 Arm_reloj::Mapping_symbol_position_less,
11355 Arm_relobj::Mapping_symbols_info): New types.
11356 (Target_arm::is_mapping_symbol_name): New method definition.
11357 (Arm_relobj::do_count_local_symbols): Save information about mapping
11358 symbols.
11359
089d69dc
DK
113602010-01-11 Doug Kwan <dougkwan@google.com>
11361
11362 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
11363 Arm_relocate_functions::thumb32_branch_upper,
11364 Arm_relocate_functions::thumb32_branch_lower,
11365 Arm_relocate_functions::thumb32_cond_branch_offset,
11366 Arm_relocate_functions::thumb32_cond_branch_upper,
11367 Arm_relocate_functions::thumb32_cond_branch_lower,
11368 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
11369 branch offset encoding.
11370 (Arm_relocate_functions::thumb_branch_common): Use new branch
11371 offset encoding methods to avoid code duplication.
11372 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
11373 (Stub_addend_reader::operator()): Use new branch encoding method
11374 to avoid code duplication.
11375
99e5bff2
DK
113762010-01-11 Doug Kwan <dougkwan@google.com>
11377
11378 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
11379 (Target_arm::do_finalize_sections): Define special EXIDX section
11380 symbols only if referenced.
11381 * gc.h (Garbage_collection::add_reference): New method.
11382 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
11383 code duplication.
11384
98e090bd
ILT
113852010-01-11 Ian Lance Taylor <iant@google.com>
11386
d0a91bd8
ILT
11387 * script.cc (Version_script_info::build_expression_list_lookup):
11388 Change complaing about duplicate wildcard match from error to
11389 warning.
11390
98e090bd
ILT
11391 * script.cc (class Lazy_demangler): Recreate--revert part of patch
11392 of 2009-12-30.
11393 (Version_script_info::Version_script_info): Initialize globs_,
11394 default_version_, default_is_global_, and exact_. Don't
11395 initialize globals_ or locals_.
11396 (Version_script_info::build_lookup_tables): Build local symbols
11397 first.
11398 (Version_script_info::unquote): New function.
11399 (Version_script_info::add_exact_match): New function.
11400 (Version_script_info::build_expression_list_lookup): Remove lookup
11401 parameter. Add is_global parameter. Change all callers. Handle
11402 wildcard pattern specially. Unquote pattern. Call
11403 add_exact_match.
11404 (Version_script_info::get_name_to_match): New function.
11405 (Version_script_info::get_symbol_version): New function.
11406 (Version_script_info::get_symbol_version_helper): Remove.
11407 (Version_script_info::check_unmatched_names): Call unquote.
11408 * script.h (class Version_script_info): Change get_symbol_version
11409 to be non-inline and add is_global parameter; change all callers.
11410 Rewrite symbol_is_local. Update declarations. Define struct
11411 Version_tree_match, Exact, Globs. Don't define struct Lookup.
11412 Remove globals_ and locals_ members. Add exact_, globs_,
11413 default_version_, is_global_.
11414 (Version_script_info::Glob): Remove pattern, add expression and
11415 is_global. Update constructor. Change all callers.
11416 * dynobj.cc (Versions::finalize): Mark the version symbol as the
11417 default version.
11418 (Versions::symbol_section_contents): If a symbol is undefined, or
11419 defined in a dynamic object, set the version index to
11420 VER_NDX_LOCAL.
11421 * symtab.cc (Symbol_table::add_from_relobj): Don't call
11422 symbol_is_local.
11423 (Symbol_table::add_from_pluginobj): Likewise.
11424 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
11425
d56962d3
DK
114262010-01-11 Doug Kwan <dougkwan@google.com>
11427
11428 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
11429 (incremental_dump_LDADD): Add linking option for libintl.
11430 * Makefile.in: Regenerate.
11431
94e6ee91
L
114322010-01-11 H.J. Lu <hongjiu.lu@intel.com>
11433
11434 PR gold/11144
11435 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
11436 instead of -Ds.
11437 * testsuite/Makefile.in: Regenerated.
11438
e96c574b
DK
114392010-01-10 Doug Kwan <dougkwan@google.com>
11440
11441 * options.h (DEFINE_var): Use parentheses around argument varname__
11442 in macro body to avoid any unintended subsequent substitutions.
11443
7198066b
ILT
114442010-01-10 Ian Lance Taylor <iant@google.com>
11445
ba4d53bf
ILT
11446 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
11447 candidates before doing symbol resolution.
11448
7198066b
ILT
11449 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
11450 ODR candidates if only one is weak.
11451
a2beed37
ILT
114522010-01-08 Ian Lance Taylor <iant@google.com>
11453
11454 * script.cc (Version_script_info::build_expression_list_lookup):
11455 Don't warn about ambiguous version, just record the ambiguity.
11456 (Version_script_info::get_symbol_version_helper): Give error if
11457 version is ambiguous.
11458
2fb7225c
DK
114592010-01-08 Doug Kwan <dougkwan@google.com>
11460
11461 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
11462 prev_data_size_ and prev_addralign_. Remove initializer for
11463 deleted data member has_been_changed_.
11464 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
11465 to determine if the table is empty.
11466 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
11467 Remove.
11468 (Stub_table::add_reloc_stub): Define method in class definition
11469 instead of just declaring it there.
11470 (Stub_table::add_cortex_a8_stub): New method definition.
11471 (Stub_table::update_data_size_and_addralign): Ditto.
11472 (Stub_table::finalize_stubs): Ditto.
11473 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
11474 (Stub_table::do_addralign_): Return address alignment in the
11475 (Stub_table::do_reset_address_and_file_offset): Define method in
11476 class definition instead of declaring it there. Set current data
11477 size to be the data size of the previous pass.
11478 (Stub_table::set_final_data_size): Use current data size as the
11479 final data size.
11480 (Stub_table::relocate_stub): Change parameter type of stub from
11481 Reloc_stub pointer to Stub pointer.
11482 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
11483 (Stub_table::Cortex_a8_stub_list): New typedef.
11484 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
11485 Stub_table::prev_addralign_): New data member.
11486 (Arm_relobj::Arm_relobj): Initialize data member
11487 section_has_cortex_a8_workaround_.
11488 (Arm_relobj::section_has_cortex_a8_workaround,
11489 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
11490 definitions.
11491 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
11492 declarations.
11493 (Target_arm::relocate_stub): Change parameter type of stub from
11494 Reloc_stub pointer to Stub pointer.
11495 (Insn_template::size, Insn_template::alignment): Handle
11496 THUMB16_SPECIAL_TYPE.
11497 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
11498 Stub_table::update_data_size_and_addralign,
11499 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
11500 definitions.
11501 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
11502 (Stub_table::do_write): Ditto.
11503 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 11504
880cd20d
ILT
115052010-01-08 Ian Lance Taylor <iant@google.com>
11506
11507 PR 11108
11508 * symtab.h (class Symbol): Remove fields is_target_special_ and
11509 has_plt_offset_. Add field is_defined_in_discarded_section_.
11510 (Symbol::is_defined_in_discarded_section): New function.
11511 (Symbol::set_is_defined_in_discarded_section): New function.
11512 (Symbol::has_plt_offset): Rewrite.
11513 (Symbol::set_plt_offset): Verify that new offset is not -1U.
11514 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
11515 Don't initialize is_target_special_ or has_plt_offset_.
11516 Initialize is_defined_in_discarded_section_.
11517 (Symbol_table::add_from_relobj): If appropriate, set
11518 is_defined_in_discarded_section.
11519 * resolve.cc (Symbol::override_base_with_special): Don't test
11520 is_target_special_. Change has_plt_offset_ to has_plt_offset().
11521 * target-reloc.h (relocate_section): Do special handling for
11522 symbols defined in discarded sections for global symbols as well
11523 as local symbols.
11524
2703e3eb
ILT
115252010-01-08 Ian Lance Taylor <iant@google.com>
11526
11527 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
11528 the SHT_SYMTAB case.
11529
339d40a3
ILT
115302010-01-08 Ian Lance Taylor <iant@google.com>
11531
11532 * object.cc (Sized_relobj::do_layout): Don't get confused if
11533 layout_eh_frame returns NULL.
11534
abecea76
ILT
115352010-01-08 Ian Lance Taylor <iant@google.com>
11536
11537 PR 11084
11538 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
11539 dynamic symbol table, use the normal symbol table.
11540 (Sized_dynobj::do_read_symbols): Remove assertion about type of
11541 symbol table.
11542
6b7dd3f3
ILT
115432010-01-08 Ian Lance Taylor <iant@google.com>
11544
11545 PR 11072
11546 * layout.cc (Layout::include_section): Remove .gnu_debuglink
11547 sections.
11548
36c50e63
L
115492010-01-08 H.J. Lu <hongjiu.lu@intel.com>
11550
11551 * version.cc (print_version): Change to "Copyright 2010".
11552
e291e7b9
ILT
115532010-01-08 Ian Lance Taylor <iant@google.com>
11554
11555 PR 10287
11556 PR 11063
11557 * i386.cc (class Target_i386): Change return type of plt_section
11558 to be non-const.
11559 (class Output_data_plt_i386): Add tls_desc_rel_ field.
11560 (Output_data_plt_i386::Output_data_plt_i386): Initialize
11561 tls_desc_rel_ field.
11562 (Output_data_plt_i386::rel_tls_desc): New function.
11563 (Target_i386::rel_tls_desc_section): New function.
11564 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
11565 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
11566 R_386_TLS_DESC reloc in rel_tls_desc_section.
11567 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
11568 Define struct Tlsdesc_info.
11569 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
11570 (Target_x86_64::do_reloc_symbol_index): New function.
11571 (Target_x86_64::add_tlsdesc_info): New function.
11572 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
11573 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
11574 tlsdesc_rel_ field.
11575 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
11576 all callers.
11577 (Output_data_plt_x86_64::rela_tlsdesc): New function.
11578 (Target_x86_64::rela_tlsdesc_section): New function.
11579 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
11580 handling.
11581 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
11582 (Target_x86_64::do_reloc_addend): New function.
11583 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
11584 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
11585 declarations. Define TARGET_CODE. Add arg field to u1_ union.
11586 (Output_reloc::type): New function.
11587 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
11588 (Output_reloc::is_target_specific): New function.
11589 (Output_reloc::target_arg): New function.
11590 (class Output_reloc) [SHT_RELA]: Add four new constructors for
11591 absolute relocs and target specific relocs.
11592 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
11593 add_target_specific.
11594 (class Output_data_reloc) [SHT_RELA]: Likewise.
11595 * output.cc (Output_reloc::Output_reloc): Add four new versions
11596 for absolute relocs and target specific relocs.
11597 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
11598 (Output_reloc::get_symbol_index): Likewise.
11599 (Output_reloc::local_section_offset): Check that local_sym_index_
11600 is not TARGET_CODE or 0.
11601 (Output_reloc::symbol_value): Likewise.
11602 (Output_reloc::write) [SHT_RELA]: Call target for target specific
11603 reloc.
11604 * target.h (class Target): Add reloc_symbol_index and reloc_addend
11605 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
11606 functions.
11607 * layout.cc (add_target_dynamic_tags): Use output section for
11608 DT_PLTRELSZ and DT_JMPREL.
11609
3a44184e
ILT
116102010-01-07 Ian Lance Taylor <iant@google.com>
11611
11612 PR 11061
11613 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
11614 function.
11615 (class Output_data_reloc_generic): Define.
11616 (class Output_data_reloc_base): Change base class to
11617 Output_data_reloc_generic. Change add() method to call
11618 bump_relative_reloc_count for a relative reloc. Remove
11619 sort_relocs_ field.
11620 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
11621 to sort_relocs().
11622 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
11623 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
11624 appropriate.
11625 * layout.h (class Layout): Update declaration.
11626
ea715a34
ILT
116272010-01-07 Ian Lance Taylor <iant@google.com>
11628
11629 * output.h (class Output_data): Add const version of
11630 output_section and do_output_section.
11631 (class Output_section_data): Add const version of
11632 do_output_section.
11633 (class Output_section): Likewise.
11634 * layout.cc (Layout::add_target_dynamic_tags): New function.
11635 * layout.h (class Layout): Update declarations.
11636 * arm.cc (Target_arm::do_finalize_sections): Use
11637 add_target_dynamic_tags.
11638 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11639 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11640 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11641 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11642
659948a4
ILT
116432010-01-07 Ian Lance Taylor <iant@google.com>
11644
11645 PR 11042
11646 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
11647 object as needed.
11648
9d3b86f6
ILT
116492010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
11650 Ian Lance Taylor <iant@google.com>
11651
11652 PR 11019
11653 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
11654 Xindex::read_symtab_xindex.
11655
bb0d3eb0
DK
116562010-01-07 Doug Kwan <dougkwan@google.com>
11657
11658 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
11659 (Insn_template::thumb16_bcond_insn): New method declaration.
11660 (Insn_template): Fix spelling.
11661 (Stub::thumb16_special): New method declaration.
11662 (Stub::do_write): Define virtual method which was previously pure
11663 virtual.
11664 (Stub::do_thumb16_special): New method declaration.
11665 (Stub::do_fixed_endian_write): New template member.
11666 (Reloc_stub::do_write): Remove.
11667 (Reloc_stub::do_fixed_endian_write): Remove.
11668 (Cortex_a8_stub): New class definition.
11669 (Stub_factory::make_cortex_a8_stub): New method definition.
11670 (Stub_factory::Stub_factory): Add missing static storage class
11671 qualifier for elf32_arm_stub_a8_veneer_blx.
11672
ffeef7df
ILT
116732010-01-07 Ian Lance Taylor <iant@google.com>
11674
dc3f80fe
ILT
11675 PR 10980
11676 * options.h (class General_options): Add --warn-unresolved-symbols
11677 and --error-unresolved-symbols.
11678 * errors.cc (Errors::undefined_symbol): Implement
11679 --warn-unresolved-symbols.
11680
ffeef7df
ILT
11681 * options.h (class General_options): Add -z text and -z textoff.
11682 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
11683
f1ec9ded
ST
116842010-01-06 Sriraman Tallam <tmsriram@google.com>
11685
11686 * gc.h (Garbage_collection::Cident_section_map): New typedef.
11687 (Garbage_collection::cident_sections): New function.
11688 (Garbage_collection::add_cident_section): New function.
11689 (Garbage_collection::cident_sections_): New member.
11690 (gc_process_relocs): Add references to sections whose names are C
11691 identifiers.
11692 * gold.h (cident_section_start_prefix): New constant.
11693 (cident_section_stop_prefix): New constant.
11694 (is_cident): New function.
11695 * layout.cc (Layout::define_section_symbols): Replace string constants
11696 with the newly defined constants.
11697 * object.cc (Sized_relobj::do_layout): Track sections whose names are
11698 C identifiers.
11699 * testsuite/Makefile.am: Add gc_orphan_section_test.
11700 * testsuite/Makefile.in: Regenerate.
11701 * testsuite/gc_orphan_section_test.cc: New file.
11702 * testsuite/gc_orphan_section_test.sh: New file.
11703
6eda8c29
ILT
117042010-01-06 Ian Lance Taylor <iant@google.com>
11705
b9674e17
ILT
11706 PR 10980
11707 * options.h (class General_options): Add --warn-shared-textrel.
11708 * layout.cc (Layout::finish_dynamic_section): Implement
11709 --warn-shared-textrel.
11710
6eda8c29
ILT
11711 PR 10980
11712 * options.h (class General_options): Add --warn-multiple-gp.
11713
32dcd44e
ILT
117142010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11715
11716 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
11717 $(THREADSLIB) and $(LIBDL).
11718 * Makefile.in: Rebuild.
11719
a192ba05
ILT
117202010-01-06 Ian Lance Taylor <iant@google.com>
11721
11722 PR 10980
11723 * options.cc (General_options::parse_section_start): New function.
11724 (General_options::section_start): New function.
11725 (General_options::General_options): Initialize all members.
11726 * options.h: Include <map>
11727 (class General_options): Add --section-start. Add section_starts_
11728 member.
11729 * layout.cc (Layout::attach_allocated_section_to_segment): If
11730 --section-start was used, set the address of the segment. Remove
11731 local sort_sections.
11732 (Layout::relaxation_loop_body): If the address of the load segment
11733 has been set by --section-start, don't use it.
11734 * output.h (Output_segment::update_flags_for_output_section): New
11735 function.
11736 * output.cc (Output_segment::add_output_section): Call
11737 update_flags_for_output_section.
11738
dde3f402
ILT
117392010-01-05 Ian Lance Taylor <iant@google.com>
11740
62dfdd4d
ILT
11741 PR 10980
11742 * options.h (class General_options): Add --undefined-version.
11743 * script.cc (struct Version_expression): Add was_matched_by_symbol
11744 field.
11745 (Version_script_info::matched_symbol): New function.
11746 (Version_script_info::get_symbol_version_helper): Call
11747 matched_symbol.
11748 (Version_script_info::check_unmatched_names): New function.
11749 * script.h (class Version_script_info): Update declarations.
11750 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
11751
9c4ae156
ILT
11752 * options.h (class General_options): Use DEFINE_bool_alias for
11753 allow_multiple_definition.
11754 * resolve.cc (Symbol_table::should_override): Don't test
11755 allow_multiple_definition.
11756
dde3f402
ILT
11757 PR 10980
11758 * options.h (class General_options): Add --cref.
11759 * main.cc (main): Print cref table if --cref. Don't close mapfile
11760 until after printing cref table.
11761 * cref.cc: Include "symtab.h".
11762 (class Cref_inputs): Define Cref_table_compare and Cref_table.
11763 (Cref_table_compare::operator()): New function.
11764 (Cref_inputs::gather_cref): New function.
11765 (filecol): New static const.
11766 (Cref_inputs::print_cref): New function.
11767 (Cref::print_cref): New function.
11768 * cref.h: Include <cstdio>.
11769 (class Cref): Update declarations.
11770 * mapfile.h (Mapfile::file): New function.
11771 * object.h (class Object): Define Symbols. Declare virtual
11772 do_get_global_symbols.
11773 (Object::get_global_symbols): New function.
11774 * object.cc (Input_objects::add_object): Pass object to cref_ if
11775 --cref.
11776 (Input_objects::archive_start): Likewise.
11777 (Input_objects::archive_stop): Likewise.
11778 (Input_objects::print_cref): New function.
11779 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
11780 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
11781 --cref.
11782 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
11783 function.
11784 * plugin.h (class Sized_pluginobj): Update declarations.
11785
8781f709
ILT
117862010-01-05 Ian Lance Taylor <iant@google.com>
11787
11788 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
11789 to is_default_version. Rename insdef to insdefault.
11790 (Symbol_table::add_from_relobj): Rename def to is_default_version
11791 and local to is_forced_local.
11792 (Symbol_table::add_from_pluginobj): Likewise.
11793 (Symbol_table::add_from_dynobj): Likewise.
11794 (Symbol_table::define_special_symbol): Rename insdef to
11795 insdefault.
11796
fe35d28d
ILT
117972010-01-04 Ian Lance Taylor <iant@google.com>
11798
30bc8c46
ILT
11799 PR 10980
11800 * options.h (class General_options): Add
11801 --allow-multiple-definition and -z muldefs.
11802 * resolve.cc (Symbol_table::should_override): Don't warn about a
11803 multiple symbol definition if --allow-multiple-definition or -z
11804 muldefs.
11805
7eaea549
ILT
11806 PR 10980
11807 * options.h (class General_options): Add --add-needed and
11808 --copy-dt-needed-entries. Tweak --as-needed help entry.
11809 * object.cc (Input_objects::check_dynamic_dependencies): Give an
11810 error if --copy-dt-needed-entries aka --add-needed is used and
11811 would cause a change in behaviour.
11812
fe35d28d
ILT
11813 PR 10980
11814 * options.h (class General_options): Add -G as a short version of
11815 --shared. Add no-op options -assert, -g, and -i.
11816
55a2bb35
ST
118172010-01-04 Sriraman Tallam <tmsriram@google.com>
11818
11819 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
11820 check for .text or .gnu.linkonce.t sections.
11821 * icf.cc (Icf::find_identical_sections): Ditto.
11822 Change the detection for mangled function name within the section
11823 name.
11824 * icf.h (is_section_foldable_candidate): New function.
11825
719328e1
ILT
118262009-12-30 Ian Lance Taylor <iant@google.com>
11827
11828 PR 10980
11829 * options.h (class General_options): Permit two dashes with
11830 --retain-symbols-file.
11831
d7bb5745
ILT
118322009-12-30 Ian Lance Taylor <iant@google.com>
11833
403a15dd
ILT
11834 PR 10979
11835 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
11836 don't put the file header and segment headers in the text
11837 segment.
11838
eda294df
ILT
11839 PR 10979
11840 * common.cc (Sort_commons::operator()): Stabilize sort when both
11841 entries are NULL.
11842 (Symbol_table::do_allocate_commons_list): When allocating common
11843 symbols, skip a symbol which is no longer common.
11844 * symtab.h (Symbol::is_common): Test whether the symbol comes from
11845 an object before checking its type.
11846 * testsuite/common_test_2.c: New file.
11847 * testsuite/common_test_3.c: New file.
11848 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
11849 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
11850 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
11851 (common_test_2_pic.o, common_test_2.so): New targets.
11852 (common_test_3_pic.o, common_test_3.so): New targets.
11853 * testsuite/Makefile.in: Rebuild.
11854
d7bb5745
ILT
11855 PR 10979
11856 * script.cc (read_input_script): If we see a new SECTIONS clause,
11857 and we have added an input section, give an error.
11858 * layout.h (class Layout): Add have_added_input_section function.
11859 Add have_added_input_section_ field.
11860 * layout.cc (Layout::Layout): Initialize
11861 have_added_input_section_.
11862 (Layout::layout): Set have_added_input_section_.
11863 (Layout::layout_eh_frame): Likewise.
11864
fc59c572
ILT
118652009-12-30 Ian Lance Taylor <iant@google.com>
11866
11867 PR 10931
11868 * options.h (class General_options): Add --sort-common option.
11869 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
11870 * common.cc (Sort_common): Add sort_order parameter to
11871 constructor. Add sort_order_ field.
11872 (Sort_commons::operator): Check sort_order_.
11873 (Symbol_table::allocate_commons): Determine the sort order.
11874 (Symbol_table::do_allocate_commons): Add sort_order parameter.
11875 Change all callers.
11876 (Symbol_table::do_allocate_commons_list): Likewise.
11877
1c74fab0
ILT
118782009-12-30 Ian Lance Taylor <iant@google.com>
11879
11880 PR 10916
11881 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
11882 symbols from this object, don't change the visibility of an
11883 undefined symbol.
11884 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
11885
6affe781
ILT
118862009-12-30 Ian Lance Taylor <iant@google.com>
11887
11888 PR 10861
11889 * script.h (class Version_script_info): Define Language enum.
11890 Update declarations. Define Glob, Exact, and Lookup types. Add
11891 new fields globals_, locals_, and is_finalized_.
11892 * script.cc: Various formatting fixes.
11893 (class Parser_closure): Change language_stack_ from a vector of
11894 std::string to one of Version_script_info::Language. Adjust all
11895 uses accordingly.
11896 (class Lazy_demangler): Remove.
11897 (struct Version_expression): Change language from std::string to
11898 Version_script_info::Language.
11899 (Version_script_info::Version_script_info): New function.
11900 (Version_script_info::~Version_script_info): Don't call clear.
11901 (Version_script_info::finalize): New function.
11902 (Version_script_info::build_lookup_tables): New function.
11903 (Version_script_info::build_expression_list_lookup): New
11904 function.
11905 (Version_script_info::get_symbol_version_helper): Rewrite to use
11906 lookup tables.
11907 (Version_script_info::print_expression_list): Adjust to use
11908 Version_script_info::Language.
11909 (script_push_lex_into_version_mode): Check that the version script
11910 has not been finalized.
11911 (version_script_push_lang): Change language string to
11912 Version_script_info::Language.
11913 * options.cc (Command_line::version_script): New function.
11914 * options.h (class General_options): Add finalize_dynamic_list
11915 function. Change version_script from declaration to definition.
11916 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
11917 * testsuite/version_script.map: Remove duplicate def of foo.
11918 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
11919 version_script.map.
11920 * testsuite/Makefile.in: Rebuild.
11921
818bf354
ILT
119222009-12-30 Ian Lance Taylor <iant@google.com>
11923
11924 PR 10843
11925 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
11926 if the input symbol index is 0, make the output symbol index 0.
11927
ebcc8304
ILT
119282009-12-30 Ian Lance Taylor <iant@google.com>
11929
11930 PR 10670
11931 * options.h (class General_options): Add -x/--discard-all.
11932 * object.cc (Sized_relobj::do_count_local_symbols): Handle
11933 --discard-all. If the local symbol needs a dynamic entry, check
11934 that before handling --discard-locals.
11935
176fe33f
ILT
119362009-12-30 Ian Lance Taylor <iant@google.com>
11937
bb321bb1
ILT
11938 PR 10450
11939 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
11940 flags to PF_R.
11941 (Output_segment::add_output_section): Don't change the flags if
11942 the type is PT_TLS.
11943
176fe33f
ILT
11944 PR 10450
11945 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
11946 GNU hash table if they need a dynamic value. Otherwise, don't add
11947 them if they are defined in a dynamic object or are forced local.
11948
e8cd95c7
ILT
119492009-12-29 Ian Lance Taylor <iant@google.com>
11950
1b81fb71
ILT
11951 PR 10450
11952 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
11953 .gnu.hash table for a 32-bit target.
11954
8d6d383d
ILT
11955 PR 10450
11956 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
11957 regular and a dynamic object only needs a dynamic symbol table
11958 entry if it is externally visible.
11959
e785ec03
ILT
11960 PR 10450
11961 * i386.cc (class Target_i386): Initialize global_offset_table_ in
11962 constructor. Add global_offset_table_ field.
11963 (Target_i386::got_section): Set global_offset_table_.
11964 (Target_i386::do_finalize_sections): Set global_offset_table_
11965 size.
11966 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
11967 in constructor. Add global_offset_table_ field.
11968 (Target_x86_64::got_section): Set global_offset_table_.
11969 (Target_x86_64::do_finalize_sections): Set global_offset_table_
11970 size.
11971
1a2dff53
ILT
11972 * layout.cc (Layout::Layout): Initialize increase_relro_.
11973 (Layout::get_output_section): Add is_relro, is_last_relro, and
11974 is_first_non_relro parameters. Change all callers.
11975 (Layout::choose_output_section): Likewise.
11976 (Layout::add_output_section_data): Likewise.
11977 (Layout::make_output_section): Likewise.
11978 (Layout::set_segment_offsets): Clear increase_relro when using a
11979 linker script.
11980 * layout.h (class Layout): Add increase_relro method. Add
11981 increase_relro_ field. Update declarations.
11982 * output.cc (Output_section::Output_section): Initialize
11983 is_last_relro_ and is_first_non_relro_.
11984 (Output_segment::add_output_section): Group relro sections is
11985 do_sort is true. Handle is_last_relro and is_first_non_relro.
11986 (Output_segment::maximum_alignment): Remove relro handling.
11987 (Output_segment::set_section_addresses): Add increase_relro
11988 parameter. Change all callers. Add initial alignment to align
11989 relro sections on separate page. Remove old relro handling.
11990 (Output_segment::set_section_list_addresses): Remove in_relro
11991 parameter. Change all callers.
11992 (Output_segment::set_offset): Add increase parameter. Change all
11993 callers. Remove old relro handling.
11994 * output.h (class Output_section): Add new methods: is_last_relro,
11995 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
11996 Add is_last_relro_ and is_first_non_relro_ fields.
11997 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
11998 Create separate .got.plt section. Call increase_relro.
11999 * x86_64.cc (Target_x86_64::got_section): Likewise.
12000 * testsuite/relro_script_test.t: Add .got.plt.
12001
f0ba79e2
ILT
12002 PR 10450
12003 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
12004 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
12005 (Layout::finalize): Call set_dynamic_symbol_size.
12006 (Layout::set_dynamic_symbol_size): New function.
12007 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
12008 set_dynamic_symbol_size.
12009
e8cd95c7
ILT
12010 PR 10450
12011 * output.h (class Output_section): Add is_entsize_zero_ field.
12012 * output.cc (Output_section::Output_section): Initialize
12013 is_entsize_zero_.
12014 (Output_section::set_entsize): If two different entsizes are
12015 requested, force it to zero.
12016 (Output_section::add_input_section): Set flags for .debug_str
12017 before updating section flags. Set entsize.
12018 (Output_section::update_flags_for_input_section): Set SHF_MERGE
12019 and SHF_STRING if all input sections have those flags.
12020
3e1b9a8a
RÁE
120212009-12-29 Rafael Espindola <espindola@google.com>
12022
12023 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
12024 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
12025 reporting.
3e1b9a8a 12026
3dcad376
ST
120272009-12-29 Sriraman Tallam <tmsriram@google.com>
12028
12029 * options.cc (General_options::parse_version): Allow -v to exit
12030 without an error if there is nothing to link.
12031
084e2665
ILT
120322009-12-29 Ian Lance Taylor <iant@google.com>
12033
12034 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
12035 using a version of gcc before 4.1.
12036 * configure: Rebuild.
12037
250acde3
CD
120382009-12-28 Chris Demetriou <cgd@google.com>
12039
12040 * attributes.cc (Output_attributes_section_data::do_write): Use
12041 std::vector::front rather than std::vector::data.
12042
99fff23b
ILT
120432009-12-28 Ian Lance Taylor <iant@google.com>
12044
12045 * symtab.h (class Symbol_table): Add enum Defined.
12046 * resolve.cc (Symbol_table::should_override): Add defined
12047 parameter. Change all callers. Test whether object is NULL
12048 before calling a method on it.
12049 (Symbol_table::report_resolve_problem): Add defined parameter.
12050 Change all callers.
12051 (Symbol_table::should_override_with_special): Likewise.
12052 * symtab.cc (Symbol_table::define_in_output_data): Add defined
12053 parameter. Change all callers.
12054 (Symbol_table::do_define_in_output_data): Likewise.
12055 (Symbol_table::define_in_output_segment): Likewise.
12056 (Symbol_table::do_define_in_output_segment): Likewise.
12057 (Symbol_table::define_as_constant): Likewise.
12058 (Symbol_table::do_define_as_constant): Likewise.
12059 * script.h (class Symbol_assignment): Add is_defsym parameter to
12060 constructor; change all callers.
12061 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
12062 parameter. Change all callers. Add is_defsym_ field.
12063 (class Parser_closure): Add parsing_defsym parameter to
12064 constructor; change all callers. Add parsing_defsym accessor
12065 function. Add parsing_defsym_ field.
12066
556bd683
ILT
120672009-12-28 Ian Lance Taylor <iant@google.com>
12068
12069 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 12070 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 12071
1782c879
ILT
120722009-12-23 Ian Lance Taylor <iant@google.com>
12073
12074 * i386.cc (Target_i386::do_calls_non_split): Recognize
12075 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
12076 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
12077 -fsplit-stack prologue when using %r11.
1782c879 12078
329ca2b1
ST
120792009-12-21 Sriraman Tallam <tmsriram@google.com>
12080
12081 * options.cc (General_options::parse_version): Make -v continue and do
12082 the link like GNU ld does.
12083
d675ff46
RÁE
120842009-12-17 Rafael Avila de Espindola <espindola@google.com>
12085
12086 * Makefile.am (CCFILES): Add timer.cc.
12087 (HFILES): Add timer.h.
12088 * configure.ac: Check for sysconf and times.
12089 * main.cc: include timer.h.
12090 (main): Use Timer instead of get_run_time.
12091 * timer.cc: New.
12092 * timer.h: New.
12093 * workqueue.cc: include timer.h.
12094 (Workqueue::find_and_run_task):
12095 Report user, sys and wall time.
12096 * Makefile.in: Regenerate.
12097 * config.in: Regenerate.
12098 * configure: Regenerate.
12099
d6344fb5
DK
121002009-12-16 Doug Kwan <dougkwan@google.com>
12101
12102 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
12103 sections.
12104 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
12105 relaxed input sections.
12106 * output.cc (Output_section::find_relaxed_input_section): Change
12107 return type to Output_relaxed_input_section pointer. Adjust code
12108 for new type of relaxed_input_section_map_.
12109 * output.h (Output_section::find_relaxed_input_section): Change
12110 return type to Output_relaxed_input_section pointer.
12111 (Output_section::Output_relaxed_input_section_by_input_section_map):
12112 New type.
12113 (Output_section::relaxed_input_section_map_): Change type to
12114 Output_section::Output_relaxed_input_section_by_input_section_map.
12115 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
12116 input section.
12117
0e0d5469
ILT
121182009-12-15 Ian Lance Taylor <iant@google.com>
12119
12120 * layout.cc (Layout::create_shstrtab): Only write out after input
12121 sections if we are compressing debug sections.
12122
0649a889
ILT
121232009-12-15 Ian Lance Taylor <iant@google.com>
12124
12125 * archive.cc (Archive::add_symbols): Only look up a symbol without
12126 a version if there is, in fact, a version.
12127
2ea97941
ILT
121282009-12-14 Ian Lance Taylor <iant@google.com>
12129
12130 Revert -Wshadow changes, all changes from:
12131 2009-12-11 Doug Kwan <dougkwan@google.com>
12132 2009-12-11 Nick Clifton <nickc@redhat.com>
12133 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
12134
b0eec2cc
DK
121352009-12-11 Doug Kwan <dougkwan@google.com>
12136
12137 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
12138 due to -Wshadow.
12139 * attributes.cc (Object_attribute::size): Ditto.
12140 (Attributes_section_data::size): Ditto.
12141 (Attributes_section_data::Attributes_section_data): Ditto.
12142 (Output_attributes_section_data::do_write): Ditto.
12143 * attributes.h (Object_attribute::set_type): Ditto.
12144 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
12145
91d6fa6a
NC
121462009-12-11 Nick Clifton <nickc@redhat.com>
12147
12148 * archive.cc: Fix shadowed variable warnings.
12149 * arm.cc: Likewise.
12150 * compressed_output.cc: Likewise.
12151 * compressed_output.h: Likewise.
12152 * configure: Likewise.
12153 * dwarf_reader.cc: Likewise.
12154 * dynobj.cc: Likewise.
12155 * dynobj.h: Likewise.
12156 * ehframe.cc: Likewise.
12157 * ehframe.h: Likewise.
12158 * errors.cc: Likewise.
12159 * expression.cc: Likewise.
12160 * fileread.cc: Likewise.
12161 * fileread.h: Likewise.
12162 * freebsd.h: Likewise.
12163 * i386.cc: Likewise.
12164 * icf.cc: Likewise.
12165 * incremental.h: Likewise.
12166 * layout.cc: Likewise.
12167 * layout.h: Likewise.
12168 * mapfile.cc: Likewise.
12169 * merge.cc: Likewise.
12170 * merge.h: Likewise.
12171 * object.cc: Likewise.
12172 * object.h: Likewise.
12173 * options.h: Likewise.
12174 * output.cc: Likewise.
12175 * output.h: Likewise.
12176 * parameters.cc: Likewise.
12177 * plugin.cc: Likewise.
12178 * powerpc.cc: Likewise.
12179 * reduced_debug_output.cc: Likewise.
12180 * reduced_debug_output.h: Likewise.
12181 * reloc.cc: Likewise.
12182 * reloc.h: Likewise.
12183 * resolve.cc: Likewise.
12184 * script-sections.cc: Likewise.
12185 * script.cc: Likewise.
12186 * script.h: Likewise.
12187 * sparc.cc: Likewise.
12188 * symtab.cc: Likewise.
12189 * symtab.h: Likewise.
12190 * target-select.cc: Likewise.
12191 * target-select.h: Likewise.
12192 * token.h: Likewise.
12193 * workqueue.cc: Likewise.
12194 * workqueue.h: Likewise.
12195 * x86_64.cc: Likewise.
12196
a0351a69
DK
121972009-12-10 Doug Kwan <dougkwan@google.com>
12198
12199 * arm.cc (attributes.h): New include.
12200 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
12201 (Arm_relobj::~Arm_relobj): Delete object pointed by
12202 attributes_section_data_.
12203 (Arm_relobj::attributes_section_data): New method definition.
12204 (Arm_relobj::attributes_section_data_): New data member declaration.
12205 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
12206 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
12207 attributes_section_data_.
12208 (Arm_dynobj::attributes_section_data): New method definition.
12209 (Arm_dynobj::attributes_section_data_): New data member declaration.
12210 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
12211 initialization value of may_use_blx_ to false.
2e702c99 12212 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
12213 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
12214 object attributes to compute results instead of hard-coding.
12215 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
12216 Target_arm::get_secondary_compatible_arch,
12217 Target_arm::set_secondary_compatible_arch
12218 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12219 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
12220 New method declarations.
12221 (Target_arm::get_aeabi_object_attribute): New method definition.
12222 (Target_arm::attributes_section_data_): New data member declaration.
12223 (read_arm_attributes_section): New template definition.
12224 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
12225 (Arm_dynobj::do_read_symbols): Ditto.
12226 (Target_arm::do_finalize_sections): Merge attributes sections from
12227 input. Check for BLX use after attributes section merging.
12228 Fix __exidx_start and __exidx_end visibility. Create an
12229 .ARM.attributes section if necessary.
12230 (Target_arm::get_secondary_compatible_arch,
12231 Target_arm::set_secondary_compatible_arch,
12232 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12233 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 12234 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
12235 New method definitions.
12236
b59befec
ILT
122372009-12-09 Ian Lance Taylor <iant@google.com>
12238
12239 * plugin.cc (Plugin::load): Don't cast from void* to a function
12240 pointer.
12241
1276bc89
ILT
122422009-12-09 Ian Lance Taylor <iant@google.com>
12243
12244 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
12245 information fields.
12246
2f2de248
L
122472009-12-09 H.J. Lu <hongjiu.lu@intel.com>
12248
12249 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
12250 Replace two_file_shared_1.so with two_file_shared_2.so.
12251 * testsuite/Makefile.in: Regenerated.
12252
4f787271
DK
122532009-12-08 Doug Kwan <dougkwan@google.com>
12254
12255 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
12256 (HFILES): Add attributes.h and int_encoding.h.
12257 * Makefile.in: Regenerate.
12258 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
12259 function definitions to int_encoding.cc
12260 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
12261 prototypes to int_encoding.h
12262 * reduced_debug_output.cc (int_encoding.h): New include.
12263 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
12264 function definitions to int_encoding.cc
12265 (insert_into_vector, read_from_pointer): Move template definitions to
12266 int_encoding.h
12267 * attributes.cc: New file.
12268 * attributes.h: New file.
12269 * int_encoding.cc: New file.
12270 * int_encoding.h: New file.
12271
20b52f1a
RÁE
122722009-12-07 Rafael Avila de Espindola <espindola@google.com>
12273
12274 PR gold/11055
12275 * incremental-dump.cc (dump_incremental_inputs): New.
12276 (main): Use dump_incremental_inputs.
12277
53d7974c
L
122782009-12-07 H.J. Lu <hongjiu.lu@intel.com>
12279
12280 PR gold/10893
12281 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
12282 checking elfcpp::STT_FUNC.
12283 (Target_i386::Relocate::relocate): Likewise.
12284 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
12285
12286 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
12287 symbols from shared libraries into normal FUNC symbols.
12288
12289 * symtab.h (Symbol): Add is_func and use it.
12290
05a352e6
DK
122912009-12-05 Doug Kwan <dougkwan@google.com>
12292
12293 * arm.cc (Target_arm::arm_info): Initialize new fields
12294 attributes_section and attributes_vendor.
12295 * i386.cc (Target_i386::i386_info): Same.
12296 * object.cc (Sized_relobj::do_layout): Skip attribute section.
12297 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
12298 fields attributes_section and attributes_vendor.
53d7974c 12299 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
12300 * target.h (Target::attributes_section, Target::attributes_vendor,
12301 Target::is_attributes_section, Target::attribute_arg_type,
12302 Target::attributes_order): New method definitions.
12303 (Target::Target_info::attributes_section,
12304 Target::Target_info::attributes_vendor): New fields.
12305 (Target::do_attribute_arg_type, Target::do_attributes_order): New
12306 virtual method definitions.
12307 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
12308 attributes_section and attributes_vendor.
12309 * testsuite/testfile.cc (Target_test::test_target_info): Same.
12310
f4e5969c
DK
123112009-12-05 Doug Kwan <dougkwan@google.com>
12312
12313 * arm.cc: Update comments about interworking and stub generation.
12314 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
12315 considered as non-PIC.
12316 (Arm_relocate_functions::base_abs): Fix formatting.
12317 (Arm_relocate_functions::got_prel): Fix comment. Change interface
12318 of function to use GOT entry address instead of offset.
12319 (Target_arm::Scan::global): Issue an error if a symbol would need a
12320 PLT does not get one because it is untyped. Remove code to create
12321 dynamic symbols for relative branches.
12322 (Target_arm::Relocate::relocate: Use 0 instead of false since function
12323 takes unsigned integer instead of boolean.
12324
1abce4a6
L
123252009-12-05 H.J. Lu <hongjiu.lu@intel.com>
12326
12327 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
12328 (two_file_test_LDADD): Likewise.
12329 (common_test_1_LDADD): Likewise.
12330 (exception_test_LDADD) Likewise.
12331 (weak_test_LDADD): Likewise.
12332 (many_sections_test_LDADD): Likewise.
12333 (initpri1_LDADD): Likewise.
12334 (script_test_1_LDADD): Likewise.
12335 (script_test_2_LDADD): Likewise.
12336 (justsyms_LDADD): Likewise.
12337 (binary_test_LDADD): Likewise.
12338 (large_LDADD): Likewise.
12339 * testsuite/Makefile.in: Regenerated.
12340
adcf2816 123412009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 12342
adcf2816
L
12343 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
12344 (Symbol_table::override_with_special): Likewise.
12345 (Symbol_table::add_from_object): Likewise.
12346
28e67f5d
RÁE
123472009-12-04 Rafael Avila de Espindola <espindola@google.com>
12348
12349 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12350 Don't set the data_offset twice.
12351
ae10a101
RÁE
123522009-12-04 Rafael Avila de Espindola <espindola@google.com>
12353
12354 * testsuite/Makefile.in: Regenerate.
12355
f59f41f3
DK
123562009-12-03 Doug Kwan <dougkwan@google.com>
12357
12358 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
12359 (Target_arm::do_finalize_sections): Add parameter for symbol table
12360 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
12361 * i386.cc (Target_i386::do_finalize_sections): Add an additional
12362 parameter for symbol table pointer.
12363 * layout.cc (Layout::finalize): Call Target::finalize_sections with
12364 an additional parameter for a pointer to symbol table.
12365 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
12366 parameter for a symbol table pointer.
12367 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
12368 * target.h (Target::finalize_sections, Target::do_finalize_sections):
12369 Ditto.
12370 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
12371 parameter for a symbol table pointer.
12372
ca55d848
RÁE
123732009-12-03 Rafael Avila de Espindola <espindola@google.com>
12374
12375 * incremental.cc (Incremental_inputs_header)
12376 (Incremental_inputs_header_write, Incremental_inputs_entry)
12377 (Incremental_inputs_entry_write): Move ...
12378 * incremental.h (Incremental_inputs_header)
12379 (Incremental_inputs_header_write, Incremental_inputs_entry)
12380 (Incremental_inputs_entry_write): here.
12381
3aec4f9c
RÁE
123822009-12-02 Rafael Avila de Espindola <espindola@google.com>
12383
12384 * incremental.cc (make_sized_incremental_binary): Set the target.
12385 Error if it is incompatible.
12386 * output.h (Output_file): Add filename method.
12387
9c0ae74d
RÁE
123882009-12-02 Rafael Avila de Espindola <espindola@google.com>
12389
12390 * incremental.cc (Incremental_inputs_entry): Remove unused argument
12391 from the get_* methods.
12392
a45500ae
RÁE
123932009-12-02 Rafael Avila de Espindola <espindola@google.com>
12394
12395 * incremental-dump.cc (main): Check that the offeset of a script is 0.
12396 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12397 Write 0 for the data_offset of scripts.
12398
325e6408
RÁE
123992009-12-02 Rafael Avila de Espindola <espindola@google.com>
12400
12401 * testsuite/Makefile.am: Add the incremental_test.sh test.
12402 * testsuite/incremental_test.sh: New.
12403 * testsuite/incremental_test_1.c: New.
12404 * testsuite/incremental_test_2.c: New.
12405
954c3e2e
RÁE
124062009-12-01 Rafael Avila de Espindola <espindola@google.com>
12407
703d02da 12408 * incremental-dump.cc (main): Fix typos.
954c3e2e 12409
f8086623
RÁE
124102009-11-27 Rafael Avila de Espindola <espindola@google.com>
12411
12412 PR gold/11025
12413 * incremental-dump.cc (main): Use llu to print 64 bit values.
12414
3b0dd6ac
L
124152009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
12416 H.J. Lu <hongjiu.lu@intel.com>
12417
12418 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
12419 $(LIBDL).
12420 (incremental_dump_LDADD): Likewise.
12421 * Makefile.in: Regenerated.
12422
a6d1ef57 124232009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 12424
a6d1ef57
DK
12425 Revert:
12426
12427 2009-11-25 Doug Kwan <dougkwan@google.com>
12428
12429 * arm.cc (Target_arm::Target_arm): Move method definition
12430 outside of class definition. Add code to handle
12431 --target1-rel, --target1-abs and --target2= options.
12432 (Target_arm::get_reloc_reloc_type): Change method to be
12433 non-static and const.
12434 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
12435 New data member declaration.
12436 (Target_arm::Scan::local, Target_arm::Scan::global,
12437 Target_arm::Relocate::relocate,
12438 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12439 Adjust call to Target_arm::get_real_reloc_type.
12440 (Target_arm::get_real_reloc_type): Use command line options
12441 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12442 * options.h (--target1-rel, --target1-abs, --target2): New
12443 ARM-only options.
12444
50aeb7d4
DK
124452009-11-25 Doug Kwan <dougkwan@google.com>
12446
12447 * arm.cc (Target_arm::Target_arm): Move method definition outside of
12448 class definition. Add code to handle --target1-rel, --target1-abs
12449 and --target2= options.
12450 (Target_arm::get_reloc_reloc_type): Change method to be non-static
12451 and const.
12452 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
12453 member declaration.
12454 (Target_arm::Scan::local, Target_arm::Scan::global,
12455 Target_arm::Relocate::relocate,
12456 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
12457 call to Target_arm::get_real_reloc_type.
12458 (Target_arm::get_real_reloc_type): Use command line options to
12459 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12460 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
12461 options.
12462
51938283
DK
124632009-11-25 Doug Kwan <dougkwan@google.com>
12464
12465 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
12466 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
12467 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
12468 formatting.
12469 (Arm_relocate_functions::thm_call): Replace body with a call to
12470 Arm_relocate_functions::thumb_branch_common.
12471 (Arm_relocate_functions::thm_jump24,
12472 Arm_relocate_functions::thm_xpc22): New method definitions.
12473 (Arm_relocate_functions::thumb_branch_common): New method definition.
12474 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
12475 operator.
12476 (Target_arm::Relocate::relocate): Adjust call to thm_call.
12477 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
12478
e2b8f3c4
RÁE
124792009-11-24 Rafael Avila de Espindola <espindola@google.com>
12480
12481 * Makefile.am: Build incremental-dump
12482 * Makefile.in: Regenerate.
12483 * incremental-dump.cc: New.
12484 * incremental.cc (Incremental_inputs_header_data,
12485 Incremental_inputs_entry_data): Move to incremental.h
12486 * incremental.h: (Incremental_inputs_header_data,
12487 Incremental_inputs_entry_data): Move from incremental.cc
12488
bcba9aec
RÁE
124892009-11-24 Rafael Avila de Espindola <espindola@google.com>
12490
12491 * incremental.cc (Incremental_inputs_header,
12492 Incremental_inputs_header_write, Incremental_inputs_entry,
12493 Incremental_inputs_entry_write): Add a typedef with the data type.
12494
7c3afe08
RÁE
124952009-11-24 Rafael Avila de Espindola <espindola@google.com>
12496
12497 * incremental.cc (Incremental_inputs_header,
12498 Incremental_inputs_header_write, Incremental_inputs_entry,
12499 Incremental_inputs_entry_write): Update comment about which
12500 type has the filed descriptions.
12501
d204b6e9
DK
125022009-11-15 Doug Kwan <dougkwan@google.com>
12503
12504 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
12505 (Arm_relocate_functions::arm_branch_common): Change method defintion
12506 in class definition to a method declaration and update list of formal
12507 parameters.
12508 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
12509 Arm_relocation_functions::jump24): Adjust call to
12510 Arm_relocate_functions::arm_branch_common. Update list of formal
12511 parameters.
12512 (Arm_relocate_functions::xpc25): New method definition.
12513 (Arm_relocate_functions::arm_branch_common): Move method defintion
12514 out from class definition. Use stubs for mode-switching and extending
12515 branch ranges.
12516 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
12517 specially. Change code to enable use of stubs in ARM branches.
12518
43d12afe
DK
125192009-11-10 Doug Kwan <dougkwan@google.com>
12520
12521 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
12522 in method declaration.
12523 (Target_arm::relocate_stub): New method declaration.
12524 (Target_arm::default_target): Change to return a pointer instead of
12525 a const reference.
12526 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
12527 Target_arm::default_target.
12528 (Arm_Relobj::do_relocate_sections): Remove options paramater in
12529 method definition.
12530 (Target_arm::relocate_section): Adjust view.
12531 (Target_arm::relocate_stub): New method definition.
12532
ac33a407
DK
125332009-11-10 Doug Kwan <dougkwan@google.com>
12534
12535 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
12536 a format warning.
12537 * incremental.cc (open_incremental_binary): Initialized local
12538 variables to avoid warnings.
12539 * object.cc (make_elf_object): Ditto.
12540 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
12541 a format warning.
e1df38aa 12542
88ee28e9
L
12543009-11-09 H.J. Lu <hongjiu.lu@intel.com>
12544
12545 PR gold/10930
12546 * testsuite/plugin_test.c: Include "config.h".
12547
2daedcd6
DK
125482009-11-09 Doug Kwan <dougkwan@google.com>
12549
12550 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
12551 (arm_symbol_value): Remove.
12552 (Arm_relocate_functions::arm_branch_common,
12553 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
12554 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
12555 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
12556 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
12557 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
12558 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
12559 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
12560 Arm_relocate_functions::thm_mobw_abs_nc,
12561 Arm_relocate_functions::thm_mov_abs,
12562 Arm_relocate_functions::movw_prel_nc,
12563 Arm_relocate_functions::thm_movt_abs,
12564 Arm_relocate_functions::movt_prel,
12565 Arm_relocate_functions::thm_movw_prel_nc,
12566 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
12567 (Target_arm::Relocate::relocate): Only decompose address into two
12568 parts if relocation type uses the thumb-bit and pass the actual
12569 bit instead of a flag indicating that the thumb-bit is used. Adjust
12570 calls to methods in Arm_relocate_functions for this change.
12571
1276bc89 125722009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
12573
12574 PR 10925
12575 * reloc.cc: Instantiate
12576 Sized_relobj::initialize_input_to_output_maps and
12577 Sized_relobj:free_input_to_output_maps.
12578
e53ad1b5
ILT
125792009-11-06 Ian Lance Taylor <iant@google.com>
12580
12581 PR 10876
12582 * defstd.cc (in_segment): Set only_if_ref true for "end".
12583
eb44217c
DK
125842009-11-06 Doug Kwan <dougkwan@google.com>
12585
12586 * arm.cc (class Reloc_stub): Correct a comment.
12587 (Target_arm::Target_arm): Initialize arm_input_section_map_.
12588 (Target_arm::scan_section_for_stubs): New method declaration.
12589 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
12590 Change methods from private to protected.
12591 (Target_arm::do_may_relax): New method definition.
12592 (Target_arm::do_relax, Target_arm::group_sections,
12593 Target_arm::scan_reloc_for_stub,
12594 Target_arm::scan_reloc_section_for_stubs): New method declarations.
12595 (Target_arm::arm_input_section_map_): New data member declaration.
12596 (Target_arm::scan_reloc_for_stub,
12597 Target_arm::scan_reloc_section_for_stubs,
12598 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
12599 Target_arm::do_relax): New method definitions.
12600
5d329b7d
ILT
126012009-11-06 Mikolaj Zalewski <mikolaj@google.com>
12602
12603 * configure.ac: Check for (struct stat)::st_mtim
12604 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
12605 * config.in: Regenerate.
12606 * configure: Regenerate.
12607
96a0d71b
ILT
126082009-11-05 Ian Lance Taylor <iant@google.com>
12609
12610 PR 10910
12611 * output.cc (Output_segment::add_output_section): Add missing
12612 return statement.
12613
594c8e5e
ILT
126142009-11-04 Ian Lance Taylor <iant@google.com>
12615
12616 PR 10880
12617 * object.h (class Object): Add is_needed and set_is_needed
12618 methods. Add is_needed_ field. Make bool fields into bitfields.
12619 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
12620 defined in a dynamic object and referenced by a regular object,
12621 set is_needed for the dynamic object.
12622 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
12623 if the file is marked with as_needed and it is not needed.
12624
22b127cc
ILT
126252009-11-04 Ian Lance Taylor <iant@google.com>
12626
12627 PR 10887
12628 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
12629 tags if data is discarded by linker script.
12630 * i386.cc (Target_i386::do_finalize_sections): Likewise.
12631 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
12632 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
12633 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
12634
f5c870d2
ILT
126352009-11-04 Ian Lance Taylor <iant@google.com>
12636
12637 * layout.cc (Layout::get_output_section): Add is_interp and
12638 is_dynamic_linker_section parameters. Change all callers.
12639 (Layout::choose_output_section): Likewise.
12640 (Layout::make_output_section): Likewise.
12641 (Layout::add_output_section_data): Add is_dynamic_linker_section
12642 parameter. Change all callers.
12643 * layout.h (class Layout): Update declarations.
12644 * output.h (class Output_section): Add is_interp, set_is_interp,
12645 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
12646 Add is_interp_, is_dynamic_linker_section_ fields. Change
12647 generate_code_fills_at_write_ to a bitfield.
12648 * output.cc (Output_section::Output_sections): Initialize new
12649 fields.
12650 (Output_segment::add_output_section): Add do_sort parameter.
12651 Change all callers.
12652
1ae4d23b
ILT
126532009-11-03 Ian Lance Taylor <iant@google.com>
12654
12655 PR 10860
12656 * options.h (class General_options): Add --warn-common.
12657 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
12658 merging two common symbols.
12659 (Symbol_table::should_override): Handle --warn-common when merging
12660 a common symbol with a defined symbol. Use report_resolve_problem
12661 for multiple definitions.
12662 (Symbol_table::report_resolve_problem): New function.
12663 * symtab.h (class Symbol_table): Declare report_resolve_problem.
12664
55da9579
DK
126652009-11-03 Doug Kwan <dougkwan@google.com>
12666
12667 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
12668 stub_factory_.
12669 (Target_arm::stub_factory): New method definition.
12670 (Target_arm::new_arm_input_section,
12671 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
12672 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 12673 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
12674 New type definitions.
12675 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
12676 member declarations.
12677 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
12678 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
12679 New method definitions.
12680
37a9ac43
ILT
126812009-11-03 Ian Lance Taylor <iant@google.com>
12682
12683 * options.h (class General_options): Add --warn_constructors.
12684
b3d6a3d4
ILT
126852009-11-03 Ian Lance Taylor <iant@google.com>
12686
12687 PR 10893
12688 * defstd.cc (in_section): Add entries for __rel_iplt_start,
12689 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
12690
934b01dd
ILT
126912009-11-03 Ian Lance Taylor <iant@google.com>
12692
12693 PR 10895
12694 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
12695 --msgid-bugs-address.
12696 (install-pdf): New target.
12697 (install-data_yes): Look up one directory to find mkinstalldirs.
12698
03c1939b
L
126992009-11-03 H.J. Lu <hongjiu.lu@intel.com>
12700
12701 * po/Make-in (.po.gmo): Don't generate .gmo files in source
12702 tree.
12703
ebd95253
DK
127042009-10-30 Doug Kwan <dougkwan@google.com>
12705
12706 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
12707
e9bbb538
DK
127082009-10-30 Doug Kwan <dougkwan@google.com>
12709
12710 * arm.cc (Stub_addend_reader): New struct template definition
12711 and partial specializations.
12712 (Stub_addend_reader::operator()): New method definition for a
12713 partially specialized template.
12714
d5b40221
DK
127152009-10-30 Doug Kwan <dougkwan@google.com>
12716
12717 * arm.cc (Arm_relobj::processor_specific_flags): New method
12718 definition.
12719 (Arm_relobj::do_read_symbols): New method declaration.
12720 (Arm_relobj::processor_specific_flags_): New data member declaration.
12721 (Arm_dynobj): New class definition.
12722 (Target_arm::do_finalize_sections): Add input_objects parameter.
12723 (Target_arm::do_adjust_elf_header): New method declaration.
12724 (Target_arm::are_eabi_versions_compatible,
12725 (Target_arm::merge_processor_specific_flags): New method declaration.
12726 (Target_arm::do_make_elf_object): New overloaded method definitions
12727 and declaration.
12728 (Arm_relobj::do_read_symbols): New method definition.
12729 (Arm_dynobj::do_read_symbols): Ditto.
12730 (Target_arm::do_finalize_sections): Add input_objects parameters.
12731 Merge processor-specific flags from all input objects.
12732 (Target_arm::are_eabi_versions_compatible,
12733 Target_arm::merge_processor_specific_flags,
12734 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
12735 New method definitions.
12736 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
12737 Input_objects pointer type parameter.
12738 * layout.cc (Layout::finalize): Pass input objects to target's.
12739 finalize_sections function.
12740 * output.cc (Output_file_header::do_sized_write): Set ELF file
12741 header's processor-specific flags.
12742 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
12743 Input_objects pointer type parameter.
12744 * sparc.cc (Target_sparc::do_finalize_sections): Same.
12745 * target.h (Input_objects): New forward class declaration.
12746 (Target::processor_specific_flags,
12747 Target::are_processor_specific_flags_sect): New method definitions.
12748 (Target::finalize_sections): Add input_objects parameter.
12749 (Target::Target): Initialize processor_specific_flags_ and
12750 are_processor_specific_flags_set_.
12751 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
12752 parameter.
12753 (Target::set_processor_specific_flags): New method definition.
12754 (Target::processor_specific_flags_,
12755 Target::are_processor_specific_flags_set_): New data member
12756 declarations.
12757 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
12758 Input_objects pointer type parameter.
12759
ebabffbd
DK
127602009-10-30 Doug Kwan <dougkwan@google.com>
12761
12762 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
12763
ad0f2072
ILT
127642009-10-28 Ian Lance Taylor <iant@google.com>
12765
12766 * object.h (class Relobj): Drop options parameter from
12767 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
12768 do_scan_relocs, do_relocate. Change all callers.
12769 (class Sized_relobj): Drop options parameters from
12770 do_gc_process_relocs, do_scan_relocs, do_relocate,
12771 do_relocate_sections, relocate_sections, emit_relocs_scan,
12772 emit_relocs_scan_reltype. Change all callers.
12773 (struct Relocate_info): Remove options field and all references to
12774 it.
12775 * reloc.h (class Read_relocs): Remove options constructor
12776 parameter and options_ field. Change all callers.
12777 (class Gc_process_relocs, class Scan_relocs): Likewise.
12778 (class Relocate_task): Likewise.
12779 * target-reloc.h (scan_relocs): Remove options parameter. Change
12780 all callers.
12781 (scan_relocatable_relocs): Likewise.
12782 * target.h (class Sized_target): Remove options parameter from
12783 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
12784 all callers.
12785 * gc.h (gc_process_relocs): Remove options parameter. Change all
12786 callers.
12787 * arm.cc: Update functions to remove options parameters.
12788 * i386.cc: Likewise.
12789 * powerpc.cc: Likewise.
12790 * sparc.cc: Likewise.
12791 * x86_64.cc: Likewise.
12792 * testsuite/testfile.cc: Likewise.
12793
8ffa3667
DK
127942009-10-28 Doug Kwan <dougkwan@google.com>
12795
12796 * arm.cc (Arm_relobj): New class definition.
e1df38aa 12797 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
12798 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
12799 New method definitions.
12800
40f36857
CC
128012009-10-28 Cary Coutant <ccoutant@google.com>
12802
12803 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
12804 (Plugin::cleanup_done_): New member.
12805 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
12806 (Plugin_manager::cleanup_done_): Remove.
12807 (Plugin_manager::add_input_file): Edit error message.
12808 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
12809 (Plugin_manager::cleanup): Remove use of cleanup_done_.
12810
2c849493
ILT
128112009-10-27 Mikolaj Zalewski <mikolajz@google.com>
12812
12813 * fileread.cc: (File_read::View::~View): Use the new
12814 data_ownership_ filed.
12815 (File_read::~File_read): Dispose the new whole_file_view_.
12816 (File_read::open): Mmap the whole file if needed.
12817 (File_read::open): Use whole_file_view_ instead of contents_.
12818 (File_read::find_view): Use whole_file_view_ if applicable.
12819 (File_read::do_read): Use whole_file_view_ instead of contents_.
12820 (File_read::make_view): Use whole_file_view_ instead of contents_,
12821 update File_read::View::View call.
12822 (File_read::find_or_make_view): Update File_read::View::View
12823 call.
12824 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
12825 remove contents_
12826 (File_read::View::Data_ownership): New enum.
12827 (File_read::View::View): Replace bool mapped_ with Data_ownership
12828 argument.
12829 (File_read::View::mapped_): Remove (replaced by data_ownership_).
12830 (File_read::View::data_ownership_): New field.
12831 (File_read::contents_): Remove (replaced by whole_file_view_).
12832 (File_read::whole_file_view_): New field.
12833 * options.h (class General_options): Add --keep-files-mapped.
12834
24998053
CC
128352009-10-27 Cary Coutant <ccoutant@google.com>
12836
12837 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
12838 * testsuite/Makefile.am (plugin_test_5): New test case.
12839 * testsuite/Makefile.in: Regenerate.
12840
72adc4fa
DK
128412009-10-25 Doug Kwan <dougkwan@google.com>
12842
12843 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
12844 from private to protected to allow access by child class.
12845 (Sized_relobj::do_relocate_sections): New method declaration.
12846 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 12847 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
12848 Sized_relobj::relocate_sections. Instantiate template explicitly
12849 for different target sizes and endianity.
12850
07f508a2
DK
128512009-10-24 Doug Kwan <dougkwan@google.com>
12852
12853 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
12854 (Arm_input_section::as_arm_input_section): New method.
12855 (Arm_output_section): New class definition.
12856 (Arm_output_section::create_stub_group,
12857 Arm_output_section::group_sections): New method definitions.
12858
10ad9fe5
DK
128592009-10-22 Doug Kwan <dougkwan@google.com>
12860
12861 * arm.cc (Arm_input_section): New class definition.
12862 (Arm_input_section::init, Arm_input_section:do_write,
12863 Arm_input_section::set_final_data_size,
12864 Arm_input_section::do_reset_address_and_file_offset): New method
12865 definitions.
12866
56ee5e00
DK
128672009-10-21 Doug Kwan <dougkwan@google.com>
12868
12869 * arm.cc (Stub_table, Arm_input_section): New forward class
12870 declarations.
12871 (Stub_table): New class defintion.
12872 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
12873 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
12874 New method definition.
12875
b569affa
DK
128762009-10-21 Doug Kwan <dougkwan@google.com>
12877
12878 * arm.cc: Update copyright comments.
12879 (Target_arm): New forward class template declaration.
12880 (Arm_address): New type.
12881 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
12882 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
12883 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
12884 constants.
12885 (Insn_template): Same.
12886 (DEF_STUBS): New macro.
12887 (Stub_type): New enum type.
12888 (Stub_template): New class definition.
12889 (Stub): Same.
12890 (Reloc_stub): Same.
12891 (Stub_factory): Same.
12892 (Target_arm::Target_arm): Initialize may_use_blx_ and
12893 should_force_pic_veneer_.
12894 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
12895 Target_arm::should_force_pic_veneer,
12896 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
12897 Target_arm::using_thumb_only, Target_arm:;default_target): New
12898 method defintions.
12899 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
12900 New data member declarations.
12901 (Insn_template::size, Insn_template::alignment): New method defintions.
12902 (Stub_template::Stub_template): New method definition.
12903 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
12904 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
12905 (Stub_factory::Stub_factory): New method definition.
12906 * gold.h (string_hash): New template.
12907 * output.h (Input_section_specifier::hash_value): Use
12908 gold::string_hash.
12909 (Input_section_specifier::string_hash): Remove.
12910 * stringpool.cc (Stringpool_template::string_hash): Use
12911 gold::string_hash.
12912
6c172549
DK
129132009-10-20 Doug Kwan <dougkwan@google.com>
12914
12915 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
12916 symbols of relaxed input sections.
12917 * output.h (Output_section::find_relaxed_input_section): Make
12918 method public.
12919
c5617f2f
DK
129202009-10-16 Doug Kwan <dougkwan@google.com>
12921
12922 * dynobj.cc (Versions::Versions): Initialize version_script_.
12923 Only insert base version symbol definition for a shared object
12924 if version script defines any version versions.
12925 (Versions::define_base_version): New method definition.
12926 (Versions::add_def): Check that base version is not needed.
12927 (Versions::add_need): Define base version lazily.
12928 * dynobj.h (Versions::define_base_version): New method declaration.
12929 (Versions::needs_base_version_): New data member declaration.
12930 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
12931 (check_DATA): Add no_version_test.stdout.
12932 (libno_version_test.so, no_version_test.o no_version_test.stdout):
12933 New make rules.
12934 * testsuite/Makefile.in: Regenerate.
12935 * testsuite/no_version_test.c: New file.
12936 * testsuite/no_version_test.sh: Ditto.
12937
3c12dcdb
DK
129382009-10-16 Doug Kwan <dougkwan@google.com>
12939
12940 * expression.cc (class Segment_start_expression): New class definition.
12941 (Segment_start_expression::value): New method definition.
12942 (script_exp_function_segment_start): Return a new
12943 Segment_start_expression.
12944 * gold/script-c.h (script_saw_segment_start_expression): New function
12945 prototype.
12946 * script-sections.cc (Script_sections::Script_sections): Initialize
12947 SAW_SEGMENT_START_EXPRESSION_ to false.
12948 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
12949 and -Tbbs options to specify section addresses if given in
12950 command line and no SEGMENT_START expression is seen in a script.
12951 * script-sections.h (Script_sections::saw_segment_start_expression,
12952 Script_sections::set_saw_segment_start_expression): New method
12953 definition.
12954 (Script_sections::saw_segment_start_expression_): New data member
12955 declaration.
12956 * script.cc (script_saw_segment_start_expression): New function.
12957 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
12958 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
12959 script_test_7.sh and script_test_8.sh.
12960 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
12961 script_test_8.stdout.
12962 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
12963 (script_test_6, script_test_6.stdout, script_test_7,
12964 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
12965 * Makefile.in: Regenerate.
12966 * testsuite/script_test_6.sh: New file.
12967 * testsuite/script_test_6.t: Same.
12968 * testsuite/script_test_7.sh: Same.
12969 * testsuite/script_test_7.t: Same.
12970 * testsuite/script_test_8.sh: Same.
12971
64b1ae37
DK
129722009-10-16 Doug Kwan <dougkwan@google.com>
12973
12974 * output.cc (Output_segment::set_section_list_address): Cast
12975 expressions to unsigned long long type to avoid format warnings.
12976
661be1e2
ILT
129772009-10-15 Ian Lance Taylor <iant@google.com>
12978
12edd763 12979 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 12980 dot assignment to script_sections_.
12edd763
ILT
12981 * script-sections.cc (Script_sections::add_dot_assignment):
12982 Initialize if necessary.
12983
68b6574b
ILT
12984 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
12985 program headers with no load segment if there is a linker script.
12986
661be1e2
ILT
12987 * layout.cc (Layout::set_segment_offsets): Align the file offset
12988 to the segment aligment for -N or -n with no load segment.
12989 * output.cc (Output_segment::add_output_section): Don't crash if
12990 the first section is a TLS section.
12991 (Output_segment::set_section_list_addresses): Print an error
12992 message if the address moves backward in a linker script.
12993 * script-sections.cc
12994 (Output_section_element_input::set_section_addresses): Don't
12995 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
12996 (Orphan_output_section::set_section_addresses): Likewise.
12997
f15f61a7
DK
129982009-10-15 Doug Kwan <dougkwan@google.com>
12999
13000 * layout.cc (Layout::finish_dynamic_section): Generate tags
13001 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
13002 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
13003 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
13004
82bb573a
ILT
130052009-10-14 Ian Lance Taylor <iant@google.com>
13006
13007 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
13008 fields.
13009 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
13010 data_shdr fields of relinfo.
13011 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
13012 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
13013 R_386_TLS_LDO_32, adjust based on section flags.
13014 (Target_i386::Relocate::fix_up_ldo): Remove.
13015
374ad285
ILT
130162009-10-13 Ian Lance Taylor <iant@google.com>
13017
13018 Add support for -pie.
13019 * options.h (class General_options): Add -pie and
13020 --pic-executable.
13021 (General_options::output_is_position_independent): Test -pie.
13022 (General_options::output_is_executable): Return true if not shared
13023 and not relocatable.
13024 (General_options::output_is_pie): Remove.
13025 * options.cc (General_options::finalize): Reject incompatible uses
13026 of -pie.
13027 * gold.cc (queue_middle_tasks): A -pie link is not static.
13028 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
13029 * symtab.cc (Symbol::final_value_is_known): Return false if
13030 output_is_position_independent.
13031 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
13032 output_is_position_independent.
13033 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
13034 output_is_position_independent.
13035 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
13036 output_is_position_independent.
13037 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
13038 two_file_pie_test.
13039 (basic_pie_test.o, basic_pie_test): New targets.
13040 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
13041 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
13042 (two_file_pie_test): New target.
13043 * testsuite/Makefile.in: Rebuild.
13044 * README: Remove note saying that -pie is not supported.
13045
c6585162
ILT
130462009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
13047
13048 * options.h (class General_options): Add -init and -fini.
13049 * layout.cc (Layout::finish_dynamic_section): Emit
13050 given init and fini functions.
13051
032ce4e9
ST
130522009-10-13 Sriraman Tallam <tmsriram@google.com>
13053
13054 * gc.h (gc_process_relocs): Check if icf is enabled using new
13055 function.
13056 * gold.cc (queue_initial_tasks): Likewise.
13057 (queue_middle_tasks): Likewise.
13058 * object.cc (do_layout): Likewise.
13059 * symtab.cc (is_section_folded): Likewise.
13060 * main.cc (main): Likewise.
13061 * reloc.cc (Read_relocs::run): Likewise.
13062 (Sized_relobj::do_scan_relocs): Likewise.
13063 * icf.cc (is_function_ctor_or_dtor): New function.
13064 (Icf::find_identical_sections): Check if function is ctor or dtor when
13065 safe icf is chosen.
13066 * options.h (General_options::icf): Change option to be an enum.
13067 (Icf_status): New enum.
13068 (icf_enabled): New method.
13069 (icf_safe_folding): New method.
13070 (set_icf_status): New method.
13071 (icf_status_): New variable.
13072 * (options.cc) (General_options::finalize): Set icf_status_.
13073 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
13074 icf_test and icf_keep_unique_test to use the --icf enum flag.
13075 * testsuite/icf_safe_test.sh: New file.
e1df38aa 13076 * testsuite/icf_safe_test.cc: New file.
032ce4e9 13077
f345227a
ST
130782009-10-12 Sriraman Tallam <tmsriram@google.com>
13079
13080 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
13081 includes to gc.h and icf.h.
13082 * arm.cc: Include gc.h.
13083 * gold.cc: Likewise.
13084 * i386.cc: Likewise.
13085 * powerpc.cc: Likewise.
13086 * sparc.cc: Likewise.
13087 * x86_64.cc: Likewise.
13088 * gc.h: Include icf.h.
13089
1c7814ed
ILT
130902009-10-11 Ian Lance Taylor <iant@google.com>
13091
13092 * plugin.cc: Include "gold.h" before other header files.
13093
ae3b5189
CD
130942009-10-10 Chris Demetriou <cgd@google.com>
13095
13096 * options.h (Input_file_argument::Input_file_type): New enum.
13097 (Input_file_argument::is_lib_): Replace with...
13098 (Input_file_argument::type_): New member.
13099 (Input_file_argument::Input_file_argument): Take Input_file_type
13100 'type' rather than boolean 'is_lib' as second argument.
13101 (Input_file_argument::is_lib): Use type_.
13102 (Input_file_argument::is_searched_file): New function.
13103 (Input_file_argument::may_need_search): Handle is_searched_file.
13104 * options.cc (General_options::parse_library): Support -l:filename.
13105 (General_options::parse_just_symbols): Update for Input_file_argument
13106 changes.
13107 (Command_line::process): Likewise.
13108 * archive.cc (Archive::get_file_and_offset): Likewise.
13109 * plugin.cc (Plugin_manager::release_input_file): Likewise.
13110 * script.cc (read_script_file, script_add_file): Likewise.
13111 * fileread.cc (Input_file::Input_file): Likewise.
13112 (Input_file::will_search_for): Handle is_searched_file.
13113 (Input_file::open): Likewise.
13114 * readsyms.cc (Read_symbols::get_name): Likewise.
13115 * testsuite/Makefile.am (searched_file_test): New test.
13116 * testsuite/Makefile.in: Regenerate.
13117 * testsuite/searched_file_test.cc: New file.
13118 * testsuite/searched_file_test_lib.cc: New file.
13119
f3048a1d
ILT
131202009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13121 Ian Lance Taylor <iant@google.com>
13122
13123 * descriptor.cc: Include <cstdio> and "binary-io.h".
13124 (Descriptors::open): Open the files in binary mode always.
13125 * script.cc (Lex::get_token): Treat \r as whitespace.
13126
d4780e57
ILT
131272009-10-09 Ian Lance Taylor <iant@google.com>
13128
13129 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
13130
d9a893b8
ILT
131312009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13132 Ian Lance Taylor <iant@google.com>
13133
13134 * configure.ac: Check for readv function also.
13135 * fileread.cc (readv): Define if not HAVE_READV.
13136 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
13137 does not exist.
13138 * config.in: Regenerate.
13139 * configure: Regenerate.
13140
c0a62865
DK
131412009-10-09 Doug Kwan <dougkwan@google.com>
13142
13143 * layout.cc (Layout::make_output_section): Call target hook to make
13144 ordinary output section.
13145 (Layout::finalize): Adjust parameter list of call the
13146 Target::may_relax().
13147 * layout.h (class Layout::section_list): New method.
13148 * merge.h (Output_merge_base::entsize): Change visibility to public.
13149 (Output_merge_base::is_string, Output_merge_base::do_is_string):
13150 New methods.
13151 (Output_merge_string::do_is_string): New method.
13152 * object.cc (Sized_relobj::do_setup): renamed from
13153 Sized_relobj::set_up.
13154 * object.h (Sized_relobj::adjust_shndx,
13155 Sized_relobj::initializ_input_to_output_maps,
13156 Sized_relobj::free_input_to_output_maps): Change visibilities to
13157 protected.
13158 (Sized_relobj::setup): Virtualize.
13159 (Sized_relobj::do_setup): New method declaration.
13160 (Sized_relobj::invalidate_section_offset,
13161 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
13162 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
13163 * options.cc (parse_int): New function.
13164 * options.h (parse_int): New declaration.
13165 (DEFINE_int): New macro.
13166 (stub_group_size): New option.
13167 * output.cc (Output_section::Output_section): Initialize memebers
13168 merge_section_map_, merge_section_by_properties_map_,
13169 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
13170 (Output_section::add_input_section): Handled deferred code-fill
13171 generation and remove an old comment.
13172 (Output_section::add_relaxed_input_section): New method definition.
13173 (Output_section::add_merge_input_section): Use merge section by
13174 properties map to speed to search. Update merge section maps
13175 as appropriate.
13176 (Output_section::build_relaxation_map): New method definition.
13177 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
13178 Same.
13179 (Output_section::relax_input_section): Renamed to
13180 Output_section::convert_input_sections_to_relaxed_sections and change
13181 interface to take a vector of pointers to relaxed sections.
13182 (Output_section::find_merge_section,
13183 Output_section::find_relaxed_input_section): New method definitions.
13184 (Output_section::is_input_address_mapped,
13185 Output_section::output_offset, Output_section::output_address):
13186 Use output section data maps to speed up searching.
13187 (Output_section::find_starting_output_address): Add comments.
13188 (Output_section::do_write,
13189 Output_section::write_to_postprocessing_buffer): Do code-fill
13190 generation as appropriate.
13191 (Output_section::get_input_sections): Invalidate relaxed input section
13192 map.
13193 (Output_section::restore_states): Adjust type of checkpoint .
13194 Invalidate relaxed input section map.
13195 * output.h (Output_merge_base): New class declaration.
13196 (Input_section_specifier): New class defintion.
13197 (class Output_relaxed_input_section) Change base class to
13198 Output_section_data_build.
13199 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
13200 base class initializer.
13201 (Output_section::add_relaxed_input_section): New method declaration.
13202 (Output_section::Input_section): Change visibility to protected.
2e702c99 13203 (Output_section::Input_section::relobj,
c0a62865
DK
13204 Output_section::Input_section::shndx): Handle relaxed input sections.
13205 Output_section::input_sections) Change visibility to protected. Also
13206 define overload to return a non-const pointer.
13207 (Output_section::Merge_section_properties): New class defintion.
13208 (Output_section::Merge_section_by_properties_map,
13209 Output_section::Output_section_data_by_input_section_map,
13210 Output_section::Relaxation_map): New types.
13211 (Output_section::relax_input_section): Rename method to
13212 Output_section::convert_input_sections_to_relaxed_sections and change
13213 interface to take a vector of relaxed section pointers.
13214 (Output_section::find_merge_section,
13215 Output_section::find_relaxed_input_section,
13216 Output_section::build_relaxation_map,
13217 Output_section::convert_input_sections_in_list_to_relaxed_sections):
13218 New method declarations.
13219 (Output_section::merge_section_map_
13220 Output_section::merge_section_by_properties_map_,
13221 Output_section::relaxed_input_section_map_,
13222 Output_section::is_relaxed_input_section_map_valid_,
13223 Output_section::generate_code_fills_at_write_): New data members.
13224 * script-sections.cc
13225 (Output_section_element_input::set_section_addresses): Call
13226 current_data_size and addralign methods of relaxed input sections.
13227 (Orphan_output_section::set_section_addresses): Call current_data_size
13228 and addralign methods of relaxed input sections.
13229 * symtab.cc (Symbol_table::compute_final_value): Extract template
13230 from the body of Symbol_table::sized_finalize_symbol.
13231 (Symbol_table::sized_finalized_symbol): Call
13232 Symbol_table::compute_final_value.
13233 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
13234 (Symbol_table::compute_final_value): New templated method declaration.
13235 * target.cc (Target::do_make_output_section): New method defintion.
13236 * target.h (Target::make_output_section): New method declaration.
13237 (Target::relax): Add more parameters for input objects, symbol table
13238 and layout. Adjust call to do_relax.
13239 (Target::do_make_output_section): New method declaration.
13240 (Target::do_relax): Add parameters for input objects, symbol table
13241 and layout.
13242
d446d6c4
ILT
132432009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13244
13245 * pread.c: Include stdio.h.
13246
bc06c745
ILT
132472009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13248
13249 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
13250 defined.
13251
75aea3d0
ILT
132522009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13253
13254 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
13255 Change read_shndx type to unsigned int.
13256 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13257 int.
13258 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13259 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
13260 Change read_shndx type to unsigned int.
13261 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13262 int.
13263 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13264 * layout.cc (Layout::create_symtab_sections): Cast the result of
13265 local_symcount * symsize to off_t in the gold_assert.
13266
be8fcb75
ILT
132672009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13268
13269 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
13270 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
13271 R_ARM_BASE_ABS.
13272 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
13273 (Arm_relocate_functions::thm_abs5): New function.
13274 (Arm_relocate_functions::abs12): New function.
13275 (Arm_relocate_functions::abs16): New function.
13276 (Arm_relocate_functions::base_abs): New function.
13277 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
13278 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
13279 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
13280 R_ARM_BASE_ABS.
13281 (Scan::global): Likewise.
13282 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
13283 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
13284 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
13285 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
13286 R_ARM_BASE_ABS.
13287
c2a122b6
ILT
132882009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13289
13290 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
13291 (Arm_relocate_functions::movt_prel): New function.
13292 (Arm_relocate_functions::thm_movw_prel_nc): New function.
13293 (Arm_relocate_functions::thm_movt_prel): New function.
13294 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
13295 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
13296 (Scan::global, Relocate::relocate): Likewise.
13297 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13298
c4aa1e2d
ILT
132992009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13300
13301 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
13302 Incremental_checker.
13303 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
13304 unsigned int.
13305 (class Incremental_inputs_header): New class.
13306 (Incremental_inputs_header_writer): Edit comment.
13307 (Incremental_inputs_entry): New class.
13308 (Incremental_inputs_entry_writer): Edit comment.
13309 (Sized_incremental_binary::do_find_incremental_inputs_section):
13310 Add *strtab_shndx parameter, fill it.
13311 (Sized_incremental_binary::do_check_inputs): New method.
13312 (Incremental_checker::can_incrementally_link_output_file): Use
13313 Sized_incremental_binary::check_inputs.
13314 (Incremental_inputs::report_command_line): Save command line in
13315 command_line_.
13316 * incremental.h:
13317 (Incremental_binary::find_incremental_inputs_section): New
13318 method.
13319 (Incremental_binary::do_find_incremental_inputs_section): Add
13320 strtab_shndx parameter.
13321 (Incremental_binary::do_check_inputs): New pure virtual method.
13322 (Sized_incremental_binary::do_check_inputs): Declare.
13323 (Incremental_checker::Incremental_checker): Add incremental_inputs
13324 parameter, use it to initialize incremental_inputs_.
13325 (Incremental_checker::incremental_inputs_): New field.
13326 (Incremental_checker::command_line): New method.
13327 (Incremental_checker::inputs): New method.
13328 (Incremental_checker::command_line_): New field.
13329
c549a694
ILT
133302009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13331
13332 * incremental.cc: Include <cstdarg> and "target-select.h".
13333 (vexplain_no_incremental): New function.
13334 (explain_no_incremental): New function.
13335 (Incremental_binary::error): New method.
13336 (Sized_incremental_binary::do_find_incremental_inputs_section): New
13337 method.
13338 (make_sized_incremental_binary): New function.
13339 (open_incremental_binary): New function.
13340 (can_incrementally_link_file): Add checks if output is ELF and has
13341 inputs section.
13342 * incremental.h: Include "elfcpp_file.h" and "output.h".
13343 (Incremental_binary): New class.
13344 (Sized_incremental_binary): New class.
13345 (open_incremental_binary): Declare.
13346 * object.cc (is_elf_object): Use
13347 elfcpp::Elf_recognizer::is_elf_file.
13348 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
13349 * output.h (Output_file::filesize): New method.
13350
fd3c5f0b
ILT
133512009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13352
13353 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
13354 New function.
13355 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
13356 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
13357 function.
13358 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
13359 function.
13360 (Arm_relocate_functions::movw_abs_nc): New function.
13361 (Arm_relocate_functions::movt_abs): New function.
13362 (Arm_relocate_functions::thm_movw_abs_nc): New function.
13363 (Arm_relocate_functions::thm_movt_abs): New function.
13364 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
13365 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
13366 (Scan::global): Likewise.
13367 (Relocate::relocate): Likewise.
13368 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13369
7f5309a5
ILT
133702009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13371
13372 * arm.cc (Arm_relocate_functions::got_prel) New function.
13373 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
13374 (Relocate::relocate): Likewise.
13375 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13376
364c7fa5
ILT
133772009-10-06 Ian Lance Taylor <iant@google.com>
13378
13379 * options.h (class General_options): Define
13380 split_stack_adjust_size parameter.
13381 * object.h (class Object): Add uses_split_stack_ and
13382 has_no_split_stack_ fields. Add uses_split_stack and
13383 has_no_split_stack accessor functions. Declare
13384 handle_split_stack_section.
13385 (class Reloc_symbol_changes): Define.
13386 (class Sized_relobj): Define Function_offsets. Declare
13387 split_stack_adjust, split_stack_adjust_reltype, and
13388 find_functions.
13389 * object.cc (Object::handle_split_stack_section): New function.
13390 (Sized_relobj::do_layout): Call handle_split_stack_section.
13391 * dynobj.cc (Sized_dynobj::do_layout): Call
13392 handle_split_stack_section.
13393 * reloc.cc (Sized_relobj::relocate_sections): Call
13394 split_stack_adjust for executable sections in split_stack
13395 objects. Pass reloc_map to relocate_section.
13396 (Sized_relobj::split_stack_adjust): New function.
13397 (Sized_relobj::split_stack_adjust_reltype): New function.
13398 (Sized_relobj::find_functions): New function.
13399 * target-reloc.h: Include "object.h".
13400 (relocate_section): Add reloc_symbol_changes parameter. Change
13401 all callers.
13402 * target.h (class Target): Add calls_non_split method. Declare
13403 do_calls_non_split virtual method. Declare match_view and
13404 set_view_to_nop.
13405 * target.cc: Include "elfcpp.h".
13406 (Target::do_calls_non_split): New function.
13407 (Target::match_view): New function.
13408 (Target::set_view_to_nop): New function.
13409 * gold.cc (queue_middle_tasks): Give an error if mixing
13410 split-stack and non-split-stack objects with -r.
13411 * i386.cc (Target_i386::relocate_section): Add
13412 reloc_symbol_changes parameter.
13413 (Target_i386::do_calls_non_split): New function.
13414 * x86_64.cc (Target_x86_64::relocate_section): Add
13415 reloc_symbol_changes parameter.
13416 (Target_x86_64::do_calls_non_split): New function.
13417 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
13418 parameter.
13419 * powerpc.cc (Target_powerpc::relocate_section): Add
13420 reloc_symbol_changes parameter.
13421 * sparc.cc (Target_sparc::relocate_section): Add
13422 reloc_symbol_changes parameter.
13423 * configure.ac: Call AM_CONDITIONAL for the default target.
13424 * configure: Rebuild.
13425 * testsuite/Makefile.am (TEST_AS): New variable.
13426 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
13427 (check_DATA): Add split_i386 and split_x86_64 files.
13428 (SPLIT_DEFSYMS): Define.
13429 (split_i386_[1234n].o): New targets.
13430 (split_i386_[124]): New targets.
13431 (split_i386_[1234r].stdout): New targets.
13432 (split_x86_64_[1234n].o): New targets.
13433 (split_x86_64_[124]): New targets.
13434 (split_x86_64_[1234r].stdout): New targets.
13435 (MOSTLYCLEANFILES): Add new executables.
13436 * testsuite/split_i386.sh: New file.
13437 * testsuite/split_x86_64.sh: New file.
13438 * testsuite/split_i386_1.s: New file.
13439 * testsuite/split_i386_2.s: New file.
13440 * testsuite/split_i386_3.s: New file.
13441 * testsuite/split_i386_4.s: New file.
13442 * testsuite/split_i386_n.s: New file.
13443 * testsuite/split_x86_64_1.s: New file.
13444 * testsuite/split_x86_64_2.s: New file.
13445 * testsuite/split_x86_64_3.s: New file.
13446 * testsuite/split_x86_64_4.s: New file.
13447 * testsuite/split_x86_64_n.s: New file.
13448 * testsuite/testfile.cc (Target_test): Update relocation_section
13449 function.
13450 * testsuite/Makefile.in: Rebuild.
13451
e8a9fcda
ILT
134522009-10-06 Ian Lance Taylor <iant@google.com>
13453
13454 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
13455 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
13456 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
13457 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
13458 the address on ldo_addrs_.
13459 (Target_i386::Relocate::fix_up_ldo): New function.
13460
e99daf92
ILT
134612009-10-06 Rafael Espindola <espindola@google.com>
13462
13463 * plugin.cc (add_input_library): New.
13464 (Plugin::load): Add add_input_library to tv.
13465 (Plugin_manager::add_input_file): Add the is_lib argument.
13466 (add_input_file): Update call to Plugin_manager::add_input_file.
13467 (add_input_library): New.
13468 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
13469
966d4097
DK
134702009-09-30 Doug Kwan <dougkwan@google.com>
13471
13472 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
13473 symbol and call Symbol::may_need_copy_reloc to determine if
13474 a copy reloc is needed.
13475 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
13476 nocopyreloc is given in command line.
13477 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
13478 given in command line.
13479 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
13480 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
13481 of the removed Target_i386::may_need_copy_reloc.
13482 * options.h (copyreloc): New option with default value false.
13483 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13484 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
13485 instead of the removed Target_powerpc::may_need_copy_reloc.
13486 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13487 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
13488 instead of the removed Target_sparc::may_need_copy_reloc.
13489 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
13490 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
13491 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
13492 instead of the removed Target_x86_64::may_need_copy_reloc.
13493
029ba973
ILT
134942009-09-30 Ian Lance Taylor <iant@google.com>
13495
13496 * object.h (class Object): Remove target_ field, and target,
13497 sized_target, and set_target methods.
13498 (Object::sized_target): Remove.
13499 (class Sized_relobj): Update declarations. Remove sized_target.
13500 * object.cc (Sized_relobj::setup): Remove target parameter.
13501 Change all callers.
13502 (Input_objects::add_object): Don't do anything with the target.
13503 (make_elf_sized_object): Add punconfigured parameter. Change all
13504 callers. Set or test parameter target.
13505 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
13506 Change all callers.
13507 * parameters.cc (Parameters::set_target): Change parameter type to
13508 be non-const.
13509 (Parameters::default_target): Remove.
13510 (set_parameters_target): Change parameter type to be non-const.
13511 (parameters_force_valid_target): New function.
13512 (parameters_clear_target): New function.
13513 * parameters.h (class Parameters): Update declarations. Remove
13514 default_target method. Add sized_target and clear_target
13515 methods. Change target_ to be non-const.
13516 (set_parameters_target): Update declaration.
13517 (parameters_force_valid_target): Declare.
13518 (parameters_clear_target): Declare.
13519 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
13520 as NULL if we aren't searching.
13521 (Add_symbols::run): Don't check for compatible target.
13522 * fileread.cc (Input_file::open_binary): Call
13523 parameters_force_valid_target.
13524 * gold.cc (queue_middle_tasks): Likewise.
13525 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
13526 set_target on object.
13527 * dynobj.h (class Sized_dynobj): Update declarations.
13528 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
13529 make_elf_object returns NULL.
13530 (Archive::include_member): Don't check whether object target is
13531 compatible.
13532 * output.cc (Output_section::add_input_section): Get target from
13533 parameters.
13534 (Output_section::relax_input_section): Likewise.
13535 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
13536 parameters.
13537 (Sized_relobj::do_scan_relocs): Likewise.
13538 (Sized_relobj::relocate_sections): Likewise.
13539 * resolve.cc (Symbol_table::resolve): Likewise.
13540 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
13541 parameter. Change all callers.
13542 (Symbol_table::add_from_object): Get target from parameters.
13543 (Symbol_table::add_from_relobj): Don't check object target.
13544 (Symbol_table::add_from_dynobj): Likewise.
13545 (Symbol_table::define_special_symbol): Get target from
13546 parameters.
13547 * symtab.h (class Symbol_table): Update declaration.
13548 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
13549 parameter. Change all callers. Clear parameter target.
13550 (Binary_test): Test target here.
13551 * testsuite/object_unittest.cc (gold_testsuite): Remove
13552 target_test_pointer parameter. Change all callers.
13553 (Object_test): Test target here.
13554
a6a22b83
ILT
135552009-09-26 Ian Lance Taylor <iant@google.com>
13556
13557 * testsuite/initpri1.c: Don't try to use constructor priorities if
13558 compiling with gcc before 4.3.
13559
6a8f49fe
ILT
135602009-09-22 Mikolaj Zalewski <mikolajz@google.com>
13561
13562 * testsuite/retain_symbols_file_test.sh (check_present): Change
13563 output file name to retain_symbols_file_test.stdout.
13564 (check_absent): Likewise.
13565
8c604651
CS
135662009-09-18 Craig Silverstein <csilvers@google.com>
13567
13568 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
13569 * options.cc: Include <cerrno> and <fstream>.
13570 (General_options::finalize): Parse -retain-symbols-file tag.
13571 * options.h: New flag.
13572 (General_options): New method should_retain_symbol, new
13573 variable symbols_to_retain.
13574 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
13575 should_retain_symbol map.
13576 * testsuite/Makefile.am (retain_symbols_file_test): New test.
13577 * testsuite/Makefile.in: Regenerate.
13578 * testsuite/retain_symbols_file_test.sh: New file.
13579
ca58b19f
NC
135802009-09-18 Nick Clifton <nickc@redhat.com>
13581
13582 * po/es.po: Updated Spanish translation.
13583
20e6d0d6
DK
135842009-09-17 Doug Kwan <dougkwan@google.com>
13585
13586 * debug.h (DEBUG_RELAXATION): New constant.
13587 (DEBUG_ALL): Add DEBUG_RELAXATION.
13588 (debug_string_to_enum): Add relaxation debug option.
13589 * layout.cc
13590 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
13591 Layout::Relaxation_debug_check::read_sections,
13592 Layout::Relaxation_debug_check::read_sections): New method definitions.
13593 (Layout::Layout): Initialize data members
13594 record_output_section_data_from_scrips_,
13595 script_output_section_data_list_ and relaxation_debug_check_.
13596 (Layout::save_segments, Layout::restore_segments,
13597 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13598 Layout::relaxation_loop_body): New method definitions.
13599 (Layout::finalize): Support relaxation. Move section layout code to
13600 Layout::relaxation_loop_body.
13601 (Layout::set_asection_address_from_script): Move code for orphan
13602 section placement out.
13603 (Layout::place_orphan_sections_in_script): New method definition.
13604 * layout.h (Output_segment_headers, Output_file_header):
13605 New forward class declarations.
13606 (Layout::~Layout): Define.
13607 (Layout::new_output_section_data_from_script): New method definition.
13608 (Layout::place_orphan_sections_in_script): New method declaration.
13609 (Layout::Segment_states): New type declaration.
13610 (Layout::save_segments, Layout::restore_segments,
13611 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13612 Layout::relaxation_loop_body): New method declarations.
13613 (Layout::Output_section_data_list): New type declaration.
13614 (Layout::Relaxation_debug_check): New class definition.
13615 (Layout::record_output_section_data_from_script_,
13616 Layout::script_output_section_data_list_, Layout::segment_states_,
13617 Layout::relaxation_debug_check_): New data members.
13618 * output.cc: (Output_section_headers::do_size): New method definition.
13619 (Output_section_headers::Output_section_headers): Move size
13620 computation to Output_section_headers::do_size.
13621 (Output_segment_headers::do_size): New method definition.
e1df38aa 13622 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
13623 Output_file_header::do_size and call it.
13624 (Output_file_header::do_size): New method definition.
13625 (Output_data_group::Output_data_group): Adjust call to
13626 Output_section_data.
13627 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
13628 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 13629 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
13630 RELAXED_INPUT_SECTION_CODE.
13631 (Output_section::Output_section): Initialize data member checkpoint_.
13632 (Output_section::~Output_section): Delete checkpoint object pointed
13633 by checkpoint_.
13634 (Output_section::add_input_section): Always add an Input_section if
13635 relaxing.
13636 (Output_section::add_merge_input_section): Add assert.
13637 (Output_section::relax_input_section): New method definition.
13638 (Output_section::set_final_data_size): Set load address to zero for
13639 an unallocated section.
13640 (Output_section::do_address_and_file_offset_have_reset_values):
13641 New method definition.
13642 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
13643 Handle relaxed input section.
13644 (Output_section::sort_attached_input_sections): Checkpoint input
13645 section list lazily.
13646 (Output_section::get_input_sections): Change type of input_sections to
13647 list of Simple_input_section pointers. Checkpoint input section list
13648 lazily. Also handle relaxed input sections.
13649 (Output_section::add_input_section_for_script): Take a reference to
13650 a Simple_input_section object instead of Relobj pointer and section
13651 index as parameter. Handle relaxed input sections.
13652 (Output_section::save_states, Output_section::restore_states): New
13653 method definitions.
13654 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
13655 (Output_data::is_data_size_fixed): New method definition.
13656 (Output_data::reset_addresss_and_file_offset): Do not reset data size
13657 if it is fixed.
13658 (Output_data::address_and_file_offset_have_reset_values): New method
13659 definition.
13660 (Output_data::do_address_and_file_offset_have_reset_values): New method
13661 definition.
13662 (Output_data::set_data_size): Check that data size is not fixed.
13663 (Output_data::fix_data_size): New method definition.
13664 (Output_data::is_data_size_fixed_): New data member.
13665 (Output_section_headers::set_final_data_size): New method definition.
13666 (Output_section_headers::do_size): New method declaration.
13667 (Output_segment_headers::set_final_data_size): New method definition.
13668 (Output_segment_headers::do_size): New method declaration.
13669 (Output_file_header::set_final_data_size)::New method definition.
13670 (Output_file_header::do_size)::New method declaration.
13671 (Output_section_data::Output_section_data): Add new parameter
13672 is_data_size_fixed and use it to fix data size.
13673 (Output_data_const::Output_data_const): Adjust call to base class
13674 constructor and fix data size.
13675 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
13676 base class constructor and fix data size.
13677 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
13678 base class constructor and fix data size.
13679 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
13680 class constructor and fix data size.
13681 (Output_data_group::set_final_data_size): New method definition.
13682 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
13683 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
13684 class constructor and fix data size.
13685 (Output_relaxed_input_section): New class definition.
13686 (Output_section::Simple_input_section): New class definition.
13687 (Output_section::get_input_sections): Adjust parameter list.
13688 (Output_section::add_input_section_for_script): Same.
13689 (Output_section::save_states, Output_section::restore_states,
13690 Output_section::do_address_and_file_offset_have_reset_values,
13691 (Output_section::Input_section::Input_section): Handle
13692 RELAXED_INPUT_SECTION_CODE. Add new overload for
13693 Output_relaxed_input_section.
13694 (Output_section::Input_section::is_input_section,
13695 Output_section::Input_section::set_output_section): Handle relaxed
13696 input section.
13697 (Output_section::Input_section::is_relaxed_input_section,
13698 Output_section::Input_section::output_section_data,
13699 Output_section::Input_section::relaxed_input_section): New method
13700 definitions.
13701 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
13702 value.
13703 (Output_section::Input_section::u1_): Update comments.
13704 (Output_section::Input_section::u2_): Add new union member poris.
13705 (Output_section::Checkpoint_output_section): New classs definition.
13706 (Output_section::relax_input_section): New method declaration.
13707 (Output_section::checkpoint_): New data member.
13708 (Output_segment): Update comments.
13709 (Output_segment::Output_segment): Un-privatize copy constructor.
13710 (Output_segment::operator=): Un-privatize.
13711 * script-sections.cc (Output_section_element::Input_section_list):
13712 Change element type to Output_section::Simple_input_section.
13713 (Output_section_element_dot_assignment::set_section_addresses):
13714 Register output section data for relaxation clean up.
13715 (Output_data_exression::Output_data_expression): Adjust call to base
13716 constructor to fix data size.
13717 (Output_section_element_data::set_section_addresses): Register
13718 Output_data_expression object for relaxation clean up.
13719 (struct Input_section_info): Replace Relobj pointer and section index
13720 pair with Output_section::Simple_input_section and Convert struct to a
13721 class.
13722 (Input_section_sorter::operator()): Adjust access to
e1df38aa 13723 Input_section_info data member to use accessors.
20e6d0d6
DK
13724 (Output_section_element_input::set_section_addresses): Use layout
13725 parameter. Adjust code to use Output_section::Simple_input_section
13726 and Input_secction_info classes. Register filler for relaxation
13727 clean up.
13728 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
13729 and section index pair with Output_section::Simple_input_section
13730 class. Adjust code accordingly.
13731 (Phdrs_element::release_segment): New method definition.
13732 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
13733 segment list.
13734 (Script_sections::release_segments): New method definition.
13735 * gold/script-sections.h (Script_sections::release_segments): New
13736 method declaration.
13737 * gold/target.h (Target::may_relax, Target::relax,
13738 Target::do_may_relax, Target::do_relax): New method definitions.
13739
5e445df6
ILT
137402009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13741
13742 * arm.cc (has_signed_unsigned_overflow): New function.
13743 (Arm_relocate_functions::abs8): New function.
13744 (Target_arm::Scan::local): Handle R_ARM_ABS8.
13745 (Target_arm::Scan::global): Likewise.
13746 (Target_arm::relocate::relocate): Likewise.
13747 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
13748 Likewise.
13749
8c604651 137502009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
13751
13752 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
13753 * testsuite/Makefile.in: Regenerate.
13754
1e9cc1c2
NC
137552009-09-11 Nick Clifton <nickc@redhat.com>
13756
13757 * po/gold.pot: Updated by the Translation project.
13758
6a89f575
CC
137592009-09-08 Cary Coutant <ccoutant@google.com>
13760
13761 * output.cc (Output_file::open): Add execute permission to empty file.
13762 * testsuite/Makefile.am (permission_test): New test.
13763 * testsuite/Makefile.in: Regenerate.
13764
fdcac5af
ILT
137652009-09-02 Ian Lance Taylor <iant@google.com>
13766
13767 * output.cc (Output_file::resize): Call map_no_anonymous rather
13768 than map.
13769
44453f85
ILT
137702009-09-01 Mikolaj Zalewski <mikolajz@google.com>
13771
13772 * gold.cc: Include "incremental.h".
13773 (queue_initial_tasks): Call Incremental_checker methods.
13774 * incremental.cc: Include "output.h".
13775 (Incremental_checker::can_incrementally_link_output_file): New
13776 method.
13777 * incremental.h (Incremental_checker): New class.
13778
13779 * output.cc (Output_file::open_for_modification): New method.
13780 (Output_file::map_anonymous): Changed return type to bool. Record
13781 map in base_ field.
13782 (Output_file::map_no_anonymous): New method, broken out of map.
13783 (Output_file::map): Use map_no_anonymous and map_anonymous.
13784 * output.h (class Output_file): Update declarations.
13785
293c1386
CC
137862009-08-24 Cary Coutant <ccoutant@google.com>
13787
13788 * options.h (Command_line::Pre_options): New class.
13789 (Command_line::pre_options): New member.
13790 * options.cc (gold::options::ready_to_register): New variable.
13791 (One_option::register_option): Do nothing if not registering options.
13792 Assert if same short option registered twice.
13793 (General_options::General_options): Turn off option registration when
13794 done constructing.
13795 (Command_line::Pre_options::Pre_options): New constructor.
13796
f773f3d2
CC
137972009-08-24 Cary Coutant <ccoutant@google.com>
13798
06a73cfe
CC
13799 * options.h (General_options::no_keep_memory): Remove incorrect
13800 short option.
f773f3d2 13801
a15af8e2
RW
138022009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13803
13804 * Makefile.am (am__skiplex, am__skipyacc): New.
13805 * Makefile.in: Regenerate.
13806
c462b41b
RW
138072009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13808
14ec8efd
RW
13809 * Makefile.am (AM_CPPFLAGS): Renamed from ...
13810 (INCLUDES): ... this.
13811 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
13812 (AM_CPPFLAGS): Renamed from ...
13813 (INCLUDE): ... this.
13814 * Makefile.in, testsuite/Makefile.in: Regenerate.
13815
81ecdfbb
RW
13816 * Makefile.in: Regenerate.
13817 * aclocal.m4: Likewise.
13818 * config.in: Likewise.
13819 * configure: Likewise.
13820 * testsuite/Makefile.in: Likewise.
13821
c462b41b
RW
13822 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
13823 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
13824 * Makefile.in: Regenerate.
13825 * testsuite/Makefile.in: Regenerate.
13826
2da73f13
CC
138272009-08-19 Cary Coutant <ccoutant@google.com>
13828
13829 * resolve.cc (Symbol_table::resolve): Don't complain about defined
13830 symbols in shared libraries overridden by hidden or internal symbols
13831 in the main program.
13832
2db70501
CD
138332009-08-19 Chris Demetriou <cgd@google.com>
13834
13835 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
13836 checking source file names in error messages.
13837
f733487b
DK
138382009-08-18 Doug Kwan <dougkwan@google.com>
13839
13840 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
13841 an elcpp::Ehdr as parameter. Adjust call to set_target.
13842 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
13843 an elfcpp::Ehdr as parameter.
13844 * object.cc (Object::set_target): Remove the version that looks up
13845 a target and sets it.
13846 (Sized_relobj::setup): Take a Target object instead of
13847 an elfcpp::Ehdr as parameter. Adjust call to set_target.
13848 (make_elf_sized_object): Find target and ask target to
13849 make an ELF object.
13850 * object.h: (Object::set_target): Remove the version that looks up
13851 a target and sets it.
13852 (Sized_relobj::setup): Take a Target object instead of
13853 an elfcpp:Ehdr as parameter.
13854 * target.cc: Include dynobj.h.
13855 (Target::do_make_elf_object_implementation): New.
2e702c99 13856 (Target::do_make_elf_object): New.
f733487b
DK
13857 * target.h (Target::make_elf_object): New template declaration.
13858 (Target::do_make_elf_object): New method declarations.
13859 (Target::do_make_elf_object_implementation): New template declaration.
13860
cc70f101
ILT
138612009-08-14 Ian Lance Taylor <iant@google.com>
13862
13863 * gold.h (FUNCTION_NAME): Define.
13864 (gold_unreachable): Use FUNCTION_NAME.
13865
ef5e0cb1
ST
138662009-08-12 Sriraman Tallam <tmsriram@google.com>
13867
13868 * icf.cc (Icf::find_identical_sections): Issue a warning when a
13869 symbol in the --keep-unique list is not found.
13870
48c187ce
ST
138712009-08-12 Sriraman Tallam <tmsriram@google.com>
13872
13873 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
13874 been maked as --keep-unique.
13875 (Icf::unfold_section): New function.
13876 * icf.h (Icf::unfold_section): New function.
13877 * options.h (General_options::keep_unique): New option.
13878 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
13879 * testsuite/Makefile.in: Regenerate.
13880 * testsuite/icf_keep_unique_test.sh: New file.
13881 * testsuite/icf_keep_unique_test.cc: New file.
13882
645afe0c
CC
138832009-08-12 Cary Coutant <ccoutant@google.com>
13884
13885 PR 10471
13886 * resolve.cc (Symbol_table::resolve): Check for references from
13887 dynamic objects to hidden and internal symbols.
13888 * testsuite/Makefile.am (hidden_test.sh): New test.
13889 * testsuite/Makefile.in: Regenerate.
13890 * testsuite/hidden_test.sh: New script.
13891 * testsuite/hidden_test_1.c: New test source.
13892 * testsuite/hidden_test_main.c: New test source.
13893
11af873f
DK
138942009-08-11 Doug Kwan <dougkwan@google.com>
13895
13896 * arm.cc: Update comments.
13897 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
13898 segment to locate the .ARM.exidx section if present.
13899
b9f7d72d
DK
139002009-08-09 Doug Kwan <dougkwan@google.com>
13901
13902 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
13903 patch.
13904
ddd3c53c
ST
139052009-08-07 Sriraman Tallam <tmsriram@google.com>
13906 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
13907 compiler warnings.
13908
27721062
ST
139092009-08-06 Sriraman Tallam <tmsriram@google.com>
13910
13911 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
13912 valid tls_segment only for non-debug-section relocations.
13913 * testsuite/Makefile.am: Add gc_tls_test.
13914 * testsuite/Makefile.in: Regenerate.
13915 * testsuite/gc_tls_test.cc: New file.
13916 * testsuite/gc_tls_test.sh: New file.
13917
ef15dade 139182009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 13919
ef15dade
ST
13920 * icf.cc: New file.
13921 * icf.h: New file.
13922 * Makefile.am (CCFILES): Add icf.cc.
13923 (HFILES): Add icf.h
13924 * Makefile.in: Regenerate.
13925 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
13926 * gc.h (gc_process_relocs): Populate lists used by icf to contain
13927 section, symbol and addend information for the relocs.
13928 * gold.cc (queue_middle_tasks): Call identical code folding.
13929 * gold.h: Add defines for multimap.
13930 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
13931 to the call of finalize_local_symbols.
13932 * main.cc (main): Create object of class Icf.
13933 * object.cc (Sized_relobj::do_layout): Allow this function to be
13934 called twice during icf.
13935 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
13936 to sections marked as identical by icf.
13937 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
13938 when available.
13939 (Sized_relobj::do_section_entsize): New function.
13940 * object.h (Object::section_entsize): New function.
13941 (Object::do_section_entsize): New pure virtual function.
13942 (Relobj::finalize_local_symbols): Add new parameter.
13943 (Relobj::do_section_entsize): New function.
13944 * options.h (General_options::icf): New option.
13945 (General_options::icf_iterations): New option.
13946 (General_options::print_icf_sections): New option.
13947 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
13948 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
13949 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
13950 icf.
13951 * symtab.cc (Symbol_table::is_section_folded): New function.
13952 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
13953 to sections marked as identical by icf.
13954 * symtab.h (Symbol_table::set_icf): New function.
13955 (Symbol_table::icf): New function.
13956 (Symbol_table::is_section_folded): New function.
13957 (Symbol_table::icf_): New data member.
13958 * target-reloc.h (relocate_section): Ignore sections folded by icf.
13959 * testsuite/Makefile.am: Add commands to build icf_test.
13960 * testsuite/Makefile.in: Regenerate.
13961 * testsuite/icf_test.sh: New file.
13962 * testsuite/icf_test.cc: New file.
13963
c3b65ac4
CD
139642009-07-24 Chris Demetriou <cgd@google.com>
13965
13966 * layout.cc (is_compressible_debug_section): Fix incorrect
13967 comment about compressed section names.
13968
1caf2c51
ILT
139692009-07-20 Ian Lance Taylor <ian@airs.com>
13970
13971 PR 10419
13972 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
13973
1ef4d87f
ILT
139742009-07-16 Ian Lance Taylor <iant@google.com>
13975
13976 PR 10400
13977 * layout.h: #include <map>.
13978 (class Kept_section): Change from struct to class. Add accessors
13979 and setters. Add section size to Comdat_group mapping. Change
13980 Comdat_group to std::map. Add is_comdat_ field. Add
13981 linkonce_size field in union.
13982 (class Layout): Update declaration of find_or_add_kept_section.
13983 Don't declare find_kept_object.
13984 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
13985 parameter. Add object, shndx, is_comdat, and is_group_name
13986 parameters. Change all callers. Adjust for new Kept_section.
13987 (Layout::find_kept_object): Remove.
13988 * object.cc (Sized_relobj::include_section_group): Update use of
13989 Kept_section. Rename secnum to shndx. Only record
13990 Kept_comdat_section if sections are the same size.
13991 (Sized_relobj::include_linkonce_section): Update use of
13992 Kept_section. Only record Kept_comdat_section if sections are the
13993 same size. Set size of linkonce section.
13994 (Sized_relobj::map_to_kept_section): Update call to
13995 get_kept_comdat_section.
13996 * object.h (class Sized_relobj): Rename fields in
13997 Kept_comdat_section to drop trailing underscores; change object
13998 field to Relobj*. Change Kept_comdat_section_table to store
13999 struct rather than pointer.
14000 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
14001 Add kept_object and kept_shndx parameters. Change all callers.
14002 (Sized_relobj::get_kept_comdat_section): Change return type to
14003 bool. Add kept_object and kept_shndx parameters. Change all
14004 callers.
14005 * plugin.cc (Pluginobj::include_comdat_group): Update call to
14006 Layout::find_or_add_kept_section.
14007
37c3b7b0
ILT
140082009-07-09 Ian Lance Taylor <iant@google.com>
14009
14010 * merge.cc (Object_merge_map::initialize_input_to_output_map):
14011 Reserve space in the hash table.
14012
98fa85cb
ILT
140132009-07-06 Mikolaj Zalewski <mikolajz@google.com>
14014
14015 * fileread.cc (File_read::get_mtime): New method.
14016 * fileread.h (Timespec): New structure.
14017 (File_read::get_mtime): New method.
14018 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
14019 Renamed from timestamp_nsec.
14020 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
14021 Elf_Xword.
e1df38aa 14022 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 14023 timestamp_nsec.
e1df38aa 14024 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
14025 (Incremental_inputs::report_obejct): Save mtime; style fix.
14026 (Incremental_inputs::report_script): Save mtime; style fix.
14027 (Incremental_inputs::finalize_inputs): Style fix.
14028 (Incremental_inputs::finalize): Style fix.
14029 (Incremental_inputs::create_input_section_data): Store inputs
14030 mtime.
14031 * incremental.h (Incremental_inputs::report_script): Add mtime
14032 argument.
14033 (Incremental_inputs::Input_info::Input_info): Intialize only one
14034 union member.
14035 (Incremental_inputs::Input_info::archive): Move to nameless
14036 union.
14037 (Incremental_inputs::Input_info::obejct): Move to nameless union.
14038 (Incremental_inputs::Input_info::script): Move to nameless union.
14039 (Incremental_inputs::mtime): New field.
14040 * script.cc (read_input_script): Pass file mtime to
14041 Incremental_input.
14042 * script.h (Script_info::inputs): Style fix.
14043
c9d70757
ILT
140442009-07-01 Ian Lance Taylor <ian@airs.com>
14045
14046 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
14047 instead of 32.
14048
9c547ec3
ILT
140492009-06-24 Ian Lance Taylor <iant@google.com>
14050
14051 PR 10156
14052 * layout.cc (Layout::choose_output_section): If we find an
14053 existing section, update the flags.
14054 (Layout::create_notes): New function, broken out of
14055 Layout::finalize.
14056 (Layout::finalize): Don't create note sections.
14057 (Layout::create_note): Don't crash if linker script discards
14058 section.
14059 (Layout::create_gold_note): Likewise.
14060 (Layout::create_build_id): Likewise. Don't set
14061 after_input_sections on the section.
14062 (Layout::create_executable_stack_info): Remove target parameter.
14063 Change caller.
14064 * layout.h (class Layout): Declare create_notes. Update
14065 declaration of create_executable_stack_info.
14066 * gold.cc (queue_middle_tasks): Call create_notes.
14067 * output.cc (Output_section::update_flags_for_input_section): Move
14068 here from output.h. If SHF_ALLOC flag is newly set, mark address
14069 invalid.
14070 * output.h (Output_data::mark_address_invalid): New function.
14071 (class Output_section): Only declare, not define,
14072 update_flags_for_input_section. Remove set_flags.
14073
55458500
ILT
140742009-06-24 Ian Lance Taylor <iant@google.com>
14075
14076 * script-sections.cc (Output_section_definition::
14077 set_section_addresses): Rename shadowing local load_address to
14078 laddr.
14079
1307d6cd
ILT
140802009-06-24 Ian Lance Taylor <iant@google.com>
14081
14082 PR 10244
14083 * reloc.cc (relocate_sections): Skip empty relocation sections.
14084
ec3f783e
ILT
140852009-06-23 Ian Lance Taylor <iant@google.com>
14086
14087 PR 10156
14088 * layout.cc (Layout::create_note): Use choose_output_section
14089 rather than make_output_section.
14090
459c9f1c
ILT
140912009-06-23 Ian Lance Taylor <iant@google.com>
14092
14093 PR 10237
14094 * options.cc (General_options::parse_V): Set printed_version_.
14095 (General_options::General_options): Initialize printed_version_.
14096 * options.h (class General_options): Add printed_version_ field.
14097 * gold.cc (queue_initial_tasks): If there are no input files,
14098 don't give a fatal error if we printed the version information.
14099 (queue_middle_tasks): If using -r with a shared object, give a
14100 fatal error rather than an ordinary error.
14101
1518dc8f
ILT
141022009-06-23 Ian Lance Taylor <iant@google.com>
14103
14104 PR 10219
14105 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
14106 (Layout::make_output_section): Set have_stabstr_section_ if we see
14107 a .stab*str section.
14108 (Layout::finalize): Call link_stabs_sections.
14109 (Layout::link_stabs_sections): New file.
14110 * layout.h (class Layout): Add have_stabstr_section_ field.
14111 Declare link_stabs_sections.
14112
3d857b98
DK
141132009-06-23 Doug Kwan <dougkwan@google.com>
14114
14115 * Makefile.am (libgold_a_LIBADD): New.
14116 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 14117 * Makefile.in: Regenerate.
3d857b98
DK
14118 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
14119 * configure: Regenerate.
14120 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
14121 * fileread.cc: Include sys/state.h
14122 * gold.h: Declare memmem and strndup if found missing.
14123 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
14124
0639a6f6
ILT
141252009-06-23 Ian Lance Taylor <iant@google.com>
14126
14127 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
14128 * configure: Rebuild.
14129
8d63875c
ILT
141302009-06-23 Ian Lance Taylor <iant@google.com>
14131
14132 PR 10147
14133 * object.cc (Object::section_contents): Don't try to get a view if
14134 the section has length zero.
14135 (Object::handle_gnu_warning_section): If the section is empty, use
14136 the name of the section as the warning.
14137
f7c8a183
ILT
141382009-06-23 Ian Lance Taylor <iant@google.com>
14139
14140 PR 10133
14141 * stringpool.h (class Stringpool_template): Add optimize_ field.
14142 (Stringpool_template::set_optimize): New function.
14143 * stringpool.cc (Stringpool_template::Stringpool_template):
14144 Initialize optimize_ field.
14145 (Stringpool_template::set_string_offsets): Test local optimize
14146 fild rather than parameter.
14147 * layout.cc (Layout::Layout): Call set_optimize on the section
14148 name stringpool.
14149
e6a307ba
ILT
141502009-06-22 Ian Lance Taylor <iant@google.com>
14151
14152 PR 10030
14153 * yyscript.y: Parse TARGET.
14154 * script.cc (script_set_target): New function.
14155 * script-c.h (script_set_target): Declare.
14156 * options.cc (General_options::string_to_object_format): Rename
14157 from string_to_object_format in anonymous namespace. Change
14158 callers.
14159 * options.h (class General_options): Declare
14160 string_to_object_format.
14161
3ee173de
ILT
141622009-06-22 Ian Lance Taylor <iant@google.com>
14163
14164 * script-sections.cc (Script_sections::create_segments): Don't put
14165 program headers in a PT_LOAD segment if -n or -N.
14166
141672009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
14168
14169 PR 10141
14170 * options.h (class General_options): Add -z lazy and -z now. Sort
14171 -z options into alphabetical order.
14172 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
14173
cd6739a1 141742009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
14175
14176 * layout.cc (Layout::make_output_section): Call
14177 Target::new_output_section.
14178 (Layout::attach_allocated_section_to_segment): Put large section
14179 sections in a separate load segment with the large segment flag
14180 set.
14181 (Layout::segment_precedes): Sort large data segments after other
14182 load segments.
14183 (align_file_offset): New static function.
14184 (Layout::set_segment_offsets): Use align_file_offset.
14185 * output.h (class Output_section): Add is_small_section_ and
14186 is_large_section_ fields.
14187 (Output_section::is_small_section): New function.
14188 (Output_section::set_is_small_section): New function.
14189 (Output_section::is_large_section): New function.
14190 (Output_section::set_is_large_section): New function.
14191 (Output_section::is_large_data_section): New function.
14192 (class Output_segment): Add is_large_data_segment_ field.
14193 (Output_segment::is_large_data_segment): New function.
14194 (Output_segment::set_is_large_data_segment): New function.
14195 * output.cc (Output_section::Output_section): Initialize new
14196 fields.
14197 (Output_segment::Output_segment): Likewise.
14198 (Output_segment::add_output_section): Add assertion that large
14199 data sections always go in large data segments. Force small data
14200 sections to the end of the list of data sections. Force small BSS
14201 sections to the start of the list of BSS sections. For large BSS
14202 sections to the end of the list of BSS sections.
14203 * symtab.h (class Symbol): Declare is_common_shndx.
14204 (Symbol::is_defined): Check Symbol::is_common_shndx.
14205 (Symbol::is_common): Likewise.
14206 (class Symbol_table): Define enum Commons_section_type. Update
14207 declarations. Add small_commons_ and large_commons_ fields.
14208 * symtab.cc (Symbol::is_common_shndx): New function.
14209 (Symbol_table::Symbol_table): Initialize new fields.
14210 (Symbol_table::add_from_object): Put small and large common
14211 symbols in the right list.
14212 (Symbol_table::sized_finalized_symbol): Check
14213 Symbol::is_common_shndx.
14214 (Symbol_table::sized_write_globals): Likewise.
14215 * common.cc (Symbol_table::do_allocate_commons): Allocate new
14216 common symbol lists. Don't call do_allocate_commons_list if the
14217 list is empty.
14218 (Symbol_table::do_allocate_commons_list): Remove is_tls
14219 parameter. Add comons_section_type parameter. Change all
14220 callers. Handle small and large common symbols.
14221 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
14222 Symbol::is_common_shndx.
14223 * resolve.cc (symbol_to_bits): Likewise.
14224 * target.h (Target::small_common_shndx): New function.
14225 (Target::small_common_section_flags): New function.
14226 (Target::large_common_shndx): New function.
14227 (Target::large_common_section_flags): New function.
14228 (Target::new_output_section): New function.
14229 (Target::Target_info): Add small_common_shndx, large_common_shndx,
14230 small_common_section_flags, and large_common_section_flags
14231 fields.
14232 (Target::do_new_output_section): New virtual function.
14233 * arm.cc (Target_arm::arm_info): Initialize new fields.
14234 * i386.cc (Target_i386::i386_info): Likewise.
14235 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
14236 Likewise.
14237 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
14238 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
14239 (Target_x86_64::do_new_output_section): New function.
14240 * configure.ac: Define conditional MCMODEL_MEDIUM.
14241 * testsuite/Makefile.am (check_PROGRAMS): Add large.
14242 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
14243 (large_LDFLAGS): Define.
14244 * testsuite/large.c: New file.
14245 * testsuite/testfile.cc (Target_test::test_target_info):
14246 Initialize new fields.
14247 * configure, testsuite/Makefile.in: Rebuild.
14248
bb04269c
DK
142492009-06-05 Doug Kwan <dougkwan@google.com>
14250
14251 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 14252 * Makefile.in: Regenerate.
bb04269c
DK
14253 * i386.cc (class Target_i386): Define new virtual method to
14254 override do_is_local_label_name in parent.
14255 * object.cc (Sized_relobj::do_count_local_symbols): Discard
14256 local symbols if --discard-locals or -X is given.
14257 * options.h (class General_options): Declare new options
14258 '--discard-locals' and '-X' for discarding locals.
14259 * target.h (class Target): Define new methods is_local_label_name.
14260 Declare new virtual method do_is_local_label_name.
14261 * target.cc: New file.
14262 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
14263 (check_SCRIPTS): Add discard_locals_test.sh.
14264 (check_DATA): Add discard_local_tests.syms.
14265 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
14266 (discard_local_tests.syms, discard_locals_test.o): New make rules.
14267 * testsuite/Makefile.in: Regenerate.
14268 * testsuite/discard_locals_test.c: New file.
14269 * testsuite/discard_locals_test.sh: Same.
14270
805bb01c
DK
142712009-06-05 Doug Kwan <dougkwan@google.com>
14272
14273 * object.cc (Sized_relobj::Sized_relobj): Initialize
14274 discarded_eh_frame_shndx_ to -1U.
14275 (Sized_relobj::do_layout): Record index of a discard .eh_frame
14276 section.
14277 (Sized_relobj::do_count_local_symbols): Skip local symbols in
14278 a discarded .eh_frame section.
14279 (Sized_relobj::do_finalize_local_symbols): Ditto.
14280 * object.h (class Sized_relobj): Declare new member
14281 discarded_eh_frame_shndx_.
14282 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
14283 (local_labels_test.o, local_labels_test): New rules.
14284 * testsuite/Makefile.in: Regenerate.
14285
1dcd334d
DK
142862009-06-04 Doug Kwan <dougkwan@google.com>
14287
14288 * layout.cc (Layout::section_name_mapping): Add mapping for
14289 special ARM sections.
14290
96d49306
DK
142912009-06-03 Doug Kwan <dougkwan@google.com>
14292
14293 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
14294 (utils::has_overflow): Same.
14295
dff16297
ILT
142962009-06-03 Ian Lance Taylor <iant@google.com>
14297
14298 * layout.cc (Layout::section_name_mapping): New array, replacing
14299 Layout::linkonce_mapping.
14300 (Layout::section_name_mapping_count): New variable, replacing
14301 Layout::linkonce_mapping_count.
14302 (Layout::linkonce_output_name): Remove.
14303 (Layout::output_section_name): Rewrite.
14304 * layout.h (class Layout): Rename Linkonce_mapping to
14305 Section_name_mapping, linkonce_mapping to section_name_mapping,
14306 linkonce_mapping_count to section_name_mapping_count. Don't
14307 declare linkonce_output_name.
14308
c121c671
DK
143092009-06-03 Doug Kwan <dougkwan@google.com>
14310
14311 * gold/arm.cc (namespace utils): New.
14312 (Target_arm::reloc_is_non_pic): Define new method.
14313 (class Arm_relocate_functions): New.
14314 (Target_arm::Relocate::relocate): Handle relocation types used by
14315 Android.
14316
07800fab
ILT
143172009-06-03 Ian Lance Taylor <iant@google.com>
14318
14319 * arm.cc (Target_arm::scan::global): Use || instead of |.
14320
c121c671
DK
143212009-06-02 Doug Kwan <dougkwan@google.com>
14322
14323 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
14324 issued_non_pic_error_.
14325 (class Target_arm::Scan): Declare new method check_non_pic.
14326 Define new method symbol_needs_plt_entry.
14327 Declare new data member issued_non_pic_error_.
14328 (class Target_arm::Relocate): Declare new method
14329 should_apply_static_reloc.
14330 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
14331 (Target_arm::Scan::check_non_pic): Define new method.
14332 (Target_arm::Scan::local): Handle a small subset of reloc types used
14333 by Android.
14334 (Target_arm::Scan::local): Same.
14335 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
14336
b19b0c6d
ILT
143372009-05-31 Mikolaj Zalewski <mikolajz@google.com>
14338
14339 * incremental.cc (Incremental_inputs::report_command_line): Filter
14340 out --incremental-* options.
14341
94cdfcff
DK
143422009-05-29 Doug Kwan <dougkwan@google.com>
14343
14344 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
14345 template class.
14346 (class Target_arm): Update comment.
14347 (Target_arm::Target_arm): Initialize new data members GOT_,
14348 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
14349 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
14350 and Target_arm::rel_dyn_section.
14351 Declare new_enum Target_arm::Got_type.
14352 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
14353 and DYNBSS_.
14354 Update commments for member do_dynsym_value.
14355 (Target_arm::got_size, Target_arm::plt_section,
14356 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
14357 new methods inside class defintion.
14358 (Target_arm::got_section): Define new method.
14359 (Target_arm::rel_dyn_section): Same.
14360 (Output_data_plt_arm): New template class.
14361 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
14362 (Output_data_plt_arm:do_adjust_output_section): Define new method.
14363 (Output_data_plt_arm::add_entry): Same.
14364 (Output_data_plt_arm::first_plt_entry): Define new
14365 static data member for PLT instruction template.
14366 (Output_data_plt_arm::plt_entry): Same.
14367 (Output_data_plt_arm::do_write): Define new method.
14368 (Target_arm::make_plt_entry): Same.
14369 (Target_arm::do_finalize_sections): Same.
14370 (Target_arm::do_dynsym_value): Same.
14371
4a657b0d
DK
143722009-05-28 Doug Kwan <dougkwan@google.com>
14373
14374 * Makefile.am (TARGETSOURCES): Add arm.cc.
14375 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
14376 * Makefile.in: Regenerate.
14377 * arm.cc: New file.
14378 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
14379
e7ae8c36
DK
143802009-05-26 Doug Kwan <dougkwan@google.com>
14381
14382 * options.cc (General_options::parse_exclude_libs). Fix a comment.
14383 (General_options::check_excluded_libs): Strip off directories in
14384 archive name before matching like GNU ld does.
14385 * testsuite/Makefile.am (MOSTLYCLEANFILES,
14386 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
14387 (exclude_libs_test_LDFLAGS): Add linker option
14388 -Wl,--exclude-libs,libexclude_libs_test_3
14389 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
14390 an explicit archive without using -l.
14391 (alt/libexclude_libs_test_3.a): New make rule.
14392 * testsuite/Makefile.in: Regenerate.
14393 * testsuite/exclude_libs_test.c : Declare lib3_default().
14394 (main): Call it.
14395 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
14396 * exclude_libs_test_3.c: New file.
14397
f12e7348
NC
143982009-05-26 Nick Clifton <nickc@redhat.com>
14399
14400 * po/id.po: New Indonesian translation.
14401 * po/gold.pot: Updated template file.
14402
4daadc0d
ST
144032009-05-22 Sriraman Tallam <tmsriram@google.com>
14404
e1df38aa 14405 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
14406 gc_comdat_test files. Add -Wl,--gc-sections to build
14407 gc_comdat_test.
14408 * testsuite/Makefile.in: Regenerate.
14409 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
14410
531813ad
ST
144112009-05-21 Sriraman Tallam <tmsriram@google.com>
14412
14413 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
14414 kept comdat section was garbage collected.
14415 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
14416 * testsuite/Makefile.in: Regenerate.
14417 * testsuite/gc_comdat_test.sh: New file.
14418 * testsuite/gc_comdat_test_1.cc: New file.
14419 * testsuite/gc_comdat_test_2.cc: New file.
14420
65514900
CC
144212009-05-19 Doug Kwan <dougkwan@google.com>
14422
14423 * archive.cc (Archive::Archive): Move constructor from archive.h
14424 to here. Initialize no_export_.
14425 (Archive::get_elf_object_for_member): Set no_export flag of object.
14426 * archive.h (Archive::Archive): Move constructor body to
14427 archive.cc.
14428 (Archive::no_export): New method.
14429 (Archive::no_export_): New field.
14430 * object.h (Object::Object): Initialize no_export_ to false.
14431 (Object::no_export, Object::set_no_export): New methods.
14432 (Object::no_export_): New field.
14433 * options.cc (General_options::parse_exclude_libs): New method.
14434 (General_options::check_excluded_libs) Same.
14435 * options.h (exclude_libs): New option.
14436 (General_options::check_excluded_libs): New method declaration.
14437 (General_options::excluded_libs_): New field.
14438 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
14439 default or protected visibility if an object has no-export flag set.
14440 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
14441 (check_SCRIPTS): Add exclude_libs_test.sh.
14442 (check_DATA): Add exclude_libs_test.syms.
14443 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
14444 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
14445 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
14446 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
14447 (exclude_libs_test.syms, libexclude_libs_test_1.a,
14448 libexclude_libs_test_2.a): New rules.
14449 * testsuite/Makefile.in: Regenerate.
14450 * testsuite/exclude_libs_test.c: New file.
14451 * testsuite/exclude_libs_test.sh: Ditto.
14452 * testsuite/exclude_libs_test_1.c: Ditto.
14453 * testsuite/exclude_libs_test_2.c: Ditto.
14454
1b77ea50
ILT
144552009-05-15 Ian Lance Taylor <iant@google.com>
14456
14457 * configure.ac: Check for declarations for cases where libiberty.h
14458 checks HAVE_DECL_xxx.
14459 * configure, config.in: Rebuild.
14460
072fe7ce
ILT
144612009-05-15 Mikolaj Zalewski <mikolajz@google.com>
14462
14463 * gold.h (Incremental_argument_list): Remove (invalid) forward
14464 declaration.
14465 * incremental.cc (Incremental_inputs::report_achive): New method.
14466 (Incremental_inputs::report_object): New method.
14467 (Incremental_inputs::report_script): New method.
14468 (Incremental_inputs::finalize_inputs): New method.
14469 (Incremental_inputs::finalize): Call finalize_inputs().
14470 (Incremental_inputs::sized_create_incremental_inputs_section_data):
14471 Create inputs entries.
14472 * incremental.h (Incremental_input_type): New enum.
14473 (Incremental_inputs::Incremental_input): Initialize new fields.
14474 (Incremental_inputs::report_inputs): New method.
14475 (Incremental_inputs::report_achive): New method.
14476 (Incremental_inputs::report_object): New method.
14477 (Incremental_inputs::report_script): New method.
14478 (Incremental_inputs::finalize_inputs): New method.
14479 (Incremental_inputs::Input_info): New struct.
14480 (Incremental_inputs::Input_info_map): New typedef.
14481 (Incremental_inputs::lock_): New field.
14482 (Incremental_inputs::Inputs_): New field.
14483 (Incremental_inputs::Inputs_map): New field.
14484 * main.cc (main): Call Incremental_input::report_inputs.
14485 * options.h (Input_argument_list): Typedef moved from
14486 Input_arguments.
14487 (Input_file_group::Files): Remove, use ::Input_argument_list.
14488 (Input_file_group::Input_argument_list): Remove, use
14489 ::Input_argument_list.
14490 * plugin.cc (Plugin_manager::add_input_file): Add error in
14491 incremental build.
14492 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
14493 functions.
14494 * script.cc (read_input_script): Call
14495 Incremental_input::report_script.
14496 * script.h (Script_info): New class.
14497
b0481b0b
ILT
144982009-04-27 Ian Lance Taylor <iant@google.com>
14499
14500 * x86_64.cc (do_adjust_output_section): Set entsize to
14501 plt_entry_size.
14502
b22a5a41 145032009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
14504
14505 * output.cc (Output_file::close): After short writes, continue
14506 writing from the correct offset in the buffer being written.
14507
40fde488
CD
145082009-04-23 Chris Demetriou <cgd@google.com>
14509
14510 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
14511 * configure: Regenerate.
14512 * config.in: Regenerate.
14513 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
14514 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
14515
3ce2c28e
ILT
145162009-04-21 Mikolaj Zalewski <mikolajz@google.com>
14517
14518 * incremental.cc (Incremental_inputs_header_data): Renamed from
14519 Incremental_input_header_data.
14520 (Incremental_inputs_header_data::data_size): New field.
14521 (Incremental_inputs_header_data::put_input_file_count): Renamed
14522 from input_file_count.
14523 (Incremental_inputs_header_data::put_command_line_offset): Renamed
14524 from command_line_offset.
14525 (Incremental_inputs_header_data::put_reserved): Renamed from
14526 put_reserved.
14527 (Incremental_inputs_entry_data): Renamed from
14528 Incremental_input_entry_data.
14529 (Incremental_inputs_entry_data::data_size): New field.
14530 (Incremental_inputs::report_command_line): New method.
14531 (Incremental_inputs::finalize): New method.
14532 (Incremental_inputs::create_incremental_inputs_data): New method.
14533 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
14534 * incremental.h: New file.
14535 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 14536 (Layout::finalize): Create incremental inputs section in
3ce2c28e 14537 incremental builds.
703d02da 14538 (Layout::create_incremental_info_sections): New method.
3ce2c28e 14539 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
14540 (Layout::create_incremental_info_sections): New method.
14541 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
14542 * main.cc (main): Notify Incremental_input of the command line.
14543
e55bde5e
ILT
145442009-04-01 Ian Lance Taylor <iant@google.com>
14545 Mikolaj Zalewski <mikolajz@google.com>
14546
14547 * gold.h (reserve_unordered_map): Define, three versions, one for
14548 each version of Unordered_map.
14549 * layout.cc (Layout::Layout): Remove options parameter. Add
14550 number_of_input_files parameter. Don't initialize options_.
14551 Initialize number_of_input_files_ and resized_signatures_. Move
14552 sections_are_attached_.
14553 (Layout::layout_group): Reserve space for group_signatures_.
14554 (Layout::find_or_add_kept_section): Change name parameter to be a
14555 reference. Resize signatures_ map when it gets large enough.
14556 (Layout::layout_eh_frame): Use parameters->options() instead of
14557 this->options_.
14558 (Layout::make_output_section): Likewise.
14559 (Layout::attach_allocated_section_to_segment): Likewise.
14560 (Layout::finalize, Layout::create_executable_stack): Likewise.
14561 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
14562 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
14563 * layout.h (class Layout): Update declarations. Remove options_
14564 field. Add number_of_input_files_ and resized_signatures_
14565 fields. Move sections_are_attached_ field.
14566 * main.cc (main): Pass number of input files to Layout
14567 constructor. Don't pass options.
14568
154b857c
ILT
145692009-03-30 Ian Lance Taylor <iant@google.com>
14570
14571 * ffsll.c (ffsll): Correct implementation.
14572
2f35ab9b
ILT
145732009-03-27 Ian Lance Taylor <iant@google.com>
14574
fd03461a
ILT
14575 * ffsll.c: New file.
14576 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
14577 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
14578 * ftruncate.c (ftruncate): Declare before definition.
14579 * mremap.c (mremap): Likewise.
14580 * pread.c (pread): Likewise.
14581 * configure, Makefile.in, config.in: Rebuild.
14582
2f35ab9b
ILT
14583 * mremap.c: New file.
14584 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
14585 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
14586 (mremap): Declare if HAVE_MREMAP is not defined.
14587 * configure, Makefile.in, config.in: Rebuild.
14588
33aea2fd
CC
145892009-03-27 Cary Coutant <ccoutant@google.com>
14590
14591 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
14592 position independent.
14593 * sparc.cc (Target_sparc::check_non_pic): Likewise.
14594 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
14595
6d479619
CC
145962009-03-24 Cary Coutant <ccoutant@google.com>
14597
14598 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
14599 an executable.
14600 (needs_dynamic_reloc): Likewise.
14601
afc06bb8
ILT
146022009-03-24 Ian Lance Taylor <iant@google.com>
14603
14604 * yyscript.y (file_cmd): Recognize EXTERN.
14605 (extern_name_list, extern_name_list_body): New nonterminals.
14606 * script.cc (script_add_extern): Define.
14607 * script-c.h (script_add_extern): Declare.
14608
f6060a4d
ILT
146092009-03-24 Rafael Avila de Espindola <espindola@google.com>
14610
14611 * object.cc (is_elf_object): Define.
14612 * object.h (is_elf_object): Declare.
14613 * archive.cc (Archive::get_elf_object_for_member): Call
14614 is_elf_object.
33aea2fd 14615 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 14616
26736d8e
ILT
146172009-03-24 Elliott Hughes <enh@google.com>
14618
14619 * output.cc (Output_file::map_anonymous): Define.
14620 (Output_file::map): Use map_anonymous. If the regular mmap fails,
14621 try an anonymous one. Report the size if the mmap fails.
14622 * output.h (class Output_file): Declare map_anonymous.
14623
22fd9730
ILT
146242009-03-24 Ian Lance Taylor <iant@google.com>
14625
14626 * target-select.cc (instantiate_target): Don't acquire the lock if
14627 the instantiated_target_ field has already been set.
14628
cb010894
ILT
146292009-03-23 Ian Lance Taylor <iant@google.com>
14630
7f055c20
ILT
14631 * gold-threads.h (class Initialize_lock): Define.
14632 * gold-threads.cc (class Initialize_lock_once): Define.
14633 (initialize_lock_control): New static variable.
14634 (initialize_lock_pointer): New static variable.
14635 (initialize_lock_once): New static function.
14636 (Initialize_lock::Initialize_lock): Define.
14637 (Initialize_lock::initialize): Define.
14638 * target-select.h: Include "gold-threads.h".
14639 (class Target_selector): Add lock_ and initialize_lock_ fields.
14640 Don't define instantiate_target, just declare it.
14641 * target-select.cc (Target_selector::Target_selector): Initialize
14642 new fields.
14643 (Target_selector::instantiate_target): Define.
14644 * descriptors.h: Include "gold-threads.h".
14645 (class Descriptors): Add initialize_lock_ field.
14646 * descriptors.cc (Descriptors::Descriptors): Initialize new
14647 field.
14648 (Descriptors::open): Use initialize_lock_ field
14649 * errors.h (class Errors): Add initialize_lock_ field.
14650 * errors.cc (Errors::Errors): Initialize new field.
14651 (Errors::initialize_lock): Use initialize_lock_ field.
14652 * powerpc.cc (class Target_selector_powerpc): Remove
14653 instantiated_target_ field. In do_recognize call
14654 instantiate_target rather than do_instantiate_target. In
14655 do_instantiate_target just allocate a new target.
14656 * sparc.cc (class Target_selector_sparc): Likewise.
14657
36959681
ILT
14658 * freebsd.h: New file.
14659 * i386.cc: Include "freebsd.h".
14660 (Target_i386): Derive from Target_freebsd rather than
14661 Sized_target.
14662 (Target_selector_i386): Derive from Target_selector_freebsd rather
14663 than Target_selector.
14664 * x86_64.cc: Include "freebsd.h".
14665 (Target_x86_64): Derive from Target_freebsd rather than
14666 Sized_target.
14667 (Target_selector_x86_64): Derive from Target_selector_freebsd
14668 rather than Target_selector.
14669 * target.h (class Target): Add adjust_elf_header and
14670 do_adjust_elf_header.
14671 * output.cc (Output_file_header:: do_sized_write): Call target
14672 adjust_elf_header routine.
14673 * configure.tgt: Set targ_osabi.
14674 * configure.ac: Define GOLD_DEFAULT_OSABI.
14675 * parameters.cc (Parameters::default_target): Pass
14676 GOLD_DEFAULT_OSABI to select_target.
14677 * target-select.h (class Target_selector): Make instantiate_target
14678 protected rather than private.
14679 * Makefile.am (HFILES): Add freebsd.h.
14680 * configure, Makefile.in, config.in: Rebuild.
14681
cb010894
ILT
14682 * merge.cc (do_add_input_section): Correct pend value. Change
14683 message about last entry not being null terminated from error to
14684 warning.
14685
0e879927
ILT
146862009-03-20 Mikolaj Zalewski <mikolajz@google.com>
14687
14688 * incremental.cc: New file.
14689 * Makefile.am (CCFILES): Add incremental.cc.
14690 * Makefile.in: Rebuild.
14691
41105937
PP
146922009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
14693
14694 * layout.cc (Layout::output_section_name): Preserve names
14695 of '.note.' sections.
e1df38aa 14696
60439920
ILT
146972009-03-19 Ian Lance Taylor <iant@google.com>
14698
14699 * descriptors.cc (Descriptors::open): Check that the options are
14700 valid before using them.
14701
0d371ad3
ILT
147022009-03-18 Ian Lance Taylor <iant@google.com>
14703
14704 * script-sections.h: Include <list>.
14705 (class Script_sections): Change Sections_elements from std::vector
14706 to std::list. Typedef public Elements_iterator. Add
14707 orphan_section_placement_, data_segment_align_start_, and
14708 saw_data_segment_align_ fields. Remove data_segment_align_index_
14709 field.
14710 * script-sections.cc (class Orphan_section_placement): New class.
14711 (class Sections_element): Add virtual functions is_relro and
14712 orphan_section_init. Remove virtual function place_orphan_here.
14713 (class Output_section_definition): Add is_relro and
14714 orphan_section_init. Remove place_orphan_here.
14715 (class Orphan_output_section): Likewise.
14716 (Script_sections::Script_sections): Update for field changes.
14717 (Script_sections::data_segment_align): Set saw_data_segment_align_
14718 and data_segment_align_start_, not data_segment_align_index.
14719 (Script_sections::data_segment_relro_end): Check
14720 saw_data_segment_align_. Use data_segment_align_start_ rather
14721 than data_segment_align_index_.
14722 (Script_sections::place_orphan): Rewrite to use
14723 Orphan_section_placement.
14724
9201d894
ILT
147252009-03-17 Ian Lance Taylor <iant@google.com>
14726
9c5b8369
ILT
14727 * archive.cc (Archive::add_symbols): Check for a version attached
14728 to the symbol name in the archive map.
14729 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
14730 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
14731 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
14732 (ver_test_11.a): New target.
14733 * testsuite/Makefile.in: Rebuild.
14734
9201d894
ILT
14735 * configure.ac: Check for chsize and posix_fallocate. Replace
14736 ftruncate.
14737 * ftruncate.c: New file, from gnulib.
14738 * output.cc (posix_fallocate): Define dummy version if not
14739 HAVE_POSIX_FALLOCATE.
14740 (Output_file::map): Call posix_fallocate rather than lseek and
14741 write.
14742 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
14743 * configure, Makefile.in, config.in: Rebuild.
14744
ef4ab7a8 147452009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 14746
ef4ab7a8
PP
14747 * layout.h (Layout::create_note): Add section_name parameter.
14748 * layout.cc (Layout::create_note): Likewise.
14749 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 14750
8c500701
ILT
147512009-03-17 Ian Lance Taylor <iant@google.com>
14752
e85b18e1
ILT
14753 * descriptors.cc: Include "options.h".
14754 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
14755 (Descriptors::open): Always use O_CLOEXEC when opening a new
14756 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
14757 then set FD_CLOEXEC.
14758
9efe6174
ILT
14759 * sparc.cc (class Target_sparc): Add has_got_section.
14760 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
14761 make sure we have a GOT section.
14762
14763 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
14764 (Target_sparc::Scan::local): Likewise.
14765 (Target_sparc::Scan::global): Likewise.
14766 (Target_sparc::Relocate::relocate): Likewise.
14767 (Target_sparc::Relocate::relocate_tls): Likewise.
14768
8c500701
ILT
14769 * symtab.cc (Symbol_table::define_default_version): New function,
14770 broken out of add_from_object.
14771 (Symbol_table::add_from_object): Call define_default_version.
14772 (Symbol_table::define_special_symbol): Add resolve_oldsym
14773 parameter. Change all callers. If the version for a symbol comes
14774 from a version script, resolve it with the symbol with the same
14775 name with no version. Also add the symbol without a version if
14776 appropriate.
14777 (do_define_in_output_data): If resolving with oldsym, don't delete
14778 sym.
14779 (do_define_in_output_segment): Likewise.
14780 (do_define_as_constant): Likewise.
14781 * symtab.h (class Symbol_table): Update declarations.
14782
f1ed28fb
ILT
147832009-03-13 Ian Lance Taylor <iant@google.com>
14784
15f8229b
ILT
14785 * readsyms.cc (Read_symbols::incompatible_warning): New function.
14786 (Read_symbols::requeue): New function.
14787 (Read_symbols::do_read_symbols): If make_elf_object fails because
14788 the target type is not configured, and the file was searched for,
14789 issue a warning and retry with the next directory.
14790 (Add_symbols::run): If the file has an incompatible format, and
14791 it was searched for, requeue the Read_symbols task. On error,
14792 release the object.
14793 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
14794 dirindex parameter to constructor. Change all callers. Declare
14795 incompatible_warning and requeue.
14796 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
14797 input_argument_ and input_group_ fields. Add them to
14798 constructor. Change all callers.
14799 (class Read_script): Add dirindex_ field. Add it to constructor.
14800 Change all callers.
14801 * archive.cc (Archive::setup): Remove input_objects parameter.
14802 Change all callers.
14803 (Archive::get_file_and_offset): Likewise.
14804 (Archive::read_all_symbols): Likewise.
14805 (Archive::read_symbols): Likewise.
14806 (Archive::get_elf_object_for_member): Remove input_objects
14807 parameter. Add punconfigured parameter. Change all callers.
14808 (Archive::add_symbols): Change return type to bool. Check return
14809 value of include_member.
14810 (Archive::include_all_members): Likewise.
14811 (Archive::include_member): Change return type to bool. Return
14812 false if first included object has incompatible target. Set
14813 included_member_ field.
14814 (Add_archive_symbols::run): If add_symbols returns false, requeue
14815 Read_symbols task.
14816 * archive.h (class Archive): Add included_member_ field.
14817 Initialize it in constructor. Add input_file and searched_for
14818 methods. Update declarations.
14819 (class Add_archive_symbols): Add dirpath_, dirindex_, and
14820 input_argument_ fields. Add them to constructor. Change all
14821 callers.
14822 * script.cc: Include "target-select.h".
14823 (class Parser_closure): Add skip_on_incompatible_target_ and
14824 found_incompatible_target_ fields. Add
14825 skip_on_incompatible_target parameter to constructor. Change all
14826 callers. Add methods skip_on_incompatible_target,
14827 clear_skip_on_incompatible_target, found_incompatible_target, and
14828 set_found_incompatible_target.
14829 (read_input_script): Add dirindex parameter. Change all callers.
14830 If parser finds an incompatible target, requeue Read_symbols
14831 task.
14832 (script_set_symbol): Clear skip_on_incompatible_target in
14833 closure.
14834 (script_add_assertion, script_parse_option): Likewise.
14835 (script_start_sections, script_add_phdr): Likewise.
14836 (script_check_output_format): New function.
14837 * script.h (read_input_script): Update declaration.
14838 * script-c.h (script_check_output_format): Declare.
14839 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
14840 (ignore_cmd): Remove OUTPUT_FORMAT.
14841 * fileread.cc (Input_file::Input_file): Add explicit this.
14842 (Input_file::will_search_for): New function.
14843 (Input_file::open): Add pindex parameter. Change all callers.
14844 * fileread.h (class Input_file): Add input_file_argument method.
14845 Declare will_search_for. Update declarations.
14846 * object.cc (make_elf_object): Add punconfigured parameter.
14847 Change all callers.
14848 * object.h (class Object): Make input_file public. Add
14849 searched_for method.
14850 (make_elf_object): Update declaration.
14851 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
14852 restart search.
14853 * dirsearch.h (class Dirsearch): Update declaration.
14854 * options.h (class General_options): Add --warn-search-mismatch.
14855 * parameters.cc (Parameters::is_compatible_target): New function.
14856 * parameters.h (class Parameters): Declare is_compatible_target.
14857 * workqueue.cc (Workqueue::add_blocker): New function.
14858 * workqueue.h (class Workqueue): Declare add_blocker.
14859
f1ed28fb
ILT
14860 * fileread.cc (Input_file::open): Remove options parameter.
14861 Change all callers.
14862 (Input_file::open_binary): Likewise.
14863 * script.cc (read_input_script): Likewise.
14864 * readsyms.h (class Read_symbols): Remove options_ field. Remove
14865 options parameter from constructor. Change all callers.
14866 (class Read_script): Likewise.
14867 * fileread.h (class Input_file): Update declarations.
14868 * script.h (read_input_script): Update declaration.
14869
34dd024a
NC
148702009-03-10 Nick Clifton <nickc@redhat.com>
14871
14872 * po/es.po: New Spanish translation.
14873
6d71b17c
CC
148742009-03-06 Cary Coutant <ccoutant@google.com>
14875
14876 * options.cc (parse_short_option): Keep dash_z from registering itself.
14877
031cdbed
ILT
148782009-03-03 Ian Lance Taylor <iant@google.com>
14879
14880 PR 9918
14881 * target-reloc.h (relocate_section): Pass output_section to
14882 relocate.
14883 * i386.cc (Target_i386::should_apply_static_reloc): Add
14884 output_section parameter. Change all callers.
14885 (Target_i386::Relocate::relocate): Add output_section parameter.
14886 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
14887 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
14888 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
14889 * testsuite/two_file_shared.sh: New script.
14890 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
14891 (check_DATA): Add two_file_shared.dbg.
14892 (two_file_shared.dbg): New target.
14893 * testsuite/Makefile.in: Rebuild.
14894
15d5fa16
ILT
148952009-03-01 Ian Lance Taylor <iant@google.com>
14896
14897 * configure.ac: Check for byteswap.h.
14898 * configure: Rebuild.
14899 * config.in: Rebuild.
14900
8a4c0b0d
ILT
149012009-03-01 Mikolaj Zalewski <mikolajz@google.com>
14902
14903 * layout.cc (Layout::find_or_add_kept_section): New function.
14904 (Layout::add_comdat): Removed.
14905 * layout.h (struct Kept_section): Move out of class Layout.
14906 Remove trailing underscores from field names. Add group_sections
14907 field. Rename group_ field to is_group. Change all uses.
14908 (class Layout): Declare find_or_add_kept_section, not add_comdat.
14909 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
14910 comdat_groups_ field.
14911 (Sized_relobj::include_section_group): Use
14912 find_or_add_kept_section and Kept_section::group_sections.
14913 (Sized_relobj::include_linkonce_section): Likewise.
14914 * object.cc (class Sized_relobj): Don't define Comdat_group or
14915 Comdat_group_table. Remove find_comdat_group and
14916 add_comdat_group. Remove comdat_groups_ field.
14917 * plugin.cc (include_comdat_group): Use
14918 Layout::find_or_add_kept_section.
14919
b4ecf66b
ILT
149202009-02-28 Ian Lance Taylor <iant@google.com>
14921
14359ca0
ILT
14922 * README: --gc-sections and map files are now supported. Document
14923 some build requirements.
14924
b4ecf66b
ILT
14925 PR 6992
14926 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
14927 relocatable link set the value of the section symbol to zero.
14928 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
14929 relocatable link don't include the section address in the local
14930 symbol value.
14931
0602e05a
ILT
149322009-02-27 Ian Lance Taylor <iant@google.com>
14933
fd9d194f
ILT
14934 PR 6811
14935 * options.h (class Search_directory): Add is_system_directory.
14936 (class General_options): Declare is_in_system_directory.
14937 * options.cc (get_relative_sysroot): Make static.
14938 (get_default_sysroot): Make static.
14939 (General_optoins::is_in_system_directory): New function.
14940 * fileread.cc (Input_file::is_in_system_directory): New function.
14941 * fileread.h (class Input_file): Declare is_in_system_directory.
14942 * object.h (class Object): Add is_in_system_directory.
14943 (class Input_objects): Remove system_library_directory_ field.
14944 * object.cc (Input_objects::add_object): Don't set
14945 system_library_directory_.
14946 (input_objects::found_in_system_library_directory): Remove.
14947 * symtab.cc (Symbol_table::write_globals): Remove input_objects
14948 parameter. Change all callers.
14949 (Symbol_table::sized_write_globals): Likewise.
14950 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
14951 Call Object::is_in_system_directory.
14952 * symtab.h (class Symbol_table): Update declarations.
14953
61edd21f
ILT
14954 PR 5990
14955 * descriptors.h (Open_descriptor): Add is_on_stack field.
14956 * descriptors.cc (Descriptors::open): If the descriptor is on the
14957 top of the stack, remove it. Initialize is_on_stack field.
14958 (Descriptors::release): Only add pod to stack if it is not on the
14959 stack already.
14960 (Descriptors::close_some_descriptor): Clear stack_next and
14961 is_on_stack fields.
14962
e29e076a
ILT
14963 PR 7091
14964 * output.cc (Output_section::find_starting_output_address): Rename
14965 from starting_output_address; add PADDR parameter; change return
14966 type.
14967 * output.h (class Output_section): Declare
14968 find_starting_output_address instead of starting_output_address.
14969 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
14970 section symbol for which we can't find a merge section.
14971
0602e05a
ILT
14972 PR 9836
14973 * symtab.cc (Symbol_table::add_from_object): If the visibility is
14974 hidden or internal, force the symbol to be local.
14975 * resolve.cc (Symbol::override_visibility): Define.
14976 (Symbol::override_base): Use override_visibility.
14977 (Symbol_table::resolve): Likewise.
14978 (Symbol::override_base_with_special): Likewise.
14979 (Symbol_table::override_with_special): If the visibility is hidden
14980 or internal, force the symbol to be local.
14981 * symtab.h (class Symbol): Add set_visibility and
14982 override_visibility.
14983 * testsuite/ver_test_1.sh: New file.
14984 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
14985 (check_DATA): Add ver_test_1.syms.
14986 (ver_test_1.syms): New target.
14987 * testsuite/Makefile.in: Rebuild.
14988
401a9a73
CC
149892009-02-25 Cary Coutant <ccoutant@google.com>
14990
14991 * layout.cc (Layout::choose_output_section): Don't rename sections
14992 when using a linker script that has a SECTIONS clause.
14993 * Makefile.in: Regenerate.
14994
14995 * testsuite/Makefile.am (script_test_5.sh): New test case.
14996 * testsuite/Makefile.in: Regenerate.
14997 * testsuite/script_test_5.cc: New file.
14998 * testsuite/script_test_5.sh: New file.
14999 * testsuite/script_test_5.t: New file.
15000
f488e4b0
CC
150012009-02-13 Rafael Avila de Espindola <espindola@google.com>
15002
15003 * archive.cc (Archive::include_member): Update calls to add_symbols.
15004 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
15005 the Layout argument.
15006 * dynobj.h (do_add_symbols): Add the Layout argument.
15007 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
15008 Layout argument.
15009 * object.h (Object::add_symbols): Add the Layout argument.
15010 (Object::do_add_symbols): Add the Layout argument.
15011 (Sized_relobj::do_add_symbols): Add the Layout argument.
15012 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
15013 Unify the two versions.
15014 (Add_plugin_symbols): Remove.
15015 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
15016 (Sized_pluginobj::do_add_symbols): Unify the two versions.
15017 (Add_plugin_symbols): Remove.
15018 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
15019 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
15020 (Add_symbols::run): Make it work with Pulginobj.
15021
89dd1680
ILT
150222009-02-06 Ian Lance Taylor <iant@google.com>
15023
15024 * object.cc (Sized_relobj::do_layout): Make info message start
15025 with lower case letter.
15026
266d0a74
ILT
150272009-02-06 Mikolaj Zalewski <mikolajz@google.com>
15028
602b464e
ILT
15029 * binary.cc: Fix file comment.
15030
266d0a74
ILT
15031 * options.h (enum Incremental_disposition): Define.
15032 (class General_options): Add new options: --incremental,
15033 --incremental_changed, --incremental_unchanged,
15034 --incremental_unknown. Add incremental_disposition_ and
15035 implicit_incremental_ fields.
15036 (General_options::incremental_disposition): New function.
15037 (class Position_dependent_options): Add incremental_disposition
15038 option.
15039 (Position_dependent_options::copy_from_options): Set incremental
15040 dispositions.
15041 * options.cc (General_options::parse_incremental_changed): New
15042 function.
2e702c99
RM
15043 (General_options::parse_incremental_unchanged): New function.
15044 (General_options::parse_incremental_unknown): New function.
15045 (General_options::General_options): Initialize new fields
266d0a74 15046 incremental_disposition_ and implicit_incremental_.
2e702c99 15047 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
15048 without --incremental.
15049
f073bbf7
CD
150502009-02-06 Chris Demetriou <cgd@google.com>
15051
15052 * gold.h (gold_undefined_symbol): Change to take only a Symbol
15053 pointer and to report location as the file name associated with
15054 the symbol.
15055 (gold_undefined_symbol_at_location): New function to replace the
15056 old gold_undefined_symbol functionality.
15057 * target-reloc.h (relocate_section): Update to use
15058 gold_undefined_symbol_at_location.
15059 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
15060 Call gold_undefined_symbol function rather than gold_error.
15061 * errors.h (Errors::undefined_symbol): Take location as a
15062 string, rather than calculating it from a relocation.
15063 * errors.cc (Errors::fatal): Print "fatal error:" before the
15064 formatted message.
15065 (Errors::error, Errors::error_at_location): Print "error: "
15066 before the formatted message.
15067 (Errors::undefined_symbol): Take location as a string, rather
15068 than calculating it from a relocation.
15069 (gold_undefined_symbol_at_location): New function akin to
15070 old gold_undefined_symbol, calculates location from relocation.
15071 (gold_undefined_symbol): Change to take only a Symbol pointer
15072 and to report location as the file name associated with the symbol.
15073 * testsuite/debug_msg.sh: Update for changed error messages.
15074 * testsuite/undef_symbol.sh: Likewise.
15075
8e94a90c
ILT
150762009-02-04 Duncan Sands <baldrick@free.fr>
15077
15078 PR 9812
15079 * reduced_debug_output.h
15080 (Output_reduced_debug_abbrev_section::failed): Use format for
15081 gold_warning.
15082 (Output_reduced_debug_info_section::faild): Likewise.
15083
88a0e15b
ILT
150842009-01-31 Mikolaj Zalewski <mikolajz@google.com>
15085
15086 * script.cc (Lazy_demangler): New class.
2e702c99 15087 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
15088 symbol only once.
15089
5efc7cd2
CC
150902009-01-29 Cary Coutant <ccoutant@google.com>
15091
15092 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
15093 to __tls_get_addr.
15094 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
15095
e0ebcf42
ILT
150962009-01-28 Ian Lance Taylor <iant@google.com>
15097
5efc7cd2 15098 * version.cc (version_string): Bump to 1.9.
75fe7426 15099
e0ebcf42
ILT
15100 * gold.h: Include <cstring> and <stdint.h>.
15101 * version.cc: Include <cstdio>.
15102 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
15103 warning.
15104 * reduced_debug_output.cc (insert_into_vector): Rename from
15105 Insert_into_vector; change all callers. Use Swap_unaligned to
15106 avoid aliasing issue; remove union since it is unnecessary.
15107
8e2813be 151082009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
15109
15110 * Makefile.am (CCFILES): Add gc.cc.
15111 (HFILES): Add gc.h.
15112 * Makefile.in: Regenerate.
15113 * gold.cc (Gc_runner): New class.
15114 (queue_initial_tasks): Call garbage collection related tasks
15115 when corresponding options are invoked.
15116 (queue_middle_gc_tasks): New function.
15117 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
15118 processed early before laying out sections during garbage collection.
15119 * gold.h (queue_middle_gc_tasks): New function.
15120 (is_prefix_of): Move from "layout.cc".
15121 * i386.cc (Target_i386::gc_process_relocs): New function.
15122 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
15123 * main.cc (main): Create object of class "Garbage_collection".
15124 * object.cc (Relobj::copy_symbols_data): New function.
15125 (Relobj::is_section_name_included): New function.
e1df38aa
NC
15126 (Sized_relobj::do_layout): Allow this function to be called twice
15127 during garbage collection and defer layout of section during the
6d03d481
ST
15128 first call.
15129 * object.h (Relobj::get_symbols_data): New function.
15130 (Relobj::is_section_name_included): New function.
15131 (Relobj::copy_symbols_data): New function.
15132 (Relobj::set_symbols_data): New function.
15133 (Relobj::get_relocs_data): New function.
15134 (Relobj::set_relocs_data): New function.
15135 (Relobj::is_output_section_offset_invalid): New pure virtual function.
15136 (Relobj::gc_process_relocs): New function.
15137 (Relobj::do_gc_process_relocs): New pure virtual function.
15138 (Relobj::sd_): New data member.
15139 (Sized_relobj::is_output_section_offset_invalid): New function.
15140 (Sized_relobj::do_gc_process_relocs): New function.
15141 * options.h (General_options::gc_sections): Modify to not be a no-op.
15142 (General_options::print_gc_sections): New option.
15143 * plugin.cc (Plugin_finish::run): Remove function call to
15144 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
15145 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
15146 * reloc.cc (Read_relocs::run): Add task to process relocs and
15147 determine unreferenced sections when doing garbage collection.
15148 (Gc_process_relocs): New class.
15149 (Sized_relobj::do_gc_process_relocs): New function.
15150 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
15151 sections that are garbage collected.
15152 * reloc.h (Gc_process_relocs): New class.
15153 * sparc.cc (Target_sparc::gc_process_relocs): New function.
15154 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
15155 symbols whose corresponding sections are garbage collected.
15156 (Symbol_table::Symbol_table): Add new parameter for the garbage
15157 collection object.
15158 (Symbol_table::gc_mark_undef_symbols): New function.
15159 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15160 (Symbol_table::gc_mark_dyn_syms): New function.
15161 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
15162 as garbage.
15163 (Symbol_table::add_from_object): Likewise.
15164 (Symbol_table::add_from_relobj): When building shared objects, do not
15165 treat externally visible symbols as garbage.
15166 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
15167 table information for static and relocatable links.
15168 * symtab.h (Symbol_table::set_gc): New function.
15169 (Symbol_table::gc): New function.
15170 (Symbol_table::gc_mark_undef_symbols): New function.
15171 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15172 (Symbol_table::gc_mark_dyn_syms): New function.
15173 (Symbol_table::gc_): New data member.
e1df38aa 15174 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
15175 function.
15176 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
15177 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
15178
3b293544
CF
151792009-01-20 Chris Faylor <me.sourceware@sourceware.org>
15180
15181 * options.h (General_options::gc_sections): Define as a no-op for now.
15182 (General_options::no_keep_memory): Ditto.
15183 (General_options::Bshareable): Define.
15184 * options.cc (General_options::finalize): Honor -Bshareable.
15185
83d22aa8
AS
151862009-01-20 Andreas Schwab <schwab@suse.de>
15187
15188 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
15189 read the value in the contents, since we don't use it. Use the
15190 template endianness when writing.
15191 (Relocate::relocate): Use it for R_PPC_REL16_HA.
15192
cd536b21
AS
151932009-01-19 Andreas Schwab <schwab@suse.de>
15194
15195 * configure.tgt (powerpc64-*): Fix targ_obj.
15196
99e9a495
ILT
151972009-01-15 Ian Lance Taylor <iant@google.com>
15198
15199 * object.cc (Sized_relobj::write_local_symbols): Don't write out
15200 local symbols when stripping all symbols.
15201
bbbfea06
CC
152022009-01-14 Cary Coutant <ccoutant@google.com>
15203
99e9a495 15204 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 15205
0f7c0701
CC
152062009-01-14 Cary Coutant <ccoutant@google.com>
15207
15208 * archive.cc (Archive::get_elf_object_for_member): Remove call
15209 to File_read::claim_for_plugin.
15210 * descriptors.cc (Descriptors::open): Remove reference to
15211 is_claimed.
15212 (Descriptors::claim_for_plugin): Remove.
15213 * descriptors.h (Descriptors::claim_for_plugin): Remove.
15214 (Descriptors::is_claimed): Remove.
15215 (claim_descriptor_for_plugin): Remove.
15216 * fileread.cc (File_read::claim_for_plugin): Remove.
15217 * fileread.h (File_read::claim_for_plugin): Remove.
15218 (File_read::descriptor): Reopen descriptor if necessary.
15219 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
15220 (Plugin_manager::all_symbols_read): Add task parameter. Change
15221 all callers.
15222 (Plugin_manager::get_input_file): New function.
15223 (Plugin_manager::release_input_file): New function.
15224 (Pluginobj::Pluginobj): Add filesize parameter and initialize
15225 corresponding data member.
15226 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
15227 and pass to base constructor. Change all callers.
15228 (get_input_file, release_input_file): New functions.
15229 (make_sized_plugin_object): Add filesize parameter. Change all callers.
15230 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
15231 (Plugin_manager::all_symbols_read): Add task parameter.
15232 (Plugin_manager::get_input_file): New function.
15233 (Plugin_manager::release_input_file): New function.
15234 (Plugin_manager::task_): New data member.
15235 (Pluginobj::Pluginobj): Add filesize parameter.
15236 (Pluginobj::filename): New function.
15237 (Pluginobj::descriptor): New function.
15238 (Pluginobj::filesize): New function.
15239 (Pluginobj::filesize_): New data member.
15240 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
15241 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
15242 File_read::claim_for_plugin; use Object::unlock to unlock the file.
15243
15244 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
15245 with archive libraries.
15246 * testsuite/Makefile.in: Regenerate.
15247 * testsuite/plugin_test.c (struct sym_info): New type.
15248 (get_input_file, release_input_file): New static variables.
15249 (onload): Capture new transfer vector entries.
15250 (claim_file_hook): Stop reading at end of file according to filesize.
15251 Factor out parsing of readelf output into separate function.
15252 (all_symbols_read_hook): Exercise get_input_file and release_input_file
15253 APIs and get the source file name from the symbol table. Convert
15254 source file name to corresponding object file name. Print info
15255 message when adding new input files.
15256 (parse_readelf_line): New function.
15257 * testsuite/plugin_test_1.sh: Add checks for new info messages.
15258 * testsuite/plugin_test_2.sh: Likewise.
15259 * testsuite/plugin_test_3.sh: Likewise.
15260 * testsuite/plugin_test_4.sh: New test case.
15261
62a6d109
ILT
152622009-01-07 Ian Lance Taylor <iant@google.com>
15263
15264 * version.cc (version_string): Bump to 1.8.
15265
483620e8
CC
152662008-12-23 Cary Coutant <ccoutant@google.com>
15267
15268 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
15269 * plugin.cc (Plugin_manager::finish): Rename as
15270 layout_deferred_objects. Move cleanup to separate function.
15271 (Plugin_manager::cleanup): New function.
15272 (Plugin_finish::run): Call layout_deferred_objects and cleanup
15273 separately.
15274 * plugin.h (Plugin_manager::finish): Rename as
15275 layout_deferred_objects.
15276 (Plugin_manager::cleanup): New function.
15277 (Plugin_manager::cleanup_done): New field.
15278
d66a9eb3
CC
152792008-12-23 Cary Coutant <ccoutant@google.com>
15280
15281 * plugin.cc (is_visible_from_outside): New function.
15282 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
15283 so we don't return "IR only" status for exported symbols or -r links.
15284
15285 * testsuite/Makefile.am (plugin_test_3): New test case.
15286 * testsuite/Makefile.in: Regenerate.
15287 * testsuite/plugin_test_3.sh: New file.
15288
5995b570
CC
152892008-12-22 Cary Coutant <ccoutant@google.com>
15290
15291 * object.cc (Sized_relobj::layout_section): New function.
15292 (Sized_relobj::do_layout): Defer layout of input sections until after
15293 plugin has provided replacement files.
15294 (Sized_relobj::do_layout_deferred_sections): New function.
15295 * object.h (Relobj::set_section_offset): Remove virtual keyword.
15296 (Relobj::layout_deferred_sections): New function.
15297 (Relobj::do_layout_deferred_sections): New function.
15298 (Sized_relobj::do_layout_deferred_sections): New function.
15299 (Sized_relobj::layout_section): New function.
15300 (Sized_relobj::Deferred_layout): New structure.
15301 (Sized_relobj::deferred_layout_): New field.
15302 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
15303 Change all callers. Layout deferred sections.
15304 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
15305 references.
15306 (Plugin_hook::run): Move code from do_plugin_hook inline.
15307 (Plugin_hook::do_plugin_hook): Remove.
15308 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
15309 (Plugin_manager::finish): Renamed, was cleanup.
15310 (Plugin_manager::should_defer_layout): New function.
15311 (Plugin_manager::add_deferred_layout_object): New function.
15312 (Plugin_manager::Deferred_layout_list): New type.
15313 (Plugin_manager::deferred_layout_objects_): New field.
15314 (Plugin_hook::do_plugin_hook): Remove.
15315
ee769c88
ILT
153162008-12-17 Ian Lance Taylor <iant@google.com>
15317
15318 * options.h (class General_options): Add --no case for
15319 --export-dynamic.
15320
abc8dcba
CC
153212008-12-16 Cary Coutant <ccoutant@google.com>
15322
15323 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
15324 vector.
15325 (Plugin_manager::claim_file): Create plugin object even if
15326 plugin did not call the add_symbols callback.
15327 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
15328 asking for more symbols than were added.
15329 * testsuite/Makefile.am (plugin_test_1): Add test case with
15330 no global symbols.
15331 (empty.syms): New target.
15332 * testsuite/Makefile.in: Regenerate.
15333 * testsuite/plugin_test.c (claim_file_hook): Add new debug
15334 message. Don't call add_symbols if no globals.
15335 (all_symbols_read_hook): Don't provide replacement for empty
15336 claimed file.
15337
b0074644
ILT
153382008-12-12 Ian Lance Taylor <iant@google.com>
15339
68943102
ILT
15340 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
15341 r_type == 0 for a local symbol with r_sym == 0.
15342 (scan_relocatable_relocs): Pass r_sym to
15343 local_non_section_strategy.
15344 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
15345 r_sym parameter.
15346
b0074644
ILT
15347 * configure.ac: Update test for TLS descriptors: they are
15348 supported as of glibc 2.9.
15349 * configure: Rebuild.
15350
c2508178
ILT
153512008-12-11 Ian Lance Taylor <iant@google.com>
15352
15353 PR 7091
15354 * target-reloc.h (Default_scan_relocatable_relocs): For each
15355 function, map r_type == 0 to RELOC_DISCARD.
15356
2756a258
CC
153572008-12-10 Cary Coutant <ccoutant@google.com>
15358
15359 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
15360 object to override a kept COMDAT group from a plugin object.
15361
bb6f53d3
ILT
153622008-12-09 Ian Lance Taylor <iant@google.com>
15363
fbc558e1
ILT
15364 PR 7088
15365 * yyscript.y (file_cmd): Handle INPUT.
15366
bb6f53d3
ILT
15367 * testsuite/initpri1.c: Change all declarations to be full
15368 prototypes by adding void, to avoid compiler warnings.
15369
4674ecfc
CC
153702008-12-05 Rafael Avila de Espindola <espindola@google.com>
15371
15372 * options.cc (General_options::parse_plugin_opt): New.
15373 (General_options::add_plugin): The argument now is just the filename.
15374 (General_options::add_plugin_option): New.
15375 * options.h (plugin_opt): New.
15376 (add_plugin): Change argument name.
15377 (add_plugin_option): New.
15378 * plugin.cc (Plugin::load): Don't parse the plugin option.
15379 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
15380 (Plugin::add_option): New.
15381 (Plugin::args_): Change type.
15382 (Plugin::filename_): New.
15383 (Plugin_manager::add_plugin_option): New.
15384 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
15385 * testsuite/Makefile.in: Regenerate.
15386
fd06b4aa
CC
153872008-12-05 Cary Coutant <ccoutant@google.com>
15388
15389 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
15390 Handle --strip-lto-sections option.
15391 * options.h (strip_lto_sections): New option.
15392
6c52134c
CC
153932008-12-01 Cary Coutant <ccoutant@google.com>
15394
15395 * plugin.cc (ld_plugin_message): Change format parameter to const.
15396 Fix mismatch between new[] and delete.
15397
a45248e0
CC
153982008-11-14 Cary Coutant <ccoutant@google.com>
15399
15400 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
15401 instead of -1U.
15402
c82fbeee
CS
154032008-11-05 Craig Silverstein <csilvers@google.com>
15404
15405 * options.cc (General_options::parse_dynamic_list): New function.
15406 * options.h (General_options): New flags dynamic_list,
15407 dynamic_list_data, dynamic_list_cpp_new, and
15408 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
15409 (General_options::in_dynamic_list): New function.
15410 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
15411 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
15412 (Lex::can_continue_name): Likewise.
15413 (yylex): Likewise.
15414 (read_script_file): New parameter script_options.
15415 (read_dynamic_list): New function.
15416 (Script_options::define_dynamic_list): New function.
15417 (dynamic_list_keyword_parsecodes): New variable.
15418 (dynamic_list_keywords): New variable.
15419 * script.h (Script_options::define_dynamic_list): New function
15420 prototype.
15421 (read_dynamic_list): New function prototype.
15422 * symtab.cc (strprefix): New macro.
15423 (Symbol::should_add_dynsym_entry): Support dynamic_list,
15424 dynamic_list_data, dynamic_list_cpp_new, and
15425 dynamic_list_cpp_typeinfo.
15426 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
15427 (dynamic_list_expr): New rule.
15428 (dynamic_list_nodes): Likewise.
15429 (dynamic_list_node): Likewise.
15430 * testsuite/Makefile.am (dynamic_list): New test.
15431 * testsuite/Makefile.in: Regenerated.
15432 * testsuite/dynamic_list.t: New file.
15433 * testsuite/dynamic_list.sh: New file.
15434
e0bb29a5
CS
154352008-11-05 Craig Silverstein <csilvers@google.com>
15436
15437 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
15438 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
15439 (t11_last): Likewise.
15440 * testsuite/ver_test_6.c (main): Likewise.
15441
4e1e25e0
CC
154422008-10-07 Cary Coutant <ccoutant@google.com>
15443
15444 * options.c (General_options::finalize): Add check for -static and
15445 -shared.
15446 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
15447 is not empty.
15448
92f03fcb
CC
154492008-10-02 Cary Coutant <ccoutant@google.com>
15450
15451 * plugin.cc (make_sized_plugin_object): Fix conditional
15452 compilation to work when not all targets are enabled.
15453
fbd8a257
CC
154542008-09-29 Cary Coutant <ccoutant@google.com>
15455
15456 * archive.cc (Archive::get_file_and_offset): Use filename instead
15457 of name to get library path.
15458 (Archive::include_member): Unlock external member of a thin archive.
15459
15460 * testsuite/Makefile.am (TEST_AR): New variable.
15461 (thin_archive_test_1): New test.
15462 (thin_archive_test_2): New test.
81636b3f
CC
15463 * testsuite/Makefile.in: Regenerate.
15464 * testsuite/thin_archive_main.cc: New file.
15465 * testsuite/thin_archive_test_1.cc: New file.
15466 * testsuite/thin_archive_test_2.cc: New file.
15467 * testsuite/thin_archive_test_3.cc: New file.
15468 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 15469
eff45813
CC
154702008-09-29 Cary Coutant <ccoutant@google.com>
15471
15472 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
15473 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
15474 instead of -1U.
15475 (Sized_relobj::do_finalize_local_symbols): Likewise.
15476 (Sized_relobj::map_to_kept_section): Likewise.
15477 * object.h (Sized_relobj::invalid_address): New constant.
15478 (Sized_relobj::do_output_section_offset): Check for invalid_address
15479 and return -1ULL.
15480 * output.cc (Output_reloc::local_section_offset): Use constant
15481 invalid_address instead of -1U.
15482 (Output_reloc::get_address): Likewise.
15483 (Output_section::output_address): Change -1U to -1ULL.
15484 * output.h (Output_reloc::invalid_address): New constant.
15485 * reloc.cc (Sized_relobj::write_sections): Use constant
15486 invalid_address instead of -1U.
15487 (Sized_relobj::relocate_sections): Likewise.
15488 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
15489 values for merge sections.
15490 * target-reloc.h (relocate_for_relocatable): Use constant
15491 invalid_address instead of -1U.
15492
89fc3421
CC
154932008-09-19 Cary Coutant <ccoutant@google.com>
15494
15495 Add plugin functionality for link-time optimization (LTO).
15496 * configure.ac (plugins): Add --enable-plugins option.
15497 * configure: Regenerate.
15498 * config.in: Regenerate.
15499 * Makefile.am (LIBDL): New variable.
15500 (CCFILES): Add plugin.cc.
15501 (HFILES): Add plugin.h.
15502 (ldadd_var): Add LIBDL.
15503 * Makefile.in: Regenerate.
15504
15505 * archive.cc: Include "plugin.h".
15506 (Archive::setup): Don't preread archive symbols when using a plugin.
15507 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
15508 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
15509 files.
15510 (Archive::include_member): Add symbols from plugin objects.
15511 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
15512 * descriptors.cc (Descriptors::open): Check for file descriptors
15513 abandoned by plugins.
15514 (Descriptors::claim_for_plugin): New function.
15515 * descriptors.h (Descriptors::claim_for_plugin): New function.
15516 (Open_descriptor::is_claimed): New field.
15517 (claim_descriptor_for_plugin): New function.
15518 * fileread.cc (File_read::claim_for_plugin): New function.
15519 * fileread.h (File_read::claim_for_plugin): New function.
15520 (File_read::descriptor): New function.
15521 * gold.cc: Include "plugin.h".
15522 (queue_initial_tasks): Add task to call plugin hooks for generating
15523 new object files.
15524 * main.cc: Include "plugin.h".
15525 (main): Load plugin libraries.
15526 * object.h (Pluginobj): Declare.
15527 (Object::pluginobj): New function.
15528 (Object::do_pluginobj): New function.
15529 (Object::set_target): New function.
15530 * options.cc: Include "plugin.h".
15531 (General_options::parse_plugin): New function.
15532 (General_options::General_options): Initialize plugins_ field.
15533 (General_options::add_plugin): New function.
15534 * options.h (Plugin_manager): Declare.
15535 (General_options): Add --plugin option.
15536 (General_options::has_plugins): New function.
15537 (General_options::plugins): New function.
15538 (General_options::add_plugin): New function.
15539 (General_options::plugins_): New field.
15540 * plugin.cc: New file.
15541 * plugin.h: New file.
15542 * readsyms.cc: Include "plugin.h".
15543 (Read_symbols::do_read_symbols): Check for archive before checking
15544 for ELF file. Call plugin hooks to claim files.
15545 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
15546 from a real object file; force override when processing replacement
15547 files.
15548 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
15549 (Symbol::init_base_object): Likewise.
15550 (Symbol::init_base_output_data): Likewise.
15551 (Symbol::init_base_output_segment): Likewise.
15552 (Symbol::init_base_constant): Likewise.
15553 (Symbol::init_base_undefined): Likewise.
15554 (Symbol::output_section): Assert that object is not a plugin.
15555 (Symbol_table::add_from_pluginobj): New function.
15556 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
15557 undefined.
15558 (Symbol_table::sized_write_globals): Likewise.
15559 (Symbol_table::add_from_pluginobj): Instantiate template.
15560 * symtab.h (Sized_pluginobj): Declare.
15561 (Symbol::in_real_elf): New function.
15562 (Symbol::set_in_real_elf): New function.
15563 (Symbol::in_real_elf_): New field.
15564 (Symbol_table::add_from_pluginobj): New function.
15565
15566 * testsuite/Makefile.am (AM_CFLAGS): New variable.
15567 (LIBDL): New variable.
15568 (LDADD): Add LIBDL.
15569 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
15570 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
15571 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
15572 (MOSTLYCLEANFILES): Likewise.
15573 * testsuite/Makefile.in: Regenerate.
15574 * testsuite/plugin_test.c: New file.
15575 * testsuite/plugin_test_1.sh: New file.
15576 * testsuite/plugin_test_2.sh: New file.
15577
de31bda5
ILT
155782008-09-16 Ian Lance Taylor <iant@google.com>
15579
9c2d0ef9
ILT
15580 * target-reloc.h (relocate_section): Check whether a symbol is
15581 defined by the ABI before reporting an undefined symbol error.
15582 * target.h (Target::is_defined_by_abi): Make parameter const.
15583 (Target::do_is_defined_by_abi): Likewise.
15584 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
15585 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
15586 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
15587 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
15588 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
15589 * testsuite/Makefile.in: Rebuild.
15590
de31bda5
ILT
15591 * fileread.cc (make_view): Add casts to avoid warning.
15592
9fa33bee
AO
155932008-09-16 Alexandre Oliva <aoliva@redhat.com>
15594
15595 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
15596 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15597
183fd0e3
AO
155982008-09-16 Alexandre Oliva <aoliva@redhat.com>
15599
15600 * options.h (General_options::output_is_executable): New.
15601 (General_options::output_is_pie): New.
15602 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
15603 for shared libraries.
15604 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15605
7be8330a
CD
156062008-09-11 Chris Demetriou <cgd@google.com>
15607
15608 * options.h (origin): New -z option.
15609 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
15610 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
15611 in DT_FLAGS_1.
15612
a9caad02
CC
156132008-09-05 Cary Coutant <ccoutant@google.com>
15614
15615 * fileread.cc (File_read::make_view): Add check for attempt to map
15616 beyond end of file.
15617
ae6dce4d
CC
156182008-09-05 Cary Coutant <ccoutant@google.com>
15619
15620 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
15621 explicit instantiations.
15622
d7ab2a47
KVH
156232008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
15624
15625 PR gold/6858
15626 * options.cc (General_options::finalize): Allow undefined symbols
15627 in shlibs if linking -shared.
15628
15629 PR gold/6859
15630 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
15631 symbols as not needing a dynsym entry.
15632
1e52a9c1
CS
156332008-08-20 Craig Silverstein <csilvers@google.com>
15634
15635 * fileread.cc (File_read::open): Do not lock the file unless it
15636 was successfully opened.
15637
d85c80a3
CC
156382008-08-14 Cary Coutant <ccoutant@google.com>
15639
15640 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
15641 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
15642 * testsuite/tls_test.cc (struct int128): 128-bit struct
15643 for testing TLS relocs with non-zero addend.
15644 (v12): New TLS variable.
15645 (t12): New test.
15646 (t_last): Add check for v12.
15647 * testsuite/tls_test.h (t12): New function.
15648 * testsuite/tls_test_main.cc (thread_routine): Call new test.
15649
2d924fd9
ILT
156502008-08-13 Ian Lance Taylor <iant@google.com>
15651
15652 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
15653 set tls_segment_ or relro_segment_.
15654 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
15655 when appropriate.
15656 * output.h (Output_section::clear_is_relro): New function.
15657 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
15658 sections specially even when output_data_ is empty.
15659 (Output_segment::maximum_alignment): When first section is relro,
15660 only force alignment for PT_LOAD segments.
15661 * script.cc (script_data_segment_align): New function.
15662 (script_data_segment_relro_end): New function.
15663 * script-c.h (script_data_segment_align): Declare.
15664 (script_data_segment_relro_end): Declare.
15665 * script-sections.h (class Script_sections): Declare
15666 data_segment_align and data_segment_relro_end. Add fields
15667 segment_align_index_ and saw_relro_end_.
15668 * script-sections.cc (class Sections_element): Add set_is_relro
15669 virtual function. Add new bool* parameter to place_orphan_here.
15670 Add get_output_section virtual function.
15671 (class Output_section_definition): Add set_is_relro. Add new
15672 bool* parameter to place_orphan_here. Add get_output_section.
15673 Add is_relro_ field.
15674 (Output_section_definition::Output_section_definition): Initialize
15675 evaluated_address_, evaluated_load_address, evaluated_addralign_,
15676 and is_relro_ fields.
15677 (Output_section_definition::place_orphan_here): Add is_relro
15678 parameter.
15679 (Output_section_definition::set_section_addresses): Set relro for
15680 output section.
15681 (Output_section_definition::alternate_constraint): Likewise.
15682 (class Orphan_output_section): Add new bool* parameter to
15683 place_orphan_here. Add get_output_section.
15684 (Orphan_output_section::place_orphan_here): Add is_relro
15685 parameter.
15686 (Script_sections::Script_sections): Initialize
15687 data_segment_align_index_ and saw_relro_end_.
15688 (Script_sections::data_segment_align): New function.
15689 (Script_sections::data_segment_relro_end): New function.
15690 (Script_sections::place_orphan): Set or clear is_relro.
15691 (Script_sections::set_section_addresses): Force alignment of first
15692 TLS section.
15693 * yyscript.y (exp): Call script_data_segment_align and
15694 script_data_segment_relro_end.
15695 * testsuite/relro_script_test.t: New file.
15696 * testsuite/relro_test.cc (using_script): Declare.
15697 (t1, t2): Test using_script.
15698 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
15699 (relro_script_test_SOURCES): Define.
15700 (relro_script_test_DEPENDENCIES): Define.
15701 (relro_script_test_LDFLAGS): Define.
15702 (relro_script_test_LDADD): Define.
15703 (relro_script_test.so): New target.
15704 * testsuite/Makefile.in: Rebuild.
15705
f827c9a9
CC
157062008-08-06 Cary Coutant <ccoutant@google.com>
15707
15708 * archive.cc (Archive::total_archives, Archive::total_members)
15709 (Archive::total_members_loaded): New variables.
15710 (Archive::setup): Add parameter. Add option to preread
15711 archive symbols.
15712 (Archive::read_armap): Add counter.
15713 (Archive::get_file_and_offset): New function.
15714 (Archive::get_elf_object_for_member): New function.
15715 (Archive::read_all_symbols): New function.
15716 (Archive::read_symbols): New function.
15717 (Archive::add_symbols): Add counters.
15718 (Archive::include_all_members): Use armap to find members if it's
15719 already built.
15720 (Archive::include_member): Skip reading symbols if already read.
15721 Factored code into Archive::get_file_and_offset and
15722 Archive::get_elf_object_for_member. Changed call to
15723 Mapfile::report_include_archive_member.
15724 (Archive::print_stats): New function.
15725 * archive.h: Declare Object and Read_symbols_data classes.
15726 (Archive::Archive): Add initializers for new members.
15727 (Archive::setup): Add parameter.
15728 (Archive::print_stats): New function.
15729 (Archive::total_archives, Archive::total_members)
15730 (Archive::total_members_loaded): New variables.
15731 (Archive::get_file_and_offset): New function.
15732 (Archive::get_elf_object_for_member): New function.
15733 (Archive::read_all_symbols): New function.
15734 (Archive::read_symbols): New function.
15735 (Archive::Archive_member): New class.
15736 (Archive::members_): New member.
15737 (Archive::num_members_): New member.
15738 * main.cc: Include archive.h.
15739 (main): Call Archive::print_stats.
15740 * mapfile.cc (Mapfile::report_include_archive_member): Delete
15741 archive parameter; member_name is now the fully-decorated name.
15742 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
15743 * options.h: (General_options): Add --preread-archive-symbols option.
15744 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
15745 Archive::setup.
15746
de4c45bd
ILT
157472008-08-04 Ian Lance Taylor <iant@google.com>
15748
15749 * symtab.h (Symbol::use_plt_offset): New function.
15750 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
15751 * powerpc.cc (Relocate::relocate): Likewise.
15752 * sparc.cc (Relocate::relocate): Likewise.
15753 * x86_64.cc (Relocate::relocate): Likewise.
15754 * testsuite/weak_plt.sh: New test.
15755 * testsuite/weak_plt_main.cc: New test.
15756 * testsuite/weak_plt_shared.cc: New test.
15757 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
15758 (check_PROGRAMS): Add weak_plt.
15759 (check_DATA): Add weak_plt_shared.so.
15760 (weak_plt_main_pic.o, weak_plt): New targets.
15761 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
15762 * testsuite/Makefile.in: Rebuild.
15763
15764 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
15765 gcctestdir/ld.
15766 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
15767 * testsuite/Makefile.in: Rebuild.
15768
323ee3f4
AM
157692008-08-04 Alan Modra <amodra@bigpond.net.au>
15770
15771 * Makefile.am (POTFILES.in): Set LC_ALL=C.
15772 * Makefile.in: Regenerate.
15773 * po/POTFILES.in: Regenerate.
15774
7c07ecec
ILT
157752008-07-29 Ian Lance Taylor <iant@google.com>
15776
15777 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
15778 symbols before other symbols.
15779 * testsuite/script_test_2.cc (test_addr): Declare.
15780 (test_addr_alias): Declare.
15781 (main): Check that test_addr and test_addr_alias have the right
cd536b21 15782 values.
7c07ecec
ILT
15783 * testsuite/script_test_2.t: Define test_addr_alias and
15784 test_addr.
15785
5778530e
ILT
157862008-07-24 Ian Lance Taylor <iant@google.com>
15787
2a00e4fb
ILT
15788 PR 5990
15789 * descriptors.cc: New file.
15790 * descriptors.h: New file.
15791 * gold-threads.h (class Hold_optional_lock): New class.
15792 * fileread.cc: Include "descriptors.h".
15793 (File_read::~File_read): Release descriptor rather than closing
15794 it.
15795 (File_read::open) [file]: Call open_descriptor rather than open.
15796 Set is_descriptor_opened_.
15797 (File_read::open) [memory]: Assert that descriptor is not open.
15798 (File_read::reopen_descriptor): New function.
15799 (File_read::release): Release descriptor.
15800 (File_read::do_read): Make non-const. Reopen descriptor.
15801 (File_read::read): Make non-const.
15802 (File_read::make_view): Reopen descriptor.
15803 (File_read::do_readv): Likewise.
15804 * fileread.h (class File_read): Add is_descriptor_opened_ field.
15805 Update declarations.
15806 * layout.cc: Include "descriptors.h".
15807 (Layout::create_build_id): Use open_descriptor rather than open.
15808 * output.cc: Include "descriptors.h".
15809 (Output_file::open): Use open_descriptor rather than open.
15810 * archive.cc (Archive::const_iterator): Change Archive to be
15811 non-const.
15812 (Archive::begin, Archive::end): Make non-const.
15813 (Archive::count_members): Likewise.
15814 * archive.h (class Archive): Update declarations.
15815 * object.h (Object::read): Make non-const.
15816 * Makefile.am (CCFILES): Add descriptors.cc.
15817 (HFILES): Add descriptors.h.
15818 * Makefile.in: Rebuild.
15819
801647d1
ILT
15820 PR 6716
15821 * gold.h: Always include <clocale>. Add Solaris workarounds
15822 following code in binutils/sysdep.h.
15823
5edd166e
ILT
15824 PR 6048
15825 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
15826 this->eh_frame_hdr_ is NULL before using it.
15827
c89ad728
ILT
15828 * dynobj.cc (Versions::Versions): Update comment.
15829
aa86f06b
ILT
15830 * dynobj.cc (Versions::Versions): If there is an soname, use it as
15831 the base version name.
15832
5778530e
ILT
15833 * stringpool.cc (Stringpool_template::add_with_length): Set key to
15834 array size plus one.
15835 (Stringpool_template::set_string_offsets): Subtract one from key
15836 before using it as an array index.
15837 (Stringpool_template::get_offset_with_length): Likewise.
15838 (Stringpool_template::write_to_buffer): Likewise.
15839 * stringpool.h (Stringpool_template::get_offset_from_key):
15840 Likewise.
15841
057ead22
ILT
158422008-07-23 Ian Lance Taylor <iant@google.com>
15843
7f649c59
ILT
15844 PR 6658
15845 * object.h (Merged_symbol_value::value): Do our best to handle a
15846 negative addend.
15847
057ead22
ILT
15848 PR 6647
15849 * script.cc (Version_script_info::get_versions): Don't add empty
15850 version tag to return value.
15851 (Version_script_info::get_symbol_version_helper): Change return
15852 type to bool. Add pversion parameter. Change all callers.
15853 (script_register_vers_node): Don't require a non-NULL tag.
15854 * script.h (class Version_script_info): Update declarations.
15855 (Version_script_info::get_symbol_version): Change return type to
15856 bool. Add version parameter. Change all callers.
15857 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
15858 handling. Handle an empty version from a version script.
15859 (Symbol_table::define_special_symbol): Likewise.
15860 * testsuite/ver_test_10.script: New file.
15861 * testsuite/ver_test_10.sh: New file.
15862 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
15863 (check_DATA): Add ver_test_10.syms.
15864 (ver_test_10.syms, ver_test_10.so): New target.
15865 * testsuite/Makefile.in: Rebuild.
15866
58e54ac2
CD
158672008-07-23 Simon Baldwin <simonb@google.com>
15868
15869 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
15870 to zero for undefined symbols from dynamic libraries.
15871
95d14cd3
ILT
158722008-07-23 Ian Lance Taylor <iant@google.com>
15873
15874 * symtab.cc (Symbol_table::resolve): Remove version parameter.
15875 Change all callers.
15876 * symtab.h (class Symbol_table): Update declaration.
15877 * testsuite/ver_test_9.cc: New file.
15878 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
15879 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
15880 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
15881 (ver_test_9.so, ver_test_9.o): New targets.
15882 * testsuite/Makefile.in: Rebuild.
15883
92de84a6
ILT
158842008-07-22 Ian Lance Taylor <iant@google.com>
15885
34810851
ILT
15886 * options.h (class General_options): Define --check-sections.
15887 * layout.cc (Layout::set_segment_offsets): Handle
15888 --check-sections.
15889
af6156ef
ILT
15890 * options.h (class General_options): Define -n/--nmagic and
15891 -N/--omagic.
15892 * options.cc (General_options::finalize): For -n/--nmagic or
15893 -N/--omagic, set -static.
15894 * layout.cc (Layout::attach_allocated_section_to_segment): If
15895 -N/--omagic, don't put read-only and read-write sections in
15896 different segments.
15897 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
15898 finding a read-only segment.
15899 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
15900 don't set the minimum segment alignment to the common page size,
15901 and don't set the file offset to the address modulo the page size.
15902 * script-sections.cc (Script_sections::create_segments): If
15903 -n/--omagic, don't put read-only and read-write sections in
15904 different segments.
15905
92de84a6
ILT
15906 * cref.cc: New file.
15907 * cref.h: New file.
15908 * options.h (class General_options): Add --print-symbol-counts.
15909 * main.cc (main): Issue defined symbol report if requested.
15910 * archive.cc (Archive::interpret_header): Make into a const member
15911 function.
15912 (Archive::add_symbols): Call Input_objects::archive_start and
15913 archive_stop.
15914 (Archive::const_iterator): Define new class.
15915 (Archive::begin, Archive::end): New functions.
15916 (Archive::include_all_members): Rewrite to use iterator.
15917 (Archive::count_members): New function.
15918 * archive.h (class Archive): Update declarations.
15919 (Archive::filename): New function.
15920 * object.cc: Include "cref.h".
15921 (Sized_relobj::Sized_relobj): Initialize defined_count_.
15922 (Sized_relobj::do_get_global_symbol_counts): New function.
15923 (Input_objects::add_object): Add object to cross-referencer.
15924 (Input_objects::archive_start): New function.
15925 (Input_objects::archive_stop): New function.
15926 (Input_objects::print_symbol_counts): New function.
15927 * object.h: Declare Cref and Archive.
15928 (Object::get_global_symbol_counts): New function.
15929 (Object::do_get_global_symbol_counts): New pure virtual function.
15930 (class Sized_relobj): Add defined_count_ field. Update
15931 declarations.
15932 (class Input_objects): Add cref_ field. Update constructor.
15933 Update declarations.
15934 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
15935 defined_count_.
15936 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
15937 symbol counts.
15938 (Sized_dynobj::do_get_global_symbol_counts): New function.
15939 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
15940 defined_count_. Update declarations. Define Symbols typedef.
15941 * symtab.cc (Symbol_table::add_from_relobj): Add defined
15942 parameter. Change all callers.
15943 (Symbol_table::add_from_dynobj): Add sympointers and defined
15944 parameters. Change all callers.
15945 * symtab.h (class Symbol_table): Update declarations.
15946 * Makefile.am (CCFILES): Add cref.cc.
15947 (HFILES): Add cref.h.
15948 * Makefile.in: Rebuild.
15949
3f7c5e1d
CD
159502008-07-22 Simon Baldwin <simonb@google.com>
15951
15952 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
15953 to zero when writing undefined symbols.
15954
e0b64032
ILT
159552008-07-22 Ian Lance Taylor <iant@google.com>
15956
15957 * output.cc (Output_section::add_input_section): Don't try to
15958 merge empty merge sections.
15959
096b02cf
CS
159602008-07-21 Craig Silverstein <csilvers@google.com>
15961
15962 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
15963 Include symbol version in error message.
cd536b21 15964
1d1f116d
CD
159652008-07-20 Chris Demetriou <cgd@google.com>
15966
cd536b21 15967 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
15968 (RANDOM_SEED_CFLAGS): New substituted variable.
15969 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
15970 * configure: Rebuild.
15971 * Makefile.in: Likewise.
15972 * testsuite/Makefile.in: Likewise.
15973
a18f591e
ILT
159742008-07-18 Ian Lance Taylor <iant@google.com>
15975
15976 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
15977 where we see NAME/NULL and NAME/VERSION as separate symbols.
15978 * testsuite/ver_test_main.cc (main): Call t4.
15979 (t4, t4_2a): Define.
15980 * testsuite/ver_test_2.cc (t4_2): Define.
15981 * testsuite/ver_test_2.script: Put t4_2a in VER2.
15982 * testsuite/ver_test_4.cc (t4_2a): Define.
15983 * testsuite/ver_test_4.script: Put t4_2a in VER2.
15984 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
15985
c6e3f6ed
ILT
159862008-07-17 Ian Lance Taylor <iant@google.com>
15987
15988 * dynobj.cc (Versions::add_def): If we give an error about a
15989 missing version, go ahead and create the version anyhow.
15990
ef9beddf
ILT
159912008-07-10 Ian Lance Taylor <iant@google.com>
15992
15993 Handle output sections with more than 0x7fffffff bytes.
15994 * object.h (class Relobj): Change map_to_output_ to
15995 output_sections_, and just keep a section pointer. Change all
15996 uses. Move comdat group support to Sized_relobj.
15997 (Relobj::is_section_specially_mapped): Remove.
15998 (Relobj::output_section): Remove poff parameter. Change all
15999 callers.
16000 (Relobj::output_section_offset): New function.
16001 (Relobj::set_section_offset): Rewrite.
16002 (Relobj::map_to_output): Remove.
16003 (Relobj::output_sections): New function.
16004 (Relobj::do_output_section_offset): New pure virtual function.
16005 (Relobj::do_set_section_offset): Likewise.
16006 (class Sized_relobj): Add section_offsets_ field. Add comdat
16007 group support from Relobj. Update declarations.
16008 (Sized_relobj::get_output_section_offset): New function.
16009 (Sized_relobj::do_output_section_offset): New function.
16010 (Sized_relobj::do_set_section_offset): New function.
16011 * object.cc (Relobj::output_section_address): Remove.
16012 (Sized_relobj::Sized_relobj): Initialize new fields.
16013 (Sized_relobj::include_section_group): Cast find_kept_object to
16014 Sized_relobj.
16015 (Sized_relobj::include_linkonce_section): Likewise.
16016 (Sized_relobj::do_layout): Use separate arrays for output section
16017 and output offset.
16018 (Sized_relobj::do_count_local_symbols): Change map_to_output to
16019 output_sections.
16020 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
16021 output_sections and section_offsets.
16022 (Sized_relobj::write_local_symbols): Likewise.
16023 (map_to_kept_section): Compute output address directly.
16024 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
16025 output_sections and section_offsets.
16026 (Sized_relobj::write_sections): Likewise.
16027 (Sized_relobj::relocate_sections): Likewise.
16028 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
16029 * output.h (class Output_reloc): Update declarations. Change
16030 u2_.relobj to Sized_relobj*.
16031 (class Output_data_reloc): Change add functions to use
16032 Sized_relobj*.
16033 * output.cc (Output_reloc::Output_reloc): Change relobj to
16034 Sized_relobj*.
16035 (Output_reloc::local_section_offset): Change return type to
16036 Elf_Addr. Use get_output_section_offset.
16037 (Output_reloc::get_address): Likewise.
16038 (Output_section::is_input_address_mapped): Don't call
16039 is_section_specially_mapped.
16040 (Output_section::output_offset): Likewise.
16041 (Output_section::output_address): Likewise.
16042 (Output_section::starting_output_address): Likewise.
16043 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
16044 parameter to Sized_relobj*.
16045 (Copy_relocs::need_copy_reloc): Likewise.
16046 (Copy_relocs::save): Likewise.
16047 * copy-relocs.h (class Copy_relocs): Update declarations.
16048 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
16049 Sized_relobj*. Change relobj_ field to Sized_relobj*.
16050 * target-reloc.h (relocate_for_relocatable): Change
16051 offset_in_output_section type to Elf_Addr. Change code that uses
16052 it as well.
16053 * layout.cc (Layout::layout): Always set *off.
16054 * mapfile.cc (Mapfile::print_input_section): Use
16055 output_section_offset.
16056 * i386.cc (Target_i386::copy_reloc): Change object parameter to
16057 Sized_relobj*.
16058 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
16059 * sparc.cc (Target_sparc::copy_reloc): Likewise.
16060 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
16061
5cb66f97
ILT
160622008-07-03 Ian Lance Taylor <iant@google.com>
16063
16064 * layout.cc (Layout::include_section): Do not discard unrecognized
16065 SHT_STRTAB sections.
16066
afe47622
CS
160672008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
16068
16069 * script.cc (Lex::can_continue_name): Make '?' allowable in
16070 version-script names.
16071 * testsuite/version_script.map: Change glob pattern to use '?'
16072
5adf9721
ILT
160732008-06-30 Manish Singh <yosh@gimp.org>
16074
16075 PR 6585
16076 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
16077 Correct typo.
16078
e6fde208
ILT
160792008-06-30 Ian Lance Taylor <iant@google.com>
16080
16081 PR 6660
16082 PR 6682
16083 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
16084 versions]: Don't try to read the value in the contents, since we
16085 don't use it. Use the template endianness when writing.
16086
3f2e6a2d
CC
160872008-06-25 Cary Coutant <ccoutant@google.com>
16088
16089 * fileread.cc (File_read::make_view): Assert on zero-length view.
16090 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
16091 symbol table when there are no symbols to read.
16092
c43d3a48
CS
160932008-06-23 Craig Silverstein <csilvers@google.com>
16094
16095 * version.cc (version_string): Bump to 1.7
16096
5f494ea0
CS
160972008-06-18 Craig Silverstein <csilvers@google.com>
16098
16099 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
16100 constant 0xFFFF to type Valtype.
16101 (Powerpc_relocate_functions::rel16_ha): Likewise.
16102
c42e122e
ILT
161032008-06-17 Ian Lance Taylor <iant@google.com>
16104
f34787f8
ILT
16105 * output.h (Output_section::Input_section): Initialize p2align_ to
16106 zero for Output_section_data constructors.
16107 (Output_section::Input_section::addralign): If not an input
16108 section, return the alignment of the Output_section_data.
16109 * testsuite/copy_test.cc: New file.
16110 * testsuite/copy_test_1.cc: New file.
16111 * testsuite/copy_test_2.cc: New file.
16112 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
16113 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
16114 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
16115 (copy_test_1_pic.o, copy_test_1.so): New targets.
16116 (copy_test_2_pic.o, copy_test_2.so): New targets.
16117 * testsuite/Makefile.in: Rebuild.
16118
c42e122e
ILT
16119 * script-sections.cc (Script_sections::place_orphan): Initialize
16120 local variable exact.
16121
ce3ac18a
DE
161222008-06-13 David Edelsohn <edelsohn@gnu.org>
16123
16124 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
16125
42cacb20
DE
161262008-06-12 David Edelsohn <edelsohn@gnu.org>
16127 David S. Miller <davem@davemloft.net>
16128
16129 * powerpc.cc: New file.
16130 * Makefile.am (TARGETSOURCES): Add powerpc.cc
16131 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
16132 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
16133 * Makefile.in: Rebuild.
16134
7b308235
ILT
161352008-06-09 Ian Lance Taylor <iant@google.com>
16136
16137 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
16138 <exception>.
16139 (throwing, orig_terminate): New static variables.
16140 (terminate_handler): New static function.
16141 (t2): Set terminate handler.
16142
f0b886e3
ILT
161432008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
16144
16145 PR 6584
cd536b21 16146 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
16147 alignment.
16148
3e90f135
CC
161492008-05-30 Cary Coutant <ccoutant@google.com>
16150
16151 * archive.cc (Archive::include_all_members) Correct to step
16152 over symbol table and extended name table in thin archives.
16153
e09ad04a
ILT
161542008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
16155
16156 PR 6407
16157 * target-reloc.h (relocate_for_relocatable): Fix new_offset
16158 calculation.
16159
62b01cb5
ILT
161602008-05-28 Caleb Howe <cshowe@google.com>
16161
16162 * reduced_debug_output.cc: New file.
16163 * reduced_debug_output.h: New file.
92de84a6 16164 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
16165 * options.cc (General_options::finalize): Add strip_debug_non_line
16166 to the strip heirarchy.
16167 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
16168 fields.
16169 * layout.cc: Include "reduced_debug_output.h".
16170 (Layout::Layout): Initialize new fields.
16171 (line_only_debug_sections): New static array.
16172 (is_lines_only_debug_sections): New static inline function.
16173 (Layout::include_section): Handle --strip-debug-non-line.
16174 (Layout::make_output_section): If --strip-debug-non-line, build
16175 new output sections for .debug_abbrev and .debug_info.
16176 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
16177 gold. Warn about possible overflow.
16178 (read_signed_LEB_128): Likewise.
16179 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
16180 (read_signed_LEB_128): Declare.
16181 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
16182 (HFILES): Add reduced_debug_output.h.
16183 * Makefile.in: Rebuild.
16184
7d9e3d98
ILT
161852008-05-21 Ian Lance Taylor <iant@google.com>
16186
16187 * mapfile.cc: New file.
16188 * mapfile.h: New file.
16189 * options.h (class General_options): Add -M/--print-map and -Map.
16190 * options.cc (General_options::finalize): Make -M equivalent to
16191 -Map -.
16192 * main.cc: Include <cstdio> and "mapfile.h".
16193 (main): Open mapfile if requested.
16194 * gold.cc (class Middle_runner): Add mapfile_ field. Update
16195 constructor. Change caller.
16196 (queue_initial_tasks): Add mapfile parameter. Change caller.
16197 (queue_middle_tasks): Likewise.
16198 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
16199 declarations.
16200 * archive.cc: Include "mapfile.h".
16201 (Archive::add_symbols): Add mapfile parameter. Change all
16202 callers. Pass mapfile, symbol, and reason to include_member.
16203 (Archive::include_all_members): Add mapfile parameter. Change all
16204 callers.
16205 (Archive::include_member): Add mapfile, sym, and why parameters.
16206 Change all callers. Report inclusion to map file.
16207 * archive.h: Include "fileread.h".
16208 (class Archive): Update declarations.
16209 (Archive::file): New const method.
16210 (class Add_archive_symbols): Add mapfile_ field. Update
16211 constructor. Change all callers.
16212 * readsyms.h (class Read_symbols): Likewise.
16213 (class Finish_group): Likewise.
16214 (class Read_script): Likewise.
16215 * common.cc: Include "mapfile.h".
16216 (Symbol_table::allocate_commons): Add mapfile parameter. Change
16217 all callers.
16218 (Symbol_table::do_allocate_commons): Likewise.
16219 (Symbol_table::do_allocate_commons_list): Likewise. Report common
16220 symbol allocation to mapfile.
16221 * common.h (class Allocate_commons_task): Add mapfile_ field.
16222 Update constructor. Change all callers.
16223 * symtab.h (class Symbol_table): Update declarations.
16224 * layout.cc: Include "mapfile.h".
16225 (Layout_task_runner::run): Print information to mapfile.
16226 (Layout::create_gold_note): Change Output_data_fixed_space to
16227 Output_data_zero_fill.
16228 (Layout::create_build_id): Likewise.
16229 (Layout::print_to_mapfile): New function.
16230 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
16231 constructor. Change caller.
16232 (class Layout): Declare print_to_mapfile.
16233 * output.cc (Output_section::Input_section::print_to_mapfile): New
16234 function.
16235 (Output_section::add_input_section): If producing a map, always
16236 add to input_sections_ list.
16237 (Output_section::do_print_to_mapfile): New function.
16238 (Output_segment::print_sections_to_mapfile): New function.
16239 (Output_segment::print_section_list_to_mapfile): New function.
16240 * output.h: Include "mapfile.h".
16241 (Output_data::print_to_mapfile): New function.
16242 (Output_data::do_print_to_mapfile): New virtual function.
16243 (Output_segment_headers::do_print_to_mapfile): New function.
16244 (Output_file_header::do_print_to_mapfile): New function.
16245 (Output_data_const::do_print_to_mapfile): New function.
16246 (class Output_data_const_buffer): Add map_name_ field. Update
16247 constructor. Change all callers. Add do_print_to_mapfile
16248 function.
16249 (class Output_data_fixed_space): Likewise.
16250 (class Output_data_space): Likewise.
16251 (class Output_data_zero_fill): New class.
16252 (Output_data_strtab::do_print_to_mapfile): New function.
16253 (Output_data_reloc_base::do_print_to_mapfile): New function.
16254 (Output_relocatable_relocs::do_print_to_mapfile): New function.
16255 (Output_data_group::do_print_to_mapfile): New function.
16256 (Output_data_got::do_print_to_mapfile): New function.
16257 (Output_data_dynamic::do_print_to_mapfile): New function.
16258 (Output_symtab_xindex::do_print_to_mapfile): New function.
16259 (class Output_section): Declare do_print_to_mapflie. Declare
16260 print_to_mapfile in Input_section.
16261 (class Output_segment): Declare new functions.
16262 * object.h (Sized_relobj::symbol_count): New function.
16263 * script-sections.cc
16264 (Output_section_element_dot_assignment::set_section_addresses):
16265 Change Output_data_fixed_space to Output_data_zero_fill.
16266 (Output_data_expression::do_print_to_mapfile): New function.
16267 * script.cc (read_input_script): Add mapfile parameter. Change
16268 all callers.
16269 * script.h (read_input_script): Update declaration.
16270 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
16271 (Eh_frame::do_print_to_mapfile): New function.
16272 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
16273 (Output_merge_string::do_print_to_mapfile): New function.
16274 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
16275 function.
16276 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
16277 function.
16278 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
16279 function.
16280 * Makefile.am (CCFILES): Add mapfile.cc.
16281 (HFILES): Add mapfile.h.
16282 * Makefile.in: Rebuild.
16283
9f1d377b
ILT
162842008-05-19 Ian Lance Taylor <iant@google.com>
16285
16286 * options.h (class General_options): Add -z relro.
16287 * layout.cc (Layout::Layout): Initialize relro_segment_.
16288 (Layout::add_output_section_data): Return the output section.
16289 (Layout::make_output_section): Rcognize relro sections and mark
16290 them appropriately.
16291 (Layout::attach_allocated_section_to_segment): Put relro sections
16292 in a PT_GNU_RELRO segment.
16293 (Layout::create_initial_dynamic_sections): Mark the .dynamic
16294 section as relro.
16295 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
16296 PT_TLS segments.
16297 (Layout::linkonce_mapping): Map d.rel.ro.local to
16298 .data.rel.ro.local.
16299 (Layout::output_section_name): Us .data.rel.ro.local for any
16300 section which begins with that.
16301 * layout.h (class Layout): Update add_output_section_data
16302 declaration. Add relro_segment_ field.
16303 * output.cc (Output_section::Output_section): Initialize is_relro_
16304 and is_relro_local_ fields.
16305 (Output_segment::add_output_section): Group relro sections.
16306 (Output_segment::is_first_section_relro): New function.
16307 (Output_segment::maximum_alignment): If there is a relro section,
16308 align the segment to the common page size.
16309 (Output_segment::set_section_addresses): Track whether we are
16310 looking at relro sections. If the last section is a relro
16311 section, align to the common page size.
16312 (Output_segment::set_section_list_addresses): Add in_relro
16313 parameter. Change all callers. Align to the page size when
16314 moving from relro to non-relro section.
16315 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
16316 segment.
16317 * output.h (class Output_section): Add is_relro_ and
16318 is_relro_local_ fields.
16319 (Output_section::is_relro): New function.
16320 (Output_section::set_is_relro): New function.
16321 (Output_section::is_relro_local): New function.
16322 (Output_section::set_is_relro_local): New function.
16323 (class Output_segment): Update declarations.
16324 * i386.cc (Target_i386::got_section): Mark .got section as relro.
16325 * sparc.cc (Target_sparc::got_section): Likewise.
16326 * x86_64.cc (Target_x86_64::got_section): Likewise.
16327 * testsuite/relro_test_main.cc: New file.
16328 * testsuite/relro_test.cc: New file.
16329 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
16330 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
16331 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
16332 (relro_test.so, relro_test_pic.o): New targets.
16333 * testsuite/Makefile.in: Rebuild.
16334
a984ee1d
ILT
163352008-05-16 Ian Lance Taylor <iant@google.com>
16336
01676dcd
ILT
16337 * output.cc (Output_segment::add_output_section): Remove front
16338 parameter.
16339 * output.h (class Output_segment): Remove
16340 add_initial_output_section and overloaded add_output_section.
16341 Update declaration of remaining add_output_section.
16342 * layout.cc (Layout::create_interp): Call add_output_section
16343 rather than add_initial_output_section.
16344 (Layout::finish_dynamic_section): Likewise.
16345
497897f9
ILT
16346 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
16347 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
16348 know the dynamic type.
16349 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
16350 field. Initialize it in constructor.
16351 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
16352 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
16353 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
16354 reloc.
16355
a984ee1d
ILT
16356 * output.cc (Output_reloc::get_address): Change return type to
16357 Elf_Addr.
16358 * output.h (class Output_reloc): Update get_address declaration.
16359 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
16360 for section addresses.
16361
55ba0940
ILT
163622008-05-09 Ian Lance Taylor <iant@google.com>
16363
16364 PR 6493
16365 * gold.cc (gold_nomem): Use return value of write.
16366
75517b77
ILT
163672008-05-08 Ian Lance Taylor <iant@google.com>
16368
16369 * symtab.c (Symbol::init_base_output_data): Add version
16370 parameter. Change all callers.
16371 (Symbol::init_base_output_segment): Likewise.
16372 (Symbol::init_base_constant): Likewise.
16373 (Symbol::init_base_undefined): Likewise.
16374 (Sized_symbol::init_output_data): Likewise.
16375 (Sized_symbol::init_output_segment): Likewise.
16376 (Sized_symbol::init_constant): Likewise.
16377 (Sized_symbol::init_undefined): Likewise.
16378 (Symbol_table::do_define_in_output_data): If the new symbol has a
16379 version, mark it as the default.
16380 (Symbol_table::do_define_in_output_segment): Likewise.
16381 (Symbol_table::do_define_as_constant): Likewise.
16382 * symtab.h (class Symbol): Update declarations.
16383 (class Sized_symbol): Likewise.
16384 * resolve.cc (Symbol::override_version): New function.
c42e122e 16385 (Symbol::override_base): Call override_version.
75517b77
ILT
16386 (Symbol::override_base_with_special): Likewise.
16387 * testsuite/ver_script_8.script: New file.
16388 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
16389 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
16390 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
16391 (ver_test_8_1.so, ver_test_8_2.so): New targets.
16392
f1f70eae
ILT
163932008-05-06 Ian Lance Taylor <iant@google.com>
16394
f3e9c5c5
ILT
16395 PR 6049
16396 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
16397 functions.
16398 (class General_options): Remove existing --undefined, and add
16399 --no-undefined instead. Add new --undefined as synonym for -u.
16400 * archive.cc (Archive::add_symbols): Check whether symbol was
16401 named with -u.
16402 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
16403 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
16404 all uses. Add IS_UNDEFINED. Update declarations to split
16405 different versions of init_base. Declare init_base_undefined.
16406 (Symbol::is_defined): Handle IS_UNDEFINED.
16407 (Symbol::is_undefined): Likewise.
16408 (Symbol::is_weak_undefined): Call is_undefined.
16409 (Symbol::is_absolute): Handle IS_CONSTANT.
16410 (class Sized_symbol): Update declarations to split different
16411 versions of init. Declare init_undefined.
16412 (class Symbol_table): Declare new functions.
16413 * symtab.cc (Symbol::init_base_object): Rename from init_base.
16414 Change all callers.
16415 (Symbol::init_base_output_data): Likewise.
16416 (Symbol::init_base_output_segment): Likewise.
16417 (Symbol::init_base_constant): Likewise.
16418 (Symbol::init_base_undefined): New function.
16419 (Sized_symbol::init_object): Rename from init. Change all
16420 callers.
16421 (Sized_symbol::init_output_data): Likewise.
16422 (Sized_symbol::init_output_segment): Likewise.
16423 (Sized_symbol::init_constant): Likewise.
16424 (Sized_symbol::init_undefined): New function.
16425 (Symbol_table::add_undefined_symbols_from_command_line): New
16426 function.
16427 (Symbol_table::do_add_undefined_symbols_from_command_line): New
16428 function.
16429 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
16430 (Symbol::output_section): Likewise.
16431 (Symbol::set_output_section): Likewise.
16432 (Symbol_table::sized_finalize_symbol): Likewise.
16433 (Symbol_table::sized_write_globals): Likewise.
16434 * resolve.cc (Symbol_table::should_override): Likewise.
16435 (Symbol::override_base_with_special): Likewise.
16436
8bdcdf2c
ILT
16437 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
16438 symbol, change it to have default visibility.
16439 * testsuite/protected_1.cc: New file.
16440 * testsuite/protected_2.cc: New file.
16441 * testsuite/protected_3.cc: New file.
16442 * testsuite/protected_main_1.cc: New file.
16443 * testsuite/protected_main_2.cc: New file.
16444 * testsuite/protected_main_3.cc: New file.
16445 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
16446 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
16447 (protected_1_LDFLAGS, protected_1_LDADD): Define.
16448 (protected_1.so): New target.
16449 (protected_1_pic.o, protected_2_pic.o): New targets.
16450 (protected_3_pic.o): New target.
16451 (check_PROGRAMS): Add protected_2.
16452 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
16453 (protected_2_LDFLAGS, protected_2_LDADD): Define.
16454 * testsuite/Makefile.in: Rebuild.
16455
2b706932
ILT
16456 * options.h (DEFINE_var): Add set_user_set_##varname__.
16457 (DEFINE_bool_alias): New macro.
16458 (class General_options): Define -Bstatic using DEFINE_bool_alias
16459 rather than DEFINE_special. Add --undefined as an alias for -z
16460 defs.
16461 * options.cc (General_options::parse_Bstatic): Remove.
16462
d82a5bcc
ILT
16463 * options.h (class General_options): Add --fatal-warnings.
16464 * main.cc (main): Implement --fatal-warnings.
16465 * errors.h (Errors::warning_count): New function.
16466
f1f70eae
ILT
16467 * options.h (class General_options): Add -Bsymbolic-functions.
16468 * symtab.h (Symbol::is_preemptible): Check for
16469 -Bsymbolic-functions.
16470
8825ac63
ILT
164712008-05-05 Ian Lance Taylor <iant@google.com>
16472
d98bc257
ILT
16473 * options.h (DEFINE_bool): For DASH_Z, create the negative option
16474 as noVARNAME rather than no-VARNAME.
16475 (class General_options): Add option -z combreloc.
16476 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
16477 get_address.
16478 (Output_reloc::sort_before) [SHT_REL]: New function.
16479 (Output_reloc::sort_before) [SHT_RELA]: New function.
16480 (class Output_data_reloc_base): Add sort_relocs_ field. Define
16481 Sort_relocs_comparison.
16482 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
16483 parameter. Change all callers.
16484 (Output_data_reloc::Output_data_reloc) [both versions]: Add
16485 sort_relocs parameter. Change all callers.
16486 * output.cc (Output_reloc::get_address): New function, broken out
16487 of write_rel.
16488 (Output_reloc::write_rel): Call it.
16489 (Output_reloc::compare): New function.
16490 (Output_data_reloc_base::do_write): Optionally sort relocs.
16491
60b2b4e7
ILT
16492 * configure.ac: If targ_extra_obj is set, link it in.
16493 * configure.tgt: Initialize all variables.
16494 (x86_64*): Set targ_extra_obj and targ_extra_size.
16495 * configure: Rebuild.
16496
8825ac63
ILT
16497 * object.cc (Sized_relobj::include_section_group): Adjust section
16498 indexes read from group data. Build vector to pass to
16499 layout_group.
16500 * layout.cc (Layout::layout_group): Add flags and shndxes
16501 parameters. Remove contents parameter. Change caller. Update
16502 explicit instantiations.
16503 * layout.h (class Layout): Update layout_group declaration.
16504 * output.cc (Output_data_group::Output_data_group): Add flags and
16505 input_shndxes parameters. Remove contents parameter. Change
16506 caller.
16507 (Output_data_group::do_write): Change input_sections_ to
16508 input_shndxes_.
16509 * output.h (class Output_data_group): Update constructor
16510 declaration. Rename input_sections_ to input_shndxes_.
16511 * testsuite/many_sections_test.cc: Add template.
16512
e94cf127
CC
165132008-04-30 Cary Coutant <ccoutant@google.com>
16514
4418b2d5
CC
16515 * target-reloc.h (relocate_section): Fix dead-pointer bug.
16516
e94cf127
CC
16517 * layout.cc (Layout::include_section): Refactored check for debug
16518 info section.
16519 (Layout::add_comdat): Add new parameters. Change type
16520 of signature parameter. Add object and shndx to signatures table.
16521 (Layout::find_kept_object): New function.
16522 * layout.h: Include <cstring>.
16523 (Layout::is_debug_info_section): New function.
16524 (Layout::add_comdat): Add new parameters.
16525 (Layout::find_kept_object): New function.
16526 (Layout::Kept_section): New struct.
16527 (Layout::Signatures): Change type of map range.
16528 * object.cc (Relobj::output_section_address): New function.
16529 (Sized_relobj::include_section_group): Add new parameters. Change
16530 calls to Layout::add_comdat. Change to build table of kept comdat
16531 groups and table mapping discarded sections to kept sections.
16532 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
16533 (Sized_relobj::do_layout): Change calls to include_section_group and
16534 include_linkonce_section.
16535 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
16536 value to zero when section is discarded.
16537 (Sized_relobj::map_to_kept_section): New function.
16538 * object.h (Relobj::output_section_address): New function.
16539 (Relobj::Comdat_group): New type.
16540 (Relobj::find_comdat_group): New function.
16541 (Relobj::Comdat_group_table): New type.
16542 (Relobj::Kept_comdat_section): New type.
16543 (Relobj::Kept_comdat_section_table): New type.
16544 (Relobj::add_comdat_group): New function.
16545 (Relobj::set_kept_comdat_section): New function.
16546 (Relobj::get_kept_comdat_section): New function.
16547 (Relobj::comdat_groups_): New field.
16548 (Relobj::kept_comdat_sections_): New field.
16549 (Symbol_value::input_value): Update comment.
16550 (Sized_relobj::map_to_kept_section) New function.
16551 (Sized_relobj::include_linkonce_section): Add new parameter.
16552 * target-reloc.h (Comdat_behavior): New type.
16553 (get_comdat_behavior): New function.
16554 (relocate_section): Add code to map a discarded section to the
16555 corresponding kept section when applying a relocation.
16556
e4e5049b
CS
165572008-04-30 Craig Silverstein <csilvers@google.com>
16558
16559 * dwarf_reader.cc (next_generation_count): New static var.
16560 (Addr2line_cache_entry): New struct.
16561 (addr2line_cache): New static var.
16562 (Dwarf_line_info::one_addr2line): Added caching.
16563 (Dwarf_line_info::clear_addr2line_cache): New function.
16564 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
16565 cache-size parameter.
16566 (Dwarf_line_info::one_addr2line_cache): New function.
16567 * symtab.cc (Symbol_table::detect_odr_violations): Pass
16568 new cache-size argument to one_addr2line(), and clear cache.
16569
d09e9154
CC
165702008-04-28 Cary Coutant <ccoutant@google.com>
16571
16572 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
16573 R_386_PC8 relocations.
16574
7ef73768
ILT
165752008-04-23 Ian Lance Taylor <iant@google.com>
16576
55438702
ILT
16577 * object.cc (Sized_relobj::include_section_group): Check for
16578 invalid section group.
16579
c165fb93
ILT
16580 * object.cc (make_elf_object): Correct test for 64-bit ELF file
16581 header size.
16582
7ef73768
ILT
16583 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
16584 than read for file header.
16585 * archive.cc (Archive::include_member): Likewise.
16586
6194aaab
L
165872008-04-23 Paolo Bonzini <bonzini@gnu.org>
16588
16589 * aclocal.m4: Regenerate.
16590 * configure: Regenerate.
16591
d491d34e
ILT
165922008-04-19 Ian Lance Taylor <iant@google.com>
16593
5ea2bac6
ILT
16594 * version.cc (version_string): Bump to 1.6.
16595
7bc3e21a
ILT
16596 * testsuite/Makefile.am (many_sections_r_test): New target.
16597 (many_sections_r_test_SOURCES): Remove.
16598 (many_sections_r_test_DEPENDENCIES): Remove.
16599 (many_sections_r_test_LDFLAGS): Remove.
16600 (many_sections_r_test_LDADD): Remove.
16601
7fcd3aa9
ILT
16602 * object.cc (Sized_relobj::do_add_symbols): Always pass
16603 local_symbol_count_ to add_from_relobj.
16604
4c94d6ae
ILT
16605 * testsuite/Makefile.am (many_sections_check.h): Only check one in
16606 every thousand variables.
16607 * testsuite/Makefile.in: Rebuild.
16608
d491d34e
ILT
16609 * object.cc (Xindex::initialize_symtab_xindex): New function.
16610 (Xindex::read_symtab_xindex): New function.
16611 (Xindex::sym_xindex_to_shndx): New function.
16612 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
16613 available.
16614 (Sized_relobj::do_initialize_xindex): New function.
16615 (Sized_relobj::do_read_symbols): Adjust section links.
16616 (Sized_relobj::symbol_section_and_value): Add is_ordinary
16617 parameter. Change all callers.
16618 (Sized_relobj::include_section_group): Adjust section links and
16619 symbol section indexes.
16620 (Sized_relobj::do_layout): Adjust section links.
16621 (Sized_relobj::do_count_local_symbols): Adjust section links and
16622 symbol section indexes.
16623 (Sized_relobj::do_finalize_local_symbols): Distinguish between
16624 ordinary and special symbols.
16625 (Sized_relobj::write_local_symbols): Add symtab_xindex and
16626 dynsym_xindex parameters. Change all callers. Adjust section
16627 links. Use SHN_XINDEX when needed.
16628 (Sized_relobj::get_symbol_location_info): Adjust section links.
16629 Don't get fooled by special symbols.
16630 * object.h (class Xindex): Define.
16631 (class Object): Add xindex_ parameter. Declare virtual functoin
16632 do_initialize_xindex.
16633 (Object::adjust_sym_shndx): New function.
16634 (Object::set_xindex): New protected function.
16635 (class Symbol_value): Add is_ordinary_shndx_ field.
16636 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
16637 (Symbol_value::value): Assert ordinary section.
16638 (Symbol_value::initialize_input_to_output_map): Likewise.
16639 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
16640 Change all callers.
16641 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
16642 all callers.
16643 (class Sized_relobj): Update declarations.
16644 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
16645 parameter. Change all callers.
16646 (Sized_relobj::adjust_shndx): New function.
16647 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
16648 field.
16649 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
16650 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
16651 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
16652 (Sized_dynobj::read_dynsym_section): Adjust section links.
16653 (Sized_dynobj::read_dynamic): Likewise.
16654 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
16655 section links.
16656 (Sized_dynobj::do_initialize_xindex): New function.
16657 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
16658 do_initialize_xindex.
16659 (Sized_dynobj::adjust_shndx): New function.
16660 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
16661 dynsym_xindex_ fields.
16662 (Layout::finalize): Add a call to set_section_indexes before
16663 creating the symtab sections.
16664 (Layout::set_section_indexes): Don't do anything if the section
16665 already has a section index.
16666 (Layout::create_symtab_sections): Add shnum parameter. Change
16667 caller. Create .symtab_shndx section if needed.
16668 (Layout::create_shdrs): Add shstrtab_section parameter. Change
16669 caller.
16670 (Layout::allocated_output_section_count): New function.
16671 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
16672 needed.
16673 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
16674 fields. Update declarations.
16675 (Layout::symtab_xindex): New function.
16676 (Layout::dynsym_xindex): New function.
16677 (class Write_symbols_task): Add layout_ field.
16678 (Write_symbols_task::Write_symbols_task): Add layout parameter.
16679 Change caller.
16680 * output.cc (Output_section_headers::Output_section_headers): Add
16681 shstrtab_section parameter. Change all callers.
16682 (Output_section_headers::do_sized_write): Store overflow values
16683 for section count and section string table section index in
16684 section header zero.
16685 (Output_file_header::do_sized_write): Check for overflow of
16686 section count and section string table section index.
16687 (Output_symtab_xindex::do_write): New function.
16688 (Output_symtab_xindex::endian_do_write): New function.
16689 * output.h (class Output_section_headers): Add shstrtab_section_.
16690 Update declarations.
16691 (class Output_symtab_xindex): Define.
16692 (Output_section::has_out_shndx): New function.
16693 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
16694 field.
16695 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
16696 Change all callers.
16697 (Sized_symbol::init): Likewise.
16698 (Symbol::output_section): Check for ordinary symbol.
16699 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
16700 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
16701 callers.
16702 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
16703 Change all callers. Simplify handling of symbols from sections
16704 not included in the link.
16705 (Symbol_table::add_from_dynobj): Handle ordinary symbol
16706 distinction.
16707 (Weak_alias_sorter::operator()): Assert that symbols are
16708 ordinary.
16709 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
16710 distinction.
16711 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
16712 parameters. Change all callers.
16713 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
16714 symbol distinction. Use SHN_XINDEX when needed.
16715 (Symbol_table::write_section_symbol): Add symtab_xindex
16716 parameter. Change all callers.
16717 (Symbol_table::sized_write_section_symbol): Likewise. Use
16718 SHN_XINDEX when needed.
16719 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
16720 declarations.
16721 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
16722 (Symbol::is_defined): Check is_ordinary.
16723 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
16724 (Symbol::is_absolute, Symbol::is_common): Likewise.
16725 (class Sized_symbol): Update declarations.
16726 (class Symbol_table): Update declarations.
16727 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
16728 parameters. Change all callers.
16729 (Sized_symbol::override): Likewise.
16730 (Symbol_table::override): Likewise.
16731 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
16732 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
16733 is_ordinary, and orig_st_shndx parameters. Change all callers.
16734 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
16735 to be in an ordinary section.
16736 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
16737 object and is_ordinary parameters. Change all callers.
16738 (Sized_dwarf_line_info::read_relocs): Add object parameter.
16739 Change all callers. Don't add undefined or non-ordinary symbols
16740 to reloc_map_.
16741 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
16742 Change all callers.
16743 * dwarf_reader.h (class Sized_dwarf_line_info): Update
16744 declarations.
16745 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
16746 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
16747 (Sized_relobj::relocate_sections): Likewise.
16748 * target-reloc.h (scan_relocs): Adjust section symbol index.
16749 (scan_relocatable_relocs): Likewise.
16750 * i386.cc (Scan::local): Check for ordinary symbols.
16751 * sparc.cc (Scan::local): Likewise.
16752 * x86_64.cc (Scan::local): Likewise.
16753 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
16754 to symbol_section_and_value.
16755 * testsuite/many_sections_test.cc: New file.
16756 * testsuite/Makefile.am (BUILT_SOURCES): Define.
16757 (check_PROGRAMS): Add many_sections_test.
16758 (many_sections_test_SOURCES): Define.
16759 (many_sections_test_DEPENDENCIES): Define.
16760 (many_sections_test_LDFLAGS): Define.
16761 (BUILT_SOURCES): Add many_sections_define.h.
16762 (many_sections_define.h): New target.
16763 (BUILT_SOURCES): Add many_sections_check.h.
16764 (many_sections_check.h): New target.
16765 (check_PROGRAMS): Add many_sections_r_test.
16766 (many_sections_r_test_SOURCES): Define.
16767 (many_sections_r_test_DEPENDENCIES): Define.
16768 (many_sections_r_test_LDFLAGS): Define.
16769 (many_sections_r_test_LDADD): Define.
16770 (many_sections_r_test.o): New target.
16771 * testsuite/Makefile.in: Rebuild.
16772
c5818ff1
CC
167732008-04-17 Cary Coutant <ccoutant@google.com>
16774
16775 * errors.cc (Errors::info): New function.
16776 (gold_info): New function.
16777 * errors.h (Errors::info): New function.
16778 * gold.h (gold_info): New function.
16779 * object.cc (Input_objects::add_object): Print trace output.
16780 * options.cc (options::parse_set): New function.
16781 (General_options::parse_wrap): Deleted.
16782 (General_options::General_options): Deleted initializer.
16783 * options.h (options::String_set): New typedef.
16784 (options::parse_set): New function.
16785 (DEFINE_set): New macro.
16786 (General_options::wrap): Changed to use DEFINE_set. Changed
16787 callers of any_wrap_symbols and is_wrap_symbol.
16788 (General_options::trace, General_options::trace_symbol):
16789 New options.
16790 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
16791 (General_options::wrap_symbols_): Deleted.
16792 * symtab.cc (Symbol_table::add_from_object): Print trace output.
16793
b5be4a7c
DM
167942008-04-17 David S. Miller <davem@davemloft.net>
16795
16796 * options.cc (General_options::parse_V): New function.
16797 * options.h: Add entries for -V and -Qy.
16798
155a0dd7
ILT
167992008-04-17 Ian Lance Taylor <iant@google.com>
16800
16801 * common.cc (Symbol_table::allocate_commons): Remove options
16802 parameter. Change caller.
16803 (Symbol_table::do_allocate_commons): Remove options parameter.
16804 Change caller. Just call do_allocate_commons_list twice.
16805 (Symbol_table::do_allocate_commons_list): New function, broken out
16806 of do_allocate_commons.
16807 * common.h (class Allocate_commons_task): Remove options_ field.
16808 Update constructor.
16809 * symtab.cc (Symbol_table::Symbol_table): Initialize
16810 tls_commons_.
16811 (Symbol_table::add_from_object): Put TLS common symbols on
16812 tls_commons_ list.
16813 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
16814 which are IN_OUTPUT_DATA.
16815 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
16816 allocate_commons and do_allocate_commons declarations. Declare
16817 do_allocate_commons_list.
16818 * gold.cc (queue_middle_tasks): Update creation of
16819 Allocate_commons_task to not pass options.
16820 * testsuite/Makefile.am (INCLUDES): Add -I.. .
16821 (TLS_TEST_C_FLAGS): New variable.
16822 (tls_test_c_pic.o): New target.
16823 (tls_test_shared.so): Link in tls_test_c_pic.o.
16824 (tls_test_c_pic_ie.o): New target.
16825 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
16826 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
16827 (tls_test_c.o): New target.
16828 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
16829 (tls_pic_test_LDADD): Likewise.
16830 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
16831 (tls_shared_gd_to_ie_test_LDADD): Likewise.
16832 (tls_test_c_gnu2.o): New target.
16833 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
16834 tls_test_c_gnu2.o.
16835 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
16836 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
16837 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
16838 * testsuite/tls_test.cc: Include "config.h".
16839 (t_last): Call t11_last.
16840 * testsuite/tls_test.h (t11, t11_last): Declare.
16841 * testsuite/tls_test_c.c: New file.
16842 * testsuite/tls_test_main.cc (thread_routine): Call t11.
16843 * configure.ac: Check for OpenMP support.
16844 * configure, config.in, Makefile.in: Rebuild.
16845 * testsuite/Makefile.in: Rebuild.
16846
edfbb029
CC
168472008-04-16 Cary Coutant <ccoutant@google.com>
16848
16849 * i386.cc (Target_i386::define_tls_base_symbol): New function.
16850 (Target_i386::tls_base_symbol_defined_): New field.
16851 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
16852 (Target_i386::Scan::global): Likewise.
16853 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
16854 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
16855 (Target_x86_64::tls_base_symbol_defined_): New field.
16856 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
16857 (Target_x86_64::Scan::global): Likewise.
16858
f3c69fca
CC
168592008-04-16 Cary Coutant <ccoutant@google.com>
16860
16861 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
16862 (Symbol::needs_plt_entry): Allow weak undefined symbols.
16863 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
16864 building shared libraries.
16865 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
16866 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
16867 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
16868 * testsuite/Makefile.in: Rebuild.
16869 * testsuite/weak_undef.h: New file.
16870 * testsuite/weak_undef_file1.cc: Add extra test cases.
16871 * testsuite/weak_undef_file2.cc: Likewise.
16872 * testsuite/weak_undef_test.cc: Likewise.
16873
7c414435
DM
168742008-04-16 David S. Miller <davem@davemloft.net>
16875
32b769e1
DM
16876 * sparc.cc (Target_sparc::Scan): Change from struct to class.
16877 Add issued_non_pic_error_ field. Declare check_non_pic.
16878 (Target_sparc::Scan::check_non_pic): New function.
16879 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
16880 (Target_sparc::Scan::global): Likewise.
16881
11936fb1
DM
16882 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
16883 * configure: Rebuild.
16884
7c414435
DM
16885 * options.h (DEFINE_enable): New macro.
16886 (new_dtags): New enable option.
16887 (initfirst, interpose, loadfltr, nodefaultlib,
16888 nodelete, nodlopen, nodump): New -z options.
16889 * layout.cc (Layout:finish_dynamic_section): If new
16890 dtags enabled, emit DT_RUNPATH. Also, emit a
16891 DT_FLAGS_1 containing any specified -z flags.
16892
85c7bf8b
ILT
168932008-04-16 Ian Lance Taylor <iant@google.com>
16894
12c0daef
ILT
16895 * copy-relocs.cc: New file.
16896 * copy-relocs.h: New file.
16897 * reloc.cc: Remove Copy_relocs code.
16898 * reloc.h: Likewise.
16899 * reloc-types.h (struct Reloc_types) [both versions]: Add
16900 get_reloc_addend_noerror.
16901 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
16902 variants of add_global which take an addend which must be zero.
16903 * i386.cc: Include "copy-relocs.h".
16904 (class Target_i386): Change type of copy_relocs_ to variable,
16905 update initializer.
16906 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
16907 Change all callers.
16908 (Target_i386::do_finalize_sections): Change handling of
16909 copy_relocs_.
16910 * sparc.cc: Include "copy-relocs.h".
16911 (class Target_sparc): Change type of copy_relocs_ to variable,
16912 update initializer.
16913 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
16914 Change all callers.
16915 (Target_sparc::do_finalize_sections): Change handling of
16916 copy_relocs_.
16917 * x86_64.cc: Include "copy-relocs.h".
16918 (class Target_x86_64): Change type of copy_relocs_ to variable,
16919 update initializer.
16920 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
16921 class. Change all callers.
16922 (Target_x86_64::do_finalize_sections): Change handling of
16923 copy_relocs_.
16924 * Makefile.am (CCFILES): Add copy-relocs.cc.
16925 (HFILES): Add copy-relocs.h.
16926
4f4995b6
ILT
16927 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
16928
85c7bf8b
ILT
16929 * testsuite/script_test_4.sh: Permit leading zeroes.
16930
4f2a9edd
ILT
169312008-04-15 Ian Lance Taylor <iant@google.com>
16932
e6188289
ILT
16933 * script-sections.cc (Script_sections::create_segments): Use
16934 header_size_adjustment even when there is enough room for the
16935 headers.
16936 * testsuite/script_test_4.sh: New file.
16937 * testsuite/script_test_4.t: New file.
16938 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
16939 (check_DATA): Add script_test_4.stdout.
16940 (MOSTLYCLEANFILES): Likewise.
16941 (script_test_4): New target.
16942 (script_test_4.stdout): New target.
16943 * testsuite/Makefile.in: Rebuild.
16944
4f2a9edd
ILT
16945 * sparc.cc: Add definitions for Output_data_plt_sparc class
16946 constants.
16947
f5314dd5
DM
169482008-04-14 David S. Miller <davem@davemloft.net>
16949
16950 * sparc.cc: New file.
16951 * Makefile.am (TARGETSOURCES): Add sparc.cc
16952 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
16953 * configure.tgt: Document targ_extra_size and
16954 targ_extra_big_endian. Add entries for sparc-* and
16955 sparc64-*.
16956 * configure.ac: Handle targ_extra_size and
16957 targ_extra_big_endian.
16958 * Makefile.in: Rebuild.
16959 * configure: Likewise.
16960 * po/POTFILES.in: Likewise.
16961 * po/gold.pot: Likewise.
16962
154e0e9a
ILT
169632008-04-14 Ian Lance Taylor <iant@google.com>
16964
16965 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
16966 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
16967 in the name/type/flags to section mapping. Don't call
16968 allocate_output_section.
16969 (Layout::choose_output_section): Change parameter from adjust_name
16970 to is_input_section. Don't permit input sections after sections
16971 are attached to segments. Don't call allocate_output_section.
16972 (Layout::layout_eh_frame): Call update_flags_for_input_section,
16973 not write_enable_output_section.
16974 (Layout::make_output_section): Don't push to
16975 unattached_section_list_ nor call attach_to_segment. Call
16976 attach_section_to_segment if sections are attached.
16977 (Layout::attach_sections_to_segments): New function.
16978 (Layout::attach_section_to_segment): New function.
16979 (Layout::attach_allocated_section_to_segment): Rename from
16980 attach_to_segment. Remove flags parameter.
16981 (Layout::allocate_output_section): Remove function.
16982 (Layout::write_enable_output_section): Remove function.
16983 * layout.h (class Layout): Update for above changes. Add new
16984 field sections_are_attached_.
16985 * output.h (Output_section::update_flags_for_input_section): New
16986 function.
16987 * output.cc (Output_section::add_input_section): Call
16988 update_flags_for_input_section.
16989 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
16990
009a67a2
CC
169912008-04-11 Cary Coutant <ccoutant@google.com>
16992
16993 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
16994 thought unnecessary.
16995 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
16996
759b1a24
ILT
169972008-04-11 Ian Lance Taylor <iant@google.com>
16998
16999 * output.h (class Output_section_data): Remove inline definition
17000 of set_addralign.
17001 * output.cc (Output_section_data::set_addralign): New function.
17002
c2b45e22
CC
170032008-04-11 Cary Coutant <ccoutant@google.com>
17004
17005 Add support for TLS descriptors for i386 and x86_64.
17006 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
17007 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
17008 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
17009 GOT_TYPE_TLS_DESC.
17010 (Target_i386::got_mod_index_entry): Remove unnecessary code.
17011 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
17012 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
17013 relocations.
17014 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
17015 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
17016 Fix problem with initial-exec relocations.
17017 (Target_i386::Relocate::relocate_tls): Likewise.
17018 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
17019 relaxation.
17020 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
17021 support for section-plus-offset dynamic table entries.
17022 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
17023 (Output_data_dynamic::Dynamic_entry): Add support for
17024 section-plus-offset dynamic table entries.
17025 (Output_data_dynamic::Classification): Likewise.
17026 (Output_data_dynamic::classification_): Renamed offset_.
17027 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
17028 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
17029 (Target_x86_64::make_plt_section): New function.
17030 (Target_x86_64::reserve_tlsdesc_entries): New function.
17031 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
17032 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
17033 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
17034 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
17035 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
17036 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
17037 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
17038 add extra PLT entry for TLS descriptors.
17039 (Output_data_plt_x86_64::got_): New field.
17040 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
17041 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
17042 fields.
17043 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
17044 descriptors.
17045 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
17046 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
17047 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
17048 R_386_TLS_DESC_CALL relocations.
17049 (Target_x86_64::Scan::global): Likewise.
17050 (Target_x86_64::do_finalize_sections): Add dynamic table entries
17051 for TLS descriptors.
17052 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
17053 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
17054 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
17055 GD-to-IE relaxation.
17056 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
17057 and TLS_DESCRIPTORS.
17058 * Makefile.in: Rebuild.
17059 * configure: Rebuild.
17060 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
17061 (tls_test_shared2.so): New target.
17062 (tls_shared_gd_to_ie_test_SOURCES): New variable.
17063 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
17064 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
17065 (tls_shared_gd_to_ie_test_LDADD): New variable.
17066 (tls_shared_gnu2_gd_to_ie_test): New target.
17067 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
17068 New targets.
17069 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
17070 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
17071 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
17072 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
17073 (tls_shared_gnu2_test): New target.
17074 (tls_test_gnu2_shared.so): New target.
17075 (tls_shared_gnu2_test_SOURCES): New variable.
17076 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
17077 (tls_shared_gnu2_test_LDFLAGS): New variable.
17078 (tls_shared_gnu2_test_LDADD): New variable.
17079 * testsuite/Makefile.in: Rebuild.
17080 * testsuite/Makefile.
17081
83bfb6b7
ILT
170822008-04-11 Ian Lance Taylor <iant@google.com>
17083
17084 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
17085 justsyms.t.
17086 * testsuite/Makefile.in: Rebuild.
17087
17088 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
17089 long.
17090 * testsuite/script_test_2.cc (main): Adjust test.
17091
706e1f5e
ILT
170922008-04-11 David S. Miller <davem@davemloft.net>
17093 Ian Lance Taylor <iant@google.com>
17094
17095 * options.h (General_options): Add entries for '-Y' and
17096 '-relax'.
17097 * options.cc (General_options:finalize): If -Y was used, add those
17098 entries to the library path instead of the default "/lib" and
17099 "/usr/lib".
17100
7c98e6bb
DM
171012008-04-11 David S. Miller <davem@davemloft.net>
17102
17103 * testsuite/justsyms.t: Start at 0x100.
17104 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
17105 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
17106 long.
17107 * testsuite/script_test_2.cc: Adjust string and section length
17108 checks.
7c98e6bb 17109
99a37bfd
ILT
171102008-04-09 Ian Lance Taylor <iant@google.com>
17111
2cefc357
ILT
17112 PR gold/5996
17113 * script-sections.cc (Sections_element::allocate_to_segment): Add
17114 orphan parameter.
17115 (Output_section_definition::allocate_to_segment): Likewise.
17116 (Orphan_output_section::allocate_to_segment): Likewise.
17117 (Script_sections::attach_sections_using_phdrs_clause): Don't
17118 propagate non-PT_LOAD segments to orphan sections.
17119 * testsuite/Makefile.am (script_test_3.stdout): Generate using
17120 readelf rather than objdump.
17121 * testsuite/script_test_3.sh: Adjust accordingly. Test that
17122 .interp section and PT_INTERP segment are the same size.
17123 * testsuite/Makefile.in: Rebuild.
17124
99a37bfd
ILT
17125 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
17126 aliases for symbols defined in the same object.
17127 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
17128 (weak_alias_test_SOURCES): New variable.
17129 (weak_alias_test_DEPENDENCIES): New variable.
17130 (weak_alias_test_LDFLAGS): New variable.
17131 (weak_alias_test_LDADD): New variable.
17132 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
17133 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
17134 (weak_alias_test_3.o): New target.
17135 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
17136 * testsuite/weak_alias_test_main.cc: New file.
17137 * testsuite/weak_alias_test_1.cc: New file.
17138 * testsuite/weak_alias_test_2.cc: New file.
17139 * testsuite/weak_alias_test_3.cc: New file.
17140
780e49c5
ILT
171412008-04-08 Ian Lance Taylor <iant@google.com>
17142
cdb0b8f5
ILT
17143 * options.h (class General_options): Add --noinhibit-exec option.
17144 * main.cc (main): Check --noinhibit-exec.
17145
0864d551
ILT
17146 * options.h (class General_options): Define --wrap as a special
17147 option. Add wrap_symbols_ field.
17148 (General_options::any_wrap_symbols): New function.
17149 (General_options::is_wrap_symbol): New function.
17150 * options.cc (General_options::parse_wrap): New function.
17151 (General_options::General_options): Initialize wrap_symbols_.
17152 * symtab.cc (Symbol_table::wrap_symbol): New function.
17153 (Symbol_table::add_from_object): Handle --wrap.
17154 * symtab.h (class Symbol_table): Declare wrap_symbol.
17155 * target.h (Target::wrap_char): New function.
17156 (Target::Target_info): Add wrap_char field.
17157 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
17158 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
17159 * testsuite/testfile.cc (Target_test::test_target_info):
17160 Likewise.
17161
789aa6de
ILT
17162 * errors.cc (Errors::undefined_symbol): Mention symbol version if
17163 there is one.
17164
2c38906f
ILT
17165 * layout.h (class Layout): Add added_eh_frame_data_ field.
17166 * layout.cc (Layout::Layout): Initialize new field.
17167 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
17168 output section until we find a section we merged successfully.
17169 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
17170 that the size be non-zero.
17171
780e49c5
ILT
17172 * merge.cc (Object_merge_map::get_output_offset): Remove inline
17173 qualifier.
17174
7fcd0256
ILT
171752008-04-08 Craig Silverstein <csilvers@google.com>
17176
17177 * configure.ac: Export new conditional variable HAVE_ZLIB.
17178 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
17179 on HAVE_ZLIB.
17180 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
17181 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17182
6835af53
ILT
171832008-04-07 Ian Lance Taylor <iant@google.com>
17184
e24f324c
ILT
17185 * version.cc (version_string): Set to "1.5".
17186
a036edd8
ILT
17187 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
17188 Add issued_non_pic_error_ field. Declare check_non_pic.
17189 (Target_x86_64::Scan::check_non_pic): New function.
17190 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
17191 (Target_x86_64::Scan::global): Likewise.
17192
624f8810
ILT
17193 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
17194 addend parameter. Change caller. Handle merge sections.
17195 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
17196 Address to Addend. Don't add in the result of
17197 local_section_offset, pass down the addend and use the returned
17198 value.
17199 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
17200 Update declarations of local_section_offset and symbol_value.
17201 * testsuite/two_file_test_1.cc (t18): New function.
17202 * testsuite/two_file_test_2.cc (f18): New function.
17203 * testsuite/two_file_test_main.cc (main): Call t18.
17204 * testsuite/two_file_test.h (t18, f18): Declare.
17205
6835af53
ILT
17206 * configure.ac: Don't test for objdump, c++filt, or readelf.
17207 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
17208 conditionals.
17209 (TEST_READELF): New variable.
17210 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
17211 (check_PROGRAMS): Add two_file_strip_test.
17212 (two_file_strip_test): New target.
17213 (check_PROGRAMS): Add two_file_same_shared_strip_test.
17214 (two_file_same_shared_strip_test_SOURCES): New variable.
17215 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
17216 (two_file_same_shared_strip_test_LDFLAGS): New variable.
17217 (two_file_same_shared_strip_test_LDADD): New variable.
17218 (two_file_shared_strip.so): New target.
17219 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
17220 (ver_test_5.syms, ver_test_7.syms): Likewise.
17221 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
17222 (strip_test_3.stdout): Use TEST_OBJDUMP.
17223 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17224
86925eef
CC
172252008-04-04 Cary Coutant <ccoutant@google.com>
17226
17227 * symtab.h (Symbol::is_weak_undefined): New function.
17228 (Symbol::is_strong_undefined): New function.
17229 (Symbol::is_absolute): New function.
17230 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
17231 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
17232 absolute symbols.
17233 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
17234 (weak_undef_test): New target.
17235 * testsuite/Makefile.in: Rebuild.
17236 * testsuite/weak_undef_file1.cc: New file.
17237 * testsuite/weak_undef_file2.cc: New file.
17238 * testsuite/weak_undef_test.cc: New file.
17239
126f3ece
ILT
172402008-04-03 Craig Silverstein <csilvers@google.com>
17241
17242 * compressed_output.h (class Output_compressed_section): Use
17243 unsigned buffer.
17244 * compressed_output.cc (zlib_compress): Use unsigned buffers,
17245 add zlib header.
17246 (zlib_compressed_suffix): Removed.
17247 (Output_compressed_section::set_final_data_size): Use unsigned
17248 buffers.
17249 * testsuite/Makefile.am (flagstest_compress_debug_sections):
17250 Fix linker invocation.
17251 (flagstest_o_specialfile_and_compress_debug_sections):
17252 Likewise.
17253 * testsuite/Makefile.in: Regenerated.
17254
deae2a14
DM
172552008-04-02 David S. Miller <davem@davemloft.net>
17256
17257 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
17258 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
17259
70752818
ILT
172602008-04-02 Craig Silverstein <csilvers@google.com>
17261
17262 * TODO: New file.
17263
39d0cb0e
ILT
172642008-04-02 Ian Lance Taylor <iant@google.com>
17265
17266 * fileread.cc (File_read::find_view): Add byteshift and vshifted
17267 parameters. Update for new key type to views_. Change all
17268 callers.
17269 (File_read::read): Adjust for byteshift in returned view.
17270 (File_read::add_view): New function, broken out of
17271 find_and_make_view.
17272 (File_read::make_view): New function, broken out of
17273 find_and_make_view.
17274 (File_read::find_or_make_view): Add offset and aligned
17275 parameters. Rewrite accordingly. Change all callers.
17276 (File_read::get_view): Add offset and aligned parameters. Adjust
17277 for byteshift in return value.
17278 (File_read::get_lasting_view): Likewise.
17279 * fileread.h (class File_read): Update declarations.
17280 (class File_read::View): Add byteshift_ field. Add byteshift to
17281 constructor. Add byteshift method.
17282 * archive.h (Archive::clear_uncached_views): New function.
17283 (Archive::get_view): Add aligned parameter. Change all callers.
17284 * object.h (Object::get_view): Add aligned parameter. Change all
17285 callers.
17286 (Object::get_lasting_view): Likewise.
17287
17288 * fileread.cc (File_read::release): Don't call clear_views if
17289 there are multiple objects.
17290 * fileread.h (File_read::clear_uncached_views): New function.
17291 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
17292 on the archive.
17293
a1207466
CC
172942008-03-31 Cary Coutant <ccoutant@google.com>
17295
17296 Add thin archive support.
17297 * archive.cc (Archive::armagt): New const.
17298 (Archive::setup): Remove task parameter and calls to unlock.
17299 (Archive::unlock_nested_archives): New function.
17300 (Archive::read_header): Add nested_off parameter. Change
17301 all callers.
17302 (Archive::interpret_header): Likewise.
17303 (Archive::include_all_members): Change to handle thin
17304 archives.
17305 (Archive::include_member): Likewise.
17306 * archive.h (Archive::Archive): Add new parameters and
17307 initializers.
17308 (Archive::armagt): New const.
17309 (Archive::setup): Remove task parameter.
17310 (Archive::unlock_nested_archives): New function.
17311 (Archive::read_header): Add nested_off parameter.
17312 (Archive::interpret_header): Likewise.
17313 (Archive::Nested_archive_table): New typedef.
17314 (Archive::is_thin_archive_): New field.
17315 (Archive::nested_archives_): New field.
17316 (Archive::options_): New field.
17317 (Archive::dirpath_): New field.
17318 (Archive::task_): New field.
17319 * readsyms.cc (Read_symbols::do_read_symbols): Add check
17320 for thin archives. Pass additional parameters to
17321 Archive::Archive. Unlock the archive file after calling
17322 Archive::setup.
cd536b21 17323
479f6503
ILT
173242008-03-29 Ian Lance Taylor <iant@google.com>
17325
686c8caf
ILT
17326 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
17327 version symbol to be local.
17328 * testsuite/ver_test_4.sh: New file.
17329 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
17330 (check_DATA): Add ver_test_4.syms.
17331 (ver_test_4.syms): New target.
17332 * testsuite/Makefile.in: Rebuild.
17333
ab794b6b
ILT
17334 * output.cc
17335 (Output_section::Input_section_sort_entry::has_priority): New
17336 function.
17337 (Output_section::Input_section_sort_entry::match_file_name): New
17338 function.
17339 (Output_section::Input_section_sort_entry::match_section_name):
17340 Remove.
17341 (Output_section::Input_section_sort_entry::match_section_name_prefix):
17342 Remove.
17343 (Output_section::Input_section_sort_entry::match_section_file):
17344 Remove.
17345 (Output_section::Input_section_sort_compare::operator()): Rewrite
17346 using new Input_section_sort_entry functions. Sort crtbegin and
17347 crtend first. Sort sections with no priority before sections with
17348 a priority.
17349 * testsuite/initpri1.c (d3): Check j != 4.
17350 (cd5): New constructor/destructor function.
17351 (main): Check j != 2.
17352
479f6503
ILT
17353 * symtab.cc (Symbol_table::add_from_object): If we don't use the
17354 new symbol when resolving, don't call set_is_default.
17355 * testsuite/ver_test_7.cc: New file.
17356 * testsuite/ver_test_7.sh: New file.
17357 * testsuite/Makefile.am (ver_test_7.so): New target.
17358 (ver_test_7.o): New target.
17359 (check_SCRIPTS): Add ver_test_7.sh.
17360 (check_DATA): Add ver_test_7.syms.
17361 (ver_test_7.syms): New target.
17362
2fd32231
ILT
173632008-03-28 Ian Lance Taylor <iant@google.com>
17364
17365 * layout.cc (Layout::layout): If we see an input section with a
17366 name that needs sorting, set the must_sort flag for the output
17367 section.
17368 (Layout::make_output_section): If the name of the output section
17369 indicates that it might require sorting, set the may_sort flag.
17370 * output.h (Output_section::may_sort_attached_input_sections): New
17371 function.
17372 (Output_section::set_may_sort_attached_input_sections): New
17373 function.
17374 (Output_section::must_sort_attached_input_sections): New
17375 function.
17376 (Output_section::set_must_sort_attached_input_sections): New
17377 function.
17378 (class Output_section): Declare Input_section_sort_entry. Define
17379 Input_section_sort_compare. Declare
17380 sort_attached_input_sections. Add new fields:
17381 may_sort_attached_input_sections_,
17382 must_sort_attached_input_sections_,
17383 attached_input_sections_are_sorted_.
17384 * output.cc (Output_section::Output_section): Initialize new
17385 fields.
17386 (Output_section::add_input_section): Add an entry to
17387 input_sections_ if may_sort or must_sort are true.
17388 (Output_section::set_final_data_size): Call
17389 sort_attached_input_sections if necessary.
17390 (Output_section::Input_section_sort_entry): Define new class.
17391 (Output_section::Input_section_sort_compare::operator()): New
17392 function.
17393 (Output_section::sort_attached_input_sections): New function.
17394 * configure.ac: Check whether the compiler supports constructor
17395 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
17396 * testsuite/initpri1.c: New file.
17397 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
17398 CONSTRUCTOR_PRIORITY.
17399 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
17400 (initpri1_LDFLAGS): New variable.
17401 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17402
18e6b24e
ILT
174032008-03-27 Ian Lance Taylor <iant@google.com>
17404
49bdd526
ILT
17405 * common.cc (Sort_commons::operator): Correct sorting algorithm.
17406 * testsuite/common_test_1.c: New file.
17407 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
17408 (common_test_1_SOURCES): New variable.
17409 (common_test_1_DEPENDENCIES): New variable.
17410 (common_test_1_LDFLAGS): New variable.
17411
18e6b24e
ILT
17412 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
17413 and commons_ correctly when NAME/VERSION does not override
17414 NAME/NULL.
17415 * testsuite/ver_test_6.c: New file.
17416 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
17417 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
17418 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
17419
04bf7072
ILT
174202008-03-26 Ian Lance Taylor <iant@google.com>
17421
5871526f
ILT
17422 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
17423 of an undefined symbol from a version script.
17424 * testsuite/Makefile.am (ver_test_5.so): New target.
17425 (ver_test_5.o): New target.
17426 (check_SCRIPTS): Add ver_test_5.sh.
17427 (check_DATA): Add ver_test_5.syms.
17428 (ver_test_5.syms): New target.
17429 * testsuite/ver_test_5.cc: New file.
17430 * testsuite/ver_test_5.script: New file.
17431 * testsuite/ver_test_5.sh: New file.
17432 * Makefile.in, testsuite/Makefile.in: Rebuild.
17433
04bf7072
ILT
17434 PR gold/5986
17435 Fix problems building gold with gcc 4.3.0.
17436 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
17437 (gold_error_at_location, gold_warning_at_location): Use it.
17438 * configure.ac: Check whether we can compile and use a template
17439 function with a printf attribute.
17440 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
17441 when jumping over bytes.
17442 * object.cc: Instantiate Object::read_section_data.
17443 * debug.h: Include <cstring>
17444 * dwarf_reader.cc: Include <algorithm>
17445 * main.cc: Include <cstring>.
17446 * options.cc: Include <cstring>.
17447 * output.cc: Include <cstring>.
17448 * script.cc: Include <cstring>.
17449 * script.h: Include <string>.
17450 * symtab.cc: Include <cstring> and <algorithm>.
17451 * target-select.cc: Include <cstring>.
17452 * version.cc: Include <string>.
17453 * testsuite/testmain.cc: Include <cstdlib>.
17454 * configure, config.in: Rebuild.
17455
874c5b28
ILT
174562008-03-25 Ian Lance Taylor <iant@google.com>
17457
819d6c3a
ILT
17458 * options.cc: Include "../bfd/bfdver.h".
17459 (options::help): Print bug reporting address.
17460
f4b2c6f5
ILT
17461 * version.cc (print_version): Adjust output for current value of
17462 BFD_VERSION_STRING.
17463
17464 * NEWS: New file.
17465
e96caa79
ILT
17466 * options.cc (options::help): Print list of supported targets.
17467 * target-select.h: Include <vector>.
17468 (class Target_selector): Make machine_, size_, and is_big_endian_
17469 fields const. Add bfd_name_ and instantiated_target_ fields.
17470 (Target_selector::Target_selector): Add bfd_name parameter.
17471 (Target_selector::recognize): Make non-virtual, call
17472 do_recognize.
17473 (Target_selector::recognize_by_name): Make non-virtual, call
17474 do_recognize_by_name.
17475 (Target_selector::supported_names): New function.
17476 (Target_selector::bfd_name): New function.
17477 (Target_selector::do_instantiate_target): New pure virtual
17478 function.
17479 (Target_selector::do_recognize): New virtual function.
17480 (Target_selector::do_recognize_by_name): New virtual function.
17481 (Target_selector::instantiate_target): New private function.
17482 (supported_target_names): Declare.
17483 * target-select.cc (Target_selector::Target_selector): Update for
17484 new parameter and fields.
17485 (select_target_by_name): Check that the name matches before
17486 calling recognize_by_name.
17487 (supported_target_names): New function.
17488 * i386.cc (class Target_selector_i386): Update Target_selector
17489 constructor call. Remove recognize and recognize_by_name. Add
17490 do_instantiate_target.
17491 * x86_64.cc (class Target_selector_x86_64): Likewise.
17492 * testsuite/testfile.cc (class Target_selector_test): Update for
17493 changes to Target_selector.
17494
874c5b28
ILT
17495 * README: Rewrite, with some notes on unsupported features.
17496
0a65a3a7
CC
174972008-03-24 Cary Coutant <ccoutant@google.com>
17498
17499 * i386.cc (Target_i386::Got_type): New enum declaration.
17500 (Target_i386::Scan::local): Updated callers of Output_data_got
17501 member functions.
17502 (Target_i386::Scan::global): Likewise.
17503 (Target_i386::Relocate::relocate): Likewise.
17504 (Target_i386::Relocate::relocate_tls): Likewise.
17505 * object.h (Got_offset_list): New class.
17506 (Sized_relobj::local_has_got_offset): Added got_type parameter.
17507 (Sized_relobj::local_got_offset): Likewise.
17508 (Sized_relobj::set_local_got_offset): Likewise.
17509 (Sized_relobj::local_has_tls_got_offset): Removed.
17510 (Sized_relobj::local_tls_got_offset): Removed.
17511 (Sized_relobj::set_local_tls_got_offset): Removed.
17512 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
17513 * output.cc (Output_data_got::add_global): Added got_type parameter.
17514 (Output_data_got::add_global_with_rel): Likewise.
17515 (Output_data_got::add_global_with_rela): Likewise.
17516 (Output_data_got::add_global_pair_with_rel): New function.
17517 (Output_data_got::add_global_pair_with_rela): New function.
17518 (Output_data_got::add_local): Added got_type parameter.
17519 (Output_data_got::add_local_with_rel): Likewise.
17520 (Output_data_got::add_local_with_rela): Likewise.
17521 (Output_data_got::add_local_pair_with_rel): New function.
17522 (Output_data_got::add_local_pair_with_rela): New function.
17523 (Output_data_got::add_global_tls): Removed.
17524 (Output_data_got::add_global_tls_with_rel): Removed.
17525 (Output_data_got::add_global_tls_with_rela): Removed.
17526 (Output_data_got::add_local_tls): Removed.
17527 (Output_data_got::add_local_tls_with_rel): Removed.
17528 (Output_data_got::add_local_tls_with_rela): Removed.
17529 * output.h (Output_data_got::add_global): Added got_type parameter.
17530 (Output_data_got::add_global_with_rel): Likewise.
17531 (Output_data_got::add_global_with_rela): Likewise.
17532 (Output_data_got::add_global_pair_with_rel): New function.
17533 (Output_data_got::add_global_pair_with_rela): New function.
17534 (Output_data_got::add_local): Added got_type parameter.
17535 (Output_data_got::add_local_with_rel): Likewise.
17536 (Output_data_got::add_local_with_rela): Likewise.
17537 (Output_data_got::add_local_pair_with_rel): New function.
17538 (Output_data_got::add_local_pair_with_rela): New function.
17539 (Output_data_got::add_global_tls): Removed.
17540 (Output_data_got::add_global_tls_with_rel): Removed.
17541 (Output_data_got::add_global_tls_with_rela): Removed.
17542 (Output_data_got::add_local_tls): Removed.
17543 (Output_data_got::add_local_tls_with_rel): Removed.
17544 (Output_data_got::add_local_tls_with_rela): Removed.
17545 * resolve.cc (Symbol::override_base_with_special): Removed
17546 reference to has_got_offset_ field.
17547 * symtab.cc (Symbol::init_fields): Replaced initialization
17548 of got_offset_ with got_offsets_. Removed initialization
17549 of has_got_offset_
53fcba31 17550 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
17551 (Symbol::got_offset): Likewise.
17552 (Symbol::set_got_offset): Likewise.
17553 (Symbol::has_tls_got_offset): Removed.
17554 (Symbol::tls_got_offset): Removed.
17555 (Symbol::set_tls_got_offset): Removed.
17556 (Symbol::got_offset_): Removed.
17557 (Symbol::tls_mod_got_offset_): Removed.
17558 (Symbol::tls_pair_got_offset_): Removed.
17559 (Symbol::got_offsets_): New field.
17560 (Symbol::has_got_offset): Removed.
17561 (Symbol::has_tls_mod_got_offset): Removed.
17562 (Symbol::has_tls_pair_got_offset): Removed.
17563 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
17564 (Target_x86_64::Scan::local): Updated callers of Output_data_got
17565 member functions.
17566 (Target_x86_64::Scan::global): Likewise.
17567 (Target_x86_64::Relocate::relocate): Likewise.
17568 (Target_x86_64::Relocate::relocate_tls): Likewise.
17569
bd52eafb
BE
175702008-03-25 Ben Elliston <bje@au.ibm.com>
17571
17572 * yyscript.y: Fix spelling error in comment.
17573
8b105e34
ILT
175742008-03-24 Ian Lance Taylor <iant@google.com>
17575
8ed814a9
ILT
17576 * options.h (class General_options): Define build_id option.
17577 * layout.h (class Layout): Declare write_build_id, create_note,
17578 create_build_id. Add build_id_note_ member.
17579 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
17580 "libiberty.h", "md5.h", "sha1.h".
17581 (Layout::Layout): Initialize eh_frame_data_,
17582 eh_frame_hdr_section_, and build_id_note_.
17583 (Layout::finalize): Call create_build_id.
17584 (Layout::create_note): New function, broken out of
17585 Layout::create_gold_note.
17586 (Layout::create_gold_note): Call create_note.
17587 (Layout::create_build_id): New function.
17588 (Layout::write_build_id): New function.
17589 (Close_task_runner::run): Call write_build_id.
17590
8b105e34
ILT
17591 * x86_64.cc: Correct license to GPLv3.
17592
086a1841
ILT
175932008-03-23 Ian Lance Taylor <iant@google.com>
17594
17595 * options.cc: Include "demangle.h".
17596 (parse_optional_string): New function.
17597 (parse_long_option): Handle takes_optional_argument.
17598 (parse_short_option): Update dash_z initializer. Handle
17599 takes_optional_argument.
17600 (General_options::General_options): Initialize do_demangle_.
17601 (General_options::finalize): Set do_demangle_. Handle demangling
17602 style.
17603 * options.h (parse_optional_string): Declare.
17604 (struct One_option): Add optional_arg field. Update constructor.
17605 Update call constructor calls. Add takes_optional_argument
17606 function.
17607 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
17608 (DEFINE_optional_string): Define.
17609 (General_options::demangle): Change from DEFINE_bool to
17610 DEFINE_optional_string.
17611 (General_options::no_demangle): New function.
17612 (General_options::do_demangle): New function.
17613 (General_options::set_do_demangle): New function.
17614 (General_options::execstack_status_): Move definition to end of
17615 class definition.
17616 (General_options::static_): Likewise.
17617 (General_options::do_demangle_): New field.
17618 * object.cc (big_endian>::get_symbol_location_info): Call
17619 Options::do_demangle, not Options::demangle.
17620 * symtab.cc (demangle): Likewise.
17621
cbb93e63
ILT
176222008-03-22 Ian Lance Taylor <iant@google.com>
17623
17624 * gold.h: Include <cstddef> and <sys/types.h>
17625 * options.h: Include <cstring>.
17626
ec531623
ILT
176272008-03-21 Ian Lance Taylor <iant@google.com>
17628
17629 * Added source code to GNU binutils.
752937aa 17630\f
b90efa5b 17631Copyright (C) 2008-2015 Free Software Foundation, Inc.
752937aa
NC
17632
17633Copying and distribution of this file, with or without modification,
17634are permitted in any medium without royalty provided the copyright
17635notice and this notice are preserved.
17636
17637Local Variables:
17638mode: change-log
17639left-margin: 8
17640fill-column: 74
17641version-control: never
17642End:
This page took 1.259705 seconds and 4 git commands to generate.