Fix regression introduced by fix for PR 18703.
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
3ac0a36c
CC
12015-08-25 Cary Coutant <ccoutant@gmail.com>
2
3 PR gold/18866
4 PR gold/18703
5 * symtab.cc (Symbol_table): Reorder conditions to avoid internal error.
6
9215b98b
AM
72015-08-20 Alan Modra <amodra@gmail.com>
8
9 PR gold/18846
10 * target-reloc.h (relocate_relocs <RELOC_ADJUST_FOR_SECTION_RELA>):
11 Subtract os->address() from addend.
12 * powerpc.cc (relocate_relocs): Likewise.
13
40fc1451
SD
142015-08-12 Simon Dardis <simon.dardis@imgtec.com>
15
16 * mips.cc (plt0_entry_o32, plt0_entry_n32, plt0_entry_n64,
17 lazy_stub_normal_1, lazy_stub_normal_1_n64,
18 lazy_stub_normal_2, lazy_stub_normal_2_n64, lazy_stub_big,
19 lazy_stub_big_n64, lazy_stub_micromips32_normal_1_n64,
20 lazy_stub_micromips32_normal_2_n64, lazy_stub_micromips32_big,
21 lazy_stub_micromips32_big_n64): Update to use 'or' for move instead
22 of 'addu/daddu'.
23
37a42ee9
L
242015-07-27 H.J. Lu <hongjiu.lu@intel.com>
25
26 * configure: Regenerated.
27
ab3b14b0
DK
282015-07-26 Doug Kwan <dougkwan@google.com>
29
30 * testsuite/arm_unaligned_reloc.{s,sh}: Make test less sensitive to
31 disassembler output format.
32
cdb06167
HS
332015-07-23 Ian Coolidge <icoolidge@google.com>
34 Plumb --pic-veneer option for gold.
35
36 * arm.cc (Reloc_stub::stub_type_for_reloc): Plumb to stub
37 generation.
38 * options.h (General_options): Add --pic-veneer option.
39
5b2af7dd
L
402015-07-22 H.J. Lu <hongjiu.lu@intel.com>
41
42 PR gold/18663
43 * testsuite/Makefile.am (script_test_1_SOURCES): Set to
44 script_test_1a.cc script_test_1b.cc.
45 (script_test_11_r.o): Replace script_test_11.o with
46 script_test_11a.o script_test_11b.o.
47 (script_test_11.o): Removed.
48 (script_test_11a.o): New.
49 (script_test_11b.o): Likewise.
50 * testsuite/Makefile.in: Regenerated.
51 * testsuite/script_test_1.h: New file.
52 * testsuite/script_test_1b.cc: Likewise.
53 * testsuite/script_test_11.h: Likewise.
54 * testsuite/script_test_11b.c: Likewise.
55 * testsuite/script_test_1.cc: Renamed to ...
56 * testsuite/script_test_1a.cc: This.
57 Include "script_test_1.h".
58 (main): Call check_int and check_ptr.
59 * testsuite/script_test_11.c: Renamed to ...
60 * testsuite/script_test_11a.c: This.
61 Include "script_test_11.h".
62 (main): Call ptr_equal.
63
cd78ea77
L
642015-07-22 H.J. Lu <hongjiu.lu@intel.com>
65
66 PR gold/18628
67 * testsuite/ifuncdep2.c (global): Change protected to hidden.
68 * testsuite/ifuncmod1.c (global): Likewise.
69 * testsuite/ifuncmod5.c (global): Likewise.
70
f945ba50
AM
712015-07-22 Alan Modra <amodra@gmail.com>
72
73 * aarch64.cc (try_fix_erratum_843419_optimized): Warning fix.
74
5417c94d
CC
752015-07-21 Cary Coutant <ccoutant@gmail.com>
76
77 PR gold/18548
78 * symtab.cc (Symbol_table::do_define_in_output_data): Check for
79 forced local symbol even when oldsym != NULL.
80 (Symbol_table::do_define_in_output_segment): Likewise.
81 (Symbol_table::do_define_as_constant): Likewise.
82
cb5cf5e2
CC
832015-07-21 Cary Coutant <ccoutant@gmail.com>
84
b8c6c5ef 85 PR gold/18698
cb5cf5e2
CC
86 * archive.cc (Library_base::should_include_member): Don't use entry
87 point for relocatable links, or if target is not yet valid.
88 * parameters.cc (Parameters::entry): Check target_valid().
89
0ef3814f
HS
902015-07-20 Han Shen <shenhan@google.com>
91
92 Optimize erratum 843419 fix.
93
94 * aarch64.cc (AArch64_insn_utilities::is_adr): New method.
95 (AArch64_insn_utilities::aarch64_adr_encode_imm): New method.
96 (AArch64_insn_utilities::aarch64_adrp_decode_imm): New method.
97 (E843419_stub): New sub-class of Erratum_stub.
98 (AArch64_relobj::try_fix_erratum_843419_optimized): New method.
99 (AArch64_relobj::section_needs_reloc_stub_scanning): Try optimized fix.
100 (AArch64_relobj::create_erratum_stub): Add 1 argument.
101 (Target_aarch64::scan_erratum_843419_span): Pass in adrp insn offset.
102
2bca0377
HS
1032015-07-20 Han Shen <shenhan@google.com>
104
105 Fix arm elf header flags wrt hardfp bit.
106
107 * arm.cc (Target_arm::do_adjust_elf_header): Set flags into view.
108
f54f5e31
L
1092015-07-20 H.J. Lu <hongjiu.lu@intel.com>
110
111 PR gold/18689
112 * layout.cc (Layout::layout): Clear the SHF_COMPRESSED flag bit
113 from input group section for relocatable link.
114 * testsuite/Makefile.am (check_SCRIPTS): Add pr18689.sh.
115 (check_DATA): Add pr18689.stdout.
116 (MOSTLYCLEANFILES): Add pr18689a.o pr18689b.o.
117 (pr18689.stdout): New rule.
118 (pr18689a.o): Likewise.
119 (pr18689b.o): Likewise.
120 (pr18689.o): Likewise.
121 * testsuite/pr18689.c: New file.
122 * testsuite/pr18689.sh: Likewise.
123 * testsuite/Makefile.in: Regenerated.
124
c20ceeb2
YW
1252015-07-20 Yiran Wang <yiran@google.com>
126 Cary Coutant <ccoutant@gmail.com>
127
128 PR gold/15574
129 * resolve.cc (Symbol_table): Remove warning about references
130 from shared objects to hidden symbols.
131 * testsuite/Makefile.am (hidden_test): Add hidden_test.syms.
132 * testsuite/Makefile.in: Regenerate.
133 * testsuite/hidden_test.sh: Check dynamic symbol table; update
134 expected error messages.
135
19a7fe52
L
1362015-07-14 H.J. Lu <hongjiu.lu@intel.com>
137
138 * compressed_output.cc (Output_compressed_section::set_final_data_size):
139 Make --compress-debug-sections=zlib the same as
140 --compress-debug-sections=zlib-gabi.
141 * testsuite/Makefile.am (flagstest_compress_debug_sections.check):
142 Expect ".debug_.*" with the SHF_COMPRESSED bit, instead of
143 ".zdebug_".
144 * testsuite/Makefile.in: Regenerated.
145
fb8b9dbc
L
1462015-07-12 H.J. Lu <hongjiu.lu@intel.com>
147
148 PR gold/18322
149 * compressed_output.cc (zlib_compress): Add argument for
150 compression header size. Set header size to compression header
151 size if it isn't 0. Don't write out the zlib header here.
152 (Output_compressed_section::set_final_data_size): Support
153 zlib-gnu and zlib-gabi compressions. Pass compression header
154 size to zlib_compress and write out compression header. Set
155 the SHF_COMPRESSED bit for zlib-gabi compression. Otherwise
156 clear the SHF_COMPRESSED bit
157 * options.h (compress_debug_sections): Add zlib-gnu and
158 zlib-gabi.
159 * output.h (Output_section::set_flags): New.
160 * testsuite/Makefile.am (check_PROGRAMS): Add
161 flagstest_compress_debug_sections_none,
162 flagstest_compress_debug_sections_gnu and
163 flagstest_compress_debug_sections_gabi.
164 (check_DATA): Add flagstest_compress_debug_sections_none.stdout.
165 flagstest_compress_debug_sections.stdout,
166 flagstest_compress_debug_sections.cmp,
167 flagstest_compress_debug_sections.check,
168 flagstest_compress_debug_sections_gnu.stdout,
169 flagstest_compress_debug_sections_gnu.cmp,
170 flagstest_compress_debug_sections_gnu.check,
171 flagstest_compress_debug_sections_gabi.stdout,
172 flagstest_compress_debug_sections_gabi.cmp and
173 flagstest_compress_debug_sections_gabi.check.
174 (flagstest_compress_debug_sections_none): New.
175 (flagstest_compress_debug_sections_none.stdout): Likewise.
176 (flagstest_compress_debug_sections.stdout): Likewise.
177 (flagstest_compress_debug_sections.check): Likewise.
178 (flagstest_compress_debug_sections.cmp): Likewise.
179 (flagstest_compress_debug_sections_gnu): Likewise.
180 (flagstest_compress_debug_sections_gnu.stdout): Likewise.
181 (flagstest_compress_debug_sections_gnu.check): Likewise.
182 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
183 (flagstest_compress_debug_sections_gabi): Likewise.
184 (flagstest_compress_debug_sections_gabi.stdout): Likewise.
185 (flagstest_compress_debug_sections_gnu.check): Likewise.
186 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
187 * testsuite/Makefile.in: Regenerated.
188
48058663
L
1892015-07-12 H.J. Lu <hongjiu.lu@intel.com>
190
191 PR gold/18321
192 * compressed_output.h (decompress_input_section): Add arguments
193 for ELF class, big endian and sh_flags.
194 * compressed_output.cc (decompress_input_section): Likewise.
195 Support the SHF_COMPRESSED section.
196 * dynobj.h (Dynobj): Add elfsize and is_big_endian member
197 functions.
198 * plugin.h (Pluginobj): Likewise.
199 * layout.cc (Layout::get_output_section_flags): Also clear the
200 SHF_COMPRESSED bit.
201 * object.h (Compressed_section_info): Add flag to store sh_flags.
202 (Object): Add pure virtual elfsize and is_big_endian member
203 functions.
204 * object.cc (need_decompressed_section): Don't skip the ".zdebug"
205 prefix here.
206 (build_compressed_section_map): Check SHF_COMPRESSED for
207 uncompressed size. Store sh_flags in Compressed_section_info.
208 Pass size, big_endian and sh_flags to decompress_input_section.
209 Skip the ".debug"/".zdebug" prefix when passing section name to
210 need_decompressed_section.
211 (Sized_relobj_file<size, big_endian>::do_find_special_section):
212 Don't check ".zdebug_*" sections.
213 (Object::decompressed_section_contents): Pass ELF class, big
214 endian and sh_flags to decompress_input_section.
215 * reloc.cc (Sized_relobj_file<size, big_endian>::write_sections):
216 Likewise.
217 * testsuite/Makefile.am (check_DATA): Add
218 debug_msg_cdebug_gabi.err and gdb_index_test_2_gabi.stdout.
219 (MOSTLYCLEANFILES): Add debug_msg_cdebug_gabi.err and
220 gdb_index_test_2_gabi.stdout.
221 (debug_msg_cdebug_gabi.o): New.
222 (odr_violation1_cdebug_gabi.o): Likewise.
223 (odr_violation2_cdebug_gabi.o): Likewise.
224 (debug_msg_cdebug_gabi.err): Likewise.
225 (check_SCRIPTS): Add gdb_index_test_2_gabi.sh.
226 (gdb_index_test_cdebug_gabi.o): Likewise.
227 (gdb_index_test_2_gabi): Likewise.
228 (gdb_index_test_2_gabi.stdout): Likewise.
229 * testsuite/gdb_index_test_2_gabi.sh: New file.
230 * testsuite/Makefile.in: Regenerated.
231
73854cdd
HS
2322015-07-09 Han Shen <shenhan@google.com>
233
234 Use "gold_info" instead of "gold_warning" for erratum fix.
235
236 * aarch64.cc (Target_aarch64::scan_erratum_843419_span): Use
237 'gold_info'.
238 (Target_aarch64::scan_erratum_835769_span): USe 'gold_info'.
239
61163dfa
HS
2402015-07-09 Han Shen <shenhan@google.com>
241
242 Drop missing symbol warning for arm/aarch64.
243
244 * aarch64.cc (AArch64_relobj::scan_errata): Drop missing symbol warning.
245 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Drop missing
246 symbol warning.
247
b91deca9
HS
2482015-07-07 Han Shen <shenhan@google.com>
249
250 Make gold aarch64 accept long form of mapping symbols.
251
252 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Make legal
253 of mapping symbols.
254
15162bef
DK
2552015-06-29 Doug Kwan <dougkwan@google.com>
256
257 * testsuite/arm_bl_out_of_range.s: Align stub table so that it appears
258 at address expected by test.
259 * testsuite/arm_cortex_a8_b.s: Ditto.
260 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
261 * testsuite/arm_cortex_a8_bl.s: Ditto.
262 * testsuite/arm_cortex_a8_blx.s: Ditto.
263 * testsuite/arm_cortex_a8_local.s: Ditto.
264 * testsuite/arm_fix_v4bx.s: Ditto.
265 * testsuite/arm_unaligned_reloc.s: Ditto.
266 * testsuite/thumb_bl_out_of_range.s: Ditto.
267 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
268 * testsuite/thumb_blx_out_of_range.s: Ditto.
b91deca9 269
56b06706
HS
2702015-06-29 Han Shen <shenhan@google.com>
271
272 Patch for erratum 843419 internal error.
273
72f4393d
L
274 * aarch64.cc (Erratum_stub::Insn_utilities): New typedef.
275 (Erratum_stub::update_erratum_insn): New method.
276 (Stub_table::relocate_stubs): Modified to place relocated insn.
277 (AArch64_relobj::fix_errata): Modified gold_assert.
56b06706 278
2f0c79aa
HS
2792015-06-12 Han Shen <shenhan@google.com>
280
281 Fix erratum 835769.
282
72f4393d
L
283 * aarch64.cc (AArch64_insn_utilities::BYTES_PER_INSN): Move
284 defintion outside class definition.
285 (AArch64_insn_utilities::AARCH64_ZR): New static constant.
286 (AArch64_insn_utilities::aarch64_op31): New member.
287 (AArch64_insn_utilities::aarch64_ra): New member.
288 (AArch64_insn_utilities::aarch64_mac): New member.
289 (AArch64_insn_utilities::aarch64_mlxl): New member.
290 (ST_E_835769): New global enum member.
291 (Stub_table::relocate_stubs): Add 835769 handler.
292 (Stub_template_repertoire::Stub_template_repertoire): Install new
293 stub type.
294 (AArch64_relobj::scan_errata): This func is renamed from
295 scan_erratum_843419.
296 (AArch64_relobj::do_count_local_symbols): Add 835769 handler.
297 (AArch64_relobj::do_relocate_sections): Add 835769 handler.
298 (AArch64_relobj::scan_sections_for_stubs): Add 835769 handler.
299 (Target_aarch64::scan_erratum_835769_span): New method.
300 (Target_aarch64::create_erratum_stub): New method.
301 (Target_aarch64::is_erratum_835769_sequence): New method.
302 (Target_aarch64::scan_erratum_843419_sequence): Move part of the
303 code into create_erratum_stub.
304 * options.h (fix_cortex_a53_835769): New option.
2f0c79aa 305
5d7908e0
CC
3062015-06-11 Cary Coutant <ccoutant@gmail.com>
307
308 * aarch64.cc (Erratum_stub::STUB_ADDR_ALIGN): Move initialization
309 outside class body.
310 (Reloc_stub::STUB_ADDR_ALIGN): Likewise.
311
dd68f8fa
CC
3122015-06-11 Cary Coutant <ccoutant@gmail.com>
313
314 PR gold/17731
315 * layout.cc (corresponding_uncompressed_section_name): New function.
316 (Layout::choose_output_section): Call it.
317 * layout.h (corresponding_uncompressed_section_name): New function.
318 * script-sections.cc (Input_section_info::set_section_name): Check
319 for compressed debug section (.zdebug style).
320
a3a0c391
JY
3212015-06-11 Jing Yu <jingyu@google.com>
322
323 * testsuite/Makefile.am: Add -O0 for script_test_12 test.
324 * testsuite/Makefile.in: Regenerate.
325
970cdef2
DI
3262015-06-11 Davide Italiano <dccitaliano@gmail.com>
327
328 * gold.h (is_cident): Correct typo.
329
a48d0c12
HS
3302015-06-10 Han Shen <shenhan@google.com>
331 Patch for erratum-843419 (2 of 2 - fix erratum occurrences).
332
333 Now fixing for 843419 is fully functional.
334
335 The first part of the erratum fix CL is here -
336 https://sourceware.org/ml/binutils/2015-04/msg00229.html
337
338 * aarch64.cc(global enum): New constants representing stub types.
339 (Stub_template): New POD struct.
340 (Stub_template_repertoire): New class.
341 (Stub_base): New class.
342 (Erratum_stub): New class.
343 (Reloc_stub): Refactored to be a subclass of Stub_base.
344 (Reloc_stub::Stub_type): Removed.
345 (Reloc_stub::offset): Moved to Stub_base.
346 (Reloc_stub::set_offset): Moved to Stub_base.
347 (Reloc_stub::destination_address): Moved to Stub_base.
348 (Reloc_stub::set_destination_address): Moved to Stub_base.
349 (Reloc_stub::reset_destination_address): Moved to Stub_base.
350 (Reloc_stub::stub_type): Renamed and moved to Stub_base.
351 (Reloc_stub::stub_size): Renamed and moved to Stub_base.
352 (Reloc_stub::stub_insns): Renamed and moved to Stub_base.
353 (Reloc_stub::write): Moved to Stub_base.
354 (Reloc_stub::invalid_offset): Moved to Stub_base.
355 (Reloc_stub::invalid_address): Moved to Stub_base.
356 (Reloc_stub::stub_type_): Renamed and moved to Stub_base.
357 (Reloc_stub::stub_insns_): Moved to Stub_base.
358 (Reloc_stub::offset_): Moved to Stub_base.
359 (Reloc_stub::destination_address_): Moved to Stub_base.
360 (Stub_table::The_aarch64_relobj): New typedef.
361 (Stub_table::The_erratum_stub): New typedef.
362 (Stub_table::The_erratum_stub_less): New typedef.
363 (Stub_table::The_erratum_stub_set): New typedef.
364 (Stub_table::The_erratum_stub_set_iter): New typedef.
365 (Stub_table::empty): Added emptiness testing for erratum stubs.
366 (Stub_table::add_erratum_stub): New method to add an erratum stub.
367 (Stub_table::find_erratum_stub): New method.
368 (Stub_table::find_erratum_stubs_for_input_section): New method.
369 (Stub_table::erratum_stub_address): New method.
370 (Stub_table::update_date_size_changed_p): Modified to handle erratum stubs.
371 (Stub_table::do_addralign): Modified to handle erratum stubs.
372 (Stub_table::erratum_stubs_): New member.
373 (Stub_table::erratum_stub_size_): New member.
374 (Stub_table::relocate_stubs): Modified to handle erratum stubs.
375 (Stub_table::do_write): Modified to handle erratum stubs.
376 (AArch64_relobj::The_erratum_stub): New typedef.
377 (AArch64_relobj::Erratum_stub_set_iter): New typedef.
378 (AArch64_relobj::fix_errata): New method.
379 (Target_aarch64::The_reloc_stub_type): Removed.
380 (Target_aarch64::The_erratum_stub): New typede.
381 (AArch64_relocate_functions::construct_b): New method.
382
1e1b2efc
NC
3832015-06-08 Nick Clifton <nickc@redhat.com>
384
385 * po/fr.po: New French Translation.
386
b8cf5075
CC
3872015-06-07 Cary Coutant <ccoutant@gmail.com>
388
389 PR gold/18288
390 * resolve.cc (symbol_to_bits): Remove type parameter; adjust all
391 callers. Don't use STT_COMMON to check for common symbols.
392 (Symbol_table::resolve): Warn if relocatable object has STT_COMMON
393 symbol that's not in a common section.
394 * symtab.h (Symbol::is_common): Don't use STT_COMMON to check for
395 common symbols.
396
bdd2d2b7
CC
3972015-06-04 Cary Coutant <ccoutant@gmail.com>
398
399 PR gold/18200
400 * Makefile.am (diststuff): Add target.
401 * Makefile.in: Regenerate.
402
cd3c333f
CC
4032015-06-04 Cary Coutant <ccoutant@gmail.com>
404
405 PR gold/17498
406 * object.cc (Sized_relobj_file::do_count_local_symbols): Discard
407 temporary locals in merge sections.
408 * options.cc (General_options::parse_discard_all): New method.
409 (General_options::parse_discard_locals): New method.
410 (General_options::parse_discard_none): New method.
411 (General_options::General_options): Initialize discard_locals_.
412 * options.h (--discard-all): Convert to special option.
413 (--discard-locals): Likewise.
414 (--discard-none): New option.
415 (General_options::discard_all): New method.
416 (General_options::discard_locals): New method.
417 (General_options::discard_sec_merge): New method.
418 (General_options::Discard_locals): New enum.
419 (General_options::discard_locals_): New data member.
420
8086551f
CC
4212015-06-03 Cary Coutant <cary@google.com>
422
423 * script-sections.cc (Script_sections::Script_sections): Initialize
424 segments_created_.
425 (Script_sections::create_note_and_tls_segments): Set flag when
426 segments are created.
427 (Script_sections::expected_segment_count): Count PT_INTERP.
428 (Script_sections::attach_sections_using_phdrs_clause): Set flag when
429 segments are created.
430 * script-sections.h (Script_sections::segments_created_): New data
431 member.
432
374082df
CC
4332015-06-03 Cary Coutant <ccoutant@gmail.com>
434
435 PR gold/15370
436 * script-sections.cc
437 (Output_section_element_input::set_section_addresses): When there
438 are several patterns with no sort spec, put all sections in the same
439 bin.
440 * testsuite/Makefile.am (script_test_12): New testcase.
441 (script_test_12i): New testcase.
442 * testsuite/Makefile.in: Regenerate.
443 * testsuite/script_test_12.t: New test linker script.
444 * testsuite/script_test_12i.t: New test linker script.
445 * testsuite/script_test_12a.c: New test source file.
446 * testsuite/script_test_12b.c: New test source file.
447
775ed62e
CC
4482015-06-02 Cary Coutant <ccoutant@gmail.com>
449
450 * nacl.h (Sniff_file): Switch parameters to get_view to get an
451 aligned view.
452
9c7fe3c5
CC
4532015-06-03 Cary Coutant <ccoutant@gmail.com>
454
72f4393d
L
455 PR gold/17819
456 * gold.cc (queue_final_tasks): When --build-id=tree, queue a
457 separate task to schedule the build id computation.
458 * layout.cc (Hash_task::Hash_task): Remove build_id_blocker,
459 add Output_file and offset.
460 (Hash_task::run): Get and release the input views.
461 (Hash_task::is_runnable): Always return NULL (always runnable).
462 (Layout::queue_build_id_tasks): Remove.
463 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
464 parameters; use them instead of class members.
465 (Build_id_task_runner::run): New function.
466 (Close_task_runner::run): Pass array_of_hashes and size_of_hashes
467 to write_build_id.
468 * layout.h (Layout::queue_build_id_tasks): Remove.
469 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
470 parameters.
471 (Layout::array_of_hashes_): Remove.
472 (Layout::size_of_array_of_hashes_): Remove.
473 (Layout::input_view_): Remove.
474 (Build_id_task_runner): New class.
475 (Close_task_runner::Close_task_runner): Add array_of_hashes and
476 size_of_hashes parameters.
477 (Close_task_runner::array_of_hashes_): New data member.
478 (Close_task_runner::size_of_hashes_): New data member.
479 * testsuite/Makefile.am
480 (flagstest_compress_debug_sections_and_build_id_tree): New test.
481 * testsuite/Makefile.in: Regenerate.
9c7fe3c5 482
400f8944
RÁE
4832015-06-01 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
484
485 * merge.cc (get_input_merge_map): Update for data structure change.
486 (get_or_make_input_merge_map): Update for data structure change.
487 * merge.h (Object_merge_map): Use a std::vector<std::pair>> instead of
488 a std::map. Remove first_shnum_, first_map_, second_shnum_, second_map_.
489
bbec1a5d
AM
4902015-05-16 Alan Modra <amodra@gmail.com>
491
492 * reloc.cc (Sized_relobj_file::find_functions): Use function_location.
493 * powerpc.cc (Target_powerpc::do_calls_non_split): New function.
494 (addi_12_1, addis_2_12, addis_12_1, cmpld_7_12_0): New constants.
495 (lis_0): Rename from lis_0_0.
496
efc6fa12
CC
4972015-04-29 Cary Coutant <cary@google.com>
498 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
499
500 * gc.h (Garbage_collection::is_section_garbage): Change Object*
501 to Relobj*.
502 (Garbage_collection::add_reference): Likewise.
503 (Garbage_collection::gc_process_relocs): Likewise. Don't push
504 object/shndx pair onto *secvec for dynamic objects. Don't follow
505 relocations pointing to dynamic objects for GC.
506 * icf.cc (Icf::find_identical_sections): Change Object* to Relobj*.
507 (Icf::unfold_section): Likewise.
508 (Icf::is_section_folded): Likewise.
509 (Icf::get_folded_section): Likewise.
510 * icf.h: (Icf::get_folded_section): Likewise.
511 (Icf::unfold_section): Likewise.
512 (Icf::is_section_folded): Likewise.
513 (Icf::section_has_function_pointers): Likewise.
514 (Icf::set_section_has_function_pointers): Likewise.
515 * object.h (Section_id): Likewise.
516 (Const_section_id): Likewise.
517 * output.cc (Output_section::update_section_layout): Likewise.
518 * output.h: (Output_section_lookup_maps::find_relaxed_input_section):
519 Likewise.
520 * plugin.cc (update_section_order): Likewise.
521 (unique_segment_for_sections): Likewise.
522 * powerpc.cc (Powerpc_relobj::add_reference): Likewise.
523 (Target_powerpc::do_gc_add_reference): Likewise.
524 (Target_powerpc::gc_process_relocs): Likewise.
525 (Target_powerpc::do_gc_add_reference): Likewise.
526 * symtab.cc (Symbol_table::is_section_folded): Likewise.
527 (Symbol_table::gc_mark_symbol): Likewise.
528 * symtab.h: (Symbol_table::is_section_folded): Likewise.
529 * target.h: (Sized_target::gc_add_reference): Likewise.
530 (Sized_target::do_gc_add_reference): Likewise.
531
f9d3ecaa
NC
5322015-04-29 Nick Clifton <nickc@redhat.com>
533
534 * po/fi.po: Updated Finnish translation.
535
faa2211d
AM
5362015-04-28 Alan Modra <amodra@gmail.com>
537
538 * powerpc.cc (Target_powerpc::do_dynsym_value): Use Address rather
539 than unsigned int for find_global_entry result temp. Compare
540 against invalid_address.
541 (Target_powerpc::do_plt_address_for_global): Likewise.
542 (Target_powerpc::Relocate::relocate): Likewise. Don't assert
543 on plt call stub existence for debug info. Do assert for plt
544 and global entry stub existence if an alloc section.
545
6ec65f28
AM
5462015-04-28 Alan Modra <amodra@gmail.com>
547
548 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't assert
549 on missing global entry stub due to bogus debug info.
550
7a2a1c79
HS
5512015-04-27 Han Shen <shenhan@google.com>
552
553 * options.h (--fix-cortex-a53-843419): Rename option.
554 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Use renamed
555 option.
556 (AArch64_relobj::scan_sections_for_stubs): Use renamed option.
557
cfbf0e3c
RÁE
5582015-04-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
559
560 PR gold/18327
561 * output.cc (Output_section::is_input_address_mapped): Assume a missing
562 entry is mapped.
563 * testsuite/Makefile.am: Add the eh_test test.
564 * testsuite/Makefile.in: Regenerate.
565 * testsuite/eh_test_a.cc: New test.
566 * testsuite/eh_test_b.cc: New test.
567
6ec65f28
AM
5682015-04-23 Sriraman Tallam <tmsriram@google.com>
569
a100d66f
ST
570 * options.h (--weak-unresolved-symbols): New option.
571 * symtab.cc (Symbol_table::sized_write_globals): Change symbol
572 binding to weak with new option.
573 * symtab.h (is_weak_undefined): Check for new option.
574 (is_strong_undefined): Check for new option.
575 * testsuite/Makefile.am (weak_unresolved_symbols_test): New test.
576 * testsuite/Makefile.in: Regenerate.
577 * testsuite/weak_unresolved_symbols_test.cc: New file.
578
4b889c30
IC
5792015-04-20 Ian Coolidge <icoolidge@google.com>
580
581 * symtab.cc (Symbol::should_add_dynsym_entry): Return true for
582 GNU_UNIQUE.
583
4277535c
RÁE
5842015-04-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
585
586 * gc.cc (Garbage_collection::do_transitive_closure): Use back and
587 push_back.
588 * gc.h (Garbage_collection): Use a std::vector instead of a std::queue.
589 * object.cc (Sized_relobj_file::do_layout): Use push_back.
590 * powerpc.cc (process_gc_mark): Use push_back.
591 (Target_powerpc::do_gc_mark_symbol): Use push_back.
592 * symtab.cc (Symbol_table::gc_mark_symbol): Use push_back.
593
7a2a1c79 5942015-04-16 Han Shen <shenhan@google.com>
5019d64a 595
6ec65f28
AM
596 * aarch64.cc (AArch64_insn_utilities): New utility class.
597 (AArch64_relobj::Mapping_symbol_position): New struct.
598 (AArch64_relobj::Mapping_symbol_info): New typedef.
599 (AArch64_relobj::do_count_local_symbols): New function overriding
600 parent's implementation.
601 (AArch64_relobj::mapping_symbol_info_): New member
602 (AArch64_relobj::scan_erratum_843419): New method.
603 (Target_aarch64::scan_erratum_843419_span): New method.
604 (Target_aarch64::is_erratum_843419_sequence): New method.
605 * options.h (fix_cortex_a53): New option.
5019d64a 606
a6a17750
CC
6072015-04-09 Cary Coutant <ccoutant@google.com>
608
609 * symtab.cc (Symbol::final_value_is_known): Check for TLS symbol
610 in a PIE link.
611 * testsuite/Makefile.am (tls_pie_test.sh): New test.
612 * testsuite/Makefile.in: Regenerate.
613 * testsuite/tls_pie_test.sh: New.
614
437ddf0c
CC
6152015-04-09 Cary Coutant <ccoutant@google.com>
616
617 * debug.h (DEBUG_LOCATION): New.
618 (DEBUG_ALL): Include DEBUG_LOCATION.
619 (debug_string_to_enum): Add DEBUG_LOCATION.
620 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Fix debug
621 output to print correct context.
622 (Sized_dwarf_line_info::do_addr2line): Add debug output. Return
623 up to 4 more locations at the beginning of the function.
624 * symtab.cc (Symbol_table::detect_odr_violations): Get canonical
625 result before sorting list of line numbers.
626 * testsuite/debug_msg.sh: Allow range of line numbers for
627 canonical results on optimized code.
628
24491327
HS
6292015-04-07 HC Yen <hc.yen@mediatek.com>
630
631 Add AArch32 support for gold linker.
632 gold/
633 * arm.cc: Add V8 arch combine table.
634
7fa5525f
RÁE
6352015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
636
637 * aarch64.cc (do_reloc_addend): Fix signature to match the parent one.
638
5368dcf2
RÁE
6392015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
640
641 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a call
642 to find by using the return value of insert.
643
9dbb4b02
RÁE
6442015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
645
646 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a copy
647 constructor call.
648
1fa29f10
IT
6492015-04-06 Ilya Tocar <ilya.tocar@intel.com>
650
651 PR gold/17641
652 * x86_64.cc (Target_x86_64::can_convert_mov_to_lea): New.
653 (Target_x86_64::Scan::local): Don't create GOT entry, when we
654 can convert mov to lea.
655 (Target_x86_64::Scan::global): Ditto.
656 (Target_x86_64::Relocate::relocate): Convert mov foo@GOTPCREL(%rip),
657 %reg to lea foo(%rip), %reg if possible.
658 * testsuite/Makefile.am (x86_64_mov_to_lea): New test.
659 * testsuite/x86_64_mov_to_lea1.s: New.
660 * testsuite/x86_64_mov_to_lea2.s: Ditto.
661 * testsuite/x86_64_mov_to_lea3.s: Ditto.
662 * testsuite/x86_64_mov_to_lea4.s: Ditto.
663 * testsuite/x86_64_mov_to_lea.sh: Ditto.
664
39f3de7c
L
6652015-04-02 H.J. Lu <hongjiu.lu@intel.com>
666
667 * configure: Regenerated.
668
c4fc4724
IT
6692015-04-01 Ilya Tocar <ilya.tocar@intel.com>
670
671 PR gold/17640
672 * i386.cc (Target_i386::can_convert_mov_to_lea): New.
673 (Target_i386::Scan::local): Don't create GOT entry, when we
674 can convert GOT to GOTOFF.
675 (Target_i386::Scan::global): Ditto.
676 (Target_i386::Relocate::relocate): Convert mov foo@GOT(%reg), %reg to
677 lea foo@GOTOFF(%reg), %reg if possible.
678 * testsuite/Makefile.am (i386_mov_to_lea): New test.
679 * testsuite/i386_mov_to_lea1.s: New.
680 * testsuite/i386_mov_to_lea2.s: Ditto.
681 * testsuite/i386_mov_to_lea3.s: Ditto.
682 * testsuite/i386_mov_to_lea4.s: Ditto.
683 * testsuite/i386_mov_to_lea5.s: Ditto.
684 * testsuite/i386_mov_to_lea.sh: Ditto.
685
918357b9
L
6862015-04-01 H.J. Lu <hongjiu.lu@intel.com>
687
688 * Makefile.am (ZLIB): New.
689 (ZLIBINC): Likewise.
690 (AM_CFLAGS): Add $(ZLIBINC).
691 (AM_CXXFLAGS): Likewise.
692 (ldadd_varldadd_var): Add $(ZLIB).
693 (incremental_dump_LDADD): Likewise.
694 (dwp_LDADD): Likewise.
695 * compressed_output.cc: Don't check HAVE_ZLIB_H to include
696 <zlib.h>.
697 (zlib_compress): Don't check HAVE_ZLIB_H.
698 (zlib_decompress): Likewise.
699 * options.h (compress_debug_sections): Likewise.
700 * configure.ac (AM_CONDITIONAL): Removed.
701 * testsuite/Makefile.am (ZLIB): New.
702 (LDADD): Add $(ZLIB).
703 Don't check HAVE_ZLIB.
704 * Makefile.in: Regenerated.
705 * config.in: Likewise.
706 * configure: Likewise.
707 * testsuite/Makefile.in: Likewise.
708
6b0ad2eb
JY
7092015-03-30 Jing Yu <jingyu@google.com>
710
711 * aarch64-reloc.def: New TLSLD_ADD_DTPREL_HI12,
712 TLSLD_ADD_DTPREL_LO12_NC.
713 * aarch64.cc (Target_aarch64::define_tls_base_symbol): Always let
714 _TLS_MODULE_BASE_ point to the start of tls segment.
715 (Target_aarch64::optimize_tls_reloc): Add cases for
716 R_AARCH64_TLSLD_ADD_DTPREL_HI12 and
717 R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
718 (Target_aarch64::Scan::local): Likewise.
719 (Target_aarch64::Scan::global): Likewise.
720 (Target_aarch64::Relocate::relocate): Likewise.
721 (Target_aarch64::Relocate::relocate_tls): Likewise. And remove
722 subtracting tls segment size from symbol value for TLSLD_*_DTPREL
723 relocations.
724
0916f9e7
RÁE
7252015-03-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
726
727 * merge.cc (Object_merge_map::add_mapping): call
728 Object_merge_map::Input_merge_map::add_mapping.
729 (Object_merge_map::Input_merge_map::add_mapping): New.
730 (Output_merge_data::do_add_input_section): Call
731 get_or_make_input_merge_map before a loop.
732 (Output_merge_string<Char_type>::finalize_merged_data): Call
733 get_or_make_input_merge_map before a loop.
734 * merge.h (Object_merge_map): Make Input_merge_map public.
735 * object.cc (Relobj::add_merge_mapping): Use get_or_create_merge_map.
736 (Relobj::get_or_create_merge_map): New.
737 * object.h (Relobj::get_or_create_merge_map): New.
738
282c9750
AM
7392015-03-24 Alan Modra <amodra@gmail.com>
740
741 PR 18147
742 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't report
743 relocation errors for branches to strong undefined symbols.
744
67f95b96
RÁE
7452015-03-23 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
746
747 * merge.cc (Object_merge_map::get_input_merge_map): Make it const.
748 (Object_merge_map::is_merge_section_for): Remove.
749 (Object_merge_map::find_merge_section): New.
750 * merge.h (Object_merge_map::is_merge_section_for): Remove.
751 (Object_merge_map::find_merge_section): New.
752 (Object_merge_map::get_input_merge_map): Add a const version.
753 * object.cc (Relobj::is_merge_section_for): Remove.
754 (Relobj::find_merge_section): New.
755 * object.h (Relobj::is_merge_section_for): Remove.
756 (Relobj::find_merge_section): New.
757 * output.cc
758 (Output_section::Input_section::is_merge_section_for): Remove.
759 (Output_section::add_merge_input_section): Don't call
760 add_merge_input_section.
761 (Output_section::find_merge_section): Return const. Use
762 object->find_merge_section.
763 (Output_section::build_lookup_maps): Don't build a map for
764 merge sections.
765 (Output_section::is_input_address_mapped): Return false if
766 section is not found.
767 (Output_section::find_starting_output_address): Use
768 find_merge_section instead of is_merge_section_for.
769 (Output_section::add_script_input_section): Don't build a map for
770 merge sections.
771 * output.h (Output_section_lookup_maps::merge_sections_by_id_): Remove.
772 (Output_section_lookup_maps::find_merge_section): Remove.
773 (Output_section_lookup_maps::add_merge_input_section) Remove.
774 (Output_section::find_merge_section): Return const.
775
152f7024
CC
7762015-03-22 Cary Coutant <cary@google.com>
777
778 PR gold/18106
779 * i386.cc (Target_i386::Relocate::tls_gd_to_ie): Fix support for
780 non-SIB form of lea, with nop after the call.
781
bccffdfd
CC
7822015-03-21 Cary Coutant <cary@google.com>
783
784 PR gold/14217
785 * output.cc (Output_segment::is_first_section_relro): Don't ignore
786 .tdata section.
787 (Output_segment::set_section_addresses): Don't align size of relro
788 segment for .tbss.
789
1c582fe7
CC
7902015-03-21 Cary Coutant <cary@google.com>
791
792 PR gold/18010
793 * stringpool.cc (Stringpool_template): Don't optimize if section
794 alignment is greater than sizeof(char).
795
410da591
CC
7962015-03-21 Cary Coutant <cary@google.com>
797
798 PR gold/18048
799 * script-c.h (script_include_directive): Add first_token parameter.
800 * script.cc (script_include_directive): Add first_token parameter, and
801 pass it to read_script_file.
802 * yyscript.y (PARSING_SECTIONS_BLOCK, PARSING_SECTION_CMDS)
803 (PARSING_MEMORY_DEF): New tokens.
804 (top): Add new productions for INCLUDE files.
805 (file_cmd): Replace file_or_sections_cmd with copy of its productions.
806 Pass PARSING_LINKER_SCRIPT to script_include_directive.
807 (section_block_cmd): Likewise; pass PARSING_SECTIONS_BLOCK.
808 (section_cmd): Pass PARSING_SECTION_CMDS.
809 (file_or_sections_cmd): Remove.
810 (memory_def): Pass PARSING_MEMORY_DEF.
811 * testsuite/Makefile.am (memory_test_2): New test.
812 * testsuite/Makefile.in: Regenerate.
813 * testsuite/memory_test_inc.t: New script file.
814 * testsuite/memory_test_inc_1.t.src: New script file.
815 * testsuite/memory_test_inc_2.t.src: New script file.
816 * testsuite/memory_test_inc_3.t.src: New script file.
817
0d5bbdb0
CC
8182015-03-21 Cary Coutant <cary@google.com>
819
820 * dwp.cc (Sized_relobj_dwo::do_section_contents): Delete.
821 (Sized_relobj_dwo::setup): Build compressed section map.
822 (Sized_relobj_dwo::do_decompressed_section_contents): Delete.
823 * dynobj.cc (Sized_dynobj::base_read_symbols): Build compressed
824 section map.
825 * object.cc (Sized_relobj_file::Sized_relobj_file): Remove
826 compressed_sections_ field.
827 (build_compressed_section_map): Take Object instead of
828 Sized_relobj_file parameter; add decompress_if_needed parameter.
829 (Sized_relobj_file::do_find_special_sections): Store compressed
830 section map in parent Object.
831 (Sized_relobj_file::do_decompressed_section_contents): Move
832 implementation to Object::decompressed_section_contents.
833 (Sized_relobj_file::do_discard_decompressed_sections): Move
834 implementation to Object::discard_decompressed_sections.
835 * object.h (build_compressed_section_map): Declare.
836 (Object::Object): Add compressed_sections_ field.
837 (Object::section_is_compressed): Move implementation here.
838 (Object::decompressed_section_contents): De-virtualize.
839 (Object::discard_decompressed_sections): De-virtualize.
840 (Object::do_section_is_compressed): Delete.
841 (Object::do_decompressed_section_contents): Delete.
842 (Object::set_compressed_sections): New method.
843 (Object::compressed_sections): New method.
844 (Object::compressed_sections_): New data member.
845 (Compressed_section_info, Compressed_section_map): Move to top of file.
846 (Sized_relobj_file::do_section_is_compressed): Delete.
847 (Sized_relobj_file::do_decompressed_section_contents): Delete.
848 (Sized_relobj_file::do_discard_decompressed_sections): Delete.
849 (Sized_relobj_file::compressed_sections_): Move to Object class.
850
bd9e0d46
CC
8512015-03-21 Cary Coutant <ccoutant@google.com>
852
853 PR gold/18152
854 * gold.cc (queue_middle_tasks): Finalize .eh_frame after laying out
855 deferred objects.
856
943c8b43
CC
8572015-03-11 Cary Coutant <ccoutant@google.com>
858
859 * options.cc (General_options::finalize): Don't allow -z relro
860 with incremental linking.
861 * testsuite/Makefile.am (incremental_test): Add -z norelro.
862 (incremental_test_2): Likewise.
863 (incremental_test_3): Likewise.
864 (incremental_test_4): Likewise.
865 (incremental_test_5): Likewise.
866 (incremental_test_6): Likewise.
867 (incremental_copy_test): Likewise.
868 (incremental_common_test_1): Likewise.
869 (incremental_comdat_test_1): Likewise.
870 * testsuite/Makefile.in: Regenerate.
871
e1663197
CC
8722015-03-09 Cary Coutant <ccoutant@google.com>
873
874 PR gold/14675
875 * ehframe.cc (Eh_frame::add_ehframe_input_section): Change return type;
876 return enum indicating whether .eh_frame section is empty, optimizable,
877 unrecognized, or an end marker. Adjust explicit instantiations.
878 * ehframe.h (Eh_frame::Eh_frame_section_disposition): New enum type.
879 (Eh_frame::add_ehframe_input_section): Change return type.
880 * gold.cc (queue_middle_tasks): Call Layout::finalize_eh_frame_section.
881 * layout.cc (Layout::layout_eh_frame): Don't add optimized sections
882 to the .eh_frame output section until we see the end marker.
883 (Layout::finalize_eh_frame_section): New.
884 * layout.h: (Layout::finalize_eh_frame_section): New.
885
beb8418f
L
8862015-03-05 H.J. Lu <hongjiu.lu@intel.com>
887
888 * output.cc (Relobj::initialize_input_to_output_map<size>):
889 Remove typename on elfcpp::Elf_types<size>::Elf_Addr.
890
48c73428
CC
8912015-03-04 Cary Coutant <ccoutant@google.com>
892
893 * parameters.cc (Parameters::set_target_once): Call
894 Target::select_as_default_target just once from here...
895 (set_parameters_target): ...instead of from here.
896
8972015-03-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
dbe40a88
RÁE
898
899 * ehframe.cc (Cie::set_output_offset): Pass in and use a
900 Output_section_data instead of a Merge_map.
901 (Eh_frame::Eh_frame): Don't initialize merge_map_.
902 (Eh_frame::read_cie): Use add_merge_mapping instead of
903 Merge_map::add_mapping.
904 (Eh_frame::read_fde): Ditto.
905 (Eh_frame::set_final_data_size): Use this instead of this->merge_map_.
906 (Eh_frame::do_output_offset): Use merge_output_offset istead of
907 merge_map_->get_output_offset.
908 (Eh_frame::do_is_merge_section_for): Delete.
909 * ehframe.h (Fde::add_mapping): Pass in and use a Output_section_data
910 instead of a Merge_map.
911 (Cie::set_output_offset): Pass in a Output_section_data instead of a
912 Merge_map.
913 (Eh_frame::do_is_merge_section_for): Delete.
914 (Eh_frame::merge_map_): Delete.
915 * merge.cc (Object_merge_map::get_or_make_input_merge_map): Pass in
916 and use a Output_section_data instead of a Merge_map.
917 (Object_merge_map::add_mapping): Ditto.
918 (Object_merge_map::get_output_offset): Remove the merge_map argument.
919 (Object_merge_map::is_merge_section_for): Pass in and use a
920 Output_section_data instead of a Merge_map.
921 (Merge_map): Delete.
922 (Output_merge_base::do_output_offset): Use merge_output_offset instead
923 of merge_map_.get_output_offset.
924 (Output_merge_base::do_is_merge_section_for): Delete.
925 (Output_merge_data::do_add_input_section): Use
926 object->add_merge_mapping instead of add_mapping.
927 (Output_merge_string<Char_type>::finalize_merged_data): Ditto.
928 * merge.h (Merge_map): Delete forward declaration.
929 (Object_merge_map::add_mapping): Pass in and use a Output_section_data
930 instead of a Merge_map.
931 (Object_merge_map::get_output_offset): Remove the merge_map argument.
932 (Object_merge_map::is_merge_section_for): Pass in and use a
933 Output_section_data instead of a Merge_map.
934 (Input_merge_map::Object_merge_map::merge_map): Replace with
935 output_data.
936 (Object_merge_map::get_or_make_input_merge_map): Pass in and use a
937 Output_section_data instead of a Merge_map.
938 (Merge_map): Delete.
939 (Output_merge_base::Output_merge_base): Don't initialize merge_map_.
940 (Output_merge_base::do_is_merge_section_for): Delete.
941 (Output_merge_base::add_mapping): Delete.
942 (Output_merge_base::merge_map_): Delete.
943 * object.cc (Relobj::initialize_input_to_output_map): New.
944 (Relobj::initialize_input_to_output_map): New.
945 (Relobj::merge_output_offset): New.
946 (Relobj::is_merge_section_for): New.
947 (Relobj::initialize_input_to_output_map): Instantiate for 32 and 64
948 bits.
949 * object.h (Relobj::merge_map): Delete.
950 (initialize_input_to_output_map): New.
951 (set_merge_map): Delete.
952 (add_merge_mapping): New.
953 (merge_output_offset): New.
954 (is_merge_section_for): New.
955 * output.cc (Output_section::Input_section::is_merge_section_for):
956 Use object->is_merge_section_for.
957 * output.h (Output_section_data::is_merge_section_for): Delete.
958 (Output_section_data::do_is_merge_section_for): Delete.
959 * reloc.cc (Merged_symbol_value<size>::initialize_input_to_output_map):
960 Use object->initialize_input_to_output_map.
961 (Merged_symbol_value<size>::value_from_output_section): Use
962 object->merge_output_offset.
963
48c73428 9642015-03-02 Peter Collingbourne <pcc@google.com>
72f4393d 965 Cary Coutant <ccoutant@google.com>
2c7b626c
CC
966
967 * output.cc (Output_section::add_merge_input_section): Do not
968 attempt to merge sections with an entsize of 0.
969
48c73428 9702015-03-02 Khem Raj <raj.khem@gmail.com>
5b07cd84
CC
971
972 * attributes.h (class Output_attributes_section_data ): Add
973 do_print_to_mapfile function.
974
ec86f434
AM
9752015-02-24 Alan Modra <amodra@gmail.com>
976
977 PR 18010
978 * powerpc.cc (Powerpc_relocate_functions::addr16_ds): Always
979 complain if value is not a multiple of four.
980 (Target_powerpc::Relocate::relocate): Correct handling of
981 R_POWERPC_GOT_TPREL16 and R_POWERPC_GOT_TPREL16_LO for ppc64.
982
be66981e
L
9832015-02-21 H.J. Lu <hongjiu.lu@intel.com>
984
985 * configure.ac (default_size): Set to 32 for x32.
986 * configure: Regenerated.
987
e3ee8ed4
AM
9882015-02-18 Alan Modra <amodra@gmail.com>
989
990 PR 17954
991 * powerpc.cc (Global_symbol_visitor_opd::operator()): Set default
992 visibility.
993
3a935c6c
RÁE
9942015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
995
996 * gc.h (Garbage_collection::add_reference): Don't use find.
997
e0a1e121
RÁE
9982015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
999
1000 * object.cc (write_local_symbols): avoid std::vector copy.
1001
45a4fb1a
RÁE
10022015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1003
1004 * merge.cc (get_output_offset): Use upper_bound instead of lower_bound.
1005
2d9afefe
MW
10062015-02-09 Mark Wielaard <mjw@redhat.com>
1007
1008 * gdb-index.cc (Gdb_index_info_reader::visit_top_die): Recognize
1009 DW_LANG_Fortran03 and DW_LANG_Fortran08.
1010
e9c1bdad
CC
10112015-02-16 Cary Coutant <ccoutant@google.com>
1012
1013 PR gold/13577
1014 PR gold/16992
1015 * layout.cc (Layout::finish_dynamic_section): Don't set DT_SYMBOLIC or
1016 DF_SYMBOLIC if --dynamic-list option is used.
1017 * options.cc (General_options::finalize): --dynamic-list is not
1018 mutually exclusive with -Bsymbolic.
1019 * symtab.h (Symbol::is_preemptible): Don't exclude dynamic symbols not
1020 listed in --dynamic-list.
1021 * testsuite/Makefile.am (dynamic_list_lib2.so): Add
1022 -Bsymbolic-functions.
1023 * testsuite/Makefile.in: Regenerate.
1024
0ed4b0bf
CC
10252015-02-16 Cary Coutant <ccoutant@google.com>
1026
1027 PR gold/17971
1028 * incremental.cc: Remove redundant include of "output.h".
1029
1a920511
JY
10302015-02-12 Jing Yu <jingyu@google.com>
1031
1032 * aarch64-reloc.def (TLSLE_MOVW_TPREL_G2, TLSLE_MOVW_TPREL_G1,
1033 TLSLE_MOVW_TPREL_G1_NC, TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC,):
1034 New relocation.
1035 * aarch64.cc (Target_aarch64::Scan::local): Add cases for new
1036 TLSLE_MOVW_* relocations.
1037 (Target_aarch64::Scan::global): Likewise.
1038 (Target_aarch64::Relocate::relocate): Likewise.
1039 (Target_aarch64::Relocate::relocate_tls): Add cases and handlings
1040 for new TLSLE_MOVW_* relocations.
1041
07f107f3
WN
10422015-02-11 Will Newton <will.newton@linaro.org>
1043
1044 PR gold/13321
1045 * arm.cc (Target_arm::make_plt_section): Create an ARM
1046 state mapping symbol at the start of the PLT.
1047
e051a5b5
L
10482015-02-09 H.J. Lu <hongjiu.lu@intel.com>
1049
1050 * testsuite/Makefile.am (two_file_shared_2_pic_1_test_DEPENDENCIES):
1051 Replace two_file_shared_2.so with two_file_shared_1.so.
1052 * testsuite/Makefile.in: Regenerated.
1053
dddcc5b9
AM
10542015-02-09 Alan Modra <amodra@gmail.com>
1055
1056 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add libweak_undef_2.a,
1057 plugin_test_thin.a and defsym_test.
1058 * testsuite/Makefile.in: Regenerate.
1059
b39b8b9d
RÁE
10602015-02-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1061
1062 * merge.cc (do_add_input_section): Combine loop epilogue into main loop
1063 body.
1064
b66d1c52
CC
10652015-02-04 Peter Collingbourne <pcc@google.com>
1066
1067 * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve
1068 forwarding symbols when computing symbol resolution info for plugins.
1069 * plugin.h (Plugin_manager::symtab): New method.
1070 (Pluginobj::get_symbol_resolution_info): Add symtab parameter.
1071
23081de0
CC
10722015-02-03 Cary Coutant <ccoutant@google.com>
1073 Peter Collingbourne <pcc@google.com>
1074
1075 PR gold/15660
1076 * archive.cc (Thin_archive_object_unlocker): New class.
1077 (Archive::include_member): Unlock external members of thin archives.
1078 * testsuite/Makefile.am (plugin_test_1): Rename .syms files.
1079 (plugin_test_2): Likewise.
1080 (plugin_test_3): Likewise.
1081 (plugin_test_4): Likewise.
1082 (plugin_test_5): Likewise.
1083 (plugin_test_6): Likewise.
1084 (plugin_test_7): Likewise.
1085 (plugin_test_8): Likewise.
1086 (plugin_test_9): Likewise.
1087 (plugin_test_10): Likewise.
1088 (plugin_test_11): New test case.
1089 * testsuite/Makefile.in: Regenerate.
1090 * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms
1091 file to decide whether to claim file.
1092 (all_symbols_read_hook): Likewise.
1093 * testsuite/plugin_test_1.sh: Adjust expected output.
1094 * testsuite/plugin_test_2.sh: Likewise.
1095 * testsuite/plugin_test_3.sh: Likewise.
1096 * testsuite/plugin_test_6.sh: Likewise.
1097 * testsuite/plugin_test_tls.sh: Likewise.
1098 * testsuite/plugin_test_11.sh: New testcase.
1099
11002015-02-03 Cary Coutant <ccoutant@google.com>
1101
1102 * descriptors.cc (Descriptors::open): Set artificially-low limit for
1103 file descriptors when debugging enabled. Add debug output.
1104 (Descriptors::release): Add debug output.
1105 (Descriptors::close_some_descriptor): Likewise.
1106 (Descriptors::close_all): Likewise.
1107 * fileread.cc (File_read::lock): Likewise.
1108 (File_read::unlock): Likewise.
1109
24dd5808
CC
11102015-02-02 Cary Coutant <ccoutant@google.com>
1111
1112 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
1113 executable output file.
1114
fa89cc82
HS
11152015-01-22 Han Shen <shenhan@google.com>
1116
1117 * arm.cc (Target_arm::Target_arm): Add initialization for new members.
1118 (Target_arm::do_plt_address_for_global): New method.
1119 (Target_arm::do_plt_address_for_local): New method.
1120 (Target_arm::rel_irelative_section): New method.
1121 (Target_arm::make_data_plt): Add more parameters for plt ctor.
1122 (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
1123 (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
1124 (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
1125 (Target_arm::Scan::check_non_pic): Add ifunc support.
1126 (Target_arm::Scan::local): Add ifunc support.
1127 (Target_arm::Scan::global): Add ifunc support.
1128 (Target_arm::make_plt_section): New method.
1129 (Target_arm::make_plt_entry): Change to call to make_plt_section.
1130 (Target_arm::make_local_ifunc_plt_entry): New method.
1131 (Target_arm::got_irelative_): New member.
1132 (Target_arm::rel_irelative_): New member.
1133 (Target_arm::got_section): Add creation for got_irelative_.
1134 (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
1135 (Target_arm::Relocate::relocate): Properly set local ifunc address.
1136 (Target_arm::do_dynsym_value): Properly set global ifunc address.
1137 (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
1138 (Output_data_plt_arm::IRelative_data): New type.
1139 (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
1140 (Output_data_plt_arm::add_entry): Add more parameters.
1141 (Output_data_plt_arm::add_relocation): New method.
1142 (Output_data_plt_arm::add_local_ifunc_entry): New method.
1143 (Output_data_plt_arm::rel_irelative): New method.
1144 (Output_data_plt_arm::entry_count): Modified.
1145 (Output_data_plt_arm::address_for_global): New method.
1146 (Output_data_plt_arm::address_for_local): New method.
23081de0 1147gold/
fa89cc82
HS
1148 (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
1149 (Output_data_plt_arm::insert_irelative_data): New method.
1150 (Output_data_plt_arm::irelative_rel_): New member.
1151 (Output_data_plt_arm::got_): New member.
1152 (Output_data_plt_arm::got_irelative_): New member.
1153 (Output_data_plt_arm::irelative_count_): New member.
1154 (Output_data_plt_arm::IRelative_data_vec): New typedef.
1155 (Output_data_plt_arm::irelative_data_vec_): New member.
1156 (Output_data_plt_arm::do_write): Write out irelative entries.
1157 (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
1158 more parameters to ctor.
1159 (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
1160 more parameters to ctor.
1161 * output.h (Output_data_reloc::add_local_relative): New method.
1162 * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
1163
0f81d3f0
AM
11642015-01-29 Alan Modra <amodra@gmail.com>
1165
1166 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
1167 and GOT_TLSGD to LE optimization.
1168
65d92137
CC
11692015-01-28 Cary Coutant <ccoutant@google.com>
1170
1171 * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
1172 for undef TLS symbols.
1173 (Target_x86_64::Relocate::relocate_tls): Likewise.
1174 (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
1175
5485698a
CC
11762015-01-25 Cary Coutant <ccoutant@google.com>
1177
1178 * output.cc (Output_segment::set_section_addresses): Fix calculation
1179 of size of relro segment.
1180
b01a4b04
AM
11812015-01-22 Alan Modra <amodra@gmail.com>
1182
1183 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
1184 condition for need of ifunc plt entry.
1185 (Target_powerpc::Scan::global <got relocs>): Likewise.
1186
3d0064a9
CC
11872015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1188
1189 * mips.cc (reloc_high): Add r_sym.
1190 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
1191 reloc_high constructor.
1192 (Mips_relocate_functions::relgot16_local): Likewise.
1193 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
1194 r_type to decide whether LO16 matches HI16.
1195 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
1196 rello16 and relgot16_local.
1197
a5cd8f05
CC
11982015-01-09 Cary Coutant <ccoutant@google.com>
1199
1200 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
1201 unless alignment is larger than page size.
1202
4fc1b9d4
L
12032015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1204 Cary Coutant <ccoutant@google.com>
1205
1206 PR gold/17729
1207 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
1208 (DEFAULT_TARGET_X32): Set for x32.
1209 * x86_64.cc (cmp_insn_32): New.
1210 (lea_r10_insn_32): Likewise.
1211 (lea_r11_insn_32): Likewise.
1212 (cmp_insn_64): Likewise.
1213 (lea_r10_insn_64): Likewise.
1214 (lea_r11_insn_64): Likewise.
1215 (Target_x86_64<size>::do_calls_non_split): Handle x32.
1216 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
1217 (check_DATA): Add split_x32 files.
1218 (split_x32_[1234n].o): New targets.
1219 (split_x32_[124]): New targets.
1220 (split_x32_[1234r].stdout): New targets.
1221 * testsuite/split_x32.sh: New file.
1222 * testsuite/split_x32_1.s: Likewise.
1223 * testsuite/split_x32_2.s: Likewise.
1224 * testsuite/split_x32_3.s: Likewise.
1225 * testsuite/split_x32_4.s: Likewise.
1226 * testsuite/split_x32_n.s: Likewise.
1227 * configure: Regenerated.
1228 * testsuite/Makefile.in: Likewise.
1229
e749cab8
L
12302015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1231
1232 PR gold/17809
1233 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
1234 x32.
1235
af759df0
AM
12362015-01-02 Alan Modra <amodra@gmail.com>
1237
1238 * version.cc (print_version): Just print current year.
1239 * dwp.cc (print_version): Likewise.
1240
b90efa5b
AM
12412015-01-01 Alan Modra <amodra@gmail.com>
1242
1243 Update year range in copyright notice of all files.
1244
f12d1e8a
AM
12452014-12-25 Alan Modra <amodra@gmail.com>
1246
1247 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
1248 new enums.
1249 (Target_arm::merge_object_attributes, ): Likewise.
1250
5c294fee
TG
12512014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
1252
1253 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
1254 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
1255 AEABI_VFP_args_vfp to check that.
1256 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
1257 value and replace hardcoded values by enum values.
1258
e30880c2
CC
12592014-12-22 Cary Coutant <ccoutant@google.com>
1260
1261 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
1262
bd040da1
L
12632014-12-20 H.J. Lu <hongjiu.lu@intel.com>
1264
1265 PR gold/14608
1266 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
1267 to "return i * i * 3;".
1268
e02a4046
CC
12692014-12-16 Cary Coutant <ccoutant@google.com>
1270
1271 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
1272 (Mapfile::print_output_data): Use current_data_size() to avoid
1273 assert for sections requiring postprocessing; if address is not valid,
1274 print 0.
1275 (Mapfile::print_output_section): Use current_data_size(); print note
1276 that addresses and sizes are before compression.
1277
add6016b
L
12782014-12-14 H.J. Lu <hongjiu.lu@intel.com>
1279
1280 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1281 Cast current_group_size to unsigned long when reporting error.
1282
0bf32ea9
JY
12832014-12-10 Jing Yu <jingyu@google.com>
1284
1285 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
1286 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
1287 Update error message.
1288 (Target_aarch64::do_relax): Use absolute value of option
1289 stub_group_size. Replace local variable with class member
1290 stub_group_size_.
1291
cbcb23fa
AM
12922014-12-04 Alan Modra <amodra@gmail.com>
1293
1294 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
1295 addend of PLTREL24 reloc when not generating a plt stub. Make
1296 max_branch_offset an "Address".
fbad6518 1297 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
cbcb23fa
AM
1298 (Target_powerpc::Relocate::relocate): Likewise.
1299
1611bc4a
AM
13002014-12-04 Alan Modra <amodra@gmail.com>
1301
1302 PR 17670
1303 * symtab.cc (Symbol::set_undefined): Remove assertion.
1304 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1305 on symbols defined in discarded sections, instead return false.
1306 Rearrange params, update all callers.
1307 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
1308 branches to syms in discarded sections.
1309 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
1310 undefined and flag as discarded.
1311 (Target_powerpc::Relocate::relocate): Localize variable.
1312
4759c34e
L
13132014-12-03 H.J. Lu <hongjiu.lu@intel.com>
1314
1315 PR gold/17675
1316 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
1317 * testsuite/Makefile.in: Regenerated.
1318
1f98a074
AM
13192014-12-03 Alan Modra <amodra@gmail.com>
1320
1321 PR 17566
1322 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
1323 when adding dynamic relocations against section symbols.
1324
fb257835
DI
13252014-12-01 Dimitry Ivanov <dimitry@google.com>
1326
1327 * layout.cc (Layout::finish_dynamic_section): When '-z global'
1328 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
1329 * options.h (General_options): New -z option (global).
1330
d8e60314
CC
13312014-12-01 Cary Coutant <ccoutant@google.com>
1332
1333 PR gold/17578
1334 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
1335 is given.
1336 (Layout::create_executable_stack_info): Warn when -z noexecstack is
1337 given but some inputs require executable stack.
1338
982bbd97
CC
13392014-11-26 Cary Coutant <ccoutant@google.com>
1340
1341 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
1342 .debug_str_offsets; strip .debug_gnu_pubnames and
1343 .debug_gnu_pubtypes.
1344 (lines_only_debug_sections): Strip all four new sections.
1345
bb779192
HS
13462014-11-26 Jing Yu <jingyu@google.com>
1347
1348 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
1349 register to be x0 when to relax TLSDESC_LD64_LO12.
1350
a3e60ddb
AM
13512014-11-26 Alan Modra <amodra@gmail.com>
1352
1353 * powerpc.cc (struct Stub_table_owner): New.
1354 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
1355 unsigned int vector. Update all references.
1356 (powerpc_relobj::set_stub_table): Take an unsigned int param
1357 rather than a Stub_table. Update callers.
1358 (Powerpc_relobj::clear_stub_table): New function.
1359 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
1360 stub_group_size_ vars.
1361 (Target_powerpc::new_stub_table): Delete.
1362 (max_branch_delta): New function, extracted from..
1363 (Target_powerpc::Relocate::relocate): ..here..
1364 (Target_powerpc::Branch_info::make_stub): ..and here. Return
1365 status on whether stub created successfully.
1366 (Stub_control::Stub_control): Add "no_size_errors" param. Move
1367 default sizing to..
1368 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
1369 reduce on relax failure.
1370 (Target_powerpc::group_sections): Add "no_size_errors" param.
1371 Use stub_group_size_. Set up group info in a temp vector,
1372 before building Stub_table vector. Account for input sections
1373 possibly already converted to relaxed sections.
1374 (Stub_table::init): Delete. Merge into..
1375 (Stub_table::Stub_table): ..here.
1376 (Stub_table::can_reach_stub): New function.
1377 (Stub_table::add_plt_call_entry): Add "from" parameter and
1378 return true iff stub could be reached.
1379 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
1380 param too.
1381 (Stub_table::clear_stubs): Add "all" param.
1382
a20605cf
AM
13832014-11-26 Alan Modra <amodra@gmail.com>
1384
1385 * powerpc.cc (Stub_control::set_output_and_owner): New function.
1386 (Target_powerpc::group_sections): Use it.
1387
43b64deb
CC
13882014-11-25 Cary Coutant <ccoutant@google.com>
1389
1390 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
1391 (Binary_to_elf::write_symbol): Add st_size parameter.
1392 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
1393
c924eb67
CC
13942014-11-25 Cary Coutant <ccoutant@google.com>
1395
1396 PR gold/17639
1397 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
1398 (Sized_relobj_file::do_layout): Handle deferred sections properly
1399 during GC pass 1. Don't add reloc sections to deferred list twice.
1400 * object.h (Sized_relobj_file::is_deferred_layout): New function.
1401 (Sized_relobj_file::is_deferred_layout_): New data member.
1402
9d585188
L
14032014-11-21 H.J. Lu <hongjiu.lu@intel.com>
1404
1405 PR gold/17619
1406 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
1407 Check PC-relative offset overflow in PLT entry.
1408
3ffaac20
AM
14092014-11-21 Alan Modra <amodra@gmail.com>
1410
1411 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
1412 for undefined weaks.
1413
0cfb0717
AM
14142014-11-20 Alan Modra <amodra@gmail.com>
1415
1416 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
1417 from --stub-group-size parameter divided by 1024.
1418 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
1419 template parameter. Update all uses.
1420 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
1421 has_stub_value. Set for long branches. Don't report overflow for
1422 branch to undefined weak symbols. Print info message on
1423 overflowing branch to stub.
1424
f9dffbf0
AM
14252014-11-20 Alan Modra <amodra@gmail.com>
1426
1427 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
1428
e88ba8d5
L
14292014-11-13 H.J. Lu <hongjiu.lu@intel.com>
1430
1431 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
1432 entry for R_X86_64_GOTPLT64.
1433 (Target_x86_64<size>::Relocate::relocate): Update comments for
1434 R_X86_64_GOTPLT64.
1435
d37ffe25
ED
14362014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
1437
1438 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
1439 * plugin.h: add lock definition
1440
9726c3c1
HS
14412014-10-29 Han Shen <shenhan@google.com>
1442 Jing Yu <jingyu@google.com>
1443
1444 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
1445 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1446 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
1447 Symbol::TLS_REF.
1448 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
1449 method.
1450 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
1451 (Target_aarch64::tls_ld_to_le): New method.
1452 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
1453 for 64bit targets.
1454 (Output_data_plt_aarch64::irelative_rel_): New data member.
1455 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
1456 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
1457 (Output_data_plt_aarch64::add_relocation): New method.
1458 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
1459 offset. Add got_irelative size to got size.
1460 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
1461 type string with the new typename.
1462 (AArch64_relocate_functions::update_adr): Replace parameter x with
1463 immed.
1464 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
1465 (AArch64_relocate_functions::reloc_common): New method.
1466 (AArch64_relocate_funcsions::rela_general): Extract common part out
1467 into reloc_common method.
1468 (AArch64_relocate_functions::rela_general): Likewise.
1469 (AArch64_relocate_functions::pcrela_general): Likewise.
1470 (AArch64_relocate_functions::adr): New method.
1471 (AArch64_relocate_functions::adrp): Calculate immed before calling
1472 update_adr.
1473 (AArch64_relocate_functions::adrp): Likewise.
1474 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
1475 comparing x to 0. Calculate immed from ~x when x < 0.
1476 (Target_aarch64::optimize_tls_reloc): Add new cases for
1477 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1478 TLSLD_MOVW_DTPREL_G0_NC.
1479 (Target_aarch64::possible_function_pointer_reloc): Implement this
1480 method.
1481 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
1482 comment.
1483 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
1484 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1485 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1486 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
1487 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1488 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1489 (Target_aarch64::make_plt_entry): Call add_entry with two more
1490 parameters.
1491 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1492 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
1493 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1494 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1495 (Target_aarch64::Relocate::relocate_tls): Add cases for
1496 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1497 TLSLD_MOVW_DTPREL_G0_NC.
1498 * testsuite/icf_safe_so_test.cc: Correct test comment.
1499 * testsuite/icf_safe_test.sh: Add AArch64 arch.
1500
80272b8c
AM
15012014-10-22 Alan Modra <amodra@gmail.com>
1502
1503 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
1504 thread_starter.
1505
998a69f4
AS
15062014-10-18 Andreas Schwab <schwab@linux-m68k.org>
1507
1508 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
1509
aed56ec5
CC
15102014-10-17 Cary Coutant <ccoutant@google.com>
1511
1512 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1513 Add "typename" keyword.
1514
bb779192 15152014-10-15 Han Shen <shenhan@google.com>
72f4393d 1516 Jing Yu <jingyu@google.com>
83a01957
HS
1517
1518 Patch for gold aarch64 backend to support relaxation.
1519 * aarch64-reloc.def: Change format.
1520 * aarch64.cc (class Reloc_stub): New class.
1521 (class Stub_table): New class.
1522 (class AArch64_relobj): New class.
1523 (class AArch64_input_section): New class.
1524 (class AArch64_output_section): New class.
1525 (Target_aarch64::new_stub_table): New method.
1526 (Target_aarch64::new_aarch64_input_section): New method.
1527 (Target_aarch64::find_aarch64_input_section): New method.
1528 (Target_aarch64::scan_section_for_stubs): New method.
1529 (Target_aarch64::scan_reloc_section_for_stubs): New method.
1530 (Target_aarch64::relocate_stub): New method.
1531 (Target_aarch64::current_target): New method.
1532 (Target_aarch64::do_make_elf_object): New method.
1533 (Target_aarch64::do_may_relax): New method.
1534 (Target_aarch64::do_relax): New method.
1535 (Target_aarch64::group_sections): New method.
1536 (Target_aarch64::scan_reloc_for_stub): New method.
1537 (Target_aarch64::do_make_output_section): New method.
1538 (Target_aarch64::stub_tables_): New data member.
1539 (Target_aarch64::aarch64_input_section_map_): New data member.
1540 (AArch64_relocate_functions::maybe_apply_stub): New method.
1541
db4c9594
CC
15422014-09-30 Cary Coutant <ccoutant@google.com>
1543
1544 PR gold/17432
1545 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
1546
cd6da036
KC
15472014-09-30 Kito Cheng <kito@0xlab.org>
1548
1549 PR gold/13597
1550 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
1551 hash table before sysv-style hash table.
1552
5f772412
ST
15532014-09-29 Sriraman Tallam <tmsriram@google.com>
1554
1555 * options.h (--pic-executable): Add negative to alias to -no-pie.
1556
5efeedf6
CC
15572014-09-26 Cary Coutant <ccoutant@google.com>
1558
1559 PR gold/16773
1560 * object.cc (Sized_relobj_file): Compute value of section symbols
1561 for TLS sections the same as TLS symbols.
1562
1707f183
CC
15632014-09-25 Cary Coutant <ccoutant@google.com>
1564
1565 PR gold/17432
1566 * resolve.cc (Symbol_table::resolve): Override common placeholder
1567 symbols, but adjust sizes.
1568 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
1569 symbols to common lists.
1570
00cac886
AM
15712014-09-24 Alan Modra <amodra@gmail.com>
1572
1573 * po/POTFILES.in: Regenerate.
1574
635aa30e 15752014-09-23 Taiju Tsuiki <tzik@google.com>
72f4393d 1576 Cary Coutant <ccoutant@google.com>
635aa30e 1577
71b9b91b 1578 PR gold/14860
635aa30e
CC
1579 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
1580 on input_sections_blocker.
1581 * layout.cc (Write_sections_task::locks): Unblock
1582 input_sections_blocker_.
1583 * layout.h (Write_sections_task::Write_sections_task): Add
1584 input_sections_blocker.
1585 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
1586 to DEPENDENCIES.
1587 * testsuite/Makefile.in: Regenerate.
1588
c0c71592
RÁE
15892014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1590
1591 * testsuite/Makefile.am (plugin_test_10): New test.
1592 * testsuite/Makefile.in: Regenerate
1593 * testsuite/plugin_common_test_2.c (c1): Align to 8.
1594 * testsuite/plugin_test_10.sh: New file.
1595
6168c2a1
RÁE
15962014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1597
1598 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
1599 * resolve.cc (Symbol_table::resolve): Don't override common symbols
1600 during the replacement phase.
1601
3a531937
JY
16022014-09-17 Han Shen <shenhan@google.com>
1603 Jing Yu <jingyu@google.com>
1604
1605 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
1606 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
1607 * aarch64.cc (Target_aarch64): Add data members
1608 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
1609 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
1610 constructor.
1611 (Target_aarch64::do_reloc_symbol_index): New method.
1612 (Target_aarch64::do_reloc_addend): New method.
1613 (Target_aarch64::add_tlsdesc_info): New method.
1614 (Target_aarch64::do_dynsym_value): New method.
1615 (Target_aarch64::do_make_data_plt): Add new parameters: got,
1616 got_irelative. Pass them to Output_data_plt_aarch64_standard.
1617 (Target_aarch64::make_data_plt): Add new parameters: got,
1618 got_irelative. Pass them to do_make_data_plt.
1619 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
1620 (Target_aarch64::Relocate:tls_gd_to_le): New method.
1621 (Target_aarch64::Relocate:tls_ie_to_le): New method.
1622 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
1623 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
1624 (Target_aarch64::got_tlsdesc_section): New method.
1625 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1626 (Target_aarch64::define_tls_base_symbol): New method.
1627 (Target_aarch64::reserve_tlsdesc_entries): New method.
1628 (Target_aarch64::got_mod_index_entry): New method.
1629 (Target_aarch64::rela_tlsdesc_section): New method.
1630 (Target_aarch64::rela_irelative_section): New method.
1631 (Target_aarch64::Tlsdesc_info): New struct.
1632 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
1633 relocations and tlsdesc relocations.
1634 (Target_aarch64::optimize_tls_reloc): Implement method.
1635 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
1636 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
1637 in constructor.
1638 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
1639 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
1640 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
1641 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
1642 (Output_data_plt_aarch64::rela_tlsdesc): New method.
1643 (Output_data_plt_aarch64::rela_irelative): New method.
1644 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
1645 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
1646 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
1647 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
1648 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
1649 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
1650 (Output_data_plt_aarch64_standard): New member variables:
1651 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
1652 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
1653 New parameter: got, got_irelative.
1654 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
1655 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
1656 (Output_data_plt_aarch64::do_write): Replace got_address with
1657 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
1658 (AArch64_relocate_functions::update_movnz): New method.
1659 (AArch64_relocate_functions): Correct format.
1660 (AArch64_relocate_functions::movnz): New method.
1661 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
1662 before the switch. Add new cases to switch.
00cac886 1663 Check ie_to_le relaxation on tlsie relocations. Add code handling
3a531937
JY
1664 tlsgd tlsdesc cases.
1665 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
1666 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
1667 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
1668 Call reloc_name_in_error_message to print unsupported reloc.
1669 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
1670 make_data_plt.
1671 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
1672 relocs. Fill in some more dynamic tags.
1673 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
1674 Skip call tls_get_addr when tlsgd is relaxed.
1675 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
1676 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
1677 tlsdesc->ie relaxation.
1678
62661c93
SS
16792014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1680
1681 * mips.cc (Target_mips_nacl): New class.
1682 (Target_selector_mips_nacl): New class.
1683 (target_selector_mips32): Rename from target_selector_mips32be and use
1684 Target_selector_mips_nacl instead of Target_selector_mips.
1685 (target_selector_mips32el): Rename from target_selector_mips32 and use
1686 Target_selector_mips_nacl instead of Target_selector_mips.
1687 (target_selector_mips64): Rename from target_selector_mips64be and use
1688 Target_selector_mips_nacl instead of Target_selector_mips.
1689 (target_selector_mips64el): Rename from target_selector_mips64 and use
1690 Target_selector_mips_nacl instead of Target_selector_mips.
1691 (Target_mips::mips_info): Add const attribute.
1692
54674d38
CC
16932014-09-02 Cary Coutant <ccoutant@google.com>
1694
1695 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
1696 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
1697 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
1698 (Sized_incr_dynobj::do_section_name): Likewise.
1699 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
1700 (Sized_incr_dynobj::do_section_name): Likewise.
1701 * object.h (Object::section_name): Likewise.
1702 (Object::do_section_name): Likewise.
1703 (Sized_relobj_file::do_section_name): Likewise.
1704 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
1705 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
1706
9860cbcf
CC
17072014-09-02 Cary Coutant <ccoutant@google.com>
1708
1709 PR gold/17005
1710 * ehframe.cc (Fde::write): Add output_offset parameter.
1711 (Cie::write): Likewise.
1712 (Eh_frame::set_final_data_size): Account for offset within output
1713 section.
1714 (Eh_frame::do_sized_write): Likewise.
1715 * ehframe.h (Fde::write): Add output_offset parameter.
1716 (Cie::write): Likewise.
1717 * output.cc (Output_section::Input_section_sort_entry): Remove
1718 section_has_name_; add output_section_name parameter. Use
1719 output section name for non-input sections.
1720 (Output_section::Input_section_sort_entry::section_has_name): Remove.
1721 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
1722 (Output_section::Input_section_sort_compare): Remove logic for
1723 sections without names.
1724 (Output_section::Input_section_sort_init_fini_compare): Likewise.
1725 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
1726 Likewise.
1727 (Output_section::Input_section_sort_section_name_compare): Likewise.
1728
8e33481e
HS
17292014-08-29 Han Shen <shenhan@google.com>
1730 Jing Yu <jingyu@google.com>
1731
1732 * aarch64-reloc-property.cc
1733 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
1734 reference reloc property in the table.
1735 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
1736 3 other entries.
1737 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
1738 2 new overloaded methods.
1739 (Output_data_got_aarch64::do_write): Add code to write out
1740 static relocs.
1741 (class Output_data_got_aarch64::Static_reloc): New class to wrap
1742 static relocs.
1743 (Output_data_got_aarch64::static_relocs): New vector to
1744 hold static relocs.
1745 (Target_aarch64::TCB_SIZE): New const static memeber.
1746 (Target_aarch64::tcb_size): New method.
1747 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
1748 (Target_aarch64::Relocate::relocate_tls): New method.
1749 (Target_aarch64::Scan::local): Add code handling new reloc types.
1750 (Target_aarch64::Scan::global): Add code handling new reloc types.
1751
81233653
ST
17522014-08-13 Sriraman Tallam <tmsriram@google.com>
1753
1754 * options.h (-no-pie): Add option.
1755
9363c7c3
JY
17562014-08-08 Jing Yu <jingyu@google.com>
1757 Han Shen <shenhan@google.com>
1758
1759 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
1760 (DEFFILES): add aarch64-reloc.def.
1761 (TARGETSOURCES): Add aarch64-reloc-property.cc.
1762 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
1763 * Makefile.in: Regenerate.
1764 * aarch64-reloc-property.cc: New file.
1765 * aarch64-reloc-property.h: New file.
1766 * aarch64-reloc.def: New file.
1767 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
1768 with tab to make the format consistent.
1769 (Output_data_got_aarch64::symbol_table_): New method.
1770 (Target_aarch64::do_plt_address_for_global): New method.
1771 (Target_aarch64::do_plt_address_for_local): New method.
1772 (Target_aarch64::do_select_as_default_target): New method.
1773 (Target_aarch64::do_make_data_plt): New method.
1774 (Target_aarch64::make_data_plt): New method.
1775 (Output_data_plt_aarch64::has_irelative_section): New method.
1776 (Output_data_plt_aarch64::address_for_global): New method.
1777 (Output_data_plt_aarch64::address_for_local): New method.
1778 (Output_data_plt_aarch64::irelative_rel_): New parameter.
1779 (Output_data_plt_aarch64::add_entry): Implement contents.
1780 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
1781 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
1782 the got_pov entry to plt0.
1783 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
1784 Implement contents.
1785 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
1786 (AArch64_howto): New struct.
1787 (aarch64_howto[]): New static const array.
1788 (AArch64_relocate_functions): New class.
1789 (Target_aarch64::Scan::get_reference_flags): Remove method.
1790 (Target_aarch64::Scan::local): Implement to support a few relocations.
1791 (Target_aarch64::Scan::global): Implement to support a few relocations.
1792 (Target_aarch64::make_plt_section): Implement contents.
1793 (Target_aarch64::make_plt_entry): Implement contents.
1794 (Target_aarch64::do_finalize_sections): Implement contents.
1795 (Target_aarch64::Relocate::relocate): Implement a few relocations.
1796 (Target_aarch64::relocate_section): Implement contents.
1797
ad9fe6c1
AM
17982014-08-06 Alan Modra <amodra@gmail.com>
1799
1800 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
1801
7cd4e5b7
AM
18022014-08-06 Alan Modra <amodra@gmail.com>
1803
1804 PR 13227
1805 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
1806
5ad9b0a7
ST
18072014-07-21 Sriraman Tallam <tmsriram@google.com>
1808
1809 * object.cc (Relobj::is_section_name_included): Add
7c16d96e 1810 ".rodata.nptl_version" to not garbage collect this section.
5ad9b0a7 1811
e051745c
CC
18122014-07-08 Cary Coutant <ccoutant@google.com>
1813
1814 * expression.cc (struct Expression::Expression_eval_info): Add
1815 new fields type_pointer, vis_pointer, and nonvis_pointer.
1816 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
1817 nonvis_pointer parameters. Adjust all calls.
1818 (Symbol_expression::value): Update type, visibility, and nonvis bits
1819 in caller.
1820 * script.cc (Symbol_assignment::sized_finalize): Update type,
1821 visibility, and remaining st_other bits for new symbol.
1822 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
1823 vis_pointer, and nonvis_pointer parameters.
1824 * symtab.h (Symbol::set_type): New method.
1825
1826 * testsuite/Makefile.am (defsym_test): New test.
1827 * testsuite/Makefile.in: Regenerate.
1828 * testsuite/defsym_test.c: New file.
1829 * testsuite/defsym_test.sh: New file.
1830
f35c4853
CC
18312014-07-08 Cary Coutant <ccoutant@google.com>
1832
1833 PR gold/15639
1834 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
1835 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
1836 (Sized_dynobj::base_read_symbols): ...new method.
1837 * object.h (Sized_relobj_file::base_read_symbols): New method.
1838 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
1839 (Sized_relobj_file::base_read_symbols): ...new method.
1840 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
1841 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
1842 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
1843
2900af2d
AM
18442014-07-04 Alan Modra <amodra@gmail.com>
1845
1846 * po/POTFILES.in: Regenerate.
1847
053a4d68
JY
18482014-07-02 Jing Yu <jingyu@google.com>
1849
1850 * aarch64.cc: New file
1851 * Makefile.am (TARGETSOURCES): Add aarch64.cc
1852 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
1853 * Makefile.in: Regenerate.
1854 * configure.tgt: Add entries for aarch64*.
1855 * configure.ac: Likewise.
1856 * configure: Likewise.
1857
7b549045
AM
18582014-06-27 Alan Modra <amodra@gmail.com>
1859
1860 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
1861
cb818dbf
CC
18622014-06-24 Cary Coutant <ccoutant@google.com>
1863
1864 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
1865 sections.
1866 (Dwo_file::sized_read_unit_index): Likewise.
1867
9810d34d
SS
18682014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1869
1870 * mips.cc: New file.
1871 * Makefile.am (TARGETSOURCES): Add mips.cc
1872 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
1873 * configure.tgt: Add entries for mips*.
1874 * configure.ac: Likewise.
1875 * Makefile.in: Regenerate.
1876 * configure: Likewise.
1877
9baa787b
CC
18782014-06-09 Cary Coutant <ccoutant@google.com>
1879
1880 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
1881 unit_length is within section bounds.
1882
8f89af0a
CC
18832014-06-09 Cary Coutant <ccoutant@google.com>
1884
1885 PR gold/16980
1886 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
1887 map.
1888
a47622ac
AM
18892014-06-07 Alan Modra <amodra@gmail.com>
1890
1891 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
1892
4320c691
CC
18932014-06-06 Cary Coutant <ccoutant@google.com>
1894
1895 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
1896 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
1897 (Dwarf_pubnames_table::read_header): Likewise.
1898 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
1899 .debug_gnu_pubtypes.
1900
270c9937
JB
19012014-06-05 Joel Brobecker <brobecker@adacore.com>
1902
1903 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
1904 * Makefile.in, configure: Regenerate.
1905
397998fc
AM
19062014-06-03 Alan Modra <amodra@gmail.com>
1907
1908 * powerpc.cc (addis_12_2): Define.
1909 (Stub_table::do_write): Support fusion on ELFv2 stubs.
1910
61f5c66f
AM
19112014-06-03 Alan Modra <amodra@gmail.com>
1912
1913 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
1914 st_other output.
1915
f6971787
AM
19162014-06-02 Alan Modra <amodra@gmail.com>
1917
1918 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
1919 Only ignore relocs on ELFv1.
1920 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
1921
f6fb8322
CC
19222014-05-30 Cary Coutant <ccoutant@google.com>
1923
1924 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
1925 * testsuite/Makefile.in: Regenerate.
1926 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
1927
c23dd342
L
19282014-05-27 H.J. Lu <hongjiu.lu@intel.com>
1929
1930 PR gold/16945
1931 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
1932 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
1933
5fe7ffdc
AM
19342014-05-15 Alan Modra <amodra@gmail.com>
1935
1936 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
1937 Compare FDE contents with DW_CFA_nop rather than 0.
1938
a82bef93
ST
19392014-05-13 Sriraman Tallam <tmsriram@google.com>
1940
1941 * symtab.h (may_need_copy_reloc): Remove check for position independent
1942 code.
1943 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
1944 position independence before pc absolute may_need_copy_reloc call.
1945 Add check for executable output befor pc relative may_need_copy_reloc
1946 call.
1947 * i386.cc: Ditto.
1948 * arm.cc: Ditto.
1949 * sparc.cc: Ditto.
1950 * tilegx.cc: Ditto.
1951 * powerpc.cc: Add check for no position independence before
1952 may_need_copy_reloc calls.
1953 * testsuite/pie_copyrelocs_test.cc: New file.
1954 * testsuite/pie_copyrelocs_shared_test.cc: New file.
1955 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 1956 * Makefile.in: Regenerate.
a82bef93 1957
53c66605
ML
19582014-05-08 Martin Liška <mliska@suse.cz>
1959
1960 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
1961
57b2284c
CC
19622014-05-06 Cary Coutant <ccoutant@google.com>
1963
1964 PR gold/16900
1965 * i386.cc (Output_data_got_plt_i386): New class.
1966 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
1967 parameter. Change all callers.
1968 (Output_data_plt_i386::layout_): Remove.
1969 (Output_data_plt_i386::got_plt_): Change type.
1970 (Target_i386::got_plt_): Change type. Change all references.
1971 (Target_i386::got_section): Create instance of new class.
1972 (Output_data_got_plt_i386::do_write): New function.
1973 * x86_64.cc (Output_data_got_plt_x86_64): New class.
1974 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
1975 parameter. Change all callers.
1976 (Output_data_plt_x86_64::layout_): Remove.
1977 (Output_data_plt_x86_64::got_plt_): Change type.
1978 (Target_x86_64::got_plt_): Change type. Change all references.
1979 (Target_x86_64::got_section): Create instance of new class.
1980 (Output_data_got_plt_x86_64::do_write): New function.
1981 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
1982 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
1983 class.
1984
6b97515d 19852014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 1986
6b97515d
CC
1987 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
1988 if we have pubnames/pubtypes.
1989
d1bddd3c
CC
19902014-05-02 Cary Coutant <ccoutant@google.com>
1991
5fe7ffdc
AM
1992 * defstd.cc (in_segment): Define __ehdr_start here...
1993 * layout.cc (Layout::finalize): ...Instead of here. Set the
1994 output segment when known.
1995 * resolve.cc (Symbol::override_base_with_special): Remember
1996 the original binding.
1997 * symtab.cc (Symbol::set_output_segment): New function.
1998 (Symbol::set_undefined): New function.
1999 * symtab.h (Symbol::is_weak_undefined): Check original undef
2000 binding.
2001 (Symbol::is_strong_undefined): New function.
2002 (Symbol::set_output_segment): New function.
2003 (Symbol::set_undefined): New function.
2004 * target-reloc.h (is_strong_undefined): Remove.
2005 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
2006 Check for hidden undefs.
2007 (relocate_section): Call Symbol::is_strong_undefined.
2008
2009 * testsuite/Makefile.am (ehdr_start_test_1)
2010 (ehdr_start_test_2, ehdr_start_test_3)
2011 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
2012 * testsuite/Makefile.in: Regenerate.
2013 * testsuite/ehdr_start_def.cc: New source file.
2014 * testsuite/ehdr_start_test.cc: New source file.
2015 * testsuite/ehdr_start_test.t: New linker script.
2016 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 2017
7849f6d8
CC
20182014-04-23 Cary Coutant <ccoutant@google.com>
2019
bf2cc635 2020 PR gold/16870
7849f6d8
CC
2021 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
2022
99fd8cff
CC
20232014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2024
2025 * layout.cc (Layout::include_section): Allow a target to decide
2026 whether to include a section.
2027 * target.h (Target::should_include_section): New function.
2028 (Target::do_should_include_section): New function.
2029
91f43acd
CC
20302014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2031
2032 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
2033 inline into ...
2034 (Copy_relocs::emit): ... here.
2035 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
2036 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
2037 (Copy_reloc_entry::entries_): Change from private to protected.
2038
c4eb27e1
ST
20392014-04-02 Sriraman Tallam <tmsriram@google.com>
2040
2041 * icf.cc (get_section_contents): Replace copies of reloc
2042 vectors with const references.
2043
ae447ddd
CC
20442014-04-02 Cary Coutant <ccoutant@google.com>
2045
2046 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
2047 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
2048 * configure: Regenerate.
2049 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
2050 -fno-use-linker-plugin.
2051 (LINK1, CXXLINK1): Add it to the link command.
2052 * testsuite/Makefile.in: Regenerate.
2053
fa47fa92
AM
20542014-03-12 Alan Modra <amodra@gmail.com>
2055
2056 * Makefile.in: Regenerate.
2057
9b12c500
CC
20582014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2059
2060 * symtab.h (Symbol::set_nonvis): New function.
2061
beacaa96
CC
20622014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2063
2064 * symtab.cc (Sized_symbol<32>::init_output_data):
2065 Instantiate the template.
2066 (Sized_symbol<64>::init_output_data): Likewise.
2067
800d9823
CC
20682014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2069
2070 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
2071 adjust dynamic symbol value.
2072 * target.h (Target::adjust_dyn_symbol): New function.
2073 (Target::do_adjust_dyn_symbol): New function.
2074
918fc1f8 20752014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 2076
918fc1f8
CC
2077 * output.cc (Output_data_dynamic::Dynamic_entry::write):
2078 Get the value of DYNAMIC_CUSTOM dynamic entry.
2079 * output.h (Output_data_dynamic::add_custom): New function.
2080 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
2081 dynamic entry.
2082 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
2083 * target.h (Target::dynamic_tag_custom_value): New function.
2084 (Target::do_dynamic_tag_custom_value): New function.
2085
98ff9231
CC
20862014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2087
2088 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
2089 dynsym indexes.
2090 * target.h (Target::has_custom_set_dynsym_indexes): New function.
2091 (Target::do_has_custom_set_dynsym_indexes): New function.
2092 (Target::set_dynsym_indexes): New function.
2093 (Target::do_set_dynsym_indexes): New function.
2094
b80eed39
AM
20952014-03-07 Alan Modra <amodra@gmail.com>
2096
2097 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
2098 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
2099 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
2100 (Powerpc_relocate_functions::has_overflow_bitfield,
2101 overflowed): Use the above.
2102 (Target_powerpc::Relocate::relocate): Correct overflow checking
2103 for a number of relocations. Modify overflow test for 16-bit
2104 fields in instructions to signed/unsigned according to whether
2105 the field takes a signed or unsigned value.
2106
4b95cf5c
AM
21072014-03-05 Alan Modra <amodra@gmail.com>
2108
2109 Update copyright years.
2110
45965137
AM
21112014-03-05 Alan Modra <amodra@gmail.com>
2112
2113 * powerpc.cc (Target_powerpc::Scan::local, global): Support
2114 R_PPC64_ADDR64_LOCAL.
2115 (Target_powerpc::Relocate::relocate): Likewise.
2116
2c80b753
AM
21172014-03-03 Alan Modra <amodra@gmail.com>
2118
2119 * dwp.cc (print_version): Update copyright year to current.
2120
c1c69e83
AM
21212014-02-10 Alan Modra <amodra@gmail.com>
2122
2123 * po/gold.pot: Regenerate.
2124
dd0c4e70
CC
21252014-02-06 Cary Coutant <ccoutant@google.com>
2126
2127 Fix problem where -u is ignored when a weak undef is seen.
2128
2129 * archive.cc (Library_base::should_include_member): Reorder
2130 code to check for -u option if a weak undef has already been seen.
2131 * testsuite/Makefile.am (weak_undef_test_2): New test case.
2132 * testsuite/Makefile.in: Regenerate.
2133 * testsuite/weak_undef_file3.cc: New file.
2134 * testsuite/weak_undef_file4.cc: New file.
2135 * testsuite/weak_undef_test_2.cc: New file.
2136
1a221d3d
CC
21372014-02-05 Cary Coutant <ccoutant@google.com>
2138
2139 Fix issues with gold undefined symbol diagnostics.
2140
2141 PR binutils/15435
2142 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
2143 check to here.
2144 * target-reloc.h (is_strong_undefined): New function.
2145 (relocate_section): Move undef vtable symbol check from here.
2146 Check for is_strong_undefined.
2147
e889f0a4 21482014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 2149
e889f0a4
CC
2150 Fix problems with the --dynamic-list option.
2151
2152 PR gold/13577
2153 * options.cc (General_options::parse_dynamic_list):
2154 Set have_dynamic_list_.
2155 (General_options::General_options): Initialize have_dynamic_list_.
2156 (General_options::finalize): Turn off -Bsymbolic and
2157 -Bsymbolic-functions if --dynamic-list provided.
2158 * options.h (General_options::have_dynamic_list): New function.
2159 (General_options::have_dynamic_list_): New data member.
2160 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
2161 correctly.
5fe7ffdc 2162
e889f0a4
CC
2163 PR gold/16530
2164 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
2165 in --dynamic-list, mark it.
5fe7ffdc 2166
e889f0a4
CC
2167 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
2168 (dynamic_list_2): New test case.
2169 * testsuite/Makefile.in: Regenerate.
2170 * testsuite/dynamic_list_2.cc: New file.
2171 * testsuite/dynamic_list_2.t: New file.
2172 * testsuite/dynamic_list_lib1.cc: New file.
2173 * testsuite/dynamic_list_lib2.cc: New file.
2174 * testsuite/gc_dynamic_list_test.c: New file.
2175 * testsuite/gc_dynamic_list_test.sh: New file.
2176 * testsuite/gc_dynamic_list_test.t: New file.
2177
ec673e64
CC
21782014-01-28 Cary Coutant <ccoutant@google.com>
2179
2180 Add .gdb_index version 7 support.
2181
2182 * gold/dwarf_reader.cc: include <utility> (for make_pair).
2183 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
2184 debug sections.
2185 (Dwarf_ranges_table::read_ranges_table): Likewise.
2186 (Dwarf_pubnames_table::read_section): Check for GNU-style
2187 sections, and for compressed debug sections.
2188 (Dwarf_pubnames_table::read_header): Compute end address of table.
2189 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
2190 for end of list by offset, not by offset == 0.
2191 (Dwarf_info_reader::do_read_string_table): Check for compressed
2192 debug sections.
2193 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2194 Initialize new data members.
2195 (Dwarf_pubnames_table::next_name): return flag_byte.
2196 (Dwarf_pubnames_table::end_of_table_): New data member.
2197 (Dwarf_pubnames_table::is_gnu_style_): New data member.
2198 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
2199 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
2200 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
2201 read skeleton type unit DIEs.
2202 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
2203 (Gdb_index::do_write): Write flag_byte.
2204 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
2205 (Gdb_index::Cu_vector): Store flags along with cu indexes.
2206 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
2207 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
2208
221fd5d5
L
22092014-01-08 H.J. Lu <hongjiu.lu@intel.com>
2210
2211 * version.cc (print_version): Update copyright year to 2014.
2212
6c09fb0b
ILT
22132013-12-19 Dimitry Andric <dimitry@andric.com>
2214
2215 * stringpool.cc (Stringpool_template::reserve): Add
2216 HAVE_UNORDERED_MAP case.
2217 * stringpool.cc (Stringpool_template::print_stats): Likewise.
2218
8356f2d0
CC
22192013-12-18 Cary Coutant <ccoutant@google.com>
2220
2221 * configure.ac: Check for <unordered_set> and <unordered_map>.
2222 * config.in: Regenerate.
2223 * configure: Regenerate.
2224 * system.h: Use <unordered_set> and <unordered_map> if available.
2225
f2c7d7ee
RM
22262013-12-10 Roland McGrath <mcgrathr@google.com>
2227
2228 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
2229 with $(INSTALL_PROGRAM_ENV).
2230 * Makefile.in: Regenerate.
2231
6632e8cc
CC
22322013-11-22 Cary Coutant <ccoutant@google.com>
2233
2234 * configure.ac: Add check for which library is needed for
2235 dlopen.
2236 * configure: Regenerate.
2237
0c075858
CC
22382013-11-22 Cary Coutant <ccoutant@google.com>
2239
2240 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
2241 assembler.
2242 * testsuite/Makefile.in: Regenerate.
2243
f49fe902
L
22442013-11-17 H.J. Lu <hongjiu.lu@intel.com>
2245
2246 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
2247 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
2248 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
2249 (Target_x86_64<size>::Scan::local): Likewise.
2250 (Target_x86_64<size>::Scan::global): Likewise.
2251 (Target_x86_64<size>::Relocate::relocate): Likewise.
2252 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
2253 Likewise.
2254 (Target_x86_64<size>::Scan::check_non_pic(): Handle
2255 R_X86_64_PC32_BND.
2256
2257 * testsuite/Makefile.am (check_PROGRAMS): Add
2258 exception_x86_64_bnd_test.
2259 (exception_x86_64_bnd_test_SOURCES): New macro.
2260 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
2261 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
2262 (exception_x86_64_bnd_test_LDADD): Likewise.
2263 (exception_x86_64_bnd_1.o): New rule.
2264 (exception_x86_64_bnd_2.o): Likewise.
2265 * testsuite/Makefile.in: Regenerated.
2266
9055360d
AM
22672013-11-15 Alan Modra <amodra@gmail.com>
2268
2269 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
2270 accessor.
2271 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
2272 Only call ppc64_local_entry_offset for 64-bit. Restrict
2273 symval_for_branch lookup to ELFv1.
2274 (Stub_table::add_plt_call_entry): Use unsigned int off.
2275 (Output_data_glink::Address, invalid_address): New.
2276 (Output_data_glink::add_eh_frame): Move out of line. Add
2277 support for ELFv2.
2278 (Output_data_glink::add_global_entry, find_global_entry,
2279 global_entry_address): New functions.
2280 (Output_data_glink::global_entry_stubs_, end_branch_table_,
2281 ge_size): New variables.
2282 (Output_data_glink::set_final_data_size): Add global entry
2283 stub sizing.
2284 (Output_data_glink::do_write): Write global entry stubs.
2285 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
2286 parameter. Return true for ELFv2. Adjust callers.
2287 (Target_powerpc::Scan::local, global): Restrict opd lookup to
2288 ELFv1. Similarly for ifunc and dynamic relocation processing
2289 specific to ELFv1. Recognize that symbols are defined on
2290 their plt entries for ELFv2.
2291 (Target_powerpc::symval_for_branch): Assert if called for
2292 ELFv2 or ppc32.
2293 (Target_powerpc::Relocate::relocate): Use global entry plt
2294 stub for symbol value if such exists on ELFv2.
2295 (Target_powerpc::Relocate::relocate): Don't call
2296 symval_for_branch when ELFv2. Do adjust for local entry
2297 offset when ELFv2.
2298 (Target_powerpc::do_dynsym_value): Set symbols to global entry
2299 plt stub for ELFv2.
2300 (Target_powerpc::do_plt_address_for_global): Similarly.
2301
cafdd569
CC
23022013-11-14 Cary Coutant <ccoutant@google.com>
2303
2304 Revert patch -- this did not fix the problem, and there is
2305 no race there.
2306
2307 2013-11-14 Cary Coutant <ccoutant@google.com>
2308
2309 PR gold/14860
2310 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2311 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2312 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2313 updating fde_offsets_.
2314 (Eh_frame_hdr::lock_): New data member.
2315
94e49e16
CC
23162013-11-14 Cary Coutant <ccoutant@google.com>
2317
2318 * dwp.cc (Dwo_file_entry): New type.
2319 (File_list): Use Dwo_file_entry.
2320 (Dwo_file::verify): New function.
2321 (Dwo_file::verify_dwo_list): New function.
2322 (Dwo_file::sized_verify_dwo_list): New function.
2323 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
2324 list.
2325 (Dwp_options): New enum type.
2326 (dwp_options): Add --verify-only.
2327 (usage): Likewise.
2328 (main): Likewise.
2329 * dwp.h (gold_info): Add declaration.
2330
7cdd7d57
CC
23312013-11-14 Cary Coutant <ccoutant@google.com>
2332
2333 PR gold/14860
2334 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2335 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2336 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2337 updating fde_offsets_.
2338 (Eh_frame_hdr::lock_): New data member.
2339
1d946cb3
CC
23402013-11-06 Cary Coutant <ccoutant@google.com>
2341
2342 PR gold/15758
2343 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
2344 before reloc sections.
2345
4f65b40e
AM
23462013-11-04 Alan Modra <amodra@gmail.com>
2347
2348 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
2349 (Symbol::needs_dynamic_reloc): Test new flag.
2350 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
2351 (Target_powerpc::Scan::get_reference_flags): Add target param.
2352 Return FUNC_DESC_ABI for 64-bit ELFv1.
2353 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
2354 call.
2355 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
2356 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
2357
908794a9
CC
23582013-10-31 Cary Coutant <ccoutant@google.com>
2359
2360 Restore support for dwp v2 DWARF package file format.
2361
2362 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2363 tu_length parameter. Adjust all callers.
2364 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2365 * dwp.cc: Include dwarf.h.
2366 (Section_bounds): New struct type.
2367 (Unit_set): New struct type.
2368 (Dwo_file::Dwo_file): Initialize new data member.
2369 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2370 Combine and rename to...
2371 (Dwo_file::read_unit_index): ...this.
2372 (Dwo_file::sized_read_compunit_index)
2373 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2374 (Dwo_file::sized_read_unit_index): ...this.
2375 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2376 parameters; add section_id parameter.
2377 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2378 (Dwo_file::add_unit_set): ...this.
2379 (Dwo_file::shndx_map_): Remove.
2380 (Dwo_file::sect_offsets_): New data member.
2381 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2382 (Dwp_output_file::add_section): Rename to...
2383 (Dwp_output_file::add_contribution): ...this.
2384 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2385 (Dwp_output_file::add_tu_set): Likewise.
2386 (Dwp_output_file::Contribution): New type.
2387 (Dwp_output_file::Section::contributions): New data member.
2388 (Dwp_output_file::Cu_or_tu_set): Remove.
2389 (Dwp_output_file::Section::Section): New ctor.
2390 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2391 (Dwp_output_file::Dwp_index::Section_table): New type.
2392 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2393 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2394 parameter.
2395 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2396 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2397 (Dwp_output_file::Dwp_index::section_table): New member function.
2398 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2399 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2400 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2401 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2402 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2403 (Dwp_output_file::Dwp_index::section_table_): New data member.
2404 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2405 (Dwp_output_file::add_output_section): New member function.
2406 (Dwp_output_file::write_new_section): New member function.
2407 (Dwp_output_file::write_contributions): New member function.
2408 (Dwp_output_file::section_id_map_): New data member.
2409 (class Dwo_id_info_reader): Remove.
2410 (class Unit_reader): New class.
2411 (get_dwarf_section_name): New function.
2412 (Dwo_file::read_executable): Adjust initializations of class data.
2413 (Dwo_file::read): Add support for v2 package file format.
2414 (Dwo_file::read_unit_index): Likewise.
2415 (Dwo_file::sized_read_unit_index): Likewise.
2416 (Dwo_file::copy_section): Likewise.
2417 (Dwo_file::add_unit_set): Likewise.
2418 (Dwp_output_file::add_output_section): Likewise.
2419 (Dwp_output_file::add_contribution): Likewise.
2420 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2421 for empty slot.
2422 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2423 file format.
2424 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2425 slot.
2426 (Dwp_output_file::initialize): Remove unused function.
2427 (Dwp_output_file::finalize): Add support for v2 package file format.
2428 (Dwp_output_file::write_index): Likewise.
2429 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2430 function prototype.
2431
2500c017
CC
24322013-10-31 Cary Coutant <ccoutant@google.com>
2433
2434 * configure.ac: Fix check for -fmerge-constants.
2435 * configure.ac: Regenerate.
2436
dd0845d7
RM
24372013-10-30 Roland McGrath <mcgrathr@google.com>
2438
2439 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
2440 Correct 9-byte nop sequence to match what the assembler generates.
2441
b4f7960d
AM
24422013-10-30 Alan Modra <amodra@gmail.com>
2443
2444 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
2445 ppc64_local_entry_offset, ppc64_local_entry_offset,
2446 do_read_symbols): New functions.
2447 (Powerpc_relobj::e_flags_, st_other_): New vars.
2448 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
2449 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
2450 (Powerpc_relobj::e_flags_): New var.
2451 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
2452 and adjust for ELFv2.
2453 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
2454 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
2455 (Powerpc_dynobj::do_find_special_sections): Likewise.
2456 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
2457 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
2458 to ELFv2 local entry.
2459 (Target_powerpc::do_relax): No thread safe barriers needed for
2460 ELFv2.
2461 (Output_data_plt_powerpc::initial_plt_entry_size_,
2462 plt_entry_size): Delete. Replace all uses with
2463 first_plt_entry_offset() and plt_entry_size().
2464 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
2465 reserved_size parm. Update callers.
2466 (Output_data_plt_powerpc::entry_count): Update.
2467 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
2468 and use Target_powerpc::first_plt_entry_offset().
2469 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
2470 rename to plt_entry_size.
2471 (Output_data_plt_powerpc::add_ifunc_entry,
2472 add_local_ifunc_entry): Adjust reloc for ELFv2.
2473 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
2474 (glink_eh_frame_fde_64v2): New.
2475 (Stub_table::plt_call_size): Support ELFv2 sizing.
2476 (Output_data_glink::add_eh_frame): Use the new FDE.
2477 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
2478 (Stub_table::do_write): Write ELFv2 stubs and glink.
2479 (Target_powerpc::Relocate::relocate): Replaces nop after call
2480 with ld 2,24(1) and adjust local offset destination for ELFv2.
2481
f9c6b907
AM
24822013-10-30 Alan Modra <amodra@gmail.com>
2483
2484 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
2485 (Target_powerpc::Scan::global, local): Likewise.
2486 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
2487 on all ppc64 @h and @ha relocs.
2488
e84fe78f
AM
24892013-10-14 Alan Modra <amodra@gmail.com>
2490
2491 * output.h (Output_data_got::add_constant): Tidy.
2492 (Output_data_got::add_constant_pair): New function.
2493 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
2494 methods used so as to first call reserve_ent().
2495
679e4abf
RM
24962013-10-11 Roland McGrath <mcgrathr@google.com>
2497
44dcb735
RM
2498 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
2499 add_got_entry and add_got_entry_pair.
2500
13323c49
RM
2501 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
2502 (HAVE_PUBNAMES): Likewise.
2503 * configure: Regenerate.
2504
1496b446
RM
2505 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
2506 * testsuite/Makefile.in: Regenerate.
2507
cc84c10b
RM
2508 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
2509 Remove const from declaration.
2510 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
2511 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
2512 * output.h (Output_file_header): Remove const from member target_
2513 and corresponding constructor argument.
2514 * output.cc (Output_file_header::Output_file_header): Update prototype.
2515 (Output_file_header::do_sized_write): Use this->target_ in place
2516 of parameters()->target().
2517
52f66a2c
RM
2518 * testsuite/undef_symbol.cc (Foo::get_a): New method.
2519
2b64b551
RM
2520 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
2521 * configure: Regenerate.
2522 * Makefile.in: Regenerate.
2523 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
2524 * testsuite/merge_string_literals_2.c: Likewise.
2525 * testsuite/Makefile.am
2526 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
2527 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
2528 literal -fmerge-constants.
2529 * testsuite/Makefile.in: Regenerate.
2530
43819297
RM
2531 * i386.cc (Target_i386): Remove unused member dynbss_.
2532 * arm.cc (Target_arm): Likewise.
2533 * powerpc.cc (Target_powerpc): Likewise.
2534 * sparc.cc (Target_sparc): Likewise.
2535 * tilegx.cc (Target_tilegx): Likewise.
2536 * x86_64.cc (Target_x86_64): Likewise.
2537 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
2538 type_signature_, type_offset_.
2539 * plugin.h (Plugin_hook): Remove unused member layout_.
2540 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
2541 mapfile_.
2542 (Read_member): Remove unused members input_objects_, symtab_,
2543 mapfile_, layout_.
2544 (Check_library): Remove unused member symtab_.
2545 * archive.h (Lib_group): Remove unused member lib_.
2546 * archive.cc (Lib_group::Lib_group): Update initializer.
2547 * incremental.h (Incremental_binary): Remove unused member target_.
2548 (Incremental_script_entry): Removed unused member script_.
2549 * layout.h (Write_symbols_task): Remove unused member input_objects_.
2550 * icf.h (Icf): Remove unused member num_tracked_relocs.
2551
39d9ead7
RM
2552 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
2553 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
2554 its only use.
2555 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
2556
679e4abf
RM
2557 * archive.h: Use struct rather than class for forward declaration
2558 of Read_symbols_data.
2559
54de2ea6
CC
25602013-10-07 Cary Coutant <ccoutant@google.com>
2561
2562 PR gold/16010
2563 * testsuite/Makefile.am (icf_test): Fix dependencies.
2564 (icf_safe_test): Likewise.
2565 (icf_safe_so_test): Likewise.
2566 (large_symbol_alignment): Add empty _LDADD rule.
2567 * testsuite/Makefile.in: Regenerate.
2568
b14016f0
L
25692013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
2570
2571 PR gold/15927
2572 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
2573 relocation for R_X86_64_32 on x32.
2574
eb426534
RM
25752013-08-27 Roland McGrath <mcgrathr@google.com>
2576
2577 * output.cc (Output_segment::set_section_addresses): Take new
2578 Target* argument. If target->isolate_execinstr() and the segment
2579 is executable and starts at a target->abi_pagesize() boundary,
2580 pad its end out to a target->abi_pagesize() boundary with code fill.
2581 * output.h (Output_segment::set_section_addresses): Update decl.
2582 * layout.h (Layout::check_output_data_for_reset_values): Take new
2583 argument RELAX_OUTPUTS.
2584 (Layout): New member relax_output_list_.
2585 (Layout::add_relax_output): New method.
2586 * layout.cc (Layout::Layout): Update constructor.
2587 (Layout::reset_relax_output): New method.
2588 (Layout::clean_up_after_relaxation): Call it.
2589 (Layout::prepare_for_relaxation): Update caller.
2590 (Layout::set_segment_offsets): Update callers of set_section_addresses.
2591 Call reset_relax_output before re-processing segments for
2592 isolate_execinstr case.
2593 (Layout::write_data): Handle relax_output_list_.
2594 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
2595 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
2596
9aff4b7a
NC
25972013-08-23 Yuri Chornoivan <yurchor@ukr.net>
2598
2599 PR binutils/15834
2600 * object.h: Fix typos.
2601
93f8221c
RM
26022013-08-16 Roland McGrath <mcgrathr@google.com>
2603
2604 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
2605 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
2606
e44c3715
CC
26072013-08-07 Cary Coutant <ccoutant@google.com>
2608
2609 Revert support for v2 DWP files:
2610
2611 2013-03-01 Cary Coutant <ccoutant@google.com>
2612
2613 Add dwp support for v2 DWARF package file format.
2614 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2615 tu_length parameter. Adjust all callers.
2616 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2617 * dwp.cc: Include dwarf.h.
2618 (Section_bounds): New struct type.
2619 (Unit_set): New struct type.
2620 (Dwo_file::Dwo_file): Initialize new data member.
2621 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2622 Combine and rename to...
2623 (Dwo_file::read_unit_index): ...this.
2624 (Dwo_file::sized_read_compunit_index)
2625 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2626 (Dwo_file::sized_read_unit_index): ...this.
2627 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2628 parameters; add section_id parameter.
2629 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2630 (Dwo_file::add_unit_set): ...this.
2631 (Dwo_file::shndx_map_): Remove.
2632 (Dwo_file::sect_offsets_): New data member.
2633 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2634 (Dwp_output_file::add_section): Rename to...
2635 (Dwp_output_file::add_contribution): ...this.
2636 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2637 (Dwp_output_file::add_tu_set): Likewise.
2638 (Dwp_output_file::Contribution): New type.
2639 (Dwp_output_file::Section::contributions): New data member.
2640 (Dwp_output_file::Cu_or_tu_set): Remove.
2641 (Dwp_output_file::Section::Section): New ctor.
2642 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2643 (Dwp_output_file::Dwp_index::Section_table): New type.
2644 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2645 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2646 parameter.
2647 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2648 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2649 (Dwp_output_file::Dwp_index::section_table): New member function.
2650 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2651 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2652 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2653 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2654 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2655 (Dwp_output_file::Dwp_index::section_table_): New data member.
2656 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2657 (Dwp_output_file::add_output_section): New member function.
2658 (Dwp_output_file::write_new_section): New member function.
2659 (Dwp_output_file::write_contributions): New member function.
2660 (Dwp_output_file::section_id_map_): New data member.
2661 (class Dwo_id_info_reader): Remove.
2662 (class Unit_reader): New class.
2663 (get_dwarf_section_name): New function.
2664 (Dwo_file::read_executable): Adjust initializations of class data.
2665 (Dwo_file::read): Add support for v2 package file format.
2666 (Dwo_file::read_unit_index): Likewise.
2667 (Dwo_file::sized_read_unit_index): Likewise.
2668 (Dwo_file::copy_section): Likewise.
2669 (Dwo_file::add_unit_set): Likewise.
2670 (Dwp_output_file::add_output_section): Likewise.
2671 (Dwp_output_file::add_contribution): Likewise.
2672 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2673 for empty slot.
2674 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2675 file format.
2676 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2677 slot.
2678 (Dwp_output_file::initialize): Remove unused function.
2679 (Dwp_output_file::finalize): Add support for v2 package file format.
2680 (Dwp_output_file::write_index): Likewise.
2681 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2682 function prototype.
2683
c6905c28
CC
26842013-07-31 Cary Coutant <ccoutant@google.com>
2685
2686 * object.cc (Sized_relobj::do_output_section_address): New function.
2687 (Sized_relobj): Instantiate explicitly.
2688 * object.h (Object::output_section_address): New function.
2689 (Object::do_output_section_address): New function.
2690 (Sized_relobj::do_output_section_address): New function.
2691 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
2692
26932013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 2694 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
2695
2696 * parameters.cc (Parameters::entry): Return target-specific entry
2697 symbol name.
2698 * target.h (Target::entry_symbol_name): New function.
2699 (Target_info::entry_symbol_name): New data member.
2700
2701 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
2702 * i386.cc (Target_i386::i386_info): Likewise.
2703 (Target_i386_nacl::i386_nacl_info): Likewise.
2704 * sparc.cc (Target_sparc::sparc_info): Likewise.
2705 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
2706 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
2707 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
2708 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
2709
234d4ab8
SA
27102013-07-22 Sterling Augustine <saugustine@google.com>
2711
2712 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
2713 Convert parameter shndx to local variable. Add parameters symtab
2714 and symtab_size. Scan over section names. Find relocation
2715 section corresponding to current section. Create and initialize
2716 reloc_mapper_ and reloc_type_.
2717 (Dwarf_pubnames_table::read_header): Add assertion. Change
2718 unit_length to off_t. Initialize member unit_length_. Fill in field
2719 cu_offset_.
2720 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2721 Initialize new fields unit_length_ and cu_offset_.
2722 (Dwarf_pubnames_table::read_section): Update prototype.
2723 (Dwarf_pubnames_table::cu_offset): New member function.
2724 (Dwarf_pubnames_table::subsection_size): Likewise.
2725 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
2726 New fields.
2727 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
2728 member functions public.
2729 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
2730 Update comment. Rework logic. Move repeated parts to...
2731 (Gdb_index_info_reader::read_pubtable): ...here. New function.
2732 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
2733 pubtypes_table_, and stmt_list_offset.
2734 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2735 Gdb_index::find_pubtype_offset,
2736 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
2737 (Gdb_index::pubnames_read): Update prototype and rework logic.
2738 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
2739 Forward declare.
2740 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2741 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
2742 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
2743 Gdb_index::map_pubtable_to_dies):
2744 Declare functions.
2745 (Gdb_index::pubnames_read): Update declaration.
2746 (Gdb_index::Pubname_offset_map): New type.
2747 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
2748 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
2749 Gdb_index::stmt_list_offset): Declare.
2750 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
2751 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
2752 Gdb_index::pubtypes_offset_): Remove.
2753
a3ed37d8
RM
27542013-07-19 Roland McGrath <mcgrathr@google.com>
2755
2756 * options.h (General_options): Add -Trodata-segment option.
2757 * parameters.cc (Parameters::check_rodata_segment): New function.
2758 (Parameters::set_target_once): Call it.
2759 * parameters.h (Parameters): Declare it (private member function).
2760 * layout.cc (load_seg_unusable_for_headers): New function, broken
2761 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
2762 then validate rodata segment rather than text segment.
2763 (relaxation_loop_body): Call that.
2764 (is_text_segment): New function. Don't admit a non-executable
2765 segment if TARGET->isolate_execinstr().
2766 (set_segment_offsets): Call it. Honor -Trodata-segment option.
2767
eb5b4ded
CC
27682013-07-15 Shawn Landden <shawnlandden@gmail.com>
2769
2770 PR gold/15070
2771 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
2772 * nacl.h (Sniff_file::View::View): Request aligned view.
2773
4d5effb9
CC
27742013-07-11 Cary Coutant <ccoutant@google.com>
2775
2776 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
2777 correct BRLT entry size.
2778
ba8ca3e7
AM
27792013-07-03 Alan Modra <amodra@gmail.com>
2780
2781 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
2782 comment.
2783
267257d2
CC
27842013-07-01 Cary Coutant <ccoutant@google.com>
2785
2786 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
2787 reloc_type_.
2788 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
2789 (Dwarf_ranges_table::lookup_reloc): New function.
2790 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
2791 reloc_type_.
2792 (Dwarf_ranges_table::lookup_reloc): New function.
2793 (Dwarf_ranges_table::reloc_type_): New data member.
2794
06f30c9d
CC
27952013-06-27 Jing Yu <jingyu@google.com>
2796
2797 PR gold/15662
2798 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
2799 function.
2800 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
2801 (Target_powerpc::do_relax): Call the above.
2802
a2d7bf59
AM
28032013-06-27 Cary Coutant <ccoutant@google.com>
2804
2805 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
2806 on garbage collected .opd section.
2807
28082013-06-27 Alan Modra <amodra@gmail.com>
2809
2810 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
2811 is non-zero.
2812 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
2813 (Target_powerpc::do_function_location): Likewise for loc->shndx.
2814
32364e50
CC
28152013-06-14 Cary Coutant <ccoutant@google.com>
2816
2817 * resolve.cc (Symbol::override_base): Don't override st_type
2818 from plugin placeholder symbols.
2819 (Symbol_table::resolve): Likewise.
2820 (Symbol_table::should_override): Don't complain about TLS mismatch
2821 if the TO symbol is a plugin placeholder.
2822 * testsuite/Makefile.am (plugin_test_tls): New test.
2823 * testsuite/Makefile.in: Regenerate.
2824 * testsuite/plugin_test_tls.sh: New test script.
2825 * testsuite/two_file_test_2_tls.cc: New test source.
2826 * testsuite/two_file_test_tls.cc: New test source.
2827
7fb47cc9
CC
28282013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
2829
2830 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
2831 the maximum segment alignment is larger than the page size.
2832 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
2833 correctly aligns the symbols with large alignemnt.
2834 * testsuite/Makefile.in: Regenerate.
2835 * testsuite/large_symbol_alignment.cc: New file.
2836
6934001a
CC
28372013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
2838 Sriraman Tallam <tmsriram@google.com>
2839
2840 * options.h (sort_section): New option.
2841 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
2842 Rename from Input_section_sort_section_name_special_ordering_compare.
2843 (Input_section_sort_section_name_compare): New struct.
2844 * output.cc (Output_section::Input_section_sort_section_name_compare::
2845 operator()): New function.
2846 (Output_section::sort_attached_input_sections): Use new sort function
2847 for .text if --sort-section=name is specified.
2848 * layout.cc (Layout::make_output_section):
2849 Add sorting by name when --sort-section=name is specified.
2850 * testsuite/Makefile.am (text_section_grouping): Test option
2851 --sort-section=name.
2852 * testsuite/Makefile.in: Regenerate.
2853 * testsuite/section_sorting_name.cc: New file.
2854 * testsuite/section_sorting_name.sh: New file.
2855
93acabad
CC
28562013-05-21 Cary Coutant <ccoutant@google.com>
2857
2858 * symtab.h (Symbol::is_cxx_vtable): New function.
2859 * target-reloc.h (relocate_section): Check for vtable symbol.
2860 * testsuite/Makefile.am (missing_key_func.sh): New test case.
2861 * testsuite/Makefile.in: Regenerate.
2862 * testsuite/missing_key_func.cc: New test source.
2863 * testsuite/missing_key_func.sh: New test script.
2864
60e8b3fc
CC
28652013-05-21 Cary Coutant <ccoutant@google.com>
2866
2b64b551
RM
2867 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
2868 type of enclosing symbol.
2869 (Relocate_info::location): Check symbol type when describing symbol.
2870 * object.h (Symbol_location_info): Remove unused line_number;
2871 add enclosing_symbol_type.
2872 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 2873
9df9de2c
CC
28742013-05-13 Cary Coutant <ccoutant@google.com>
2875
2b64b551
RM
2876 * configure.ac: Export DEFAULT_TARGET.
2877 * configure: Regenerate.
2878 * Makefile.in: Regenerate.
2879 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
2880 * testsuite/Makefile.in: Regenerate.
2881 * testsuite/debug_msg.sh: Delete duplicate tests.
2882 Don't check undef_int error message match for powerpc where the
2883 source file and line number aren't available.
9df9de2c 2884
bbc5ae17
RM
28852013-05-10 Roland McGrath <mcgrathr@google.com>
2886
2887 * options.h (General_options): Add --rosegment-gap option.
2888 * options.cc (finalize): --rosegment-gap implies --rosegment.
2889 * layout.cc (set_segment_offsets): Let user option override
2890 target->rosegment_gap().
2891
0c6e6c39
RM
28922013-05-10 Roland McGrath <mcgrathr@google.com>
2893
2894 * options.h (General_options): Remove leading space from help
2895 messages for -nostdlib and --rosegment.
2896
cde7cb01
MR
28972013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
2898
2899 PR ld/15365
2900 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
2901
f31ae5b8
AM
29022013-05-03 Alan Modra <amodra@gmail.com>
2903
2904 * merge.cc (Output_merge_string::do_add_input_section): Correct
2905 scan for number of strings. Rename vars to avoid shadowing.
2906 Include missing terminator in input_size_.
2907
d3a7cd45
L
29082013-05-01 H.J. Lu <hongjiu.lu@intel.com>
2909
2910 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
2911 Restore empty string handling.
2912
6ad3daba
CC
29132013-05-01 Cary Coutant <ccoutant@google.com>
2914
2915 * stringpool.cc (Stringpool_template::new_key_offset): Fix
2916 uninitialized warning.
2917
e31908b6
CC
29182013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
2919
2920 * output.cc (Output_section::add_merge_input_section): Allow
2921 to merge sections if the alignment is more than character size.
2922 * merge.h (Output_merge_string::Output_merge_string): Remove
2923 assert.
2924 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
2925 only not-null strings. Check the alignment of strings.
2926 * stringpool.h
2927 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
2928 alignment as the argument.
2929 (Stringpool_template<Stringpool_char>::addralign_): New class member.
2930 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
2931 Align non-zero length strings according to the addralign_.
2932 (Stringpool_template<Stringpool_char>::set_string_offsets):
2933 Updating offsets according to the given alignment.
2934 * testsuite/Makefile.am (text_section_grouping): Test if string
2935 literals are getting merged.
2936 * testsuite/Makefile.in: Regenerate.
2937 * testsuite/merge_string_literals_1.c: New file.
2938 * testsuite/merge_string_literals_2.c: Ditto.
2939 * testsuite/merge_string_literals.sh: Ditto.
2940
0e804863
ILT
29412013-04-26 Ian Lance Taylor <iant@google.com>
2942
2943 * target-reloc.h (relocate_section): If the reloc offset is out of
2944 range, pass VIEW as NULL to relocate.relocate.
2945 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
2946 * i386.cc (Target_i386::Relocate::relocate): Likewise.
2947 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
2948 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
2949 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
2950 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
2951
e7c5ea40
CC
29522013-04-26 Geoff Pike <gpike@chromium.org>
2953
2954 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
2955 * layout.cc (Hash_task): New class.
2956 (Layout::queue_build_id_tasks): New function.
2957 (Layout::write_build_id): Handle single-thread portion of build ID
2958 computation. (In some cases, all of it is single-threaded.) Replace
2959 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
2960 functionality in fewer lines of code.
2961 * layout.h (Layout::queue_build_id_tasks): New function declaration.
2962 * options.h (General_options): make "--build-id" default to tree
2963 rather than sha1. Add two new options related to --build-id=tree:
2964 --build-id-chunk-size-for-treehash and
2965 --build-id-min-file-size-for-treehash.
2966 * Makefile.am: add testing of --build-id=tree and related new options
2967 (these tests will be invoked by "make check").
2968 * Makefile.in: Regenerate.
2969
49926cd0
AM
29702013-04-25 Alan Modra <amodra@gmail.com>
2971
2972 * configure.tgt: Add powerpcle and powerpc64le.
2973
a4034750
AM
29742013-04-22 Alan Modra <amodra@gmail.com>
2975
2976 PR gold/15355
2977 * layout.cc (Layout::segment_precedes): Allow more than one
2978 segment with the same type and flags.
2979
e79c84aa
CC
29802013-04-15 Cary Coutant <ccoutant@google.com>
2981
2982 * layout.cc (Layout::set_relocatable_section_offsets): Don't
2983 allocate space in file for BSS sections.
2984
2199fbe7
CC
29852013-04-15 Cary Coutant <ccoutant@google.com>
2986
2987 * script-sections.cc (Orphan_output_section): Reset address
2988 to zero after each orphaned section for relocatable links.
2989
502e8a84
CC
29902013-04-15 Cary Coutant <ccoutant@google.com>
2991
a4034750
AM
2992 * symtab.cc (Symbol_table::sized_write_globals): Subtract
2993 section starting address for relocatable link.
2994 * testsuite/Makefile.am (script_test_11): New test.
2995 * testsuite/Makefile.in: Regenerate.
2996 * testsuite/script_test_11.c: New source file.
2997 * testsuite/script_test_11.t: New linker script.
502e8a84 2998
0cfdc767
AM
29992013-04-13 Alan Modra <amodra@gmail.com>
3000
3001 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
3002 owner when sections are not adjacent and exceed group size.
3003 (Target_powerpc::group_sections): Handle corner case.
3004 (Target_powerpc::Branch_info::make_stub): Handle case where
3005 stub table doesn't exist due to branches in non-exec sections.
3006 (Target_powerpc::Relocate::relocate): Likewise.
3007
6830ee24
AM
30082013-04-11 Alan Modra <amodra@gmail.com>
3009
3010 PR gold/15354
3011 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
3012 .branch_lt to match bfd ld. Adjust comments throughout file.
3013
54a3d865
ILT
30142013-04-04 Ian Lance Taylor <iant@google.com>
3015
3016 GCC PR c++/56840
3017 * object.cc (do_layout_deferred_sections): Handle .eh_frame
3018 sections before checking whether they are included in the link.
3019
9993ba11
ST
30202013-03-29 Sriraman Tallam <tmsriram@google.com>
3021
3022 * archive.cc (Archive::get_elf_object_for_member): Create the elf
3023 object before calling the plugin claim_file handler. Pass the elf
3024 object of the archive to the plugin. Delete the elf object if the
3025 plugin claims the file.
3026
ebacd51e
AM
30272013-03-21 Alan Modra <amodra@gmail.com>
3028
3029 * layout.cc (Layout::set_segment_offsets): Accept writable .text
3030 segment when omagic.
3031
117be58f
AM
30322013-03-21 Alan Modra <amodra@gmail.com>
3033
3034 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
3035 comparison warning.
3036 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
3037 uninitialized" warning.
3038
32e2b61d
AM
30392013-03-20 Alan Modra <amodra@gmail.com>
3040
3041 * symtab.h (Symbol::clear_version): New function.
3042 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
3043 is_needed by weak references. Clear version for symbols defined
3044 in as-needed objects that are not needed.
3045
b3ccdeb5
AM
30462013-03-15 Alan Modra <amodra@gmail.com>
3047
3048 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
3049 static and public. Add report_err param. Return false for data refs.
3050 (Target_powerpc::rela_dyn_section): New overloaded function.
3051 (Target_powerpc::plt_, iplt_): Elucidate.
3052 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
3053 (Output_data_plt_powerpc::do_write): Don't write .iplt.
3054 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
3055 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
3056 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
3057 push_branch and make_plt_entry for ifunc syms when
3058 reloc_needs_plt_for_ifunc.
3059 (Target_powerpc::Relocate::relocate): Don't use plt entry value
3060 for ifunc unless reloc_needs_plt_for_ifunc.
3061
ad3d8a2f
AM
30622013-03-15 Alan Modra <amodra@gmail.com>
3063
3064 * gc.h (gc_process_relocs): Don't look through function descriptors.
3065 * icf.cc (get_section_contents): Do so here instead.
3066
4d9aa155
AM
30672013-03-13 Alan Modra <amodra@gmail.com>
3068
3069 * powerpc.cc (is_branch_reloc): Forward declare.
3070 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
3071 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
3072 false for 64-bit, true for 32-bit non-branch relocs.
3073 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
3074 * testsuite/Makefile.am (icf_test): Use linker map file instead of
3075 nm output.
3076 (icf_safe_test): Generate linker map file as well as nm output.
3077 (icf_safe_so_test): Likewise.
3078 * testsuite/Makefile.in: Regenerate.
3079 * testsuite/icf_test.sh: Parse linker map file to determine
3080 section folding.
3081 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
3082 * testsuite/icf_safe_so_test.sh: Likewise.
3083 (X86_32_or_ARM_specific_safe_fold): Merge into..
3084 (arch_specific_safe_fold): ..this.
3085 (X86_64_specific_safe_fold): Delete unused function.
3086
57420c20
AM
30872013-03-12 Alan Modra <amodra@gmail.com>
3088
3089 * gc.h (gc_process_relocs): Look through function descriptors
3090 to determine shndx, symvalue and addend used by ICF. Tidy
3091 variable duplication.
3092
dc3714f3
AM
30932013-03-11 Alan Modra <amodra@gmail.com>
3094
3095 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
3096 * layout.cc (Layout_task_runner::run): ..to here.
3097 * symtab.h (struct Symbol_location): Extract from..
3098 (class Symbol_table): ..here.
3099 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
3100 * target.h (class Target): Add function_location and
3101 do_function_location functions.
3102 (class Sized_target): Add do_function_location.
3103 * object.h (class Sized_relobj_file): Move find_shdr..
3104 (class Object): ..to here.
3105 * object.cc: Likewise. Update to suit. Instantiate.
3106 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
3107 * powerpc.cc (class Powerpc_dynobj): New.
3108 (Target_powerpc::do_function_location): New function.
3109 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
3110 (Powerpc_dynobj::do_read_symbols): New function.
3111 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
3112
956b03bb
ILT
31132013-03-08 Ian Lance Taylor <iant@google.com>
3114
3115 * options.cc (General_options::string_to_object_format): Accept
3116 "default".
3117
4bead2d5
AM
31182013-03-08 Alan Modra <amodra@gmail.com>
3119
3120 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
3121 pointer to Post_fde.
3122 (struct Post_fde): Move definition to here..
3123 * ehframe.cc (struct Post_fde): ..from here.
3124 (Cie::write): Don't alloc Post_fde.
3125 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
3126
02e60bf7
AM
31272013-03-07 Alan Modra <amodra@gmail.com>
3128
3129 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
3130 relocation referencing .LC0.
3131 * testsuite/discard_locals_test.sh: Remove FIXMEs.
3132
8343f03a
AM
31332013-03-07 Alan Modra <amodra@gmail.com>
3134
3135 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
3136 always_inline. Add assembly for powerpc to avoid GOT.
3137
3366d57c
AM
31382013-03-07 Alan Modra <amodra@gmail.com>
3139
3140 * testsuite/script_test_10.sh: Don't test .bss section
3141 header number.
3142
6c77229c
AM
31432013-03-06 Alan Modra <amodra@gmail.com>
3144
3145 * powerpc.cc (class Powerpc_relobj): Move some member functions.
3146 (Target_powerpc::symval_for_branch): Add symtab param. Update
3147 all callers. Handle folded sections.
3148 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
3149 to Powerpc_relobj.
3150 (Global_symbol_visitor_opd::operator()): Likewise.
3151
a39e4af6
AM
31522013-03-04 Alan Modra <amodra@gmail.com>
3153
3154 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
3155 * testsuite/Makefile.in: Regenerate.
3156
d5834edb
CC
31572013-03-01 Cary Coutant <ccoutant@google.com>
3158
3159 Add dwp support for v2 DWARF package file format.
3160 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
3161 tu_length parameter. Adjust all callers.
3162 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
3163 * dwp.cc: Include dwarf.h.
3164 (Section_bounds): New struct type.
3165 (Unit_set): New struct type.
3166 (Dwo_file::Dwo_file): Initialize new data member.
3167 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
3168 Combine and rename to...
3169 (Dwo_file::read_unit_index): ...this.
3170 (Dwo_file::sized_read_compunit_index)
3171 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
3172 (Dwo_file::sized_read_unit_index): ...this.
3173 (Dwo_file::copy_section): Remove section_name, is_str_offsets
3174 parameters; add section_id parameter.
3175 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
3176 (Dwo_file::add_unit_set): ...this.
3177 (Dwo_file::shndx_map_): Remove.
3178 (Dwo_file::sect_offsets_): New data member.
3179 (Dwp_output_file::Dwp_output_file): Initialize new data members.
3180 (Dwp_output_file::add_section): Rename to...
3181 (Dwp_output_file::add_contribution): ...this.
3182 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
3183 (Dwp_output_file::add_tu_set): Likewise.
3184 (Dwp_output_file::Contribution): New type.
3185 (Dwp_output_file::Section::contributions): New data member.
3186 (Dwp_output_file::Cu_or_tu_set): Remove.
3187 (Dwp_output_file::Section::Section): New ctor.
3188 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
3189 (Dwp_output_file::Dwp_index::Section_table): New type.
3190 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
3191 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
3192 parameter.
3193 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
3194 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
3195 (Dwp_output_file::Dwp_index::section_table): New member function.
3196 (Dwp_output_file::Dwp_index::section_table_end): New member function.
3197 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
3198 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
3199 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
3200 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
3201 (Dwp_output_file::Dwp_index::section_table_): New data member.
3202 (Dwp_output_file::Dwp_index::section_mask_): New data member.
3203 (Dwp_output_file::add_output_section): New member function.
3204 (Dwp_output_file::write_new_section): New member function.
3205 (Dwp_output_file::write_contributions): New member function.
3206 (Dwp_output_file::section_id_map_): New data member.
3207 (class Dwo_id_info_reader): Remove.
3208 (class Unit_reader): New class.
3209 (get_dwarf_section_name): New function.
3210 (Dwo_file::read_executable): Adjust initializations of class data.
3211 (Dwo_file::read): Add support for v2 package file format.
3212 (Dwo_file::read_unit_index): Likewise.
3213 (Dwo_file::sized_read_unit_index): Likewise.
3214 (Dwo_file::copy_section): Likewise.
3215 (Dwo_file::add_unit_set): Likewise.
3216 (Dwp_output_file::add_output_section): Likewise.
3217 (Dwp_output_file::add_contribution): Likewise.
3218 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
3219 for empty slot.
3220 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
3221 file format.
3222 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
3223 slot.
3224 (Dwp_output_file::initialize): Remove unused function.
3225 (Dwp_output_file::finalize): Add support for v2 package file format.
3226 (Dwp_output_file::write_index): Likewise.
3227 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
3228 function prototype.
3229
a68a081d
CC
32302013-03-01 Cary Coutant <ccoutant@google.com>
3231
3232 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
3233 function into class definition in header file.
3234 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
3235 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
3236 New function.
3237 (Dwarf_info_reader::check_buffer): Move here from .cc file.
3238
9d5781f8
AM
32392013-02-28 Alan Modra <amodra@gmail.com>
3240
3241 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
3242 * target.cc (Target::do_plt_fde_location): New function.
3243 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
3244 accessor function, and constructor param.
3245 (struct Post_fde, Post_fdes): Declare.
3246 (Cie::write): Add post_fdes param.
3247 * ehframe.cc (Fde::write): Use plt_fde_location.
3248 (struct Post_fde): Define.
3249 (Cie::write): Stash FDEs added post merge mapping.
3250 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
3251 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
3252 (Eh_frame::do_sized_write): Arrange to write post map FDES after
3253 other FDEs.
3254 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
3255 (Target_powerpc::has_glink): New function.
3256 (Target_powerpc::do_relax): Add eh_frame info for stubs.
3257 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
3258 glink_eh_frame_fde_32, default_fde): New data.
3259 (Stub_table::eh_frame_added_): New var.
3260 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
3261 Make const.
3262 (Stub_table::add_eh_frame): New function.
3263 (Output_data_glink::add_eh_frame): New function.
3264 (Target_powerpc::make_glink_section): Call add_eh_frame.
3265
214383dd
ILT
32662013-02-15 Ian Lance Taylor <iant@google.com>
3267
3268 * options.h (DEFINE_uint64_alias): Define.
3269 (class General_options): Add -Ttext-segment as an alias for
3270 -Ttext.
3271
91c2b899
AM
32722013-02-15 Alan Modra <amodra@gmail.com>
3273
3274 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
3275 (Stub_table::do_write): ..here, two places.
3276 (Stub_table::plt_call_size): Use it here too.
3277
20e2a8aa
ILT
32782013-02-11 Ian Lance Taylor <iant@google.com>
3279
3280 * descriptors.cc (Descriptors::close_all): New function.
3281 * descriptors.h (class Descriptors): Declare close_all.
3282 (close_all_descriptors): New inline function.
3283 * plugin.cc: Include "descriptors.h".
3284 (Plugin_manager::cleanup): Call close_all_descriptors.
3285
8952bc69
AM
32862013-02-06 Alan Modra <amodra@gmail.com>
3287
3288 * README: Update coding style link.
3289
29bd8b6b
CC
32902013-01-28 Cary Coutant <ccoutant@google.com>
3291
a4034750
AM
3292 * dwp.cc (File_list): New typedef.
3293 (Dwo_name_info_reader): New class.
3294 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
3295 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
3296 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
3297 (Dwo_file::read_executable): New function.
3298 (Dwo_file::read): Move common setup code to ...
3299 (Dwo_file::make_object): ... here.
3300 (dwp_options): Add --exec/-e.
3301 (usage): Likewise.
3302 (main): Likewise.
29bd8b6b 3303
c6ac678d
ST
33042013-01-24 Sriraman Tallam <tmsriram@google.com>
3305
3306 * layout.cc (Layout::layout): Check for option text_reorder.
3307 (Layout::make_output_section): Ditto.
3308 * options.h (text_reorder): New option.
3309 * output.cc (Input_section_sort_compare): Remove special ordering
3310 of section names.
3311 (Output_section::
3312 Input_section_sort_section_name_special_ordering_compare::
3313 operator()): New function.
3314 (Output_section::sort_attached_input_sections): Use new sort function
3315 for .text.
3316 * output.h (Input_section_sort_section_name_special_ordering_compare):
3317 New struct.
3318 * testsuite/Makefile.am (text_section_grouping): Test option
3319 --no-text-reorder
3320 * testsuite/Makefile.in: Regenerate.
3321 * testsuite/text_section_grouping.sh: Check order of functions without
3322 default text reordering.
3323
50701cc1
MF
33242013-01-18 Mike Frysinger <vapier@gentoo.org>
3325
3326 * options.h (General_options): Change default to true for new_dtags.
3327
b1b00fcc
MF
33282013-01-18 Mike Frysinger <vapier@gentoo.org>
3329
3330 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
3331 when enable_new_dtags is false. Only add DT_RUNPATH when
3332 enable_new_dtags is true.
3333
ec5b8187
AM
33342013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
3335
3336 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
3337 used in declaration and definition consistent.
3338 (Target_powerpc::symval_for_branch): Ditto.
3339
a880d4c4
ST
33402013-01-16 Sriraman Tallam <tmsriram@google.com>
3341
3342 * testsuite/plugin_final_layout.cc: Fix comment.
3343
7c381248
ST
33442013-01-16 Sriraman Tallam <tmsriram@google.com>
3345
3346 * layout.cc (Layout::layout): Do not do default sorting for
3347 text sections when section ordering is specified.
3348 (make_output_section): Ditto.
3349 * testsuite/plugin_final_layout.cc: Name the function sections
3350 to catch reordering issues.
3351
e2458743
AM
33522013-01-15 Alan Modra <amodra@gmail.com>
3353
3354 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
3355 plt-thread-safe.
3356
431ed302
AM
33572013-01-15 Alan Modra <amodra@gmail.com>
3358
3359 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
3360 * testsuite/Makefile.in: Regenerate.
3361
0ec6429b
AM
33622013-01-14 Alan Modra <amodra@gmail.com>
3363
3364 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
3365 * testsuite/Makefile.in: Regenerate.
3366
0bf402d5
ILT
33672013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
3368
36af3926 3369 PR bfd/14430
0bf402d5
ILT
3370 Fix mingw gold build with plugins enabled
3371 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
3372 * configure.ac: Export DLOPEN_LIBS and add headers check.
3373 * plugin.cc: Handle non-dlfcn case.
3374 * Makefile.in: Regenerate.
3375 * config.in: Regenerate.
3376 * configure: Regenerate.
3377 * testsuite/Makefile.in: Regenerate.
3378
9e9143bc
ST
33792013-01-09 Sriraman Tallam <tmsriram@google.com>
3380
3381 * output.h (sort_attached_input_sections): Change to be public.
3382 * script-sections.cc
3383 (Output_section_definition::set_section_addresses): Sort
3384 attached input sections according to section order before linker
3385 script assigns section addresses.
3386 (Orphan_output_section::set_section_addresses): Sort
3387 attached input sections according to section order before linker
3388 script assigns section addresses.
3389 * Makefile.am (final_layout.sh): Use a simple linker script to
3390 check if section ordering still works.
3391 * Makefile.in: Regenerate.
3392
679af368
ILT
33932013-01-09 Ben Cheng <bccheng@google.com>
3394
3395 * arm.cc (Target_arm::attributes_accept_div): New function.
3396 (Target_arm::attributes_forbid_div): New function.
3397 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
3398 attribute using the same new functions as what bfd/elf32_arm.c
3399 does.
3400
3136a00e
CC
34012013-01-07 Cary Coutant <ccoutant@google.com>
3402
3403 PR gold/14993
3404 * output.cc (Output_section::add_input_section): For incremental
3405 updates, don't track input sections that are allocated from patch
3406 space.
3407
f2a6224b
L
34082013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3409 Ian Lance Taylor <iant@google.com>
3410
3411 PR gold/14897
3412 * configure.ac (--enable-ld): Removed.
3413 (install_as_default): Set to yes only for --enable-gold=default
3414 or --disable-ld.
3415 * configure: Regenerated.
3416
4f46f626
L
34172013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3418
3419 * options.h (General_options): Add -fuse-ld= for GCC linker
3420 option compatibility.
3421
26e4ef59
CC
34222013-01-04 Cary Coutant <ccoutant@google.com>
3423
3424 * configure.ac: Fix typo restoring CXXFLAGS.
3425 * configure: Regenerate.
3426
3d587466
CC
34272013-01-04 Cary Coutant <ccoutant@google.com>
3428
4f46f626
L
3429 * testsuite/Makefile.am (CXXLINK_S): New macro.
3430 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
3431 * testsuite/Makefile.in: Regenerate.
3d587466 3432
44db6695
L
34332013-01-02 H.J. Lu <hongjiu.lu@intel.com>
3434
3435 * version.cc (print_version): Update copyright year to 2013.
3436
edcac0c1
ILT
34372012-12-20 Ian Lance Taylor <iant@google.com>
3438
3439 * layout.cc (Layout::special_ordering_of_input_section): New
3440 function.
3441 (Layout::layout): If input section requires special ordering, must
3442 sort input sections.
3443 (Layout::make_output_section): May sort .text input sections.
3444 (Layout::is_section_name_prefix_grouped): Remove.
3445 * layout.h (class Layout): Declare
3446 special_ordering_of_input_section. Don't declare
3447 is_section_name_prefix_grouped.
3448 * output.cc (Output_section::add_input_section): Revert last
3449 change.
3450 (Output_section::Input_section_sort::match_file_name): Don't crash
3451 if called on output section data.
3452 (Output_section::Input_section_sort_compare): Sort based on
3453 special ordering.
3454 (Output_section::Input_section_sort_section_order_index_compare):
3455 Revert last patch.
3456 (Output_section::sort_attached_input_sections): Likewise.
3457
28f2a4ac
ST
34582012-12-18 Sriraman Tallam <tmsriram@google.com>
3459
edcac0c1 3460 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
3461 * layout.h (Layout::is_section_name_prefix_grouped): New function.
3462 * output.cc (Output_section::add_input_section): Check if section
3463 name contains special prefix. Keep input sections to sort such
3464 sections.
3465 (Output_section::Input_section_sort_section_order_index_compare
3466 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
3467 (Output_section::sort_attached_input_sections): Add condition to
3468 Input_section_entry constructor call.
28f2a4ac
ST
3469 * testsuite/Makefile.am (text_section_grouping): New test.
3470 * testsuite/Makefile.in: Regenerate.
3471 * testsuite/text_section_grouping.cc: New file.
3472 * testsuite/text_section_grouping.sh: New file.
3473
5bf135a7
NC
34742012-12-17 Nick Clifton <nickc@redhat.com>
3475
3476 * Makefile.am: Add copyright notice.
3477 * NEWS: Likewise.
3478 * README: Likewise.
3479 * configure.ac: Likewise.
3480 * ftruncate.c: Likewise.
3481 * Makefile.in: Regenerate.
3482
59965708
CC
34832012-12-14 Cary Coutant <ccoutant@google.com>
3484
a4034750
AM
3485 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
3486 --no-as-needed flag.
3487 (exception_separate_shared_12_test): Likewise.
3488 (incremental_copy_test): Likewise.
3489 * testsuite/Makefile.in: Regenerate.
59965708 3490
2a77e2ab
CC
34912012-12-14 Cary Coutant <ccoutant@google.com>
3492
3493 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
3494 (Dwp_output_file::Dwp_index::enter_set): Add assert.
3495
e3deeb9c
AM
34962012-12-12 Alan Modra <amodra@gmail.com>
3497
3498 * powerpc.cc (class Track_tls): New.
3499 (class Relocate, class Scan): Inherit Track_tls.
3500 (Target_powerpc::Scan::local, global): Track tls optimization
3501 and avoid creating plt entry for __tls_get_addr if all uses
3502 are optimized away.
3503 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
3504
d8f5a274
AM
35052012-12-12 Alan Modra <amodra@gmail.com>
3506
3507 * options.h (General_options): Add --toc-sort/--no-toc-sort.
3508 Replace no_toc_optimize with toc_optimize.
3509 * output.h (Output_section::input_sections): Provide non-const variant.
3510 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
3511 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
3512 accessors.
3513 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
3514 (class Sort_toc_sections): New.
3515 (Target_powerpc::do_finalize_sections): Sort toc sections.
3516 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
3517
4c8a1de1
RM
35182012-12-10 Roland McGrath <mcgrathr@google.com>
3519
3520 * testsuite/binary_unittest.cc (read_all): New function.
3521 (Sized_binary_test): Use it instead of ::read.
3522 * fileread.cc (do_read): Don't assume pread always reads the whole
3523 amount in a single call.
3524
edc27beb
AM
35252012-12-10 Alan Modra <amodra@gmail.com>
3526
3527 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
3528 Set EM_PPC64 or EM_PPC here.
3529 (Target_selector_powerpc::do_recognize): Delete.
3530
906b9150
AM
35312012-12-10 Alan Modra <amodra@gmail.com>
3532
3533 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
3534 stub_table_.
3535 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
3536
418c15ae
RM
35372012-12-07 Roland McGrath <mcgrathr@google.com>
3538
3539 * testsuite/binary_unittest.cc (Sized_binary_test):
3540 Use open_descriptor rather than ::open.
3541
decdd3bc
AM
35422012-12-07 Alan Modra <amodra@gmail.com>
3543
3544 * powerpc.cc (Stub_table::do_write): Delete redundant Address
3545 typedef and invalid_address constant.
3546 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
3547 instantiate constants.
3548
db399005
ILT
35492012-12-06 Roland McGrath <mcgrathr@google.com>
3550
3551 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
3552 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
3553 * aclocal.m4: Regenerate.
3554 * configure: Regenerate.
3555 * Makefile.in: Regenerate.
3556 * testsuite/Makefile.in: Regenerate.
3557
aba6bc71
AM
35582012-12-07 Alan Modra <amodra@gmail.com>
3559
3560 * options.h (General_options): Add no_toc_optimize.
3561 * powerpc.cc (ok_lo_toc_insn): New function.
3562 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
3563
9e69ed50
AM
35642012-12-06 Alan Modra <amodra@gmail.com>
3565
3566 * options.h (General_options): Add plt_align, plt_static_chain,
3567 plt_thread_safe. Update stub_group_size help text.
3568 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
3569 for new plt_thread_safe_ var.
3570 (use_plt_offset): Correct comments.
3571 (Target_powerpc::do_relax): Look for thread creation symbols to
3572 determine default plt_thread_safe value. Clear plt call stubs
3573 as well as branch stubs each iteration.
3574 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
3575 insn constants.
3576 (l, hi, ha, write_insn): Move earlier.
3577 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
3578 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
3579 plt stubs too.
3580 (Stub_table::update_size): Adjust.
3581 (Stub_table::prev_size, set_prev_size): Delete.
3582 (Stub_table::stub_align): Let --plt-align affect result.
3583 (Stub_table::plt_call_size): Calculate sizes for various stubs.
3584 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
3585 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
3586 (Stub_table::do_write): Support more stub variants.
3587
f43ba157
AM
35882012-12-04 Alan Modra <amodra@gmail.com>
3589
3590 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
3591 (Target_powerpc::do_define_standard_symbols): New function.
3592
34171bc5
AM
35932012-12-03 Alan Modra <amodra@gmail.com>
3594
3595 * output.h: Formatting, whitespace.
3596
dc9589e9 35972012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
3598
3599 * layout.h (Layout::get_executable_sections): Declare.
3600 * layout.cc (Layout::get_executable_sections): New function.
3601 * arm.cc (Target_arm::group_sections): Use it.
3602 (Arm_output_section::group_sections): Delete now redundant test.
3603 * output.cc (Output_reloc::Output_reloc): Add is_relative.
3604 param to handle relative relocs.
3605 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
3606 (Output_data_reloc::add_absolute): Adjust.
3607 (Output_data_reloc::add_relative): New function.
3608 (Output_data::reset_data_size): New function.
3609 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
3610 (Output_section::set_addralign): New function.
3611 (Output_section::checkpoint_set_addralign): New function.
3612 (Output_section::clear_section_offsets_need_adjustment): New function.
3613 (Output_section::input_sections): Make public.
3614 * powerpc.cc (class Output_data_brlt_powerpc): New.
3615 (class Stub_table, class Stub_control): New.
3616 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
3617 stub_table_, set_stub_table, stub_table): New vectors and accessor
3618 functions.
3619 (Target_powerpc::do_may_relax, do_relax, push_branch,
3620 new_stub_table, stub_tables, brlt_section, group_sections,
3621 add_branch_lookup_table, find_branch_lookup_table,
3622 write_branch_lookup_table, make_brlt_section): New functions.
3623 (Target_powerpc::struct Sort_sections, class Branch_info): New.
3624 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
3625 branch_info_): New vars.
3626 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
3627 make call stubs here.
3628 (Output_data_glink): Remove all call stub handling from this class.
3629 (Target_powerpc::Scan::local, global): Save interesting branch
3630 relocs and relocs for ifunc. Adjust calls to plt entry functions.
3631 (Target_powerpc::do_finalize_sections): Only make reg save/restore
3632 functions on final link.
3633 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
3634 Handle long branch destinations too.
3635 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
3636 do_plt_address_for_local): Adjust lookup of plt call stubs.
3637
627b30b7
AM
36382012-11-30 Alan Modra <amodra@gmail.com>
3639
3640 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
3641 relocs against protected symbols when building 32-bit shared libs.
3642
40b469d7
AM
36432012-11-30 Alan Modra <amodra@gmail.com>
3644
3645 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
3646 param. Call got_section() to make .got. Update all callers
3647 and their callers and so on.
3648
bb66a627
AM
36492012-11-30 Alan Modra <amodra@gmail.com>
3650
3651 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
3652 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
3653 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
3654 value if it already exists.
3655
d2cf1c6c
L
36562012-11-19 H.J. Lu <hongjiu.lu@intel.com>
3657
3658 PR gold/14858
3659 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
3660
edccdf7c
RM
36612012-11-14 Roland McGrath <mcgrathr@google.com>
3662
3663 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
3664 than bfc instruction for data sandboxing.
3665
6febeb74
AM
36662012-11-08 Alan Modra <amodra@gmail.com>
3667
3668 * po/POTFILES.in: Regenerate.
3669
0a6f1bf2
AM
36702012-11-05 Alan Modra <amodra@gmail.com>
3671
3672 * configure.ac: Apply 2012-09-10 change to config.in here.
3673 * configure: Regenerate.
3674
26a4e9cb
AM
36752012-11-05 Alan Modra <amodra@gmail.com>
3676
3677 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
3678 (struct Opd_ent): Use "Address" rather than "Offset".
3679 (Output_data_got_powerpc::got_base_offset): Return Valtype.
3680 (Target_powerpc::got_section): Make public.
3681 (Target_powerpc::scan_relocs): Move code setting symbols..
3682 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
3683 Create _SDA_BASE_ only when referenced.
3684
cc928013
RM
36852012-11-02 Roland McGrath <mcgrathr@google.com>
3686
3687 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
3688 from last change.
3689
50ed5eb1
RM
36902012-11-01 Roland McGrath <mcgrathr@google.com>
3691
62fe925a
RM
3692 * target.h (Sized_target::relocate_relocs): Use Elf_Off
3693 for offset_in_output_section parameter.
3694 (Sized_target::relocate_special_relocatable): Likewise.
3695 * arm.cc (Target_arm::relocate_relocs): Likewise.
3696 (Target_arm::relocate_special_relocatable): Likewise.
3697 * i386.cc (Target_i386::relocate_relocs): Likewise.
3698 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
3699 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
3700 * target-reloc.h (relocate_relocs): Likewise.
3701 * testsuite/testfile.cc (Target_test): Likewise.
3702 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
3703 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
3704
3705 * system.h: Move inclusion of <clocale> to after <libintl.h> in
3706 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
3707
3708 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
3709 parameter, which is unused in the [!F_SETFD] case.
3710
50ed5eb1
RM
3711 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
3712 SYMNDX to off_t before comparing it to this->data_size().
3713 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
3714 * incremental.cc (Output_section_incremental_inputs::do_write):
3715 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
3716
2cadc0bf
RM
3717 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
3718
3bfcb652
NC
37192012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
3720
3721 * gold.cc (Target_arm::do_adjust_elf_header): Add the
3722 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
3723 in EABI_VER5.
3724
c1a8d56e
CC
37252012-10-29 Cary Coutant <ccoutant@google.com>
3726
3727 * dwp.cc (usage): Add file and exit status parameters;
3728 add --help and --version options.
3729 (print_version): New function.
3730 (main): Add --help and --version options.
3731
b2490a7b
L
37322012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3733
3734 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
3735 final_layout_sequence.txt.
3736 * testsuite/Makefile.in: Regenerated.
3737
aa543512
L
37382012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3739
3740 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
3741 COMPILE generated by automake.
3742 (LINK1): Likewise.
3743 (CXXCOMPILE1): Likewise.
3744 (CXXLINK1): Likewise.
3745 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
3746 (LINK): Likewise.
3747 (CXXCOMPILE): Likewise.
3748 (CXXLINK): Likewise.
3749 * testsuite/Makefile.in: Regenerated.
3750
d361fafb
L
37512012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3752
3753 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
3754 on bad fwrite return.
3755
598c7410
L
37562012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3757
3758 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
3759 on val.
3760
35c813e2
CC
37612012-10-23 Cary Coutant <ccoutant@google.com>
3762
3763 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
3764 * testsuite/Makefile.in: Regenerate.
3765 * testsuite/dwp_test.h: New source file.
3766 * testsuite/dwp_test_1.cc: New source file.
3767 * testsuite/dwp_test_1.s: New source file.
3768 * testsuite/dwp_test_1.sh: New source file.
3769 * testsuite/dwp_test_1b.cc: New source file.
3770 * testsuite/dwp_test_1b.s: New source file.
3771 * testsuite/dwp_test_2.cc: New source file.
3772 * testsuite/dwp_test_2.s: New source file.
3773 * testsuite/dwp_test_2.sh: New source file.
3774 * testsuite/dwp_test_main.cc: New source file.
3775 * testsuite/dwp_test_main.s: New source file.
3776
77429909
CC
37772012-10-23 Cary Coutant <ccoutant@google.com>
3778
3779 * dwp.h: New header file.
3780 * dwp.cc: New source file.
3781 * gold.h: Move shared declarations to system.h.
3782 * system.h: New header file.
3783 * Makefile.am: Add dwp.
3784 * Makefile.in: Regenerate.
3785
ed5d6712
CC
37862012-10-23 Cary Coutant <ccoutant@google.com>
3787
3788 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
3789 Dwarf_info_reader::read_from_pointer.
3790 (Dwarf_pubnames_table::read_header): Likewise.
3791 (Dwarf_pubnames_table::next_name): Likewise.
3792 (Dwarf_die::read_attributes): Likewise.
3793 (Dwarf_die::skip_attributes): Likewise.
3794 (Dwarf_info_reader::read_from_pointer): New function template.
3795 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
3796 (Dwarf_pubnames_table): Likewise.
3797 (Dwarf_info_reader::read_from_pointer): New function template.
3798 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
3799 Dwarf_pubnames_table ctor.
3800
8787852d
CC
38012012-10-23 Cary Coutant <ccoutant@google.com>
3802
3803 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
3804 abbrev_shndx.
3805 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
3806 abbrev_shndx_.
3807 (Dwarf_info_reader::set_abbrev_shndx): New method.
3808 (Dwarf_info_reader::abbrev_shndx_): New data member.
3809
9fc236f3
CC
38102012-10-23 Cary Coutant <ccoutant@google.com>
3811
3812 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
3813 from object, not parameters.
3814 (Dwarf_info_reader::parse): Likewise.
3815 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
3816 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
3817 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
3818 methods.
3819
effe8365
CC
38202012-10-23 Cary Coutant <ccoutant@google.com>
3821
3822 * fileread.cc (Input_file::Input_file): New constructor.
3823 * fileread.h (class Input_file): Add new constructor.
3824
1698990d
AM
38252012-10-18 Alan Modra <amodra@gmail.com>
3826
3827 PR gold/14727
3828 * object.cc (Relobj::is_section_name_included): Also match
3829 .sdata personality section.
3830
168a4726
AM
38312012-10-18 Alan Modra <amodra@gmail.com>
3832
3833 * target-reloc.h (class Default_comdat_behavior): New, package up..
3834 (get_comdat_behaviour): ..this.
3835 (relocate_section): Add Relocate_comdat_behavior template arg,
3836 adjust code to suit.
3837 * arm.cc (Target_arm::relocate_section): Adjust to suit.
3838 (Target_arm::scan_reloc_section): Likewise.
3839 * i386.cc (Target_i386::relocate_section): Likewise.
3840 * sparc.cc (Target_sparc::relocate_section): Likewise.
3841 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
3842 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
3843 * powerpc.cc (class Relocate_comdat_behavior): New.
3844 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
3845 gold::relocate_section with new template arg.
3846
acc276d8
AM
38472012-10-18 Alan Modra <amodra@gmail.com>
3848
3849 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
3850 dynamic relocs for GOT_TPREL got entries, without symbol if
3851 resolving locally.
3852 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
3853 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
3854 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
3855
e10f9870
AM
38562012-10-17 Alan Modra <amodra@gmail.com>
3857
3858 PR gold/14726
3859 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
3860
ae034989
ST
38612012-10-16 Sriraman Tallam <tmsriram@google.com>
3862
3863 * layout.cc (Layout::include_section): Keep sections marked
3864 SHF_EXCLUDE when doing relocatable links.
3865
f3a0ed29
AM
38662012-10-16 Alan Modra <amodra@gmail.com>
3867
3868 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
3869 (Target_powerpc::do_finalize_sections): Call it.
3870 (Output_data_save_res): New class and supporting functions.
3871 (Target_powerpc::symval_for_branch): Only look up .opd entry for
3872 normal symbols defined in object files.
3873
c6de8ed4
AM
38742012-10-12 Alan Modra <amodra@gmail.com>
3875
3876 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
3877 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
3878 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
3879 section if scan_opd_relocs not yet called.
3880 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
3881
03e25981
AM
38822012-10-12 Alan Modra <amodra@gmail.com>
3883
3884 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
3885 add_local_ifunc_entry): Revert last change.
3886 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
3887
c9824451
AM
38882012-10-05 Alan Modra <amodra@gmail.com>
3889
3890 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
3891 do_plt_address_for_global): New functions.
3892 (Output_data_got_powerpc::do_write): Don't segfault when linking
3893 statically.
3894 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
3895 add_local_ifunc_entry): Return true on adding entry..
3896 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
3897 glink->add_entry call. Remove unused symtab param. Adjust calls.
3898 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
3899 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
3900 set up symbols here.
3901 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
3902 syms here. Do so even when no .iplt. Don't segfault when linking
3903 statically.
3904 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
3905 new variants without reloc param.
3906 (Glink_sym_ent::Glink_sym_ent): Likewise.
3907 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
3908 reloc when refs will resolve to plt call stub.
3909 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
3910 R_PPC_PLTREL24 to resolve locally.
3911 (Target_powerpc::Scan::global): Correct ifunc handling.
3912 (Target_powerpc::Relocate::relocate): Correct local sym glink
3913 lookup. Don't destroy "value" when we have a plt call stub,
3914 and when checking plt call validity.
3915 (Target_powerpc::do_dynsym_value): Simplify.
3916
19fec8c1
AM
39172012-10-05 Alan Modra <amodra@gmail.com>
3918
3919 * i386.cc (Output_data_plt_i386::address_for_global,
3920 address_for_local): Add plt offset to returned value. Adjust uses.
3921 * sparc.cc (Output_data_plt_sparc::address_for_global,
3922 address_for_local): Likewise.
3923 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
3924 address_for_local): Likewise.
3925 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
3926 address_for_local): Likewise.
3927 * target.h (Target::plt_address_for_global, plt_address_for_local):
3928 Update comment.
3929 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
3930 (Output_data_got::Got_entry::write): Nor here.
3931 * output.h: Comment fix.
3932
e867b647
WL
39332012-10-02 Jiong Wang <jiwang@tilera.com>
3934
3935 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
3936 global_offset_table_ value for larget got.
3937 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
3938
e5d5f5ed
AM
39392012-09-29 Alan Modra <amodra@gmail.com>
3940
3941 * powerpc.cc (Target_powerpc::iplt_): New output section.
3942 (Target_powerpc::iplt_section, make_iplt_section,
3943 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
3944 (Target_powerpc::make_plt_entry): Handle ifunc syms.
3945 Target_powerpc::plt_entry_count): Count iplt entries too.
3946 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
3947 reloc section in constructor. New params.
3948 (Target_powerpc::make_plt_section): Create reloc section here instead.
3949 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
3950 functions.
3951 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
3952 (Output_data_glink::add_entry, find_entry): New functions to
3953 deal with local syms.
3954 (Glink_sym_ent): Add support for local syms.
3955 (Output_data_glink::do_write): Handle ifunc plt entries.
3956 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3957 (Target_powerpc::Scan::local, global): Handle ifunc syms.
3958 (Target_powerpc::Relocate::relocate): Likewise.
3959 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
3960
ec4dbad3
AM
39612012-09-25 Alan Modra <amodra@gmail.com>
3962
3963 * object.h (Sized_relobj_file::adjust_local_symbol,
3964 do_adjust_local_symbol): New functions.
3965 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
3966 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
3967 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
3968 and irregular opd entry spacing.
3969 (Powerpc_relobj::do_read_relocs): Add opd size checks.
3970 (Global_symbol_visitor_opd): New functor.
3971 (Target_powerpc::do_finalize_sections): Omit global symbols defined
3972 on deleted opd entries.
3973
5c0b3823
WL
39742012-09-15 Jiong Wang <jiwang@tilera.com>
3975
3976 * tilegx.cc: New file.
3977 * Makefile.am (TARGETSOURCES): Add tilegx.cc
3978 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
3979 * configure.tgt: Add entries for tilegx*.
3980 * configure.ac: Likewise.
3981 * Makefile.in: Rebuild.
3982 * configure: Likewise.
3983 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
3984 tilegx.
3985
bfdfa4cd
AM
39862012-09-13 Alan Modra <amodra@gmail.com>
3987
3988 * target-reloc.h (scan_relocs): Call scan.local for relocs
3989 against symbols in discarded sections. Pass is_discarded
3990 param.
3991 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
3992 Add is_discarded param.
3993 * powerpc (Target_powerpc::Scan::local): Likewise. Use
3994 is_discarded to flag opd entry as discarded. Don't emit dyn
3995 relocs on such entries.
3996 (Target_powerpc::Scan::global): Similarly detect and handle
3997 such opd entries.
3998 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
3999 opd_ent_. Update all uses.
4000 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
4001 (Target_powerpc::relocate_section): Zero out discarded opd
4002 entry relocs.
4003
d77a0555
ILT
40042012-09-12 Ian Lance Taylor <iant@google.com>
4005
4006 PR gold/14570
4007 * output.cc: Rename Output_data_got template parameter from size
4008 to got_size for all functions. Compile all variants of
4009 Output_data_got.
4010 (Output_data_got::Got_entry::write): Correct use of size for
4011 symbol value. Use local_is_tls rather than casting to
4012 Sized_relobj_file.
4013 * object.h (class Object): Add local_is_tls and do_local_is_tls.
4014 (class Sized_relobj_file): Add do_local_is_tls.
4015 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
4016
815a1205
AM
40172012-09-11 Alan Modra <amodra@gmail.com>
4018
4019 PR gold/14566
4020 * layout.cc (Layout::set_segment_offsets): When using
4021 common-page-size alignment, ensure we are on a new max-page-size
4022 page.
4023 * output.cc (Output_segment::set_section_addresses): Use
4024 abi_pagesize, not common_pagesize for relro boundary.
4025 (Output_segment::set_offset): Likewise.
4026
bd73a62d
AM
40272012-09-11 Alan Modra <amodra@gmail.com>
4028
4029 * output.h (Output_data_got::add_global_tls, add_local_tls,
4030 add_local_tls_pair): New functions.
4031 (Output_data_got::add_local_pair_with_rel): Remove second
4032 reloc param. Expand comment.
4033 (Output_data_got::Got_entry): Rename use_plt_offset_ to
4034 use_plt_or_tls_offset_, similarly for constructor param.
4035 (Output_data_got::Got_entry::write): Add got_index param.
4036 * output.cc (Output_data_got::add_global_tls, add_local_tls,
4037 add_local_tls_pair): New functions.
4038 (Output_data_got::Got_entry::write): Handle tls symbols
4039 with use_plt_or_tls_offset_ set specially.
4040 (Output_data_got::add_local_pair_with_rel): Only one reloc.
4041 (Output_data_got::do_write): Replace iterator with index, pass
4042 index to entry write function.
4043 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
4044 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
4045 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
4046 call.
4047 * i386.cc (Target_i386::Scan::local): Likewise.
4048 * sparc.cc (Target_sparc::Scan::local): Likewise.
4049 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
4050 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
4051 do_tls_offset_for_global): New functions.
4052 (Target_powerpc::Scan::local): Correct TLS relocations and got
4053 entry values.
4054 (Target_powerpc::Scan::global): Don't emit unnecessary
4055 dynamic relocations on TLS GOT entries.
4056
00716ab1
AM
40572012-09-10 Matthias Klose <doko@ubuntu.com>
4058
4059 * config.in: Disable sanity check for kfreebsd.
4060
c891b3f9
SA
40612012-09-10 Sterling Augustine <saugustine@google.com>
4062
4063 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
4064 (Gdb_index::pubtypes_read): New parameter.
4065 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
4066 to calls.
4067 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
4068 pubtypes_object_.
4069
e81fea4d
AM
40702012-09-09 Alan Modra <amodra@gmail.com>
4071
4072 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
4073 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
4074 * gc.h (gc_process_relocs): Call target gc_add_reference.
4075 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
4076 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
4077 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
4078 unnecessary cast.
4079 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
4080 to cater for when we don't need code offset. Update use.
4081 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
4082 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
4083 set_opd_valid): New functions.
4084 (Target_powerpc::do_gc_add_reference): New function.
4085 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
4086 stashed refs.
4087 (Target_powerpc::do_gc_mark_symbol): New function.
4088
d2d60eef
CC
40892012-09-06 Cary Coutant <ccoutant@google.com>
4090
4091 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
4092 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
4093 (Dwarf_die::skip_attributes): Likewise.
4094 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
4095 * testsuite/gdb_index_test.cc (inline_func_1): New function.
4096 (main): Call it.
4097 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
4098
32ed4573
L
40992012-09-05 H.J. Lu <hongjiu.lu@intel.com>
4100
4101 * testsuite/script_test_3.t: Add .got.plt output section
4102 statement.
4103 * testsuite/script_test_4.t: Likewise.
4104
f4baf0d4
AM
41052012-09-05 Alan Modra <amodra@gmail.com>
4106
4107 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
4108 update all uses and lose "enum" when using type.
4109
864a1b56
AM
41102012-09-05 Alan Modra <amodra@gmail.com>
4111
4112 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
4113 * configure: Regenerate.
4114 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
4115 (plugin_final_layout.stdout): Likewise.
4116 (memory_test): Set page sizes to 0x1000.
4117 * testsuite/Makefile.in: Regenerate.
4118 * testsuite/discard_locals_test.sh: Add FIXME comment.
4119 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
4120 * testsuite/pr14265.t: Add .got output section statement.
4121 * testsuite/script_test_2.t: Likewise.
4122 * testsuite/script_test_3.t: Likewise.
4123 * testsuite/script_test_4.t: Likewise.
4124 * testsuite/script_test_5.t: Likewise.
4125 * testsuite/script_test_6.t: Likewise.
4126 * testsuite/script_test_7.t: Likewise.
4127 * testsuite/script_test_9.t: Likewise.
4128
3ea0a085
AM
41292012-09-05 Alan Modra <amodra@gmail.com>
4130
4131 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
4132 (Powerpc_relocate_functions::Status): New typedef.
4133 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4134 (Target_powerpc::Scan::local): Handle REL64.
4135 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
4136 for REL32 and REL64.
4137 (Target_powerpc::symval_for_branch): New function, extracted from..
4138 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
4139 checks. Report overflow errors.
4140
7404fe1b
AM
41412012-09-05 Alan Modra <amodra@gmail.com>
4142
4143 * object.h (Sized_relobj_file::emit_relocs): Delete.
4144 (Sized_relobj_file::emit_relocs_reltype): Delete.
4145 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
4146 relocate_relocs for --emit-relocs.
4147 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
4148 * output.h: Update comment.
4149 (Output_segment::first_section): New function.
4150 (Output_segment::first_section_load_address): Use first_section.
4151 * output.cc (Output_segment::first_section): New function extracted..
4152 (Output_segment::first_section_load_address): ..from here. Delete.
4153 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
4154 * target.h (Sized_target::relocate_for_relocatable): Likewise.
4155 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
4156 adjust call to target.h function.
4157 * i386.cc (Target_i386): Likewise.
4158 * sparc.cc (Target_sparc): Likewise.
4159 * x86_64.cc (Target_x86_64): Likewise.
4160 * powerpc.cc (Target_powerpc): Likewise.
4161 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
4162 first tls section has section symbol for optimised local dynamic
4163 output relocs.
4164 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
4165 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
4166 optimised tls code.
4167 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
4168 Rename to relocate_relocs. Update error message.
4169
957564c9
AS
41702012-09-04 Andreas Schwab <schwab@linux-m68k.org>
4171
4172 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
4173 --just-symbols.
4174
dd93cd0a
AM
41752012-08-31 Alan Modra <amodra@gmail.com>
4176
4177 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
4178 (Powerpc_relobj::toc_base_offset): New stub function.
4179 (Target_powerpc): Add tp_offset, dtp_offset. Rename
4180 got_mod_index_offset to tlsld_got_offset. Update all refs.
4181 (Target_powerpc::Relocate::enum skip_tls): New.
4182 (Target_powerpc::call_tls_get_addr_): New var.
4183 (Target_powerpc::is_branch_reloc): Move to file scope.
4184 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
4185 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
4186 New functions.
4187 (Target_powerpc::enum Got_type): Delete old values, add new ones.
4188 (powerpc_info): Correct common_pagesize for ppc64.
4189 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
4190 (Powerpc_relocate_functions): Add overflow check enums and functions.
4191 Add non-shift version of rela, rela_ua. Delete all rel public
4192 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
4193 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
4194 addr16_ha3, addr14 functions.
4195 (Output_data_got_powerpc::add_constant_pair): New function.
4196 (Output_data_got_powerpc::got_base_offset): Likewise.
4197 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
4198 (instruction constants): Sort, add some more.
4199 (Output_data_glink::do_write): Add and use Address typedef. Use
4200 object->toc_base_offset() stub for 64-bit.
4201 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
4202 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4203 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
4204 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
4205 Always treat .opd relocs as against locally defined symbol.
4206 Correct condition for RELATIVE relocs.
4207 (Target_powerpc::do_finalize_sections): Test for NULL sections.
4208 (Target_powerpc::Relocate::relocate): Use plt call stub as value
4209 for 32-bit syms with a plt entry. Correct ppc64 toc base
4210 calculations. Handle TLS relocs, and more. Add overflow
4211 checking and adjust for Powerpc_relocate_functions changes.
4212 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
4213 Reinstate --emit-relocs code with FIXME.
4214
a1373b60
AM
42152012-08-30 Alan Modra <amodra@gmail.com>
4216
4217 * layout.cc (Layout::set_segment_offsets): Set p_align to
4218 abi_pagesize, not common_pagesize.
4219 (Layout::relaxation_loop_body): Similarly use abi_pagesize
4220 to determine whether file header can go in segment.
4221
703d02da
AM
42222012-08-30 Alan Modra <amodra@gmail.com>
4223
4224 * output.h (Output_reloc::Output_reloc <output section>): Add
4225 is_relative param. Adjust calls.
4226 (Output_reloc::add_output_section_relative): New functions.
4227 * output.cc (Output_reloc::Output_reloc <output section>): Handle
4228 is_relative.
4229 (Output_reloc::symbol_value): Handle SECTION_CODE.
4230
16164a6b
ST
42312012-08-24 Sriraman Tallam <tmsriram@google.com>
4232
4233 * gold.cc (queue_middle_tasks): Call layout again when unique
4234 segments for sections is desired.
4235 * layout.cc (Layout::Layout): Initialize new members.
4236 (Layout::get_output_section_flags): New function.
4237 (Layout::choose_output_section): Call get_output_section_flags.
4238 (Layout::layout): Make output section for mapping to a unique segment.
4239 (Layout::insert_section_segment_map): New function.
4240 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 4241 output sections marked so.
16164a6b
ST
4242 (Layout::segment_precedes): Check for unique segments when sorting.
4243 * layout.h (Layout::Unique_segment_info): New struct.
4244 (Layout::Section_segment_map): New typedef.
4245 (Layout::insert_section_segment_map): New function.
4246 (Layout::get_output_section_flags): New function.
4247 (Layout::is_unique_segment_for_sections_specified): New function.
4248 (Layout::set_unique_segment_for_sections_specified): New function.
4249 (Layout::unique_segment_for_sections_specified_): New member.
4250 (Layout::section_segment_map_): New member.
4251 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
4252 Rename is_gc_pass_one to is_pass_one.
4253 Rename is_gc_pass_two to is_pass_two.
4254 Rename is_gc_or_icf to is_two_pass.
4255 Check for which pass based on whether symbols data is present.
4256 Make it two pass when unique segments for sections is desired.
4257 * output.cc (Output_section::Output_section): Initialize new
4258 members.
4259 * output.h (Output_section::is_unique_segment): New function.
4260 (Output_section::set_is_unique_segment): New function.
4261 (Output_section::is_unique_segment_): New member.
4262 (Output_section::extra_segment_flags): New function.
4263 (Output_section::set_extra_segment_flags): New function.
4264 (Output_section::extra_segment_flags_): New member.
4265 (Output_section::segment_alignment): New function.
4266 (Output_section::set_segment_alignment): New function.
4267 (Output_section::segment_alignment_): New member.
4268 (Output_segment::Output_segment): Initialize is_unique_segment_.
4269 (Output_segment::is_unique_segment): New function.
4270 (Output_segment::set_is_unique_segment): New function.
4271 (Output_segment::is_unique_segment_): New member.
4272 * plugin.cc (allow_unique_segment_for_sections): New function.
4273 (unique_segment_for_sections): New function.
4274 (Plugin::load): Add new functions to transfer vector.
4275 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
4276 * Makefile.in: Regenerate.
4277 * testsuite/plugin_final_layout.sh: Check if unique segment
4278 functionality works.
4279 * testsuite/plugin_section_order.c (onload): Check if new interfaces
4280 are available.
4281 (allow_unique_segment_for_sections): New global.
4282 (unique_segment_for_sections): New global.
4283 (claim_file_hook): Call allow_unique_segment_for_sections.
4284 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 4285
1e2bee4f
CC
42862012-08-22 Cary Coutant <ccoutant@google.com>
4287
4288 * layout.cc (Layout::include_section): Don't assert on GROUP
4289 sections with --emit-relocs.
4290
1d5dfe78
CC
42912012-08-21 Cary Coutant <ccoutant@google.com>
4292
4293 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
4294 if --export-dynamic-symbol names an undef symbol.
4295
c9269dff
AM
42962012-08-18 Alan Modra <amodra@gmail.com>
4297
4298 * powerpc.cc: Formatting and white space.
4299 (Powerpc_relobj): Rename got2_section_ to special_.
4300 Add opd_ent_shndx_ and opd_ent_off_ vectors.
4301 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
4302 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
4303 (Target_powerpc): Add Address typedef and invalid_address. Use
4304 throughout.
4305 (Target_powerpc::is_branch_reloc): New function.
4306 (Powerpc_relocate_functions): Add Address typedef, use throughout.
4307 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
4308 for dst_mask, value and addend.
4309 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
4310 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
4311 (Output_data_glink::do_write): Correct toc base. Don't try to use
4312 uint16_t for 24-bit offset. Use get_output_section_offset and
4313 check return.
4314 (Target_powerpc::Scan::local): Handle more relocs.
4315 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
4316 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
4317 Plug in toc restoring insn after plt calls. Translate branches
4318 to function descriptor symbols to corresponding entry point.
4319 (Target_powerpc::relocate_for_relocatable): Check return from
4320 get_output_section_offset.
4321 * symtab.h: Comment typo.
4322
b1759dce
ILT
43232012-08-14 Ian Lance Taylor <iant@google.com>
4324
4325 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
4326 unsupported_relocal_local to call unsupported_reloc_global.
4327
b9b2ae8b
NC
43282012-08-14 Nick Clifton <nickc@redhat.com>
4329
4330 PR ld/14265
4331 * script-sections.cc (Sections_element::output_section_name): Add
4332 keep return parameter.
4333 (Output_section_element::match_name): Add keep return parameter.
4334 Return the value of the keep_ member.
4335 * script-sections.h (class Output_section): Update
4336 output_section_name prototype.
4337 * layout.cc (Layout::keep_input_section): New public member
4338 function.
4339 (Layout::choose_output_section): Pass keep parameter to
4340 output_section_name.
4341 * layout.h (class Layout): Add keep_input_section.
4342 * object.cc (Sized_relobj_file::do_layout): Check for kept input
4343 sections.
4344 * testsuite/Makefile.am: Add a test.
4345 * testsuite/Makefile.in: Regenerate.
4346 * testsuite/pr14265.c: Source file for the test.
4347 * testsuite/pr14265.t: Linker script for the test.
4348 * testsuite/pr14265.sh: Shell script for the test.
4349
921b5322
AM
43502012-08-14 Alan Modra <amodra@gmail.com>
4351
4352 * target.h (Target::output_section_name): New function.
4353 (Target::do_output_section_name): New function.
4354 * layout.cc (Layout::choose_output_section): Call the above.
4355 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
4356
6ce78956
AM
43572012-08-14 Alan Modra <amodra@gmail.com>
4358
4359 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
4360 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
4361 for replace_constant call.
4362 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
4363 (Output_data_glink::do_print_to_mapfile): New function.
4364 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
4365 (Target_powerpc::Relocate::relocate): Likewise.
4366
d1a8cabd
AM
43672012-08-14 Alan Modra <amodra@gmail.com>
4368
4369 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
4370 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
4371 (Output_data_glink::add_entry,find_entry): Remove shndx param.
4372 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
4373 all references to shndx_. Handle special case for R_PPC_PLTREL24
4374 here.
4375 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
4376 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
4377 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
4378 here.
4379 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
4380 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
4381
d83ce4e3
AM
43822012-08-12 Alan Modra <amodra@gmail.com>
4383
4384 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
4385 (glink insn constants): Use uint32_t.
4386 (Output_data_glink::add_entry): Use insert, not [] operator.
4387
cf43a2fe
AM
43882012-08-11 Alan Modra <amodra@gmail.com>
4389
4390 * object.h (Sized_relobj_file::find_shdr): New function.
4391 (Sized_relobj_file::find_special_sections): New function.
4392 * object.cc (Sized_relobj_file::find_shdr): New function.
4393 (Sized_relobj_file::find_eh_frame): Use find_shdr.
4394 (Sized_relobj_file::find_special_sections): New function, split out..
4395 (Sized_relobj_file::do_read_symbols): ..from here.
4396 * output.h (Output_data_got::replace_constant): New function.
4397 (Output_data_got::num_entries): New function.
4398 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
4399 (Output_data_got::got_offset): Protected rather than private.
4400 (Output_data_got::replace_got_entry): New function.
4401 * output.cc (Output_data_got::replace_got_entry): New function.
4402 * powerpc.cc (class Powerpc_relobj): New.
4403 (class Powerpc_relocate_functions): Delete all psymval variants or
4404 convert to value,addend type. Delete pcrela, pcrela_unaligned.
4405 Implement _ha functions using corresponding _hi function.
4406 (Powerpc_relobj::find_special_sections): New function.
4407 (Target_powerpc::do_make_elf_object): New function.
4408 (class Output_data_got_powerpc): New.
4409 (class Output_data_glink): New.
4410 (class Powerpc_scan_relocatable_reloc): New.
4411 Many more changes througout file.
4412
3c892704
NC
44132012-08-09 Nick Clifton <nickc@redhat.com>
4414
4415 * po/vi.po: Updated Vietnamese translation.
4416
82435b3b
ILT
44172012-08-07 Ian Lance Taylor <iant@google.com>
4418
4419 * layout.cc (Layout::add_target_dynamic_tags): If
4420 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
4421 plt_rel.
4422
a6dc81d2
NC
44232012-07-30 Nick Clifton <nickc@redhat.com>
4424
4425 * po/gold.pot: Updated template.
4426 * po/es.po: Updated Spanish translation.
4427
f1415016
CC
44282012-07-18 Cary Coutant <ccoutant@google.com>
4429
4430 PR gold/14344
4431 * configure.ac: Add check for -gpubnames support.
4432 * configure: Regenerate.
4433 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
4434 support; force -gno-pubnames.
4435 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
4436 support.
4437 (gdb_index_test_4): New test.
4438 * testsuite/Makefile.in: Regenerate.
4439 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
4440 * testsuite/gdb_index_test_2.sh: Likewise.
4441 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
4442 * testsuite/gdb_index_test_4.sh: New script.
4443 * testsuite/gdb_index_test_comm.sh: New script with common code;
4444 don't look for space after colon.
4445
b7fd7c37
ST
44462012-07-16 Sriraman Tallam <tmsriram@google.com>
4447
4448 * gold.cc (queue_middle_tasks): Update function order only after
4449 deferred objects due to plugins are processed.
4450
1f3212db
ILT
44512012-07-11 Ian Lance Taylor <iant@google.com>
4452
4453 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
4454 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
4455 (Target_arm::scan_reloc_for_stub): Likewise.
4456 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
4457 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
4458 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
4459 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
4460 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
4461
81c82a68
ILT
44622012-07-10 Dodji Seketeli <dodji@redhat.com>
4463 Ian Lance Taylor <iant@google.com>
4464
4465 PR gold/14309
4466 * configure.ac: Test whether std::tr1::hash<off_t> works.
4467 * gold.h: Add a specialization for std::tr1::hash<off_t> if
4468 needed.
4469 * output.h (class Output_fill): Add virtual destructor.
4470 * configure, config.in: Rebuild.
4471
eabc84f4
RM
44722012-06-22 Roland McGrath <mcgrathr@google.com>
4473
4474 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
4475
370e30b6
RÁE
44762012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
4477
4478 * plugin.cc (Plugin::load): Handle position independent executables.
4479
fb1b895d
CC
44802012-06-06 Cary Coutant <ccoutant@google.com>
4481
4482 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
4483 add .debug_macro.
4484 (lines_only_debug_sections): Likewise.
4485 (gdb_fast_lookup_sections): New static array.
4486 (is_gdb_debug_section): Rename formal parameter.
4487 (is_lines_only_debug_section): Likewise.
4488 (is_gdb_fast_lookup_section): New function.
4489 (Layout::include_section): Check for ".zdebug_" prefix; pass
4490 section name suffix to is_gdb_debug_section, et al.; check for
4491 fast-lookup sections when building .gdb_index.
4492 * options.h (--strip-debug-gdb): Update GDB version number.
4493
7c0640fa
CC
44942012-06-06 Cary Coutant <ccoutant@google.com>
4495
4496 * configure.ac: Add check for fallocate.
4497 * configure: Regenerate.
4498 * config.in: Regenerate.
4499
4500 * options.h (class General_options): Add --mmap-output-file and
4501 --posix-fallocate options.
4502 * output.cc: (posix_fallocate): Remove; replace with...
4503 (gold_fallocate): New function.
4504 (Output_file::map_no_anonymous): Call gold_fallocate.
4505 (Output_file::map): Check --mmap-output-file option.
4506
2a49eb69
DK
45072012-06-05 Jing Yu <jingyu@google.com>
4508
4509 * gold.h (textdomain): Add do {} to empty while(0).
4510 (bindtextdomain): Likewise.
4511
fad072ac
CC
45122012-06-04 Cary Coutant <ccoutant@google.com>
4513
4514 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
4515 has_dynsym_index.
4516
8cc69fb6
ST
45172012-05-25 Sriraman Tallam <tmsriram@google.com>
4518
4519 * symtab.cc (Symbol_table::define_special_symbol):
4520 Initialize *poldsym to prevent uninitialized variable errors.
4521
1be75daa
CC
45222012-05-23 Cary Coutant <ccoutant@google.com>
4523
4524 * layout.cc (Layout::section_name_mapping): Add rules to handle
4525 exact match on .data.rel.ro.local or .data.rel.ro.
4526 (Layout::output_section_name): Check for exact matches.
4527
9b689de0
CC
45282012-05-23 Cary Coutant <ccoutant@google.com>
4529
4530 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
4531 more carefully.
4532
b24fdbf5
CC
45332012-05-22 Cary Coutant <ccoutant@google.com>
4534
4535 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
4536 object before exporting symbol.
4537
e550e1a2
L
45382012-05-21 H.J. Lu <hongjiu.lu@intel.com>
4539
4540 * testsuite/tls_test.cc: Include "config.h" first.
4541 * testsuite/tls_test_c.c: Likewise.
4542
df7b86aa
NC
45432012-05-17 Daniel Richard G. <skunk@iskunk.org>
4544 Nick Clifton <nickc@redhat.com>
4545
4546 PR 14072
4547 * configure.in: Add check that sysdep.h has been included before
4548 any system header files.
4549 * configure: Regenerate.
4550 * config.in: Regenerate.
4551
1007b503
CC
45522012-05-14 Cary Coutant <ccoutant@google.com>
4553
4554 * layout.cc (Layout::make_output_section): Mark .tdata section
4555 as RELRO.
4556 * testsuite/relro_test.cc: Add a TLS variable.
4557
fd885f3a
L
45582012-05-10 H.J. Lu <hongjiu.lu@intel.com>
4559
4560 PR gold/14091
4561 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
4562 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
4563 R_X86_64_64.
4564
80f5885c
CC
45652012-05-08 Cary Coutant <ccoutant@google.com>
4566
4567 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
4568 (lines_only_debug_sections): Likewise.
4569
2e702c99
RM
45702012-05-02 Roland McGrath <mcgrathr@google.com>
4571
4572 * nacl.cc: New file.
4573 * nacl.h: New file.
4574 * Makefile.am (CCFILES, HFILES): Add them.
4575 * Makefile.in: Regenerate.
4576 * i386.cc (Output_data_plt_i386_nacl): New class.
4577 (Output_data_plt_i386_nacl_exec): New class.
4578 (Output_data_plt_i386_nacl_dyn): New class.
4579 (Target_i386_nacl): New class.
4580 (Target_selector_i386_nacl): New class.
4581 (target_selector_i386): Use it instead of Target_selector_i386.
4582 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
4583 (Target_x86_64_nacl): New class.
4584 (Target_selector_x86_64_nacl): New class.
4585 (target_selector_x86_64, target_selector_x32): Use it instead of
4586 Target_selector_x86_64.
4587 * arm.cc (Output_data_plt_arm_nacl): New class.
4588 (Target_arm_nacl): New class.
4589 (Target_selector_arm_nacl): New class.
4590 (target_selector_arm, target_selector_armbe): Use it instead of
4591 Target_selector_arm.
4592
4593 * target-select.cc (select_target): Take new Input_file* and off_t
4594 arguments, pass them on to recognize method of selector.
4595 * object.cc (make_elf_sized_object): Update caller.
4596 * parameters.cc (parameters_force_valid_target): Likewise.
4597 * incremental.cc (make_sized_incremental_binary): Likewise.
4598 * target-select.h: Update decl.
4599 (Target_selector::recognize): Take new Input_file* argument,
4600 pass it on to do_recognize.
4601 (Target_selector::do_recognize): Take new Input_file* argument.
4602 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
4603 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
4604 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
4605 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
4606
4607 * target.h (Target::Target_info): New members isolate_execinstr
4608 and rosegment_gap.
4609 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
4610 * arm.cc (Target_arm::arm_info): Update initializer.
4611 * i386.cc (Target_i386::i386_info): Likewise.
4612 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
4613 * sparc.cc (Target_sparc::sparc_info): Likewise.
4614 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
4615 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
4616 * layout.cc (Layout::attach_allocated_section_to_segment):
4617 Take new const Target* argument. If target->isolate_execinstr(), act
4618 like --rosegment.
4619 (Layout::find_first_load_seg): Take new const Target* argument;
4620 if target->isolate_execinstr(), reject PF_X segments.
4621 (Layout::relaxation_loop_body): Update caller.
4622 (Layout::set_segment_offsets): If target->isolate_execinstr(),
4623 reset file offset to zero when we hit LOAD_SEG, and then do a second
4624 loop over the segments before LOAD_SEG to reassign offsets after
4625 addresses have been determined. Handle target->rosegment_gap().
4626 (Layout::attach_section_to_segment): Take new const Target* argument;
4627 pass it to attach_allocated_section_to_segment.
4628 (Layout::make_output_section): Update caller.
4629 (Layout::attach_sections_to_segments): Take new const Target* argument;
4630 pass it to attach_section_to_segment.
4631 * gold.cc (queue_middle_tasks): Update caller.
4632 * layout.h (Layout): Update method decls with new arguments.
4633
4634 * arm.cc (Target_arm::Target_arm): Take optional argument for the
4635 Target_info pointer to use.
4636 (Target_arm::do_make_data_plt): New virtual method.
4637 (Target_arm::make_data_plt): New method that calls it.
4638 (Target_arm::make_plt_entry): Use it.
4639 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
4640 for the section alignment.
4641 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
4642 method.
4643 (Output_data_plt_arm::first_plt_entry_offset): Call it.
4644 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
4645 method.
4646 (Output_data_plt_arm::get_plt_entry_size): Call it.
4647 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
4648 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
4649 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
4650 method.
4651 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
4652 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
4653 method instead of sizeof(plt_entry).
4654 (Output_data_plt_arm::add_entry): Likewise.
4655 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
4656 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
4657 than static method.
4658 (Target_arm::plt_entry_size): Likewise.
4659 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
4660 Move to ...
4661 (Output_data_plt_arm_standard): ... here, new class.
4662 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
4663 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
4664 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
4665
4666 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
4667 Take additional argument for the PLT entry size.
4668 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
4669 Use get_plt_entry_size method rather than plt_entry_size variable.
4670 (Output_data_plt_x86_64::reserve_slot): Likewise.
4671 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
4672 (Output_data_plt_x86_64::add_entry): Likewise.
4673 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
4674 (Output_data_plt_x86_64::address_for_global): Likewise.
4675 (Output_data_plt_x86_64::address_for_local): Likewise.
4676 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4677 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
4678 Make method non-static.
4679 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
4680 method.
4681 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
4682 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
4683 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
4684 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
4685 virtual method.
4686 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
4687 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
4688 virtual method.
4689 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
4690 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
4691 virtual method.
4692 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
4693 (Output_data_plt_x86_64::plt_entry_size)
4694 (Output_data_plt_x86_64::first_plt_entry)
4695 (Output_data_plt_x86_64::plt_entry)
4696 (Output_data_plt_x86_64::tlsdesc_plt_entry)
4697 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
4698 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
4699 (Output_data_plt_x86_64_standard): ... here, new class.
4700 (Target_x86_64::Target_x86_64): Take optional argument for the
4701 Target_info pointer to use.
4702 (Target_x86_64::do_make_data_plt): New virtual method.
4703 (Target_x86_64::make_data_plt): New method to call it.
4704 (Target_x86_64::init_got_plt_for_update): Use that.
4705 Call this->plt_->add_eh_frame method here.
4706 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
4707 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
4708 rather than static method.
4709 (Target_x86_64::plt_entry_size): Likewise.
4710 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
4711 rather than plt_entry_size variable. Move guts of PLT filling to...
4712 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
4713 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
4714 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
4715
4716 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
4717 additional argument for the section alignment.
4718 Don't do add_eh_frame_for_plt here.
4719 (Output_data_plt_i386::first_plt_entry_offset): Make the method
4720 non-static. Use get_plt_entry_size method rather than plt_entry_size
4721 variable.
4722 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
4723 method.
4724 (Output_data_plt_i386::get_plt_entry_size): Call it.
4725 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
4726 (Output_data_plt_i386::add_eh_frame): New method to call it.
4727 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
4728 method.
4729 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
4730 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
4731 method.
4732 (Output_data_plt_i386::fill_plt_entry): New method to call it.
4733 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
4734 method instead of plt_entry_size.
4735 (Output_data_plt_i386::plt_entry_size)
4736 (Output_data_plt_i386::plt_eh_frame_fde_size)
4737 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
4738 (Output_data_plt_i386_standard): ... here, new class.
4739 (Output_data_plt_i386_exec): New class.
4740 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
4741 (Output_data_plt_i386_exec::first_plt_entry): ... here.
4742 (Output_data_plt_i386::exec_plt_entry): Move to ...
4743 (Output_data_plt_i386_exec::plt_entry): ... here.
4744 (Output_data_plt_i386_dyn): New class.
4745 (Output_data_plt_i386::first_plt_entry): Move to ...
4746 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
4747 (Output_data_plt_i386::dyn_plt_entry): Move to ...
4748 (Output_data_plt_i386_dyn::plt_entry): ... here.
4749 (Target_i386::Target_i386): Take optional argument for the Target_info
4750 pointer to use.
4751 (Target_i386::do_make_data_plt): New virtual method.
4752 (Target_i386::make_data_plt): New method to call it.
4753 (Target_i386::make_plt_section): Use that.
4754 Call this->plt_->add_eh_frame method here.
4755 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
4756 rather than plt_entry_size variable.
4757 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
4758 (Output_data_plt_i386::address_for_local): Likewise.
4759 (Output_data_plt_i386::do_write): Likewise.
4760 Move guts of PLT filling to...
4761 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
4762 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
4763 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
4764 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
4765
b9b9f2ee
CC
47662012-05-01 Cary Coutant <ccoutant@google.com>
4767
4768 * dwarf_reader.cc (Dwarf_die::read_attributes)
4769 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
4770 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
4771 * reduced_debug_output.cc
4772 (Output_reduced_debug_info_section::get_die_end): Remove
4773 DW_FORM_GNU_ref_index. Add default case.
4774
57923f48
MW
47752012-04-26 Mark Wielaard <mjw@redhat.com>
4776
4777 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
4778 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
4779 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
4780 DW_AT_high_pc as offset from DW_AT_low_pc.
4781
4782 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
4783 * testsuite/Makefile.in: Regenerate.
4784 * testsuite/gdb_index_test_3.c: New test source file.
4785 * testsuite/gdb_index_test_3.sh: New test source file.
4786
2c54b4f4
ILT
47872012-04-25 Ian Lance Taylor <iant@google.com>
4788
4789 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
4790 pointer.
4791 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
4792 as a class, not a struct.
4793 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
4794 (Target_arm::apply_cortex_a8_workaround): Likewise.
4795 * gc.h: Declare Reloc_types as a struct, not a class.
4796 * object.h: Declare Symbols_data as a struct.
4797 * reloc.h: Declare Read_relocs_data as a struct.
4798 * target.h: Declare Relocate_info as a struct.
4799
a5a5f7a3
DM
48002012-04-24 David S. Miller <davem@davemloft.net>
4801
4802 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
4803 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
4804 and R_SPARC_WPLT30.
4805
f038d496
CC
48062012-04-24 Cary Coutant <ccoutant@google.com>
4807
4808 * incremental-dump.cc (find_input_containing_global): Replace
4809 magic number with symbolic constant.
4810 (dump_incremental_inputs): Update version number.
4811 * incremental.cc (Output_section_incremental_inputs): Update version
4812 number; import symbolic constants from Incremental_inputs_reader.
4813 (Incremental_inputs::create_data_sections): Align relocations
4814 section correctly for 64-bit targets.
4815 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
4816 constants; add padding.
4817 (Output_section_incremental_inputs::write_header): Add assert for
4818 header_size.
4819 (Output_section_incremental_inputs::write_input_files): Add assert
4820 for input_entry_size.
4821 (Output_section_incremental_inputs::write_info_blocks): Add padding;
4822 add assert for object_info_size, input_section_entry_size,
4823 global_sym_entry_size.
4824 * incremental.h (Incremental_inputs_reader): Add symbolic constants
4825 for data structure sizes; use them.
4826 (Incremental_input_entry_reader): Import symbolic constants from
4827 Incremental_inputs_reader; use them.
4828
a4d85145
DM
48292012-04-23 David S. Miller <davem@davemloft.net>
4830
4831 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
4832 and elf_flags_set_.
4833 (Target_sparc::Target_sparc): Initialize new fields.
4834 (Target_sparc::do_make_elf_object): New function.
4835 (Target_sparc::do_adjust_elf_header): New function.
4836
1d509098
CC
48372012-04-23 Cary Coutant <ccoutant@google.com>
4838
4839 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
4840 CU range table of gdb index.
4841
7ebeff7f
DM
48422012-04-20 David S. Miller <davem@davemloft.net>
4843
4844 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
4845 instead of false.
4846
13cf9988
DM
48472012-04-16 David S. Miller <davem@davemloft.net>
4848
2a1079e8
DM
4849 * sparc.cc (Target_sparc::got_address): New function.
4850 (Sparc_relocate_functions::gdop_hix22): New function.
4851 (Sparc_relocate_functions::gdop_lox10): New function.
4852 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
4853 relocs.
4854 (Target_sparc::Scan::local): Likewise if the global symbol is not
4855 preemptible and is not IFUNC.
4856 (Target_sparc::Relocate::relocate): Perform GOTDATA code
4857 transformations for local and non-preemptible non-IFUNC global
4858 symbols.
4859
0bc964fc
DM
4860 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
4861 writing out 64-bit part of ranges.
4862
661d7a80
DM
4863 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
4864 -fpic and -fpie respectively.
4865 * Makefile.in: Regenerate.
4866
8c2bf391
DM
4867 * sparc.cc (class Target_sparc): Add rela_ifunc_.
4868 (Target_sparc::Target_sparc): Initialize new field.
4869 (Target_sparc::do_plt_section_for_global): New function.
4870 (Target_sparc::do_plt_section_for_local): New function.
4871 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
4872 (Target_sparc::make_plt_section): New function, broken out of
4873 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
4874 (Target_sparc::make_plt_entry): Call make_plt_section.
4875 (Target_sparc::make_local_ifunc_plt_entry): New function.
4876 (Target_sparc::rela_ifunc_section): New function.
4877 (Target_sparc::plt_section): Remove const.
4878 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
4879 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
4880 and ifunc_count_ fields.
4881 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
4882 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
4883 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
4884 (Output_data_plt_sparc::rela_ifunc): New function.
4885 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
4886 (Output_data_plt_sparc::has_ifunc_section): New function.
4887 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
4888 (Output_data_plt_sparc::address_for_global): New function.
4889 (Output_data_plt_sparc::address_for_local): New function.
4890 (Output_data_plt_sparc::plt_index_to_offset): New function.
4891 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
4892 and entry_count.
4893 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
4894 entry_count.
4895 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
4896 R_SPARC_JMP_IREL to switch.
4897 (Target_sparc::Scan::check_non_pic): Likewise.
4898 (Target_sparc::Scan::local): Handle IFUNC symbols.
4899 (Target_sparc::Scan::local): Likewise.
4900 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
4901 and plt_address_for_local.
4902 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
4903 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
4904
13cf9988
DM
4905 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
4906 (class Output_data_reloc): Adjust calls to Output_reloc_type.
4907 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
4908 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
4909 global relocs too.
4910 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
4911 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
4912 calls.
4913 * sparc.cc (Target_sparc::Scan::global): Likewise.
4914 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4915
31821be0
CC
49162012-04-16 Cary Coutant <ccoutant@google.com>
4917
4918 * archive.cc (Library_base::should_include_member): Check for
4919 --export-dynamic-symbol.
4920 * options.h (class General_options): Add --export-dynamic-symbol.
4921 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
4922 --export-dynamic-symbol.
4923 (Symbol_table::gc_mark_undef_symbols): Likewise.
4924 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
4925
2615994e
DM
49262012-04-12 David S. Miller <davem@davemloft.net>
4927
4928 * sparc.cc (Reloc::wdisp10): New relocation method.
4929 (Reloc::h34): Likewise.
4930 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
4931 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
4932 R_SPARC_WDISP10.
4933 (Target_sparc::Scan::local): Likewise.
4934 (Target_sparc::Scan::global): Likewise.
4935 (Target_sparc::Relocate::relocate): Likewise.
4936
6782735d
CC
49372012-04-09 Cary Coutant <ccoutant@google.com>
4938
4939 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
4940 low_pc == 0.
4941
8c7a0b00
ILT
49422012-04-06 Ian Lance Taylor <iant@google.com>
4943
4944 * timer.cc: #include <unistd.h>.
4945
58797674
RM
49462012-04-06 Roland McGrath <mcgrathr@google.com>
4947
4948 * configure.in (AC_CHECK_HEADERS): Add locale.h.
4949 * config.in: Regenerate.
4950 * configure: Regenerate.
4951
44350750
NC
49522012-04-05 Nick Clifton <nickc@redhat.com>
4953
4954 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
4955 (AM_LC_MESSAGES): Add.
4956 * aclocal.m4: Regenerate.
4957 * config.in: Regenerate.
4958 * configure: Regenerate.
4959
c1027032
CC
49602012-03-21 Cary Coutant <ccoutant@google.com>
4961
4962 * Makefile.am: Add gdb-index.cc, gdb-index.h.
4963 * Makefile.in: Regenerate.
4964 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
4965 (Sized_elf_reloc_mapper::symbol_section): New function.
4966 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
4967 (make_elf_reloc_mapper): New function.
4968 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
4969 (Dwarf_abbrev_table::do_read_abbrevs): New function.
4970 (Dwarf_abbrev_table::do_get_abbrev): New function.
4971 (Dwarf_ranges_table::read_ranges_table): New function.
4972 (Dwarf_ranges_table::read_range_list): New function.
4973 (Dwarf_pubnames_table::read_section): New function.
4974 (Dwarf_pubnames_table::read_header): New function.
4975 (Dwarf_pubnames_table::next_name): New function.
4976 (Dwarf_die::Dwarf_die): New function.
4977 (Dwarf_die::read_attributes): New function.
4978 (Dwarf_die::skip_attributes): New function.
4979 (Dwarf_die::set_name): New function.
4980 (Dwarf_die::set_linkage_name): New function.
4981 (Dwarf_die::attribute): New function.
4982 (Dwarf_die::string_attribute): New function.
4983 (Dwarf_die::int_attribute): New function.
4984 (Dwarf_die::uint_attribute): New function.
4985 (Dwarf_die::ref_attribute): New function.
4986 (Dwarf_die::child_offset): New function.
4987 (Dwarf_die::sibling_offset): New function.
4988 (Dwarf_info_reader::check_buffer): New function.
4989 (Dwarf_info_reader::parse): New function.
4990 (Dwarf_info_reader::do_parse): New function.
4991 (Dwarf_info_reader::do_read_string_table): New function.
4992 (Dwarf_info_reader::lookup_reloc): New function.
4993 (Dwarf_info_reader::get_string): New function.
4994 (Dwarf_info_reader::visit_compilation_unit): New function.
4995 (Dwarf_info_reader::visit_type_unit): New function.
4996 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
4997 Sized_elf_reloc_mapper.
4998 (Sized_dwarf_line_info::symbol_section): Remove function.
4999 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
5000 (Sized_dwarf_line_info::read_line_mappings): Remove object
5001 parameter, adjust callers.
5002 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
5003 * dwarf_reader.h: Include <sys/types.h>.
5004 (class Track_relocs): Remove forward declaration.
5005 (class Elf_reloc_mapper): New class.
5006 (class Sized_elf_reloc_mapper): New class.
5007 (class Dwarf_abbrev_table): New class.
5008 (class Dwarf_range_list): New class.
5009 (class Dwarf_ranges_table): New class.
5010 (class Dwarf_pubnames_table): New class.
5011 (class Dwarf_die): New class.
5012 (class Dwarf_info_reader): New class.
5013 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
5014 (Sized_dwarf_line_info::symbol_section): Remove member function.
5015 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
5016 base class.
5017 * gdb-index.cc: New source file.
5018 * gdb-index.h: New source file.
5019 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
5020 and .debug_types sections, call Layout::add_to_gdb_index.
5021 (Sized_relobj_incr::do_section_name): Implement.
5022 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
5023 return type; Implement.
5024 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
5025 return type.
5026 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
5027 parameter list and return type.
5028 (Sized_incr_dynobj::do_section_contents): Likewise.
5029 * layout.cc: Include gdb-index.h.
5030 (Layout::Layout): Initialize gdb_index_data_.
5031 (Layout::init_fixed_output_section): Check for .gdb_index section.
5032 (Layout::add_to_gdb_index): New function. Instantiate.
5033 * layout.h: Add forward declaration for class Gdb_index.
5034 (Layout::add_to_gdb_index): New member function.
5035 (Layout::gdb_index_data_): New data member.
5036 * main.cc: Include gdb-index.h.
5037 (main): Print statistics for gdb index.
5038 * object.cc (Object::section_contents): Move code into
5039 do_section_contents.
5040 (need_decompressed_section): Check for sections needed when building
5041 gdb index.
5042 (build_compressed_section_map): Likewise.
5043 (Sized_relobj_file::do_read_symbols): Need local symbols when building
5044 gdb index.
5045 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
5046 sections; call Layout::add_to_gdb_index.
5047 (Sized_relobj_file::do_decompressed_section_contents): Call
5048 do_section_contents directly.
5049 * object.h (Object::do_section_contents): Adjust parameter list and
5050 return type.
5051 (Object::do_decompressed_section_contents): Call do_section_contents
5052 directly.
5053 (Sized_relobj_file::do_section_contents): Adjust parameter list and
5054 return type.
5055 * options.h (class General_options): Add --gdb-index option.
5056 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
5057 list and return type.
5058 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
5059 * reloc.h (Track_relocs::checkpoint): New function.
5060 (Track_relocs::reset): New function.
5061
5062 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
5063 New test cases.
5064 * testsuite/Makefile.in: Regenerate.
5065 * testsuite/gdb_index_test.cc: New test source file.
5066 * testsuite/gdb_index_test_1.sh: New test source file.
5067 * testsuite/gdb_index_test_2.sh: New test source file.
5068
647f1574
DK
50692012-03-19 Doug Kwan <dougkwan@google.com>
5070
5071 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 5072 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
5073 __exidx_start and __exidx_end. Make symbol table parameter
5074 anonymous as it is not used.
5075 * gold.cc (queue_middle_tasks): Call target hook to define any
5076 target-specific symbols.
5077 * target.h (Target::define_standard_symbols): New method.
5078 (Target::do_define_standard_symbols): Same.
5079 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
5080 * testsuite/Makefile.in: Regenerate.
5081 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
5082 and __exidx_end.
5083 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
5084 relocations are generated for __exidx_start and __exidx_end.
5085
7c6109da
DK
50862012-03-16 Doug Kwan <dougkwan@google.com>
5087
5088 * testsuite/Makefile.am: Disable test initpri3b.
5089 * testsuite/Makefile.in: Regenerate.
5090
7b8957f8
DK
50912012-03-15 Doug Kwan <dougkwan@google.com>
5092
5093 * arm.cc (Target_arm::got_section): Make .got section read-only
5094 if -z now is given.
5095
14dc9ef7
ILT
50962012-03-15 Ian Lance Taylor <iant@google.com>
5097
5098 PR gold/13850
5099 * layout.cc (Layout::make_output_section): Correctly mark
5100 SHT_INIT_ARRAY, et. al., as relro.
5101
fa40b62a
DK
51022012-03-14 Doug Kwan <dougkwan@google.com>
5103
5104 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
5105 dynamic relocations for protected symbols in shared objects.
5106
fd325007
ILT
51072012-03-13 Ian Lance Taylor <iant@google.com>
5108
5109 * resolve.cc (Symbol_table::resolve): When merging common symbols,
5110 keep the larger alignment.
5111
e8dd54e1
CC
51122012-03-12 Cary Coutant <ccoutant@google.com>
5113
5114 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
5115 handling of DW_LNE_define_file.
5116
feb5f3b0
CC
51172012-03-12 Cary Coutant <ccoutant@google.com>
5118
5119 * reduced_debug_output.cc
5120 (Output_reduced_debug_info_section::get_die_end): Add new FORM
5121 codes to switch.
5122
a1fb4256
CC
51232012-02-29 Cary Coutant <ccoutant@google.com>
5124
5125 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
5126
5dd8762a
CC
51272012-02-29 Cary Coutant <ccoutant@google.com>
5128
5129 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
5130 Call Object::decompressed_section_contents.
5131 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
5132 New dtor.
5133 (Sized_dwarf_line_info::buffer_start_): New data member.
5134 * merge.cc (Output_merge_data::do_add_input_section): Call
5135 Object::decompressed_section_contents.
5136 (Output_merge_string::do_add_input_section): Likewise.
5137 * object.cc (need_decompressed_section): New function.
5138 (build_compressed_section_map): Decompress sections needed later.
5139 (Sized_relobj_file::do_decompressed_section_contents): New function.
5140 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5141 * object.h (Object::decompressed_section_contents): New function.
5142 (Object::discard_decompressed_sections): New function.
5143 (Object::do_decompressed_section_contents): New function.
5144 (Object::do_discard_decompressed_sections): New function.
5145 (Compressed_section_info): New type.
5146 (Compressed_section_map): Include decompressed section contents.
5147 (Sized_relobj_file::do_decompressed_section_contents): New function.
5148 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5149
7b5de7ee
CC
51502012-02-16 Cary Coutant <ccoutant@google.com>
5151
5152 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
5153 * testsuite/Makefile.in: Regenerate.
5154
f9fa4a63
CC
51552012-02-14 Cary Coutant <ccoutant@google.com>
5156
5157 * options.cc (General_options::finalize): Disallow -pie and -static.
5158
2c175ebc
DK
51592012-02-03 Doug Kwan <dougkwan@google.com>
5160
5161 * arm.cc (Arm_relocate_functions::abs8,
5162 Arm_relocate_functions::abs16): Use
5163 Bits::has_signed_unsigned_overflow32.
5164 (Arm_relocate_functions::thm_abs8): Correct range of
5165 overflow check.
5166 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
5167 in assertions.
5168
90cff06f
DK
51692012-02-02 Doug Kwan <dougkwan@google.com>
5170
5171 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
5172 position independent outputs, not just shared objects.
5173
63887f3d
L
51742012-01-30 H.J. Lu <hongjiu.lu@intel.com>
5175
5176 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
5177 * configure: Regenerated.
5178
bef2b434
ILT
51792012-01-27 Ian Lance Taylor <iant@google.com>
5180
5181 * reloc.h (Bits): New class with static functions, copied from
5182 namespace utils in arm.cc.
5183 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
5184 instead.
5185
c335b55d
L
51862012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5187
5188 * incremental.cc (write_info_blocks): Correct relocation offset.
5189
41194d9f
L
51902012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5191
5192 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
5193 (Relocate::tls_gd_to_le): Likewise.
5194
1bae613c
L
51952012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5196
5197 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
5198
24482ca0
L
51992012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5200
5201 * configure.ac: Check if -mcmodel=medium works.
5202 * configure: Regenerated.
5203
c2c7840a
CC
52042012-01-24 Cary Coutant <ccoutant@google.com>
5205
5206 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
5207 definition and ...
5208 (read_unsigned_LEB_128_x): ... this new function.
5209 (read_signed_LEB_128): Replaced with inline definition and ...
5210 (read_signed_LEB_128_x): ... this new function.
5211 * int_encoding.h (read_unsigned_LEB_128_x): New function.
5212 (read_unsigned_LEB_128): Add inline definition.
5213 (read_signed_LEB_128_x): New function.
5214 (read_signed_LEB_128): Add inline definition.
5215 * testsuite/Makefile.am (leb128_unittest): New unit test.
5216 * testsuite/Makefile.in: Regenerate.
5217 * testsuite/leb128_unittest.cc: New unit test.
5218
833de760 52192012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
5220
5221 PR gold/13617
5222 * i386.cc (Target_i386::do_code_fill): When using a jmp
5223 instruction, pad with nop instructions.
5224 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5225
618d6666
L
52262012-01-22 H.J. Lu <hongjiu.lu@intel.com>
5227
5228 * x86_64.cc (gc_process_relocs): Add typename on types used in
5229 template.
5230 (scan_relocs): Likewise.
5231 (relocate_section): Likewise.
5232 (apply_relocation): Likewise.
5233
3660ff06
L
52342012-01-10 H.J. Lu <hongjiu.lu@intel.com>
5235
5236 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
5237 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
5238 under x32.
5239
fc51264f
L
52402012-01-09 H.J. Lu <hongjiu.lu@intel.com>
5241
5242 * x86_64.cc: Initial support for x32.
5243
dd74ae06
CC
52442012-01-03 Cary Coutant <ccoutant@google.com>
5245
5246 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
5247 Use abstract base class for GOT.
5248 * gold/output.h (class Output_data_got_base): New abstract base class.
5249 (class Output_data_got): Derive from new base class, adjust ctors.
5250 (Output_data_got::reserve_slot): Make virtual; rename to
5251 do_reserve_slot; Adjust callers.
5252 * gold/target.h (Sized_target::init_got_plt_for_update): Return
5253 pointer to abstract base class.
5254 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
5255
83896202
ILT
52562011-12-18 Ian Lance Taylor <iant@google.com>
5257
5258 * object.h (Relobj::local_symbol_value): New function.
5259 (Relobj::local_plt_offset): New function.
5260 (Relobj::local_has_got_offset): New function.
5261 (Relobj::local_got_offset): New function.
5262 (Relobj::set_local_got_offset): New function.
5263 (Relobj::do_local_symbol_value): New pure virtual function.
5264 (Relobj::do_local_plt_offset): Likewise.
5265 (Relobj::do_local_has_got_offset): Likewise.
5266 (Relobj::do_local_got_offset): Likewise.
5267 (Relobj::do_set_local_got_offset): Likewise.
5268 (Sized_relobj::do_local_has_got_offset): Rename from
5269 local_has_got_offset.
5270 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
5271 (Sized_relobj::do_set_local_got_offset): Rename from
5272 set_local_got_offset.
5273 (Sized_relobj_file::do_local_plt_offset): Rename from
5274 local_plt_offset.
5275 (Sized_relobj_file::do_local_symbol_value): New function.
5276 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
5277 local_plt_offset.
5278 * output.cc (Output_data_got::Got_entry::write): Change object to
5279 Relobj. Use local_symbol_value.
5280 (Output_data_got::add_global_with_rel): Change rel_dyn to
5281 Output_data_reloc_generic*. Use add_global_generic.
5282 (Output_data_got::add_global_with_rela): Remove. Change all
5283 callers to use add_global_with_rel.
5284 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
5285 Output_data_reloc_generic*. Use add_global_generic.
5286 (Output_data_got::add_global_pair_with_rela): Remove. Change all
5287 callers to use add_global_pair_with_rel.
5288 (Output_data_got::add_local): Change object to Relobj*.
5289 (Output_data_got::add_local_plt): Likewise.
5290 (Output_data_got::add_local_with_rel): Change object to Relobj*,
5291 change rel_dyn to Output_data_reloc_generic*. Use
5292 add_local_generic.
5293 (Output_data_got::add_local_with_rela): Remove. Change all
5294 callers to use all_local_with_rel.
5295 (Output_data_got::add_local_pair_with_rel): Change object to
5296 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
5297 add_output_section_generic.
5298 (Output_data_got::add_local_pair_with_rela): Remove. Change all
5299 callers to use add_local_pair_with_rel.
5300 (Output_data_got::reserve_local): Change object to Relobj*.
5301 * output.h: (class Output_data_reloc_generic): Add pure virtual
5302 declarations for add_global_generic, add_local_generic,
5303 add_output_section_generic.
5304 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
5305 functions for Output_data_reloc_generic. Update declarations for
5306 changes listed in output.cc.
5307 (class Output_data_got): Change template parameter to got_size.
5308 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
5309 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
5310 function.
5311 (Sized_relobj_incr::do_local_plt_offset): New function.
5312 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
5313 add_global_generic.
5314
76677ad0
CC
53152011-12-17 Cary Coutant <ccoutant@google.com>
5316
5317 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
5318 * resolve.cc (Symbol_table::resolve): Likewise.
5319 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
5320 arrays.
5321 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5322
8b8dd8d5
ILT
53232011-12-16 Ian Lance Taylor <iant@google.com>
5324
5325 * output.h (Output_data_reloc_generic::add): Only call
5326 add_dynamic_reloc if this is a dynamic reloc section.
5327
d55525b9
L
53282011-12-15 H.J. Lu <hongjiu.lu@intel.com>
5329
5330 PR gold/13505
5331 * target-reloc.h (apply_relocation): Replace <64, false> with
5332 <size, big_endian>.
5333
ff81c7c1
NC
53342011-11-25 Nick Clifton <nickc@redhat.com>
5335
5336 * po/it.po: New Italian translation.
5337
628f39be
SA
53382011-11-17 Sterling Augustine <saugustine@google.com>
5339
5340 * script.cc (script_include_directive): Implement.
5341 (read_script_file): New local variables name and search_path. Update
5342 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
5343 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
5344 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
5345
98ef3ea4
SA
53462011-11-11 Sterling Augustine <saugustine@google.com>
5347
5348 * yyscript.y (section_cmd): Add support for INCLUDE directive.
5349 (file_or_sections_cmd): Likewise.
5350
f4a8b6d7
DK
53512011-11-11 Doug Kwan <dougkwan@google.com>
5352
5353 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
5354 if --just-symbols is given.
5355
29ab395d
DK
53562011-11-10 Doug Kwan <dougkwan@google.com>
5357
5358 PR gold/13362
5359 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
5360 when processing data relocs.
5361 * reloc.h (Relocate_functions::rel_unaligned): New method.
5362 (Relocate_functions::pcrel_unaligned): Ditto.
5363 (Relocate_functions::rel32_unaligned): Ditto.
5364 (Relocate_functions::pcrel32_unaligned): Ditto.
5365
2c339f71
DK
53662011-11-09 Doug Kwan <dougkwan@google.com>
5367
5368 PR gold/13362
5369 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
5370 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
5371 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
5372 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5373 (Relocate_functions::rel_unaligned): New.
5374 (Relocate_functions::rel32_unaligned): New.
5375 * target-reloc.h (relocate_for_relocatable): Add code to handle
5376 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5377 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
5378 arm_unaligned_reloc_r): New targets.
5379 * testsuite/Makefile.in: Regenerate.
5380 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
5381 linking.
5382
3f3cddf1
ILT
53832011-11-02 Ian Lance Taylor <iant@google.com>
5384
5385 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
5386 NATIVE_LINKER.
5387 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
5388 * options.cc (General_options::finalize): Use library search path
5389 from configure script if specified. If not native and no sysroot,
5390 only search TOOLLIBDIR.
5391 * options.h (Search_directory::Search_directory): Change name to
5392 const std::string&.
5393 (General_options::add_to_library_path_with_sysroot): Change arg to
5394 const std::string&.
5395 * configure, Makefile.in, config.in: Rebuild.
5396
a8e2273b
ILT
53972011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5398
5399 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
5400 we are working around the ARM1176 Erratum.
5401 * options.h (General_options::fix_arm1176): Add option.
5402 * testsuite/Makefile.am: Add testcases, and keep current ones
5403 working.
5404 * testsuite/Makefile.in: Regenerate.
5405 * testsuite/arm_fix_1176.s: New file.
5406 * testsuite/arm_fix_1176.sh: Likewise.
5407
cd6eab1c
ILT
54082011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5409
5410 * arm.cc (Target_arm::Target_arm): Remove initialisation of
5411 may_use_blx_.
5412 (Target_arm::may_use_blx): Remove method.
5413 (Target_arm::set_may_use_blx): Likewise.
5414 (Target_arm::may_use_v4t_interworking): New method.
5415 (Target_arm::may_use_v5t_interworking): Likewise.
5416 (Target_arm::may_use_blx_): Remove member variable.
5417 (Arm_relocate_functions::arm_branch_common): Check for v5T
5418 interworking.
5419 (Arm_relocate_functions::thumb_branch_common): Likewise.
5420 (Reloc_stub::stub_type_for_reloc): Likewise.
5421 (Target_arm::do_finalize_sections): Correct interworking checks.
5422 * testsuite/Makefile.am: Add new tests.
5423 * testsuite/Makefile.in: Regenerate.
5424 * testsuite/arm_farcall_arm_arm.s: New test.
5425 * testsuite/arm_farcall_arm_arm.sh: Likewise.
5426 * testsuite/arm_farcall_arm_thumb.s: Likewise.
5427 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
5428 * testsuite/arm_farcall_thumb_arm.s: Likewise.
5429 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
5430 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
5431 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
5432
286adcf4
CC
54332011-10-31 Cary Coutant <ccoutant@google.com>
5434
5435 PR gold/13023
5436 * expression.cc (Expression::eval_with_dot): Add
5437 is_section_dot_assignment parameter.
5438 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
5439 absolute and assigning to dot within a section.
5440 * script-sections.cc
5441 (Output_section_element_assignment::set_section_addresses): Pass
5442 dot_section to set_if_absolute.
5443 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
5444 as is_section_dot_assignment flag to eval_with_dot.
5445 (Output_section_element_dot_assignment::set_section_addresses):
5446 Likewise.
5447 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
5448 parameter. Also set value if relative to dot_section; set the
5449 symbol's output_section.
5450 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
5451 parameter. Adjust all callers.
5452 (Expression::eval_maybe_dot): Likewise.
5453 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
5454 Adjust all callers.
5455 * testsuite/script_test_2.t: Test assignment of an absolute value
5456 to dot within an output section element.
5457
9634ed06
CC
54582011-10-31 Cary Coutant <ccoutant@google.com>
5459
5460 * options.h (class General_options): Add --[no-]gnu-unique options.
5461 * symtab.cc (Symbol_table::sized_write_globals): Convert
5462 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
5463
de4101c7
CC
54642011-10-31 Cary Coutant <ccoutant@google.com>
5465
5466 PR gold/13359
5467 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
5468 unnecessary assertion.
5469 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
5470
7257cc92
ST
54712011-10-31 Sriraman Tallam <tmsriram@google.com>
5472
5473 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5474 gc_mark_symbol.
5475 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5476 gc_mark_symbol.
5477 Change to just keep the section associated with symbol.
5478 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
5479 they are externally visible and --export-dynamic is turned on.
5480 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
5481
bfc34b3f
ILT
54822011-10-19 Ian Lance Taylor <iant@google.com>
5483
5484 PR gold/13163
5485 * script-sections.cc
5486 (Output_section_element_dot_assignment::needs_output_section): New
5487 function.
5488
ea0d8c47
ILT
54892011-10-19 Ian Lance Taylor <iant@google.com>
5490
5491 PR gold/13204
5492 * layout.cc (Layout::segment_precedes): Don't assert failure if a
5493 --section-start option was seen.
5494 * options.h (General_options::any_section_start): New function.
5495
abd242a9
DM
54962011-10-18 David S. Miller <davem@davemloft.net>
5497
5498 PR binutils/13301
5499 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
5500 member to track relocation locations that have moved during TLS
5501 reloc optimizations.
5502 (Target_sparc::Relocate::Relocate): Initialize to NULL.
5503 (Target_sparc::Relocate::relocate): Adjust view down by 4
5504 bytes if it matches reloc_adjust_addr_.
5505 (Target_sparc::Relocate::relocate_tls): Always move the
5506 __tls_get_addr call delay slot instruction forward 4 bytes when
5507 performing relaxation.
5508
bab9090f
CC
55092011-10-18 Cary Coutant <ccoutant@google.com>
5510
5511 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
5512 (Output_file::map_no_anonymous): Check for non-zero
5513 return code from posix_fallocate.
5514
f7c5b166
CC
55152011-10-17 Cary Coutant <ccoutant@google.com>
5516
5517 PR gold/13245
5518 * plugin.cc (is_visible_from_outside): Check for symbols
5519 referenced from dynamic objects.
5520 * resolve.cc (Symbol_table::resolve): Don't count references
5521 from dynamic objects as references from real ELF files.
5522 * testsuite/plugin_test_2.sh: Adjust expected result.
5523
b490c0bb
CC
55242011-10-17 Cary Coutant <ccoutant@google.com>
5525
5526 * gold.cc: Include timer.h.
5527 (queue_middle_tasks): Stamp time.
5528 (queue_final_tasks): Likewise.
5529 * main.cc (main): Store timer in parameters. Print timers
5530 for each pass.
5531 * parameters.cc (Parameters::Parameters): Initialize timer_.
5532 (Parameters::set_timer): New function.
5533 (set_parameters_timer): New function.
5534 * parameters.h (Parameters::set_timer): New function.
5535 (Parameters::timer): New function.
5536 (Parameters::timer_): New data member.
5537 (set_parameters_timer): New function.
5538 * timer.cc (Timer::stamp): New function.
5539 (Timer::get_pass_time): New function.
5540 * timer.h (Timer::stamp): New function.
5541 (Timer::get_pass_time): New function.
5542 (Timer::pass_times_): New data member.
5543
f475cf7b
CC
55442011-10-17 Cary Coutant <ccoutant@google.com>
5545
5546 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
5547 task for members of lib groups.
5548
cdd7e244
CC
55492011-10-17 Cary Coutant <ccoutant@google.com>
5550
5551 PR gold/13288
4f95c8b4 5552 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
5553 (File_read::make_view): Move bounds check (replace with assert)...
5554 (File_read::find_or_make_view): ... to here.
5555
dfb45471
CC
55562011-10-12 Cary Coutant <ccoutant@google.com>
5557
4f95c8b4 5558 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
5559 ::read returns less than requested size.
5560
53bbcc1b
CC
55612011-10-10 Cary Coutant <ccoutant@google.com>
5562
4f95c8b4 5563 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
5564 Initialize defined_count_.
5565 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
5566 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
5567 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
5568 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
5569 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 5570 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
5571 member.
5572 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 5573 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
5574 Return zeroes instead of internal error.
5575
397b129b
CC
55762011-10-10 Cary Coutant <ccoutant@google.com>
5577
5578 PR gold/13249
4f95c8b4 5579 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 5580 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 5581 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
5582 (Output_reloc::type_): Adjust size of bit field.
5583 (Output_reloc::use_plt_offset_): New bit field.
5584 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
5585 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
5586 flag. Adjust all callers.
4f95c8b4 5587 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
5588 creating RELATIVE relocations.
5589
d5698657
NC
55902011-10-10 Nick Clifton <nickc@redhat.com>
5591
5592 * po/es.po: Updated Spanish translation.
5593 * po/fi.po: Updated Finnish translation.
5594
6a59a5c2
DN
55952011-10-03 Diego Novillo <dnovillo@google.com>
5596
5597 * options.cc (parse_uint): Fix dereference of RETVAL.
5598
f0558624
ST
55992011-09-29 Sriraman Tallam <tmsriram@google.com>
5600
5601 * layout.h (section_order_map_): New member.
5602 (get_section_order_map): New member function.
5603 * output.cc (Output_section::add_input_section): Check for patterns
5604 only when --section-ordering-file is specified.
5605 * gold.cc (queue_middle_tasks): Delay updating order of sections till
5606 output_sections have been formed.
5607 * layout.cc (Layout_Layout): Initialize section_order_map_.
5608 * plugin.cc (update_section_order): Store order in order_map. Do not
5609 update the order.
5610 * testsuite/Makefile.am: Add test case for plugin_final_layout.
5611 * testsuite/Makefile.in: Regenerate.
5612 * testsuite/plugin_section_order.c: New file.
5613 * testsuite/plugin_final_layout.cc: New file.
5614 * testsuite/plugin_final_layout.sh: New file.
5615
a7dac153
CC
56162011-09-29 Cary Coutant <ccoutant@google.com>
5617
4f95c8b4 5618 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 5619 Check for NULL.
4f95c8b4 5620 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
5621 symbols during incremental update.
5622 (Symbol_table::add_from_dynobj): Likewise.
5623
eebd87a5
ILT
56242011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5625 Ian Lance Taylor <iant@google.com>
5626
5627 * symtab.cc (Symbol_table::define_special_symbol): Always
5628 canonicalize version string.
5629
403a3331
CC
56302011-09-26 Cary Coutant <ccoutant@google.com>
5631
4f95c8b4
CC
5632 * gold.cc (queue_initial_tasks): Move option checks ...
5633 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
5634 some options; make others fatal.
5635
235061c2
CC
56362011-09-26 Cary Coutant <ccoutant@google.com>
5637
5638 gcc PR lto/47247
5639 * plugin.cc (get_symbols_v2): New function.
5640 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
5641 (is_referenced_from_outside): New function.
5642 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
5643 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
5644 (get_symbols): Pass version parameter.
5645 (get_symbols_v2): New function.
5646 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
5647 parameter.
5648 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
5649 (onload): Add LDPT_GET_SYMBOLS_V2.
5650 (all_symbols_read_hook): Use get_symbols_v2; check for
5651 LDPR_PREVAILING_DEF_IRONLY_EXP.
5652 * testsuite/plugin_test_3.sh: Update expected results.
5653
dc87f620
ILT
56542011-09-23 Simon Baldwin <simonb@google.com>
5655
5656 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
5657 configuration options.
5658 * configure: Regenerate.
5659 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
5660 * Makefile.in: Regenerate.
5661 * testsuite/Makefile.in: Regenerate.
5662
a8279f82
ST
56632011-09-19 Sriraman Tallam <tmsriram@google.com>
5664
5665 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
5666
0c9350c8
CC
56672011-09-19 Cary Coutant <ccoutant@google.com>
5668
5669 * incremental.cc (can_incremental_update): Fix typo in comment.
5670 * incremental.h (can_incremental_update): Likewise.
5671
aa06ae28
CC
56722011-09-18 Cary Coutant <ccoutant@google.com>
5673
5674 * incremental.cc (can_incremental_update): New function.
5675 * incremental.h (can_incremental_update): New function.
5676 * layout.cc (Layout::init_fixed_output_section): Call it.
5677 (Layout::make_output_section): Don't allow patch space in .eh_frame.
5678 * object.cc (Sized_relobj_file::do_layout): Call
5679 can_incremental_update.
5680
ebb300b2
CC
56812011-09-13 Cary Coutant <ccoutant@google.com>
5682
5683 * configure.ac: Check for glibc support for gnu_indirect_function
5684 support with static linking, setting automake conditional
5685 IFUNC_STATIC.
5686 * Makefile.in: Regenerate.
5687 * configure: Regenerate.
5688
5689 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
5690 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
5691 for IFUNC_STATIC.
5692 * testsuite/Makefile.in: Regenerate.
5693
1206d0d5
CC
56942011-09-13 Cary Coutant <ccoutant@google.com>
5695
5696 * incremental.cc (Sized_relobj_incr::do_layout): Call
5697 report_comdat_group for kept comdat sections.
5698 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
5699 * testsuite/Makefile.in: Regenerate.
5700 * testsuite/incr_comdat_test_1.cc: New source file.
5701 * testsuite/incr_comdat_test_2_v1.cc: New source file.
5702 * testsuite/incr_comdat_test_2_v2.cc: New source file.
5703 * testsuite/incr_comdat_test_2_v3.cc: New source file.
5704
40b29874
ILT
57052011-09-13 Ian Lance Taylor <iant@google.com>
5706
5707 * object.cc (Sized_relobj_file::do_layout): Remove unused local
5708 variable external_symbols_offset.
5709
1b045aac
ILT
57102011-09-12 Ian Lance Taylor <iant@google.com>
5711
5712 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
5713 triggered if object has no symbols.
5714
24c6c55a
DM
57152011-09-09 David S. Miller <davem@davemloft.net>
5716
5717 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
5718 (Output_fill_debug_line::do_write): Likewise.
5719
66570254
CC
57202011-08-29 Cary Coutant <ccoutant@google.com>
5721
5722 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
5723 casts to match formatting specs.
5724 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
5725
8ea8cd50
CC
57262011-08-26 Cary Coutant <ccoutant@google.com>
5727
5728 * layout.cc (Free_list::allocate): Provide guarantee of minimum
5729 remaining hole size when allocating.
5730 (Layout::make_output_section): Set fill methods for debug sections.
5731 * layout.h (Free_list::Free_list_node): Move from private to
5732 public.
5733 (Free_list::set_min_hole_size): New function.
5734 (Free_list::begin, Free_list::end): New functions.
5735 (Free_list::min_hole_): New data member.
5736 * output.cc: Include dwarf.h.
5737 (Output_fill_debug_info::do_minimum_hole_size): New function.
5738 (Output_fill_debug_info::do_write): New function.
5739 (Output_fill_debug_line::do_minimum_hole_size): New function.
5740 (Output_fill_debug_line::do_write): New function.
5741 (Output_section::Output_section): Initialize new data member.
5742 (Output_section::set_final_data_size): Ensure patch space is larger
5743 than minimum hole size.
5744 (Output_section::do_write): Fill holes in debug sections.
5745 * output.h (Output_fill): New class.
5746 (Output_fill_debug_info): New class.
5747 (Output_fill_debug_line): New class.
5748 (Output_section::set_free_space_fill): New function.
5749 (Output_section::free_space_fill_): New data member.
5750 * testsuite/Makefile.am (incremental_test_3): Add
5751 --incremental-patch option.
5752 (incremental_test_4): Likewise.
5753 (incremental_test_5): Likewise.
5754 (incremental_test_6): Likewise.
5755 (incremental_copy_test): Likewise.
5756 (incremental_common_test_1): Likewise.
5757 * testsuite/Makefile.in: Regenerate.
5758
7cf80422
NC
57592011-08-26 Nick Clifton <nickc@redhat.com>
5760
5761 * po/es.po: Updated Spanish translation.
5762
c3f7b0e5
CC
57632011-08-01 Cary Coutant <ccoutant@google.com>
5764
5765 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
5766 * gold/testsuite/Makefile.in: Regenerate.
5767 * gold/testsuite/justsyms_exec.c: New source file.
5768 * gold/testsuite/justsyms_lib.c: New source file.
5769
9590bf25
CC
57702011-08-01 Cary Coutant <ccoutant@google.com>
5771
5772 * layout.cc (Layout::set_segment_offsets): Don't realign text
5773 segment if -Ttext was specified.
5774 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
5775 file type.
5776 * object.h (Sized_relobj_file::e_type): New function.
5777 (Sized_relobj_file::e_type_): New data member.
5778 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
5779 base address for ET_EXEC files.
5780 * target.cc (Target::do_make_elf_object_implementation): Allow
5781 ET_EXEC files with --just-symbols option.
5782
dcd8d12e
CC
57832011-07-28 Cary Coutant <ccoutant@google.com>
5784
5785 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
5786 Add thread_number parameter.
5787 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
5788 * workqueue-threads.cc
5789 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
5790 current thread if its thread number is greater than desired thread
5791 count.
5792 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
5793 Add thread_number parameter.
5794 (Workqueue::should_cancel_thread): Likewise.
5795 (Workqueue::find_runnable_or_wait): Pass thread_number to
5796 should_cancel_thread.
5797 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
5798 parameter.
5799
804eb480
ST
58002011-07-22 Sriraman Tallam <tmsriram@google.com>
5801
5802 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
5803 only after checking if it cannot be forced local.
5804 * symtab.h (is_externally_visible): Check if the symbol is not forced
5805 local.
5806
f1ddb600
ILT
58072011-07-15 Ian Lance Taylor <iant@google.com>
5808
5809 * options.h (class General_options): Add --print-output-format.
5810 Move -EL next to -EB, for better --help output.
5811 * target-select.cc: Include <cstdio>, "options.h", and
5812 "parameters.h".
5813 (Target_selector::do_target_bfd_name): New function.
5814 (print_output_format): New function.
5815 * target-select.h (class Target_selector): Update declarations.
5816 (Target_selector::target_bfd_name): New function.
5817 (print_output_format): Declare.
5818 * main.cc: Include "target-select.h".
5819 (main): Handle --print-output-format.
5820 * gold.cc: Include "target-select.h".
5821 (queue_initial_tasks): Handle --print-output-format when there are
5822 no input files.
5823 * parameters.cc (parameters_force_valid_target): Give a better
5824 error message if -EB/-EL does not match target.
5825 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
5826 function.
5827
7d172687
ILT
58282011-07-15 Ian Lance Taylor <iant@google.com>
5829
5830 * i386.cc (class Output_data_plt_i386): Add layout_ field.
5831 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
5832 (Output_data_plt_i386::do_write): Write address of .dynamic
5833 section to first entry in .got.plt section.
5834 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
5835 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
5836 Initialize layout_.
5837 (Output_data_plt_x86_64::do_write): Write address of .dynamic
5838 section to first entry in .got.plt section.
5839 * layout.h (Layout::dynamic_section): New function.
5840
e9552f7e
ST
58412011-07-13 Sriraman Tallam <tmsriram@google.com>
5842
5843 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
5844 to claim_file call.
5845 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
5846 input_section_position_, and input_section_glob_.
5847 (read_layout_from_file): Call function section_ordering_specified.
5848 * layout.h (is_section_ordering_specified): New function.
5849 (section_ordering_specified): New function.
5850 (section_ordering_specified_): New boolean member.
5851 * main.cc(main): Call load_plugins after layout object is defined.
5852 * output.cc (Output_section::add_input_section): Use
5853 function section_ordering_specified to check if section ordering is
5854 needed.
5855 * output.cc (Output_section::add_relaxed_input_section): Use
5856 function section_ordering_specified to check if section ordering is
5857 needed.
5858 (Output_section::update_section_layout): New function.
5859 (Output_section::sort_attached_input_sections): Check if input section
5860 must be reordered.
5861 * output.h (Output_section::update_section_layout): New function.
5862 * plugin.cc (get_section_count): New function.
5863 (get_section_type): New function.
5864 (get_section_name): New function.
5865 (get_section_contents): New function.
5866 (update_section_order): New function.
58797674 5867 (allow_section_ordering): New function.
e9552f7e
ST
5868 (Plugin::load): Add the new interfaces to the transfer vector.
5869 (Plugin_manager::load_plugins): New parameter.
5870 (Plugin_manager::all_symbols_read): New parameter.
5871 (Plugin_manager::claim_file): New parameter. Save the elf object for
5872 unclaimed objects.
5873 (Plugin_manager::get_elf_object): New function.
5874 (Plugin_manager::get_view): Change to directly use the bool to check
5875 if get_view is called from claim_file_hook.
5876 * plugin.h (input_objects): New function
5877 (Plugin__manager::load_plugins): New parameter.
5878 (Plugin_manager::claim_file): New parameter.
5879 (Plugin_manager::get_elf_object): New function.
5880 (Plugin_manager::in_claim_file_handler): New function.
5881 (Plugin_manager::in_claim_file_handler_): New member.
5882 (layout): New function.
5883 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
5884 handler with an extra parameter. Make the elf object before calling
5885 claim_file handler.
5886 * testsuite/plugin_test.c (get_section_count): New function pointer.
5887 (get_section_type): New function pointer.
5888 (get_section_name): New function pointer.
5889 (get_section_contents): New function pointer.
5890 (update_section_order): New function pointer.
5891 (allow_section_ordering): New function pointer.
5892 (onload): Check if the new interfaces exist.
5893
9446efde
ILT
58942011-07-13 Ian Lance Taylor <iant@google.com>
5895
5896 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
5897 relro section.
5898 * x86_64.cc (Target_x86_64::got_section): Likewise.
5899 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
5900 (relro_now_test_SOURCES): New variable.
5901 (relro_now_test_DEPENDENCIES): New variable.
5902 (relro_now_test_LDFLAGS): New variable.
5903 (relro_now_test_LDADD): New variable.
5904 (relro_now_test.so): New target.
5905 * testsuite/Makefile.in: Rebuild.
5906
07aa62f2
ILT
59072011-07-12 Ian Lance Taylor <iant@google.com>
5908
5909 PR gold/12980
5910 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
5911 GLOB_DAT relocation rather than a RELATIVE relocation for a
5912 protected symbol when creating a shared library.
5913 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
5914 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
5915 * testsuite/protected_main_1.cc (main): Test that protected
5916 function has same address.
5917
e2153196
ILT
59182011-07-11 Ian Lance Taylor <iant@google.com>
5919
5920 PR gold/12979
5921 * options.h (class General_options): Add -Bgroup.
5922 * options.cc (General_options::finalize): If -Bgroup is set,
5923 default to --unresolved-symbols=report-all.
5924 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
5925 * target-reloc.h (issue_undefined_symbol_error): Handle
5926 --unresolved-symbols=report-all.
5927
6daf5215
ILT
59282011-07-08 Ian Lance Taylor <iant@google.com>
5929
5930 PR gold/11985
5931 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
5932 if linker script discards key sections.
5933 (Layout::create_dynamic_symtab): Likewise.
5934 (Layout::assign_local_dynsym_offsets): Likewise.
5935 (Layout::sized_create_version_sections): Likewise.
5936 (Layout::create_interp): Likewise.
5937 (Layout::finish_dynamic_section): Likewise.
5938 (Layout::set_dynamic_symbol_size): Likewise.
5939
beabb2c6
ILT
59402011-07-08 Ian Lance Taylor <iant@google.com>
5941
5942 PR gold/12386
5943 * options.h (class General_options): Add --unresolved-symbols.
5944 * target-reloc.h (issue_undefined_symbol_error): Check
5945 --unresolved-symbols. Add comments.
5946
9c16daf1
ILT
59472011-07-08 Ian Lance Taylor <iant@google.com>
5948
5949 * testsuite/odr_violation2.cc (Ordering::operator()): Make
5950 expression more complex.
5951
191f1a2d
ILT
59522011-07-08 Ian Lance Taylor <iant@google.com>
5953
5954 PR gold/11317
5955 * target-reloc.h (issue_undefined_symbol_error): New inline
5956 function, broken out of relocate_section.
5957 (relocate_section): Call issue_undefined_symbol_error.
5958 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
5959 there is no TLS segment if we are about to issue an undefined
5960 symbol error.
5961 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
5962
62855347
ILT
59632011-07-08 Ian Lance Taylor <iant@google.com>
5964
5965 PR gold/12279
5966 * resolve.cc (Symbol_table::should_override): Add fromtype
5967 parameter. Change all callers. Give error when linking together
5968 TLS and non-TLS symbol.
5969 (Symbol_table::should_override_with_special): Add fromtype
5970 parameter. Change all callers.
5971 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
5972 there is no TLS segment if we have reported some errors.
5973 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
5974
67181c72
ILT
59752011-07-08 Ian Lance Taylor <iant@google.com>
5976
5977 PR gold/12372
5978 * target.h (Target::plt_address_for_global): New function.
5979 (Target::plt_address_for_local): New function.
5980 (Target::plt_section_for_global): Remove.
5981 (Target::plt_section_for_local): Remove.
5982 (Target::do_plt_address_for_global): New virtual function.
5983 (Target::do_plt_address_for_local): New virtual function.
5984 (Target::do_plt_section_for_global): Remove.
5985 (Target::do_plt_section_for_local): Remove.
5986 (Target::register_global_plt_entry): Add Symbol_table and Layout
5987 parameters.
5988 * output.cc (Output_data_got::Got_entry::write): Use
5989 plt_address_for_global and plt_address_for_local.
5990 * layout.cc (Layout::add_target_dynamic_tags): Use size and
5991 address of output section.
5992 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
5993 got_irelative_, and irelative_count_ fields. Update
5994 declarations.
5995 (Output_data_plt_i386::has_irelative_section): New function.
5996 (Output_data_plt_i386::entry_count): Add irelative_count_.
5997 (Output_data_plt_i386::set_final_data_size): Likewise.
5998 (class Target_i386): Add got_irelative_ and rel_irelative_
5999 fields. Update declarations.
6000 (Target_i386::Target_i386): Initialize new fields.
6001 (Target_i386::do_plt_address_for_global): New function replacing
6002 do_plt_section_for_global.
6003 (Target_i386::do_plt_address_for_local): New function replacing
6004 do_plt_section_for_local.
6005 (Target_i386::got_section): Create got_irelative_.
6006 (Target_i386::rel_irelative_section): New function.
6007 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
6008 fields. Don't define __rel_iplt_{start,end}.
6009 (Output_data_plt_i386::add_entry): Add symtab and layout
6010 parameters. Change all callers. Use different PLT and GOT for
6011 IFUNC symbols.
6012 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
6013 layout parameters. Change all callers. Use different PLT and
6014 GOT.
6015 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
6016 (Output_data_plt_i386::rel_irelative): New function.
6017 (Output_data_plt_i386::address_for_global): New function.
6018 (Output_data_plt_i386::address_for_local): New function.
6019 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
6020 IRELATIVE GOT when changing IFUNC GOT entries.
6021 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
6022 reloc.
6023 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
6024 if we didn't create an IRELATIVE GOT.
6025 (Target_i386::Relocate::relocate): Use plt_address_for_global and
6026 plt_address_for_local.
6027 (Target_i386::do_dynsym_value): Use plt_address_for_global.
6028 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
6029 got_irelative_, and irelative_count_ fields. Update
6030 declarations.
6031 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
6032 Initialize new fields. Remove symtab parameter. Change all
6033 callers.
6034 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
6035 irelative_count_.
6036 (Output_data_plt_x86_64::has_irelative_section): New function.
6037 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
6038 (class Target_x86_64): Add got_irelative_ and rel_irelative_
6039 fields. Update declarations.
6040 (Target_x86_64::Target_x86_64): Initialize new fields.
6041 (Target_x86_64::do_plt_address_for_global): New function replacing
6042 do_plt_section_for_global.
6043 (Target_x86_64::do_plt_address_for_local): New function replacing
6044 do_plt_section_for_local.
6045 (Target_x86_64::got_section): Create got_irelative_.
6046 (Target_x86_64::rela_irelative_section): New function.
6047 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
6048 all callers. Don't create __rel_iplt_{start,end}.
6049 (Output_data_plt_x86_64::add_entry): Add symtab and layout
6050 parameters. Change all callers. Use different PLT and GOT for
6051 IFUNC symbols.
6052 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
6053 layout parameters. Change all callers. Use different PLT and
6054 GOT.
6055 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
6056 parameters. Change all callers. Use different PLT and GOT for
6057 IFUNC symbols.
6058 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
6059 (Output_data_plt_x86_64::rela_irelative): New function.
6060 (Output_data_plt_x86_64::address_for_global): New function.
6061 (Output_data_plt_x86_64::address_for_local): New function.
6062 (Output_data_plt_x86_64::set_final_data_size): Likewise.
6063 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
6064 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
6065 (Target_x86_64::register_global_plt_entry): Add symtab and layout
6066 parameters.
6067 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
6068 reloc.
6069 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
6070 symbols if we didn't create an IRELATIVE GOT.
6071 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
6072 plt_address_for_local.
6073 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
6074 * testsuite/ifuncvar1.c: New test file.
6075 * testsuite/ifuncvar2.c: New test file.
6076 * testsuite/ifuncvar3.c: New test file.
6077 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
6078 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
6079 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
6080 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
6081 * testsuite/Makefile.in: Rebuild.
6082
33c15b45
CC
60832011-07-07 Cary Coutant <ccoutant@google.com>
6084
6085 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
6086 (two_file_test_1_ndebug.o): Likewise.
6087 (two_file_test_1b_ndebug.o): Likewise.
6088 (two_file_test_2_ndebug.o): Likewise.
6089 (two_file_test_main_ndebug.o): Likewise.
6090 (incremental_test_2): Link with no-debug versions.
6091
f48b5fb7
CC
60922011-07-06 Cary Coutant <ccoutant@google.com>
6093
6094 * gold/incremental.cc
6095 (Output_section_incremental_inputs::write_info_blocks): Check for
6096 hidden and internal symbols.
6097
221597a5
CC
60982011-07-06 Cary Coutant <ccoutant@google.com>
6099
6100 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
6101 Check disposition for startup file.
6102 (Incremental_inputs::report_command_line): Ignore
6103 --incremental-startup-unchanged option.
6104 * options.cc (General_options::parse_incremental_startup_unchanged):
6105 New function.
6106 (General_options::General_options): Initialize new data member.
6107 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
6108 (General_options): Add --incremental-startup-unchanged option.
6109 (General_options::incremental_startup_disposition): New function.
6110 (General_options::incremental_startup_disposition_): New data member.
6111
e24719f6
CC
61122011-07-06 Cary Coutant <ccoutant@google.com>
6113
6114 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
6115 input file index to Script_info ctor.
6116 (Sized_incremental_binary::do_file_has_changed): Find the
6117 command-line argument for files named in scripts.
6118 * incremental.h (Script_info::Script_info): New ctor
6119 with input file index.
6120 (Script_info::input_file_index): New function.
6121 (Script_info::input_file_index_): New data member.
6122 (Incremental_binary::get_library): Add const.
6123 (Incremental_binary::get_script_info): Add const.
6124 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
6125 * testsuite/Makefile.am (incremental_test_5): New test case.
6126 (incremental_test_6): New test case.
6127 * testsuite/Makefile.in: Regenerate.
6128
8f7c81e8
CC
61292011-07-06 Cary Coutant <ccoutant@google.com>
6130
6131 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
6132 debug output when command lines differ.
6133
9fbd3822
CC
61342011-07-06 Cary Coutant <ccoutant@google.com>
6135
6136 * incremental.cc (Incremental_inputs::report_command_line): Ignore
6137 --incremental-patch option.
6138 * layout.cc (Free_list::allocate): Extend allocation beyond original
6139 end if enabled.
6140 (Layout::make_output_section): Mark sections that should get
6141 patch space.
6142 * options.cc (parse_percent): New function.
6143 * options.h (parse_percent): New function.
6144 (DEFINE_percent): New macro.
6145 (General_options): Add --incremental-patch option.
6146 * output.cc (Output_section::Output_section): Initialize new data
6147 members.
6148 (Output_section::add_input_section): Print section name when out
6149 of patch space.
6150 (Output_section::add_output_section_data): Likewise.
6151 (Output_section::set_final_data_size): Add patch space when
6152 doing --incremental-full.
6153 (Output_section::do_reset_address_and_file_offset): Remove patch
6154 space.
6155 (Output_segment::set_section_list_addresses): Print debug output
6156 only if --incremental-update.
6157 * output.h (Output_section::set_is_patch_space_allowed): New function.
6158 (Output_section::is_patch_space_allowed_): New data member.
6159 (Output_section::patch_space_): New data member.
6160 * parameters.cc (Parameters::incremental_full): New function.
6161 * parameters.h (Parameters::incremental_full): New function
6162 * testsuite/Makefile.am (incremental_test_2): Add test for
6163 --incremental-patch option.
6164 * testsuite/Makefile.in: Regenerate.
6165 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
6166 (t18): Remove function body.
6167
f6cccc2c
DK
61682011-07-05 Doug Kwan <dougkwan@google.com>
6169
6170 PR gold/12771
6171 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
6172 Arm_Address type for relocation result.
6173 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
6174 overflow check.
6175 (Arm_relocate_functions::abs32): Use unaligned access.
6176 (Arm_relocate_functions::rel32): Ditto.
6177 (Arm_relocate_functions::prel31): Ditto.
6178 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
6179 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
6180 static data relocations.
6181 * testsuite/Makefile.in: Regnerate.
6182 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
6183
28a13fec
ILT
61842011-07-05 Ian Lance Taylor <iant@google.com>
6185
6186 PR gold/12392
6187 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
6188 symbols if necessary.
6189 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6190
24d47b34
ILT
61912011-07-05 Ian Lance Taylor <iant@google.com>
6192
6193 PR gold/12952
6194 * resolve.cc (Symbol::override_base_with_special): Simply override
6195 version with special symbol version, ignoring previous version.
6196
41f9cbbe
ILT
61972011-07-05 Ian Lance Taylor <iant@google.com>
6198
6199 * object.cc (Sized_relobj_file::include_section_group): Add
6200 information to comment about signature location.
6201
886288f1
ILT
62022011-07-02 Ian Lance Taylor <iant@google.com>
6203
6204 PR gold/12957
6205 * options.h (class General_options): Add -f and -F.
6206 * options.cc (General_options::finalize): Fatal error if -f/-F
6207 are used without -shared.
6208 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
6209
ae3a6d4f
ILT
62102011-07-02 Ian Lance Taylor <iant@google.com>
6211
6212 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
6213
21131061
ILT
62142011-07-01 Ian Lance Taylor <iant@google.com>
6215
6216 PR gold/12525
6217 PR gold/12952
6218 * resolve.cc (Symbol::override_base_with_special): Don't override
6219 the version if the overriding symbol has a different name.
6220 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
6221 all callers. If we give an error about an undefined version,
6222 define the base version if necessary.
6223 * dynobj.h (class Versions): Update declaration.
6224 * testsuite/weak_alias_test_5.cc: New file.
6225 * testsuite/weak_alias_test.script: New file.
6226 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
6227 and versioned_alias have the right value, and call t2.
6228 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
6229 weak_alias_test_5.so.
6230 (weak_alias_test_LDADD): Likewise.
6231 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
6232 * testsuite/Makefile.in: Rebuild.
6233
611062c0
ILT
62342011-07-01 Ian Lance Taylor <iant@google.com>
6235
6236 PR gold/12525
6237 * options.h (class General_options): Support -z notext.
6238 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
6239 -Wl,-z,notext.
6240 (two_file_shared_nonpic.so): Likewise.
6241 (two_file_shared_mixed.so): Likewise.
6242 (two_file_shared_mixed_1.so): Likewise.
6243 (weak_undef_lib_nonpic.so): Likewise.
6244 (alt/weak_undef_lib_nonpic.so): Likewise.
6245 (tls_test_shared_nonpic.so): Likewise.
6246 * testsuite/Makefile.in: Rebuild.
6247
328c7c2f
ILT
62482011-07-01 Ian Lance Taylor <iant@google.com>
6249
6250 PR gold/12525
6251 * configure.ac: Test whether static linking works, setting
6252 the automake conditional HAVE_STATIC.
6253 * testsuite/Makefile.am: Disable tests using -static if
6254 HAVE_STATIC is not true.
6255 * configure, testsuite/Makefile.in: Rebuild.
6256
02d7cd44
ILT
62572011-07-01 Ian Lance Taylor <iant@google.com>
6258
6259 PR gold/12525
6260 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
6261 Assert if we see DW_EH_PE_indirect.
6262 * target.h (Target::ehframe_datarel_base): New function.
6263 (Target::do_ehframe_datarel_base): New target function.
6264 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
6265 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
6266 function.
6267
07a60597
ILT
62682011-07-01 Ian Lance Taylor <iant@google.com>
6269
6270 PR gold/12571
6271 * options.h (class General_options): Add
6272 --ld-generated-unwind-info.
6273 * ehframe.cc (Fde::write): Add address parameter. Change all
6274 callers. If associated with PLT, fill in address and size.
6275 (Cie::set_output_offset): Only add merge mapping if there is an
6276 object.
6277 (Cie::write): Add address parameter. Change all callers.
6278 (Eh_frame::add_ehframe_for_plt): New function.
6279 * ehframe.h (class Fde): Update declarations. Move shndx_ and
6280 input_offset_ fields into union u_, with new plt field.
6281 (Fde::Fde): Adjust for new union field.
6282 (Fde::Fde) [Output_data version]: New constructor.
6283 (Fde::add_mapping): Only add merge mapping if there is an object.
6284 (class Cie): Update declarations.
6285 (class Eh_frame): Declare add_ehframe_for_plt.
6286 * layout.cc (Layout::layout_eh_frame): Break out code into
6287 make_eh_frame_section, and call it.
6288 (Layout::make_eh_frame_section): New function.
6289 (Layout::add_eh_frame_for_plt): New function.
6290 * layout.h (class Layout): Update declarations.
6291 * merge.cc (Merge_map::add_mapping): Add assertion.
6292 * i386.cc: Include "dwarf.h".
6293 (class Output_data_plt_i386): Make first_plt_entry,
6294 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
6295 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6296 and plt_eh_frame_fde.
6297 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
6298 boundary. Call add_eh_frame_for_plt if appropriate.
6299 * x86_64.cc: Include "dwarf.h".
6300 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
6301 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
6302 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6303 and plt_eh_frame_fde.
6304 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
6305 appropriate.
6306
14788a3f
ILT
63072011-06-29 Ian Lance Taylor <iant@google.com>
6308
6309 PR gold/12629
6310 * object.cc (Sized_relobj_file::layout_section): Change shdr
6311 parameter to be const.
6312 (Sized_relobj_file::layout_eh_frame_section): New function, broken
6313 out of do_layout.
6314 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
6315 appropriate. Call layout_eh_frame_section.
6316 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
6317 sections.
6318 * object.h (class Sized_relobj_file): Update declarations.
6319
6c21fce1
ILT
63202011-06-29 Ian Lance Taylor <iant@google.com>
6321
37e41b03 6322 PR gold/12652
6c21fce1
ILT
6323 * script.cc (Token::integer_value): Accept trailing M/m/K/k
6324 modifier.
6325 (Lex::gather_token): Accept trailing M/m/K/k for integers.
6326
4d5e4e62
ILT
63272011-06-29 Ian Lance Taylor <iant@google.com>
6328
6329 PR gold/12675
6330 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
6331 SHT_X86_64_UNWIND.
6332 * layout.cc (Layout::layout_eh_frame): Likewise.
6333
886f533a
ILT
63342011-06-29 Ian Lance Taylor <iant@google.com>
6335
6336 PR gold/12695
6337 * layout.cc (Layout::symtab_section_shndx): New function.
6338 * layout.h (class Layout): Declare symtab_section_shndx.
6339 * output.cc (Output_section::write_header): Call it.
6340
f3ae1b28
ILT
63412011-06-29 Ian Lance Taylor <iant@google.com>
6342
6343 PR gold/12818
6344 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
6345 symbols which are not used in a relocation.
6346
aecf301f
ILT
63472011-06-28 Ian Lance Taylor <iant@google.com>
6348
6349 PR gold/12898
6350 * layout.cc (Layout::segment_precedes): Don't crash if a linker
6351 script create indistinguishable segments.
6352 (Layout::set_segment_offsets): Use stable_sort when sorting
6353 segments. Pass this to Compare_segments constructor.
6354 * layout.h (class Layout): Make segment_precedes non-static.
6355 (class Compare_segments): Change from struct to class. Add
6356 layout_ field. Add constructor.
6357 * script-sections.cc
6358 (Script_sections::attach_sections_using_phdrs_clause): Rename
6359 local orphan to is_orphan. Don't report failure to put empty
6360 section in segment. On attachment failure, report name of
6361 section, and attach to first PT_LOAD segment.
6362
03ef7571
ILT
63632011-06-28 Ian Lance Taylor <iant@google.com>
6364
6365 PR gold/12934
6366 * target-select.cc (Target_selector::Target_selector): Add
6367 emulation parameter. Change all callers.
6368 (select_target_by_bfd_name): Rename from select_target_by_name.
6369 Change all callers.
6370 (select_target_by_emulation): New function.
6371 (supported_emulation_names): New function.
6372 * target-select.h (class Target_selector): Add emulation_ field.
6373 Update declarations.
6374 (Target_selector::recognize_by_bfd_name): Rename from
6375 recognize_by_name. Change all callers.
6376 (Target_selector::supported_bfd_names): Rename from
6377 supported_names. Change all callers.
6378 (Target_selector::recognize_by_emulation): New function.
6379 (Target_selector::supported_emulations): New function.
6380 (Target_selector::emulation): New function.
6381 (Target_selector::do_recognize_by_bfd_name): Rename from
6382 do_recognize_by_name. Change all callers.
6383 (Target_selector::do_supported_bfd_names): Rename from
6384 do_supported_names. Change all callers.
6385 (Target_selector::do_recognize_by_emulation): New function.
6386 (Target_selector::do_supported_emulations): New function.
6387 (select_target_by_bfd_name): Change name in declaration.
6388 (select_target_by_emulation): Declare.
6389 (supported_emulation_names): Declare.
6390 * parameters.cc (parameters_force_valid_target): Try to find
6391 target based on emulation from -m option.
6392 * options.h (class General_options): Change doc string for -m.
6393 * options.cc (help): Print emulations.
6394 (General_options::parse_V): Likewise.
6395 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
6396 Add emulation parameter. Change all callers.
6397
200b2bb9
ILT
63982011-06-28 Ian Lance Taylor <iant@google.com>
6399
6400 * target.h (class Target): Add osabi_ field.
6401 (Target::osabi): New function.
6402 (Target::set_osabi): New function.
6403 (Target::Target): Initialize osabi_.
6404 (Target::do_adjust_elf_header): Make pure virtual.
6405 (Sized_target::do_adjust_elf_header): Declare.
6406 * target.cc (Sized_target::do_adjust_elf_header): New function.
6407 (class Sized_target): Instantiate all versions.
6408 * freebsd.h (class Target_freebsd): Remove.
6409 (Target_selector_freebsd::do_recognize): Call set_osabi on
6410 Target.
6411 (Target_selector_freebsd::do_recognize_by_name): Likewise.
6412 (Target_selector_freebsd::set_osabi): Remove.
6413 * i386.cc (class Target_i386): Inherit from Sized_target rather
6414 than Target_freebsd.
6415 * x86_64.cc (class Target_x86_64): Likewise.
6416
b3ce541e
ILT
64172011-06-28 Ian Lance Taylor <iant@google.com>
6418
6419 * target.h (Target::can_check_for_function_pointers): Rewrite.
6420 Make non-virtual.
6421 (Target::can_icf_inline_merge_sections): Likewise.
6422 (Target::section_may_have_icf_unsafe_poineters): Likewise.
6423 (Target::Target_info): Add can_icf_inline_merge_sections field.
6424 (Target::do_can_check_for_function_pointers): New virtual
6425 function.
6426 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
6427 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
6428 from can_check_for_function_pointers, move in file.
6429 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
6430 section_may_have_icf_unsafe_poineters, move in file.
6431 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
6432 * i386.cc (Target_i386::do_can_check_for_function_pointers):
6433 Rename from can_check_for_function_pointers, move in file.
6434 (Target_i386::can_icf_inline_merge_sections): Remove.
6435 (Target_i386::i386_info): Initialize
6436 can_icf_inline_merge_sections.
6437 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
6438 Initialize can_icf_inline_merge_sections.
6439 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
6440 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
6441 Rename from can_check_for_function_pointers, move in file.
6442 (Target_x86_64::can_icf_inline_merge_sections): Remove.
6443 (Target_x86_64::x86_64_info): Initialize
6444 can_icf_inline_merge_sections.
6445 * testsuite/testfile.cc (Target_test::test_target_info):
6446 Likewise.
6447 * icf.cc (get_section_contents): Correct formatting.
6448
6d1c4efb
ILT
64492011-06-27 Ian Lance Taylor <iant@google.com>
6450
6451 * symtab.cc (Symbol::versioned_name): New function.
6452 (Symbol_table::add_to_final_symtab): Use versioned_name when
6453 appropriate.
6454 (Symbol_table::sized_write_symbol): Likewise.
6455 * symtab.h (class Symbol): Declare versioned_name.
6456 * stringpool.h (class Stringpool_template): Add variant of add
6457 which takes a std::basic_string.
6458 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
6459 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
6460 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
6461 (ver_test_12.o): New target.
6462 * testsuite/Makefile.in: Rebuild.
6463
57eb9b50
DK
64642011-06-27 Doug Kwan <dougkwan@google.com>
6465
6466 * arm.cc (Arm_relocate_functions::thm_jump8,
6467 Arm_relocate_functions::thm_jump11): Use a wider signed
6468 type to compute offset.
6469 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
6470 arm_thm_jump8.
6471 * testsuite/Makefile.in: Regenerate.
6472 * testsuite/arm_branch_in_range.sh: Check test results of
6473 arm_thm_jump11 and arm_thm_jump8.
6474 * testsuite/arm_thm_jump11.s: New test source file.
6475 * testsuite/arm_thm_jump11.t: New linker script.
6476 * testsuite/arm_thm_jump8.s: New test source file.
6477 * testsuite/arm_thm_jump8.t: New linker script.
6478
487b39df
ILT
64792011-06-24 Ian Lance Taylor <iant@google.com>
6480
6481 * layout.cc: Include "object.h".
6482 (ctors_sections_in_init_array): New static variable.
6483 (Layout::is_ctors_in_init_array): New function.
6484 (Layout::layout): Add entry to ctors_sections_in_init_array if
6485 appropriate.
6486 * layout.h (class Layout): Declare is_ctors_in_init_array.
6487 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
6488 is_ctors_reverse_view is set.
6489 (Sized_relobj_file::write_sections): Add layout parameter. Change
6490 all callers. Set is_ctors_reverse_view field of View_size.
6491 (Sized_relobj_file::reverse_words): New function.
6492 * object.h (Sized_relobj_file::View_size): Add
6493 is_ctors_reverse_view field.
6494 (class Sized_relobj_file): Update declarations.
6495 * testsuite/initpri3.c: New test.
6496 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
6497 initpri3b.
6498 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
6499 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
6500 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
6501 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
6502 * testsuite/Makefile.in: Rebuild.
6503
472076e4
CC
65042011-06-24 Cary Coutant <ccoutant@google.com>
6505
6506 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
6507 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
6508 (debug_msg_cdebug.err): New targets.
6509 * testsuite/Makefile.in: Regenerate.
6510 * testsuite/debug_msg.sh: Check output of link with compressed debug.
6511 Fix checks for link with shared library.
6512
a60af0db
DK
65132011-06-24 Doug Kwan <dougkwan@google.com>
6514
6515 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
6516 skip empty text sections.
6517 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
6518
5393d741
ILT
65192011-06-22 Ian Lance Taylor <iant@google.com>
6520
6521 PR gold/12910
6522 * options.h (class General_options): Add --ctors-in-init-array.
6523 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
6524 friends as SHT_PROGBITS for merging sections.
6525 (Layout::layout): Remove special handling of .init_array and
6526 friends. Don't sort if doing relocatable link. Sort for .ctors
6527 and .dtors if ctors_in_init_array.
6528 (Layout::make_output_section): Force correct section types for
6529 .init_array and friends. Don't sort if doing relocatable link,
6530 Don't sort .ctors and .dtors if ctors_in_init_array.
6531 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
6532 (Layout::output_section_name): Add relobj parameter. Change all
6533 callers. Handle .ctors. and .dtors. in code rather than table.
6534 Handle .ctors and .dtors if ctors_in_init_array.
6535 (Layout::match_file_name): New function, moved from output.cc.
6536 * layout.h (class Layout): Update declarations.
6537 * output.cc: Include "layout.h".
6538 (Input_section_sort_entry::get_priority): New function.
6539 (Input_section_sort_entry::match_file_name): Just call
6540 Layout::match_file_name.
6541 (Output_section::Input_section_sort_init_fini_compare::operator()):
6542 Handle .ctors and .dtors. Sort by explicit priority rather than
6543 by name.
6544 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
6545 * testsuite/initpri2.c: New test.
6546 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
6547 (check_PROGRAMS): Add initpri2.
6548 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
6549 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
6550 * configure, testsuite/Makefile.in: Rebuild.
6551
e1f74f98
ILT
65522011-06-19 Ian Lance Taylor <iant@google.com>
6553
6554 PR gold/12880
6555 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
6556 .interp section to a PT_INTERP segment even if we have seen a
6557 --dynamic-linker option. Don't do it if we have seen a PHDRS
6558 clause in a linker script.
6559 (Layout::finalize): Don't create a .interp section if we've
6560 already create a PT_INTERP segment.
6561 (Layout::create_interp): Always call choose_output_section (revert
6562 patch of 2011-06-17). Don't create PT_INTERP segment.
6563 * script-sections.cc
6564 (Script_sections::create_note_and_tls_segments): Add a .interp
6565 section to a PT_INTERP segment even if we have seen a
6566 --dynamic-linker option.
6567
766f91bb
ILT
65682011-06-18 Ian Lance Taylor <iant@google.com>
6569
6570 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
6571 merely because a non-PT_LOAD segment has a dynamic reloc.
6572
0d212c3a
ILT
65732011-06-18 Ian Lance Taylor <iant@google.com>
6574
6575 * layout.cc (Layout::finish_dynamic_section): Don't create
6576 DT_FLAGS entry if not needed.
6577
911a5072
ILT
65782011-06-18 Ian Lance Taylor <iant@google.com>
6579
6580 PR gold/12745
6581 * layout.cc (Layout::layout_eh_frame): Correct handling of
6582 writable .eh_frame section.
6583
534b4e5f
ILT
65842011-06-17 Ian Lance Taylor <iant@google.com>
6585
6586 PR gold/12893
6587 * resolve.cc (Symbol_table::resolve): Don't give an error if a
6588 symbol is redefined with the exact same object and value.
6589
10b4f102
ILT
65902011-06-17 Ian Lance Taylor <iant@google.com>
6591
6592 PR gold/12880
6593 * layout.h (class Layout): Add interp_segment_ field.
6594 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
6595 (Layout::attach_allocated_section_to_segment): If making shared
6596 library, put .interp section in PT_INTERP segment.
6597 (Layout::finalize): Also call create_interp if -dynamic-linker
6598 option was used.
6599 (Layout::create_interp): Assert that there is no PT_INTERP
6600 segment. If not using a SECTIONS clause, use make_output_section.
6601 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
6602 * script-sections.cc
6603 (Script_sections::create_note_and_tls_segments): If making shared
6604 library, put .interp section in PT_INTERP segment.
6605
a29b0dad
ILT
66062011-06-17 Ian Lance Taylor <iant@google.com>
6607
e588ea8d
ILT
6608 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
6609 when making a shared library.
6610
66112011-06-17 Ian Lance Taylor <iant@google.com>
6612
6613 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
6614 parameter. Change all callers. Don't issue warning about PC32
6615 against locally defined symbol.
a29b0dad 6616
9d3b0698
ILT
66172011-06-16 Ian Lance Taylor <iant@google.com>
6618
6619 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
6620 occurs in same object.
6621
85b0f90c
AM
66222011-06-14 Alan Modra <amodra@gmail.com>
6623
6624 * po/POTFILES.in: Regenerate.
6625
a94907d9
ILT
66262011-06-09 Ian Lance Taylor <iant@google.com>
6627
6628 * script-sections.cc
6629 (Orphan_output_section::set_section_addresses): For a relocatable
6630 link set address to 0.
6631
4fb3a1c3
CC
66322011-06-09 Cary Coutant <ccoutant@google.com>
6633
6634 PR gold/12804
6635 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
6636 used with --compress-debug-sections.
6637 * gold/object.cc (Sized_relobj_file::do_layout): Report
6638 uncompressed size of compressed input sections.
6639
61220854
CC
66402011-06-08 Cary Coutant <ccoutant@google.com>
6641
6642 PR gold/12804
6643 * testsuite/two_file_test_2_v1.cc: Change initialization of
6644 v2 to keep it in .data.
6645
e6455dfb
CC
66462011-06-07 Cary Coutant <ccoutant@google.com>
6647
6648 * common.cc (Symbol_table::do_allocate_commons_list): Call
6649 gold_fallback.
6650 * errors.cc (Errors::fatal): Adjust call to gold_exit.
6651 (Errors::fallback): New function.
6652 (gold_fallback): New function.
6653 * errors.h (Errors::fallback): New function.
6654 * gold.cc (gold_exit): Change status parameter to enum; adjust
6655 all callers.
6656 (queue_initial_tasks): Call gold_fallback.
6657 * gold.h: Include cstdlib.
6658 (Exit_status): New enum type.
6659 (gold_exit): Change status parameter to enum.
6660 (gold_fallback): New function.
6661 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
6662 (Layout::create_symtab_sections): Likewise.
6663 (Layout::create_shdrs): Likewise.
6664 * main.cc (main): Adjust call to gold_exit.
6665 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
6666 (Output_data_got::add_got_entry_pair): Likewise.
6667 (Output_section::add_input_section): Likewise.
6668 (Output_section::add_output_section_data): Likewise.
6669 (Output_segment::set_section_list_addresses): Likewise.
6670 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
6671
fb0e076f
CC
66722011-06-07 Cary Coutant <ccoutant@google.com>
6673
6674 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
6675 for incremental links.
6676 * output.cc (Output_segment::set_section_list_addresses): Remove
6677 FIXME and test for TLS or BSS.
6678
a5ee4d5d
CC
66792011-06-07 Cary Coutant <ccoutant@google.com>
6680
6681 * testsuite/Makefile.am: Add incremental_copy_test,
6682 incremental_common_test_1.
6683 * testsuite/Makefile.in: Regenerate.
6684 * testsuite/common_test_1_v1.c: New source file.
6685 * testsuite/common_test_1_v2.c: New source file.
6686 * testsuite/copy_test_v1.cc: New source file.
6687
5146f448
CC
66882011-06-07 Cary Coutant <ccoutant@google.com>
6689
6690 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
6691 update, allocate common from bss section's free list.
6692 * incremental-dump.cc (dump_incremental_inputs): Print flag for
6693 linker-defined symbols.
6694 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
6695 Skip GOT and PLT entries that are no longer referenced.
6696 (Output_section_incremental_inputs::write_info_blocks): Mark
6697 linker-defined symbols.
6698 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
6699 * output.cc (Output_section::allocate): New function.
6700 * output.h (Output_section::allocate): New function.
6701 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
6702 linker-defined symbols.
6703 (Symbol::override_base_with_special): Copy is_predefined_ flag.
6704 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
6705 (Symbol::init_base_output_data): Likewise.
6706 (Symbol::init_base_output_segment): Likewise.
6707 (Symbol::init_base_constant): Likewise.
6708 (Sized_symbol::init_output_data): Likewise.
6709 (Sized_symbol::init_output_segment): Likewise.
6710 (Sized_symbol::init_constant): Likewise.
6711 (Symbol_table::do_define_in_output_data): Likewise.
6712 (Symbol_table::do_define_in_output_segment): Likewise.
6713 (Symbol_table::do_define_as_constant): Likewise.
6714 * symtab.h (Symbol::is_predefined): New function.
6715 (Symbol::init_base_output_data): Add is_predefined parameter.
6716 (Symbol::init_base_output_segment): Likewise.
6717 (Symbol::init_base_constant): Likewise.
6718 (Symbol::is_predefined_): New data member.
6719 (Sized_symbol::init_output_data): Add is_predefined parameter.
6720 (Sized_symbol::init_output_segment): Likewise.
6721 (Sized_symbol::init_constant): Likewise.
6722 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
6723
26d3c67d
CC
67242011-06-07 Cary Coutant <ccoutant@google.com>
6725
6726 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
6727 instead of emit_copy_reloc.
6728 (Copy_relocs::emit_copy_reloc): Refactor.
6729 (Copy_relocs::make_copy_reloc): New function.
6730 (Copy_relocs::add_copy_reloc): Remove.
6731 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
6732 section.
6733 (Copy_relocs::make_copy_reloc): New function.
6734 (Copy_relocs::add_copy_reloc): Remove.
6735 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
6736 unchanged input files.
6737 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
6738 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
6739 Reserve BSS space for COPY relocations.
6740 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6741 (Output_section_incremental_inputs::write_info_blocks): Record
6742 whether a symbol is copied from a shared object.
6743 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
6744 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
6745 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
6746 (Incremental_input_entry_reader::get_output_symbol_index): Add
6747 is_copy parameter.
6748 (Incremental_binary::emit_copy_relocs): New function.
6749 (Incremental_binary::do_emit_copy_relocs): New function.
6750 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6751 new data member.
6752 (Sized_incremental_binary::add_copy_reloc): New function.
6753 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6754 (Sized_incremental_binary::Copy_reloc): New struct.
6755 (Sized_incremental_binary::Copy_relocs): New typedef.
6756 (Sized_incremental_binary::copy_relocs_): New data member.
6757 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
6758 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
6759 * target.h (Sized_target::emit_copy_reloc): New function.
6760 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
6761
7cdb37d9
CC
67622011-06-02 Cary Coutant <ccoutant@google.com>
6763
6764 PR gold/12163
6765 * gold/archive.cc (Archive::Archive): Initialize new data member.
6766 (Archive::include_all_members): Return if archive has already been
6767 included.
6768 * gold/archive.h (Archive::include_all_members_): New data member.
6769
cc643b88
NC
67702011-06-02 Nick Clifton <nickc@redhat.com>
6771
6772 * dynobj.h: Fix spelling mistake in comment.
6773 * output.cc: Likewise.
6774
f62a3ca7 67752011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 6776 Asier Llano
f62a3ca7
DK
6777
6778 PR gold/12826
cc643b88 6779 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
6780 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
6781 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
6782 redundant arm_exidx_test.so.
6783 * testsuite/Makefile.in: Regenerate.
6784 (check_SCRIPTS): Add pr12826.sh
6785 (check_DATA): Add pr12826.stdout
6786 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
6787 * testsuite/pr12826.sh: New file.
6788 * testsuite/pr12826_1.s: Ditto.
6789 * testsuite/pr12826_1.s: Ditto.
6790
8dbe1edc
ILT
67912011-05-30 Ian Lance Taylor <iant@google.com>
6792
6793 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
6794 sections.
6795
c49875be
ILT
67962011-05-29 Ian Lance Taylor <iant@google.com>
6797
6798 PR gold/12804
6799 * testsuite/Makefile.am: Use different file name for two_file_test
6800 temporary file for each incremental test.
6801 * testsuite/Makefile.in: Rebuild.
6802
69d53f7a
ILT
68032011-05-29 Ian Lance Taylor <iant@google.com>
6804
6805 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
6806 binary input file is empty.
6807
41d0ab5f
ILT
68082011-05-27 Ian Lance Taylor <iant@google.com>
6809
6810 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
6811 (ver_test_9.so): Likewise.
6812 * testsuite/Makefile.in: Rebuild.
6813
89d8a36b
CC
68142011-05-26 Cary Coutant <ccoutant@google.com>
6815
6816 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
6817 * incremental.cc (Incremental_inputs::report_input_section): Fix
6818 comment, indentation.
6819 (Incremental_inputs::report_comdat_group): New function.
6820 (Output_section_incremental_inputs::set_final_data_size): Adjust size
6821 of data for incremental input file entry.
6822 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
6823 group count, COMDAT group signatures.
6824 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
6825 an unchanged input file.
6826 * incremental.h (Incremental_object_entry::Incremental_object_entry):
6827 Initialize new data member.
6828 (Incremental_object_entry::add_comdat_group): New function.
6829 (Incremental_object_entry::get_comdat_group_count): New function.
6830 (Incremental_object_entry::get_comdat_signature_key): New function.
6831 (Incremental_object_entry::groups_): New data member.
6832 (Incremental_inputs::report_comdat_group): New function.
6833 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
6834 data for incremental input file entry.
6835 (Incremental_input_entry_reader::get_comdat_group_count): New function.
6836 (Incremental_input_entry_reader::get_input_section): Adjust size of
6837 data for incremental input file entry.
6838 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
6839 (Incremental_input_entry_reader::get_comdat_group_signature): New
6840 function.
6841 * object.cc (Sized_relobj::include_section_group): Report kept
6842 COMDAT groups for incremental links.
6843
1706a06f
ILT
68442011-05-24 David Meyer <pdox@google.com>
6845
6846 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
6847 with name parameter. Add found_name parameter.
6848 * fileread.cc (Input_file::find_file): Adjust code accordingly.
6849 * dirsearch.h (class Dirsearch): Update declaration.
6850
a10ae760
ILT
68512011-05-24 Ian Lance Taylor <iant@google.com>
6852
6853 * archive.cc (Library_base::should_include_member): Pull in object
6854 from archive if it defines the entry symbol.
6855 * parameters.cc (Parameters::entry): New function.
6856 * parameters.h (class Parameters): Declare entry.
6857 * output.h (class Output_file_header): Remove entry_ field.
6858 * output.cc (Output_file_header::Output_file_header): Remove entry
6859 parameter. Change all callers.
6860 (Output_file_header::entry): Use parameters->entry.
6861 * gold.cc (queue_middle_tasks): Likewise.
6862 * plugin.cc (Plugin_hook::run): Likewise.
6863
aa92d6ed
CC
68642011-05-24 Cary Coutant <ccoutant@google.com>
6865
6866 * gold.cc (queue_initial_tasks): Pass incremental base filename
6867 to Output_file::open_base_file; don't print error message.
6868 * incremental-dump.cc (main): Adjust call to
6869 Output_file::open_for_modification.
6870 * incremental-dump.cc (main): Likewise.
6871 * incremental.cc (Incremental_inputs::report_command_line):
6872 Ignore --incremental-base option when comparing command lines.
6873 Ignore parameter when given as separate argument.
6874 * options.h (class General_options): Add --incremental-base.
6875 * output.cc (Output_file::Output_file):
6876 (Output_file::open_base_file): Add base_name and writable parameters;
6877 read base file into new file; print error message here.
6878 (Output_file::map_no_anonymous): Add writable parameter; adjust all
6879 callers.
6880 * output.h (Output_file::open_for_modification): Rename to...
6881 (Output_file::open_base_file): ...this; add base_name and
6882 writable parameters; adjust all callers.
6883 (Output_file::map_no_anonymous): Add writable parameter; adjust all
6884 callers.
6885 * testsuite/Makefile.am (incremental_test_4): Test
6886 --incremental-base.
6887 * testsuite/Makefile.in: Regenerate.
6888
2eedd706
CC
68892011-05-24 Cary Coutant <ccoutant@google.com>
6890
6891 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
6892 incremental_test_4.
6893 * testsuite/Makefile.in: Regenerate.
6894 * testsuite/two_file_test_1_v1.cc: New test source file.
6895 * testsuite/two_file_test_1b_v1.cc: New test source file.
6896 * testsuite/two_file_test_2_v1.cc: New test source file.
6897
0f1c85a6
CC
68982011-05-24 Cary Coutant <ccoutant@google.com>
6899
6900 * dynobj.h (Dynobj::do_dynobj): New function.
6901 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
6902 flag and soname for shared objects.
6903 * incremental.cc (Incremental_inputs::report_object): Make
6904 either Incremental_object_entry or Incremental_dynobj_entry; add
6905 soname to string table.
6906 (Incremental_inputs::report_input_section): Add assertion.
6907 (Output_section_incremental_inputs::set_final_data_size): Adjust
6908 type of input file entry for shared libraries; adjust size of
6909 shared library info entry.
6910 (Output_section_incremental_inputs::write_input_files): Write
6911 as_needed flag for shared libraries.
6912 (Output_section_incremental_inputs::write_info_blocks): Adjust type
6913 of input file entry for shared libraries; write soname.
6914 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
6915 soname from incremental info.
6916 * incremental.h (enum Incremental_input_flags): Add
6917 INCREMENTAL_INPUT_AS_NEEDED.
6918 (Incremental_input_entry::Incremental_input_entry): Initialize new
6919 data member.
6920 (Incremental_input_entry::set_as_needed): New function.
6921 (Incremental_input_entry::as_needed): New function.
6922 (Incremental_input_entry::do_dynobj_entry): New function.
6923 (Incremental_input_entry::as_needed_): New data member.
6924 (Incremental_object_entry::Incremental_object_entry): Don't check
6925 for shared library.
6926 (Incremental_object_entry::do_type): Likewise.
6927 (class Incremental_dynobj_entry): New class.
6928 (Incremental_input_entry_reader::as_needed): New function.
6929 (Incremental_input_entry_reader::get_soname): New function.
6930 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
6931 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
6932 size of shared library info entry.
58797674 6933 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
6934 incremental link when adding DT_NEEDED entries.
6935 * object.h (Object::Object): Initialize new data member.
6936 (Object::dynobj): New function.
6937 (Object::set_as_needed): New function.
6938 (Object::as_needed): New function.
6939 (Object::do_dynobj): New function.
6940 (Object::as_needed_): New data member.
6941
6fa2a40b
CC
69422011-05-24 Cary Coutant <ccoutant@google.com>
6943
6944 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
6945 info; adjust display of GOT entries.
6946 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
6947 vector of input objects; remove file_status_.
6948 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
6949 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
6950 got_plt reader; call target hooks to reserve GOT entries.
6951 (Output_section_incremental_inputs::set_final_data_size): Adjust size
6952 of input file info header and GOT info entry.
6953 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
6954 relocation info.
6955 (Got_plt_view_info::got_descriptor): Remove.
6956 (Got_plt_view_info::sym_index): New data member.
6957 (Got_plt_view_info::input_index): New data member.
6958 (Local_got_offset_visitor::visit): Write input file index.
6959 (Global_got_offset_visitor::visit): Write 0 for input file index.
6960 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
6961 with sym_index and input_index.
6962 (Output_section_incremental_inputs::write_got_plt): Adjust size of
6963 incremental info GOT entry; replace got_descriptor with input_index.
6964 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
6965 map from input file index to object.
6966 (Sized_relobj_incr::do_layout): Replace direct data member reference
6967 with accessor function.
6968 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
6969 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
6970 Adjust size of input file info header.
6971 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
6972 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
6973 (Incremental_input_entry_reader::get_input_section): Adjust size of
6974 input file info header.
6975 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
6976 of incremental info GOT entry.
6977 (Incremental_got_plt_reader::get_got_desc): Remove.
6978 (Incremental_got_plt_reader::get_got_symndx): New function.
6979 (Incremental_got_plt_reader::get_got_input_index): New function.
6980 (Sized_incremental_binary::Sized_incremental_binary): Remove
6981 file_status_; add input_objects_.
6982 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
6983 (Sized_incremental_binary::set_file_is_unchanged): Remove.
6984 (Sized_incremental_binary::file_is_unchanged): Remove.
6985 (Sized_incremental_binary::set_input_object): New function.
6986 (Sized_incremental_binary::input_object): New function.
6987 (Sized_incremental_binary::file_status_): Remove.
6988 (Sized_incremental_binary::input_objects_): New data member.
6989 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
6990 references.
6991 (Sized_relobj_incr::invalid_address): Move to base class.
6992 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
6993 class.
6994 (Sized_relobj_incr::do_output_section_offset): Likewise.
6995 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
6996 (Sized_relobj_incr::section_offsets_): Likewise.
6997 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
6998 function.
6999 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
7000 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
7001 with accessor function.
7002 (Sized_relobj_file::do_layout): Likewise.
7003 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
7004 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
7005 (Sized_relobj_file::compute_final_local_value): Replace refs to
7006 section_offsets_ with accessor function.
7007 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
7008 * object.h (Relobj::Relobj): Initialize new data members.
7009 (Relobj::add_dyn_reloc): New function.
7010 (Relobj::first_dyn_reloc): New function.
7011 (Relobj::dyn_reloc_count): New function.
7012 (Relobj::first_dyn_reloc_): New data member.
7013 (Relobj::dyn_reloc_count_): New data member.
7014 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
7015 references.
7016 (Sized_relobj::Address): New typedef.
7017 (Sized_relobj::invalid_address): Move here from child class.
7018 (Sized_relobj::Sized_relobj): Initialize new data members.
7019 (Sized_relobj::sized_relobj): New function.
7020 (Sized_relobj::is_output_section_offset_invalid): Move here from
7021 child class.
7022 (Sized_relobj::get_output_section_offset): Likewise.
7023 (Sized_relobj::local_has_got_offset): Likewise.
7024 (Sized_relobj::local_got_offset): Likewise.
7025 (Sized_relobj::set_local_got_offset): Likewise.
7026 (Sized_relobj::do_for_all_local_got_entries): Likewise.
7027 (Sized_relobj::clear_got_offsets): New function.
7028 (Sized_relobj::section_offsets): Move here from child class.
7029 (Sized_relobj::do_output_section_offset): Likewise.
7030 (Sized_relobj::do_set_section_offset): Likewise.
7031 (Sized_relobj::Local_got_offsets): Likewise.
7032 (Sized_relobj::local_got_offsets_): Likewise.
7033 (Sized_relobj::section_offsets_): Likewise.
7034 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
7035 references.
7036 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
7037 class.
7038 (Sized_relobj_file::sized_relobj): New function
7039 (Sized_relobj_file::local_has_got_offset): Move to base class.
7040 (Sized_relobj_file::local_got_offset): Likewise.
7041 (Sized_relobj_file::set_local_got_offset): Likewise.
7042 (Sized_relobj_file::get_output_section_offset): Likewise.
7043 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
7044 (Sized_relobj_file::do_output_section_offset): Likewise.
7045 (Sized_relobj_file::do_set_section_offset): Likewise.
7046 (Sized_relobj_file::Local_got_offsets): Likewise.
7047 (Sized_relobj_file::local_got_offsets_): Likewise.
7048 (Sized_relobj_file::section_offsets_): Likewise.
7049 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
7050 (all constructors).
7051 (set_needs_dynsym_index): Convert relobj to derived class pointer.
7052 (Output_reloc::get_symbol_index): Likewise.
7053 (Output_reloc::local_section_offset): Likewise.
7054 (Output_reloc::get_address): Likewise.
7055 (Output_reloc::symbol_value): Likewise.
7056 (Output_data_got::reserve_slot): Move to class definition.
7057 (Output_data_got::reserve_local): New function.
7058 (Output_data_got::reserve_slot_for_global): Remove.
7059 (Output_data_got::reserve_global): New function.
7060 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
7061 (all constructors, two instantiations).
7062 (Output_reloc::get_relobj): New function (two instantiations).
7063 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
7064 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
7065 (Output_data_reloc::add_global): Adjust type of relobj.
7066 (Output_data_reloc::add_global_relative): Likewise.
7067 (Output_data_reloc::add_symbolless_global_addend): Likewise.
7068 (Output_data_reloc::add_local): Likewise.
7069 (Output_data_reloc::add_local_relative): Likewise.
7070 (Output_data_reloc::add_symbolless_local_addend): Likewise.
7071 (Output_data_reloc::add_local_section): Likewise.
7072 (Output_data_reloc::add_output_section): Likewise.
7073 (Output_data_reloc::add_absolute): Likewise.
7074 (Output_data_reloc::add_target_specific): Likewise.
7075 (Output_data_got::reserve_slot): Move definition here.
7076 (Output_data_got::reserve_local): New function.
7077 (Output_data_got::reserve_global): New function.
7078 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
7079 section_offsets_ with accessor function.
7080 (Sized_relobj_file::write_sections): Likewise.
7081 (Sized_relobj_file::do_relocate_sections): Likewise.
7082 * target.h (Sized_target::reserve_local_got_entry): New function.
7083 (Sized_target::reserve_global_got_entry): New function.
7084 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
7085 (Target_x86_64::reserve_global_got_entry): New function.
7086 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
7087
4829d394
CC
70882011-05-23 Cary Coutant <ccoutant@google.com>
7089
7090 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
7091 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
7092 bit when checking got_type.
7093 * incremental.cc (Sized_incremental_binary::setup_readers):
7094 Store symbol table and string table locations; initialize bit vector
7095 of file status flags.
7096 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
7097 unchanged files.
7098 (Sized_incremental_binary::do_process_got_plt): New function.
7099 (Sized_incremental_binary::get_symtab_view): Use stored locations.
7100 (Output_section_incremental_inputs::set_final_data_size): Record
7101 file index for each input file.
7102 (Output_section_incremental_inputs::write_got_plt): Store file index
7103 instead of input entry offset for each GOT entry.
7104 * incremental.h
7105 (Incremental_input_entry::Incremental_input_entry): Initialize new
7106 data member.
7107 (Incremental_input_entry::set_offset): Store file index.
7108 (Incremental_input_entry::get_file_index): New function.
7109 (Incremental_input_entry::file_index_): New data member.
7110 (Incremental_binary::process_got_plt): New function.
7111 (Incremental_binary::do_process_got_plt): New function.
7112 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7113 data members.
7114 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
7115 (Sized_incremental_binary::set_file_is_unchanged): New function.
7116 (Sized_incremental_binary::file_is_unchanged): New function.
7117 (Sized_incremental_binary::do_process_got_plt): New function.
7118 (Sized_incremental_binary::file_status_): New data member.
7119 (Sized_incremental_binary::main_symtab_loc_): New data member.
7120 (Sized_incremental_binary::main_strtab_loc_): New data member.
7121 * output.cc (Output_data_got::Got_entry::write): Add case
7122 RESERVED_CODE.
7123 (Output_data_got::add_global): Call add_got_entry.
7124 (Output_data_got::add_global_plt): Likewise.
7125 (Output_data_got::add_global_with_rel): Likewise.
7126 (Output_data_got::add_global_with_rela): Likewise.
7127 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
7128 (Output_data_got::add_global_pair_with_rela): Likewise.
7129 (Output_data_got::add_local): Call add_got_entry.
7130 (Output_data_got::add_local_plt): Likewise.
7131 (Output_data_got::add_local_with_rel): Likewise.
7132 (Output_data_got::add_local_with_rela): Likewise.
7133 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
7134 (Output_data_got::add_local_pair_with_rela): Likewise.
7135 (Output_data_got::reserve_slot): New function.
7136 (Output_data_got::reserve_slot_for_global): New function.
7137 (Output_data_got::add_got_entry): New function.
7138 (Output_data_got::add_got_entry_pair): New function.
7139 (Output_section::add_output_section_data): Edit FIXME.
7140 * output.h
7141 (Output_section_data_build::Output_section_data_build): New
7142 constructor with size parameter.
7143 (Output_data_space::Output_data_space): Likewise.
7144 (Output_data_got::Output_data_got): Initialize new data member; new
7145 constructor with size parameter.
7146 (Output_data_got::add_constant): Call add_got_entry.
7147 (Output_data_got::reserve_slot): New function.
7148 (Output_data_got::reserve_slot_for_global): New function.
7149 (class Output_data_got::Got_entry): Add RESERVED_CODE.
7150 (Output_data_got::add_got_entry): New function.
7151 (Output_data_got::add_got_entry_pair): New function.
7152 (Output_data_got::free_list_): New data member.
7153 * target.h (Sized_target::init_got_plt_for_update): New function.
7154 (Sized_target::register_global_plt_entry): New function.
7155 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
7156 Initialize new data member; call init; add constructor with PLT count.
7157 (Output_data_plt_x86_64::init): New function.
7158 (Output_data_plt_x86_64::add_relocation): New function.
7159 (Output_data_plt_x86_64::reserve_slot): New function.
7160 (Output_data_plt_x86_64::free_list_): New data member.
7161 (Target_x86_64::init_got_plt_for_update): New function.
7162 (Target_x86_64::register_global_plt_entry): New function.
7163 (Output_data_plt_x86_64::add_entry): Allocate from free list for
7164 incremental updates.
7165 (Output_data_plt_x86_64::add_relocation): New function.
7166 * testsuite/object_unittest.cc (Object_test): Set default options.
7167
ec69d6da
ILT
71682011-05-16 Ian Lance Taylor <iant@google.com>
7169
7170 * options.h (class General_options): Make -i a synonym for -r.
7171
732e31de
ILT
71722011-05-16 Ian Lance Taylor <iant@google.com>
7173
7174 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
7175
403676b5
CC
71762011-05-10 Cary Coutant <ccoutant@google.com>
7177
7178 * object.cc (Sized_relobj::do_count_local_symbols): Check for
7179 strip_all (-s).
7180
5b7b7d6e
ILT
71812011-05-06 Ian Lance Taylor <iant@google.com>
7182
7183 * layout.cc (Layout::layout): If the output section flags change,
7184 update the ordering.
7185
f0f9babf
CC
71862011-04-25 Cary Coutant <ccoutant@google.com>
7187
7188 * incremental-dump.cc (dump_incremental_inputs): Print local
7189 symbol info for each input file.
7190 * incremental.cc
7191 (Output_section_incremental_inputs::set_final_data_size): Add local
7192 symbol info to input file entries in incremental info.
7193 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7194 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
7195 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
7196 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
7197 implementation.
7198 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
7199 (Sized_incr_relobj::do_relocate): Write the local symbols.
7200 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
7201 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
7202 Adjust size of input file header.
7203 (Incremental_inputs_reader::get_local_symbol_offset): New function.
7204 (Incremental_inputs_reader::get_local_symbol_count): New function.
7205 (Incremental_inputs_reader::get_input_section): Adjust size of input
7206 file header.
7207 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
7208 (Sized_incr_relobj::This): New typedef.
7209 (Sized_incr_relobj::sym_size): New const data member.
7210 (Sized_incr_relobj::Local_symbol): New struct.
7211 (Sized_incr_relobj::do_output_local_symbol_count): New function.
7212 (Sized_incr_relobj::do_local_symbol_offset): New function.
7213 (Sized_incr_relobj::local_symbol_count_): New data member.
7214 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
7215 (Sized_incr_relobj::local_symbol_index_): New data member.
7216 (Sized_incr_relobj::local_symbol_offset_): New data member.
7217 (Sized_incr_relobj::local_dynsym_offset_): New data member.
7218 (Sized_incr_relobj::local_symbols_): New data member.
7219 * object.h (Relobj::output_local_symbol_count): New function.
7220 (Relobj::local_symbol_offset): New function.
7221 (Relobj::do_output_local_symbol_count): New function.
7222 (Relobj::do_local_symbol_offset): New function.
7223 (Sized_relobj::do_output_local_symbol_count): New function.
7224 (Sized_relobj::do_local_symbol_offset): New function.
7225
d0a9ace3
ILT
72262011-04-22 Vladimir Simonov <sv@sw.ru>
7227
7228 * descriptors.cc (set_close_on_exec): New function.
7229 (Descriptors::open): Use set_close_on_exec.
7230 * output.cc (S_ISLNK): Define if not defined.
7231
94a3fc8b
CC
72322011-04-22 Cary Coutant <ccoutant@google.com>
7233
7234 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
7235 global symbol map.
7236 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7237 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
7238 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
7239 relocations.
7240 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
7241 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
7242 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
7243 * incremental.h
7244 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
7245 function.
7246 (Incremental_binary::apply_incremental_relocs): New function.
7247 (Incremental_binary::do_apply_incremental_relocs): New function.
7248 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7249 data member.
7250 (Sized_incremental_binary::add_global_symbol): New function.
7251 (Sized_incremental_binary::global_symbol): New function.
7252 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7253 (Sized_incremental_binary::symbol_map_): New data member.
7254 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
7255 * target.h (Sized_target::apply_relocation): New function.
7256 * target-reloc.h (apply_relocation): New function.
7257 * x86_64.cc (Target_x86_64::apply_relocation): New function.
7258
c87e4302
DK
72592011-04-22 Doug Kwan <dougkwan@google.com>
7260
7261 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
7262 flag of a SHT_ARM_EXIDX section.
2e702c99 7263 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
7264 * testsuite/Makefile.in: Regenerate.
7265 * testsuite/arm_exidx_test.s: New file.
7266 * testsuite/arm_exidx_test.sh: Same.
7267
e7782cf6
CC
72682011-04-20 Cary Coutant <ccoutant@google.com>
7269
7270 PR gold/12689
7271 * archive.h (Incremental_archive_entry::Archive_member):
7272 Initialize arg_serial_ (second constructor).
7273
308ecdc7
ILT
72742011-04-17 Ian Lance Taylor <iant@google.com>
7275
7276 * object.cc (Relocate_info::location): Simplify location string.
7277 * errors.cc (Errors::error_at_location): Don't print program
7278 name.
7279 (Errors::warning_at_location): Likewise.
7280 (Errors::undefined_symbol): Likewise.
7281 * testsuite/debug_msg.sh: Update accordingly.
7282
bec5b579
CC
72832011-04-14 Cary Coutant <ccoutant@google.com>
7284
7285 * gold/layout.cc (Layout::symtab_section_offset): New function.
7286 * gold/layout.h (Layout::symtab_section_offset): New function.
7287 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
7288
88597d34
ILT
72892011-04-12 Ian Lance Taylor <iant@google.com>
7290
7291 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
7292 with MREMAP_MAYMOVE.
7293 * output.h (class Output_file): Add map_is_allocated_ field.
7294 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
7295 not available, provide stubs. If mremap is not available, #define
7296 it to gold_mremap.
7297 (MREMAP_MAYMOVE): Define if not defined.
7298 (Output_file::Output_file): Initialize map_is_allocated_.
7299 (Output_file::resize): Check map_is_allocated_.
7300 (Output_file::map_anonymous): If mmap fails, use malloc.
7301 (Output_file::unmap): Don't do anything for an anonymous map.
7302 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
7303 is not available, provide stubs.
7304 (File_read::View::~View): Use free rather than delete[].
7305 (File_read::make_view): Use malloc rather than new[]. If mmap
7306 fails, use malloc.
7307 (File_read::find_or_make_view): Use malloc rather than new[].
7308 * gold.h: Remove HAVE_REMAP code.
7309 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
7310 exists. Rename mremap to gold_mremap. If mmap is not available
7311 don't do anything.
7312 * configure, config.in: Rebuild.
7313
11e361bc
ILT
73142011-04-11 Ian Lance Taylor <iant@google.com>
7315
7316 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
7317 initialize local variable v.
7318
cdc29364
CC
73192011-04-11 Cary Coutant <ccoutant@google.com>
7320
7321 * archive.cc (Archive::include_member): Adjust call to
7322 report_object.
7323 (Add_archive_symbols::run): Track argument serial numbers.
7324 (Lib_group::include_member): Likewise.
7325 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
7326 * archive.h (Incremental_archive_entry::Archive_member):
7327 Initialize arg_serial_.
7328 (Archive_member::arg_serial_): New data member.
7329 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
7330 (Sized_dynobj::do_add_symbols): Track symbols when doing an
7331 incremental link.
7332 (Sized_dynobj::do_for_all_local_got_entries): New function.
7333 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
7334 function.
7335 * fileread.cc (get_mtime): New function.
7336 * fileread.h (get_mtime): New function.
7337 * gold.cc (queue_initial_tasks): Check for incremental update.
7338 (process_incremental_input): New function.
7339 (queue_middle_tasks): Don't force valid target for incremental
7340 update.
7341 * incremental-dump.cc (find_input_containing_global): Adjust
7342 size of symbol info entry.
7343 (dump_incremental_inputs): Dump argument serial number and
7344 in_system_directory flag; bias shndx by 1; print symbol names
7345 when dumping per-file symbol lists; use new symbol info readers.
7346 * incremental.cc
7347 (Output_section_incremental_inputs:update_data_size): New function.
7348 (Sized_incremental_binary::setup_readers): Setup input readers
7349 for each input file; build maps for files added from libraries
7350 and scripts.
7351 (Sized_incremental_binary::check_input_args): New function.
7352 (Sized_incremental_binary::do_check_inputs): Build map of argument
7353 serial numbers to input arguments.
7354 (Sized_incremental_binary::do_file_has_changed): Rename
7355 do_file_is_unchanged to this; compare file modification times.
7356 (Sized_incremental_binary::do_init_layout): New function.
7357 (Sized_incremental_binary::do_reserve_layout): New function.
7358 (Sized_incremental_binary::do_get_input_reader): Remove.
7359 (Sized_incremental_binary::get_symtab_view): New function.
7360 (Incremental_checker::can_incrementally_link_output_file): Remove.
7361 (Incremental_inputs::report_command_line): Exclude --debug options.
7362 (Incremental_inputs::report_archive_begin): Add parameter; track
7363 argument serial numbers; don't put input file entry for archive
7364 before archive members.
7365 (Incremental_inputs::report_archive_end): Put input file entry
7366 for archive after archive members.
7367 (Incremental_inputs::report_object): Add parameter; track argument
7368 serial numbers and in_system_directory flag.
7369 (Incremental_inputs::report_script): Add parameter; track argument
7370 serial numbers.
7371 (Output_section_incremental_inputs::set_final_data_size): Adjust
7372 size of symbol info entry; check for forwarding symbols.
7373 (Output_section_incremental_inputs::write_input_files): Write
7374 in_system_directory flag and argument serial number.
7375 (Output_section_incremental_inputs::write_info_blocks): Map section
7376 indices between incremental info and original input file; store
7377 input section index for each symbol.
7378 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
7379 change operator() to visit().
7380 (class Global_got_offset_visitor): Likewise.
7381 (class Global_symbol_visitor_got_plt):
7382 (Output_section_incremental_inputs::write_got_plt): Use new visitor
7383 classes.
7384 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
7385 (Sized_incr_relobj::do_read_symbols): New function.
7386 (Sized_incr_relobj::do_layout): New function.
7387 (Sized_incr_relobj::do_layout_deferred_sections): New function.
7388 (Sized_incr_relobj::do_add_symbols): New function.
7389 (Sized_incr_relobj::do_should_include_member): New function.
7390 (Sized_incr_relobj::do_for_all_global_symbols): New function.
7391 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
7392 (Sized_incr_relobj::do_section_size): New function.
7393 (Sized_incr_relobj::do_section_name): New function.
7394 (Sized_incr_relobj::do_section_contents): New function.
7395 (Sized_incr_relobj::do_section_flags): New function.
7396 (Sized_incr_relobj::do_section_entsize): New function.
7397 (Sized_incr_relobj::do_section_address): New function.
7398 (Sized_incr_relobj::do_section_type): New function.
7399 (Sized_incr_relobj::do_section_link): New function.
7400 (Sized_incr_relobj::do_section_info): New function.
7401 (Sized_incr_relobj::do_section_addralign): New function.
7402 (Sized_incr_relobj::do_initialize_xindex): New function.
7403 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
7404 (Sized_incr_relobj::do_read_relocs): New function.
7405 (Sized_incr_relobj::do_gc_process_relocs): New function.
7406 (Sized_incr_relobj::do_scan_relocs): New function.
7407 (Sized_incr_relobj::do_count_local_symbols): New function.
7408 (Sized_incr_relobj::do_finalize_local_symbols): New function.
7409 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
7410 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
7411 (Sized_incr_relobj::do_relocate): New function.
7412 (Sized_incr_relobj::do_set_section_offset): New function.
7413 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
7414 (Sized_incr_dynobj::do_read_symbols): New function.
7415 (Sized_incr_dynobj::do_layout): New function.
7416 (Sized_incr_dynobj::do_add_symbols): New function.
7417 (Sized_incr_dynobj::do_should_include_member): New function.
7418 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
7419 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
7420 (Sized_incr_dynobj::do_section_size): New function.
7421 (Sized_incr_dynobj::do_section_name): New function.
7422 (Sized_incr_dynobj::do_section_contents): New function.
7423 (Sized_incr_dynobj::do_section_flags): New function.
7424 (Sized_incr_dynobj::do_section_entsize): New function.
7425 (Sized_incr_dynobj::do_section_address): New function.
7426 (Sized_incr_dynobj::do_section_type): New function.
7427 (Sized_incr_dynobj::do_section_link): New function.
7428 (Sized_incr_dynobj::do_section_info): New function.
7429 (Sized_incr_dynobj::do_section_addralign): New function.
7430 (Sized_incr_dynobj::do_initialize_xindex): New function.
7431 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
7432 (make_sized_incremental_object): New function.
7433 (Incremental_library::copy_unused_symbols): New function.
7434 (Incremental_library::do_for_all_unused_symbols): New function.
7435 * incremental.h (enum Incremental_input_flags): New type.
7436 (class Incremental_checker): Remove.
7437 (Incremental_input_entry::Incremental_input_entry): Add argument
7438 serial number.
7439 (Incremental_input_entry::arg_serial): New function.
7440 (Incremental_input_entry::set_is_in_system_directory): New function.
7441 (Incremental_input_entry::is_in_system_directory): New function.
7442 (Incremental_input_entry::arg_serial_): New data member.
7443 (Incremental_input_entry::is_in_system_directory_): New data member.
7444 (class Script_info): Move here from script.h.
7445 (Script_info::Script_info): Add filename parameter.
7446 (Script_info::filename): New function.
7447 (Script_info::filename_): New data member.
7448 (Incremental_script_entry::Incremental_script_entry): Add argument
7449 serial number.
7450 (Incremental_object_entry::Incremental_object_entry): Likewise.
7451 (Incremental_object_entry::add_input_section): Build list of input
7452 sections with map to original shndx.
7453 (Incremental_object_entry::get_input_section_index): New function.
7454 (Incremental_object_entry::shndx_): New data member.
7455 (Incremental_object_entry::name_key_): Rename; adjust all refs.
7456 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
7457 (Incremental_archive_entry::Incremental_archive_entry): Add argument
7458 serial number.
7459 (Incremental_inputs::report_archive_begin): Likewise.
7460 (Incremental_inputs::report_object): Likewise.
7461 (Incremental_inputs::report_script): Likewise.
7462 (class Incremental_global_symbol_reader): New class.
7463 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
7464 and store flags and input file type.
7465 (Incremental_input_entry_reader::arg_serial): New function.
7466 (Incremental_input_entry_reader::type): Extract type from flags.
7467 (Incremental_input_entry_reader::is_in_system_directory): New function.
7468 (Incremental_input_entry_reader::get_input_section_count): Call
7469 accessor function for type.
7470 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
7471 function for type; adjust size of global symbol entry.
7472 (Incremental_input_entry_reader::get_global_symbol_count): Call
7473 accessor function for type.
7474 (Incremental_input_entry_reader::get_object_count): Likewise.
7475 (Incremental_input_entry_reader::get_object_offset): Likewise.
7476 (Incremental_input_entry_reader::get_member_count): Likewise.
7477 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
7478 (Incremental_input_entry_reader::get_member_offset): Likewise.
7479 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
7480 (Incremental_input_entry_reader::Global_symbol_info): Remove.
7481 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
7482 (Incremental_input_entry_reader::get_global_symbol_reader): New
7483 function.
7484 (Incremental_input_entry_reader::get_output_symbol_index): New
7485 function.
7486 (Incremental_input_entry_reader::type_): Remove.
7487 (Incremental_input_entry_reader::flags_): New data member.
7488 (Incremental_inputs_reader::input_file_offset): New function.
7489 (Incremental_inputs_reader::input_file_index): New function.
7490 (Incremental_inputs_reader::input_file): Call input_file_offset.
7491 (Incremental_inputs_reader::input_file_at_offset): New function.
7492 (Incremental_relocs_reader::get_r_type): Reformat.
7493 (Incremental_relocs_reader::get_r_shndx): Reformat.
7494 (Incremental_relocs_reader::get_r_offset): Reformat.
7495 (Incremental_relocs_reader::data): New function.
7496 (Incremental_binary::Incremental_binary): Initialize new data members.
7497 (Incremental_binary::check_inputs): Add cmdline parameter.
7498 (Incremental_binary::file_is_unchanged): Remove.
7499 (Input_reader::arg_serial): New function.
7500 (Input_reader::get_unused_symbol_count): New function.
7501 (Input_reader::get_unused_symbol): New function.
7502 (Input_reader::do_arg_serial): New function.
7503 (Input_reader::do_get_unused_symbol_count): New function.
7504 (Input_reader::do_get_unused_symbol): New function.
7505 (Incremental_binary::input_file_count): New function.
7506 (Incremental_binary::get_input_reader): Change signature to use
7507 index instead of filename.
7508 (Incremental_binary::file_has_changed): New function.
7509 (Incremental_binary::get_input_argument): New function.
7510 (Incremental_binary::get_library): New function.
7511 (Incremental_binary::get_script_info): New function.
7512 (Incremental_binary::init_layout): New function.
7513 (Incremental_binary::reserve_layout): New function.
7514 (Incremental_binary::output_file): New function.
7515 (Incremental_binary::do_check_inputs): New function.
7516 (Incremental_binary::do_file_is_unchanged): Remove.
7517 (Incremental_binary::do_file_has_changed): New function.
7518 (Incremental_binary::do_init_layout): New function.
7519 (Incremental_binary::do_reserve_layout): New function.
7520 (Incremental_binary::do_input_file_count): New function.
7521 (Incremental_binary::do_get_input_reader): Change signature.
7522 (Incremental_binary::input_args_map_): New data member.
7523 (Incremental_binary::library_map_): New data member.
7524 (Incremental_binary::script_map_): New data member.
7525 (Sized_incremental_binary::Sized_incremental_binary): Initialize
7526 new data members.
7527 (Sized_incremental_binary::output_section): New function.
7528 (Sized_incremental_binary::inputs_reader): Add const.
7529 (Sized_incremental_binary::symtab_reader): Add const.
7530 (Sized_incremental_binary::relocs_reader): Add const.
7531 (Sized_incremental_binary::got_plt_reader): Add const.
7532 (Sized_incremental_binary::get_symtab_view): New function.
7533 (Sized_incremental_binary::Inputs_reader): New typedef.
7534 (Sized_incremental_binary::Input_entry_reader): New typedef.
7535 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
7536 (Sized_incremental_binary::do_file_is_unchanged): Remove.
7537 (Sized_incremental_binary::do_file_has_changed): New function.
7538 (Sized_incremental_binary::do_init_layout): New function.
7539 (Sized_incremental_binary::do_reserve_layout): New function.
7540 (Sized_input_reader::Inputs_reader): Remove.
7541 (Sized_input_reader::Input_entry_reader): Remove.
7542 (Sized_input_reader::do_arg_serial): New function.
7543 (Sized_input_reader::do_get_unused_symbol_count): New function.
7544 (Sized_input_reader::do_get_unused_symbol): New function.
7545 (Sized_incremental_binary::do_input_file_count): New function.
7546 (Sized_incremental_binary::do_get_input_reader): Change signature;
7547 use index instead of filename.
7548 (Sized_incremental_binary::section_map_): New data member.
7549 (Sized_incremental_binary::input_entry_readers_): New data member.
7550 (class Sized_incr_relobj): New class.
7551 (class Sized_incr_dynobj): New class.
7552 (make_sized_incremental_object): New function.
7553 (class Incremental_library): New class.
7554 * layout.cc (Free_list::num_lists): New static data member.
7555 (Free_list::num_nodes): New static data member.
7556 (Free_list::num_removes): New static data member.
7557 (Free_list::num_remove_visits): New static data member.
7558 (Free_list::num_allocates): New static data member.
7559 (Free_list::num_allocate_visits): New static data member.
7560 (Free_list::init): New function.
7561 (Free_list::remove): New function.
7562 (Free_list::allocate): New function.
7563 (Free_list::dump): New function.
7564 (Free_list::print_stats): New function.
7565 (Layout_task_runner::run): Resize output file for incremental updates.
7566 (Layout::Layout): Initialize new data members.
7567 (Layout::set_incremental_base): New function.
7568 (Layout::init_fixed_output_section): New function.
7569 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
7570 incremental updates.
7571 (Layout::create_gold_note): Do not create gold note section for
7572 incremental updates.
7573 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
7574 for incremental updates.
7575 (Layout::set_section_offsets): For incremental updates, allocate space
7576 from free list.
7577 (Layout::create_symtab_sections): Layout with offsets relative to
7578 start of section; for incremental updates, allocate space from free
7579 list.
7580 (Layout::create_shdrs): For incremental updates, allocate space from
7581 free list.
7582 (Layout::finish_dynamic_section): For incremental updates, do not
7583 check --as-needed (fixed in subsequent patch).
7584 * layout.h (class Free_list): New class.
7585 (Layout::set_incremental_base): New function.
7586 (Layout::incremental_base): New function.
7587 (Layout::init_fixed_output_section): New function.
7588 (Layout::allocate): New function.
7589 (Layout::incremental_base_): New data member.
7590 (Layout::free_list_): New data member.
7591 * main.cc (main): Print Free_list statistics.
7592 * object.cc (Relobj::finalize_incremental_relocs): Add
7593 clear_counts parameter; clear counts only when clear_counts is set.
7594 (Sized_relobj::Sized_relobj): Initialize new base class.
7595 (Sized_relobj::do_layout): Don't report special sections.
7596 (Sized_relobj::do_for_all_local_got_entries): New function.
7597 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
7598 symtab_off to all symbol table offsets.
7599 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
7600 * object.h (class Got_offset_list): Move to top of file.
7601 (Object::Object): Allow case where input_file == NULL.
7602 (Object::~Object): Likewise.
7603 (Object::input_file): Assert that input_file != NULL.
7604 (Object::lock): Allow case where input_file == NULL.
7605 (Object::unlock): Likewise.
7606 (Object::is_locked): Likewise.
7607 (Object::token): Likewise.
7608 (Object::release): Likewise.
7609 (Object::is_incremental): New function.
7610 (Object::get_mtime): New function.
7611 (Object::for_all_local_got_entries): New function.
7612 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
7613 (Object::set_is_in_system_directory): New function.
7614 (Object::is_in_system_directory): New function.
7615 (Object::do_is_incremental): New function.
7616 (Object::do_get_mtime): New function.
7617 (Object::do_for_all_local_got_entries): New function.
7618 (Object::is_in_system_directory_): New data member.
7619 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
7620 (class Sized_relobj_base): New class.
7621 (class Sized_relobj): Derive from Sized_relobj_base.
7622 (class Sized_relobj::Symbols): Redeclare from base class.
7623 (class Sized_relobj::local_got_offset_list): Remove.
7624 (class Sized_relobj::Output_sections): Redeclare from base class.
7625 (class Sized_relobj::do_for_all_local_got_entries): New function.
7626 (class Sized_relobj::write_local_symbols): Add offset parameter.
7627 (class Sized_relobj::local_symbol_offset_): Update comment.
7628 (class Sized_relobj::local_dynsym_offset_): Update comment.
7629 * options.cc (Input_arguments::add_file): Remove const.
7630 * options.h (Input_file_argument::Input_file_argument):
7631 Initialize arg_serial_ (all constructors).
7632 (Input_file_argument::set_arg_serial): New function.
7633 (Input_file_argument::arg_serial): New function.
7634 (Input_file_argument::arg_serial_): New data member.
7635 (Input_arguments::Input_arguments): Initialize file_count_.
7636 (Input_arguments::add_file): Remove const.
7637 (Input_arguments::number_of_input_files): New function.
7638 (Input_arguments::file_count_): New data member.
7639 (Command_line::number_of_input_files): Call
7640 Input_arguments::number_of_input_files.
7641 * output.cc (Output_segment_headers::Output_segment_headers):
7642 Set current size.
7643 (Output_section::Input_section::current_data_size): New function.
7644 (Output_section::Output_section): Initialize new data members.
7645 (Output_section::add_input_section): Don't do merge sections for
7646 an incremental link; allocate space from free list for an
7647 incremental update.
7648 (Output_section::add_output_section_data): Allocate space from
7649 free list for an incremental update.
7650 (Output_section::update_data_size): New function.
7651 (Output_section::set_fixed_layout): New function.
7652 (Output_section::reserve): New function.
7653 (Output_segment::set_section_addresses): Remove const.
7654 (Output_segment::set_section_list_addresses): Remove const; allocate
7655 space from free list for an incremental update.
7656 (Output_segment::set_offset): Adjust size of RELRO segment for an
7657 incremental update.
7658 * output.h (Output_data::current_data_size): Move here from
7659 child classes.
7660 (Output_data::pre_finalize_data_size): New function.
7661 (Output_data::update_data_size): New function.
7662 (Output_section_headers::update_data_size): new function.
7663 (Output_section_data_build::current_data_size): Move to Output_data.
7664 (Output_data_strtab::update_data_size): New function.
7665 (Output_section::current_data_size): Move to Output_data.
7666 (Output_section::set_fixed_layout): New function.
7667 (Output_section::has_fixed_layout): New function.
7668 (Output_section::reserve): New function.
7669 (Output_section::update_data_size): New function.
7670 (Output_section::has_fixed_layout_): New data member.
7671 (Output_section::free_list_): New data member.
7672 (Output_segment::set_section_addresses): Remove const.
7673 (Output_segment::set_section_list_addresses): Remove const.
7674 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
7675 New function.
7676 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
7677 New function.
7678 * readsyms.cc (Read_symbols::do_read_symbols): Add library
7679 parameter when calling Add_symbols constructor; store argument
7680 serial number for members of a lib group.
7681 (Add_symbols::locks): Allow case where token == NULL.
7682 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
7683 (Read_member::~Read_member): New function.
7684 (Read_member::is_runnable): New function.
7685 (Read_member::locks): New function.
7686 (Read_member::run): New function.
7687 (Check_script::~Check_script): New function.
7688 (Check_script::is_runnable): New function.
7689 (Check_script::locks): New function.
7690 (Check_script::run): New function.
7691 (Check_library::~Check_library): New function.
7692 (Check_library::is_runnable): New function.
7693 (Check_library::locks): New function.
7694 (Check_library::run): New function.
7695 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
7696 (Add_symbols::library_): New data member.
7697 (class Read_member): New class.
7698 (class Check_script): New class.
7699 (class Check_library): New class.
7700 * reloc.cc (Read_relocs::is_runnable): Allow case where
7701 token == NULL.
7702 (Read_relocs::locks): Likewise.
7703 (Scan_relocs::locks): Likewise.
7704 (Relocate_task::locks): Likewise.
7705 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
7706 to clear counters.
7707 (Sized_relobj::incremental_relocs_scan): Fix comment.
7708 (Sized_relobj::do_relocate): Pass output file offset to
7709 write_local_symbols.
7710 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
7711 from class declaration.
7712 * script.cc (read_input_script): Allocate Script_info; pass
7713 argument serial number to report_script.
7714 * script.h (class Script_info): Move to incremental.h.
7715 * symtab.cc (Symbol_table::add_from_incrobj): New function.
7716 * symtab.h (Symbol_table::add_from_incrobj): New function.
7717 (Symbol_table::set_file_offset): New function.
7718
b961d0d7
CC
77192011-04-05 Cary Coutant <ccoutant@google.com>
7720
7721 * incremental-dump.cc (dump_incremental_inputs): Change signature
7722 to take a Sized_incremental_binary; change caller. Use readers
7723 in Sized_incremental_binary.
7724 * incremental.cc
7725 (Sized_incremental_binary::find_incremental_inputs_sections):
7726 Rename do_find_incremental_inputs_sections to this.
7727 (Sized_incremental_binary::setup_readers): New function.
7728 (Sized_incremental_binary::do_check_inputs): Check
7729 has_incremental_info_ flag; move setup code to setup_readers;
7730 use input readers.
7731 (Sized_incremental_binary::do_file_is_unchanged): New function.
7732 (Sized_incremental_binary::do_get_input_reader): New function.
7733 * incremental.h (class Incremental_binary): Move to end of file.
7734 (Incremental_binary::file_is_unchanged): New function.
7735 (Incremental_binary::do_file_is_unchanged): New function.
7736 (Incremental_binary::Input_reader): New class.
7737 (Incremental_binary::get_input_reader): New function.
7738 (class Sized_incremental_binary): Move to end of file.
7739 (Sized_incremental_binary::Sized_incremental_binary): Setup the
7740 input section reader classes.
7741 (Sized_incremental_binary::has_incremental_info): New function.
7742 (Sized_incremental_binary::inputs_reader): New function.
7743 (Sized_incremental_binary::symtab_reader): New function.
7744 (Sized_incremental_binary::relocs_reader): New function.
7745 (Sized_incremental_binary::got_plt_reader): New function.
7746 (Sized_incremental_binary::do_file_is_unchanged): New function.
7747 (Sized_incremental_binary::Sized_input_reader): New class.
7748 (Sized_incremental_binary::get_input_reader): New function.
7749 (Sized_incremental_binary::find_incremental_inputs_sections):
7750 Rename do_find_incremental_inputs_sections to this.
7751 (Sized_incremental_binary::setup_readers): New function.
7752 (Sized_incremental_binary::has_incremental_info_): New data member.
7753 (Sized_incremental_binary::inputs_reader_): New data member.
7754 (Sized_incremental_binary::symtab_reader_): New data member.
7755 (Sized_incremental_binary::relocs_reader_): New data member.
7756 (Sized_incremental_binary::got_plt_reader_): New data member.
7757 (Sized_incremental_binary::current_input_file_): New data member.
7758
a869183f
PP
77592011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
7760
7761 PR gold/12640
7762 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
7763 violation.
7764
77652011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
7766
7767 * archive.cc (Archive::include_member): Adjust call to report_object.
7768 (Add_archive_symbols::run): Add script_info to call to
7769 report_archive_begin.
7770 (Lib_group::include_member): Adjust call to report_object.
7771 (Add_lib_group_symbols::run): Adjust call to report_object.
7772 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
7773 blocks. Add object count for script input files.
7774 * incremental.cc (Incremental_inputs::report_archive_begin): Add
7775 script_info parameter; change all callers.
7776 (Incremental_inputs::report_object): Add script_info parameter;
7777 change all callers.
7778 (Incremental_inputs::report_script): Store backpointer to
7779 incremental info entry.
7780 (Output_section_incremental_inputs::set_final_data_size): Record
7781 additional information for scripts.
7782 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7783 * incremental.h (Incremental_script_entry::add_object): New function.
7784 (Incremental_script_entry::get_object_count): New function.
7785 (Incremental_script_entry::get_object): New function.
7786 (Incremental_script_entry::objects_): New data member; adjust
7787 constructor.
7788 (Incremental_inputs::report_archive_begin): Add script_info parameter.
7789 (Incremental_inputs::report_object): Add script_info parameter.
7790 (Incremental_inputs_reader::get_object_count): New function.
7791 (Incremental_inputs_reader::get_object_offset): New function.
7792 * options.cc (Input_arguments::add_file): Return reference to
7793 new input argument.
7794 * options.h (Input_argument::set_script_info): New function.
7795 (Input_argument::script_info): New function.
7796 (Input_argument::script_info_): New data member; adjust all
7797 constructors.
7798 (Input_file_group::add_file): Return reference to new input argument.
7799 (Input_file_lib::add_file): Likewise.
7800 (Input_arguments::add_file): Likewise.
7801 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
7802 * script.cc (Parser_closure::Parser_closure): Add script_info
7803 parameter; adjust all callers.
7804 (Parser_closure::script_info): New function.
7805 (Parser_closure::script_info_): New data member.
7806 (read_input_script): Report scripts earlier to incremental info.
7807 (script_add_file): Set script_info in Input_argument.
7808 (script_add_library): Likewise.
7809 * script.h (Script_options::Script_info): Rewrite class.
7810
a869183f 78112011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
7812
7813 * archive.cc (Library_base::should_include_member): Move
7814 method here from class Archive.
7815 (Archive::Archive): Initialize base class.
7816 (Archive::should_include_member): Move to base class.
7817 (Archive::do_for_all_unused_symbols): New function.
7818 (Add_archive_symbols::run): Remove redundant access to
7819 incremental_inputs.
7820 (Lib_group::Lib_group): Initialize base class.
7821 (Lib_group::do_filename): New function.
7822 (Lib_group::include_member): Pass pointer to Lib_group to
7823 report_object.
7824 (Lib_group::do_for_all_unused_symbols): New function.
7825 (Add_lib_group_symbols::run): Report archive information for
7826 incremental links.
7827 * archive.h (class Library_base): New base class.
7828 (class Archive): Derive from Library_base.
7829 (Archive::filename): Move to base class.
7830 (Archive::set_incremental_info): Likewise.
7831 (Archive::incremental_info): Likewise.
7832 (Archive::Should_include): Likewise.
7833 (Archive::should_include_member): Likewise.
7834 (Archive::Armap_entry): Remove.
7835 (Archive::Unused_symbol_iterator): Remove.
7836 (Archive::unused_symbols_begin): Remove.
7837 (Archive::unused_symbols_end): Remove.
7838 (Archive::do_filename): New function.
7839 (Archive::do_get_mtime): New function.
7840 (Archive::do_for_all_unused_symbols): New function.
7841 (Archive::task_): Move to base class.
7842 (Archive::incremental_info_): Likewise.
7843 (class Lib_group): Derive from Library_base.
7844 (Lib_group::do_filename): New function.
7845 (Lib_group::do_get_mtime): New function.
7846 (Lib_group::do_for_all_unused_symbols): New function.
7847 (Lib_group::task_): Move to base class.
7848 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
7849 function.
7850 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
7851 function.
7852 * incremental.cc (Incremental_inputs::report_archive_begin):
7853 Use Library_base; call library's get_mtime; add incremental inputs
7854 entry before members.
7855 (class Unused_symbol_visitor): New class.
7856 (Incremental_inputs::report_archive_end): Use Library_base; use
7857 visitor class to record unused symbols; don't add incremental inputs
7858 entry after members.
7859 (Incremental_inputs::report_object): Use Library_base.
7860 * incremental.h
7861 (Incremental_archive_entry::Incremental_archive_entry): Remove
7862 unused Archive parameter.
7863 (Incremental_inputs::report_archive_begin): Use Library_base.
7864 (Incremental_inputs::report_archive_end): Likewise.
7865 (Incremental_inputs::report_object): Likewise.
7866 * object.cc (Sized_relobj::do_for_all_global_symbols): New
7867 function.
7868 * object.h (Object::for_all_global_symbols): New function.
7869 (Object::do_for_all_global_symbols): New function.
7870 (Sized_relobj::do_for_all_global_symbols): New function.
7871 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
7872 function.
7873 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
7874 function.
7875
61ab3e40
ILT
78762011-03-27 Ian Lance Taylor <iant@google.com>
7877
7878 * archive.cc (Archive::interpret_header): Return -1 if something
7879 goes wrong. Change callers accordingly.
7880
30e1f9e6
CC
78812011-03-25 Cary Coutant <ccoutant@google.com>
7882
7883 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
7884 * testsuite/Makefile.in: Regenerate.
7885
9370ce59 78862011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
7887
7888 * plugin.cc (get_view): New.
7889 (Plugin::load): Pass get_view to the plugin.
7890 (Plugin_manager::get_view): New.
7891
9312bb0a
ILT
78922011-03-21 Ian Lance Taylor <iant@google.com>
7893
7894 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 7895 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 7896
7e12ba9e
ST
78972011-03-21 Sriraman Tallam <tmsriram@google.com>
7898
7899 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
7900 Change == to -eq.
7901 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
7902 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
7903 Change == to -eq.
7904 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
7905 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
7906
fd7a005d
ILT
79072011-03-14 Ian Lance Taylor <iant@google.com>
7908
7909 * script-sections.cc (Sort_output_sections::script_compare):
7910 Rename from is_before, change return type.
7911 (Sort_output_sections::operator()): Adjust accordingly.
7912
ed16fd1b
ILT
79132011-03-11 Jeffrey Yasskin <jyasskin@google.com>
7914
7915 PR gold/12572
7916 * testsuite/odr_violation2.cc: Add comment to make all error line
7917 numbers double digits.
7918 * testsuite/debug_msg.sh: Adjust expected errors.
7919
71ff8986
ILT
79202011-03-09 Jeffrey Yasskin <jyasskin@google.com>
7921
7922 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
7923 but mark earlier ones as non-canonical
7924 (offset_to_iterator): Update search target and example
7925 (do_addr2line): Return extra lines in a vector*
7926 (format_file_lineno): Extract from do_addr2line
7927 (one_addr2line): Add vector* out-param
7928 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
7929 when a lineno entry appeared last for its instruction
7930 (Dwarf_line_info): Add vector* out-param
7931 * object.cc (Relocate_info): Pass NULL for the vector* out-param
7932 * symtab.cc (Odr_violation_compare): Include the lineno in the
7933 comparison again.
7934 (linenos_from_loc): New. Combine the canonical line for an
7935 address with its other lines.
7936 (True_if_intersect): New. Helper functor to make
7937 std::set_intersection a query.
7938 (detect_odr_violations): Compare sets of lines instead of just
7939 one line for each function. This became less deterministic, but
7940 has fewer false positives.
7941 * symtab.h: Declarations.
7942 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
7943 mix an optimized and non-optimized object in the same binary
7944 (odr_violation2.so): Same.
7945 * testsuite/Makefile.in: Regenerate from Makefile.am.
7946 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
7947 * testsuite/debug_msg.sh: Update line numbers and add
7948 assertions.
7949 * testsuite/odr_violation1.cc: Use OdrDerived, in a
7950 non-optimized context.
7951 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
7952 isn't inlined, and use OdrDerived in an optimized context.
7953 * testsuite/odr_header1.h: Defines OdrDerived, where
7954 optimization will change the
7955 first-instruction-in-the-destructor's file and line number.
7956 * testsuite/odr_header2.h: Defines OdrBase.
7957
a19fefdc
ILT
79582011-03-09 Ian Lance Taylor <iant@google.com>
7959
7960 * fileread.cc (File_read::clear_views): Don't delete the whole
7961 file view.
7962
ecb351e9
ILT
79632011-03-08 Ian Lance Taylor <iant@google.com>
7964
7965 PR gold/12525
7966 * fileread.cc: #include <climits>.
7967 (GOLD_IOV_MAX): Define.
7968 (File_read::read_multiple): Limit number of entries by iov_max.
7969 * fileread.h (class File_read): Always set max_readv_entries to
7970 128.
7971
b821d13c
ILT
79722011-03-07 Ian Lance Taylor <iant@google.com>
7973
7974 PR gold/12525
7975 * options.h (class General_options): Add -dy and -dn.
7976
89243142
CC
79772011-03-02 Cary Coutant <ccoutant@google.com>
7978
7979 * testsuite/script_test_9.t: Add TLS segment.
7980
d0773f31
ILT
79812011-03-02 Simon Baldwin <simonb@google.com>
7982
7983 * configure.ac: Add check for gnu_indirect_function support in
7984 the toolchain building binutils.
7985 * configure: Rebuild.
7986
9370ce59 79872011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
7988
7989 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
7990 plugin only symbols.
7991 (Symbol_table::sized_finalize_symbol) Mark symbol only present
7992 in plugin files as not needed in the symbol table.
7993
4cf7a849
ST
79942011-02-11 Sriraman Tallam <tmsriram@google.com>
7995
7996 * output.cc (Output_section::add_input_section): Delay fill
7997 generation for section ordering.
7998
b578bd7d
ILT
79992011-02-09 Ian Lance Taylor <iant@google.com>
8000
8001 PR gold/12316
8002 * object.h (class Sized_relobj): Remove clear_local_symbols.
8003 * reloc.cc (Sized_relobj::do_relocate): Don't call
8004 clear_local_symbols.
8005
9370ce59 80062011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
8007
8008 * plugin.cc (is_visible_from_outside): Return true for symbols
8009 in the -u option.
8010
55382fb7
ILT
80112011-02-04 Jeffrey Yasskin <jyasskin@google.com>
8012
8013 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
8014 filename.
8015
4e271fff
ST
80162011-02-02 Sriraman Tallam <tmsriram@google.com>
8017
8018 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 8019 to std::string.
4e271fff 8020 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 8021 section_name to be std::string.
4e271fff
ST
8022 (is_function_ctor_or_dtor): Change type of parameter to std::string.
8023
d433c3ac
ILT
80242011-01-25 Ian Lance Taylor <iant@google.com>
8025
8026 * script.cc (script_add_extern): Rewrite to use
8027 add_symbol_reference.
8028
880473a6
DK
80292011-01-25 Doug Kwan <dougkwan@google.com>
8030
d433c3ac 8031 * icf.cc (get_section_contents): Always lock section's object.
880473a6 8032
f30f86fa
ILT
80332011-01-24 Ian Lance Taylor <iant@google.com>
8034
8035 * options.h (class General_options): Accept
8036 --no-detect-odr-violations.
8037
8e51a0b9
ILT
80382011-01-24 Ian Lance Taylor <iant@google.com>
8039
8040 * version.cc (version_string): Bump to 1.11.
8041
0f3b89d8
ILT
80422011-01-24 Ian Lance Taylor <iant@google.com>
8043
8044 * plugin.cc (class Plugin_rescan): Define new class.
8045 (Plugin_manager::claim_file): Set any_claimed_.
8046 (Plugin_manager::save_archive): New function.
8047 (Plugin_manager::save_input_group): New function.
8048 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
8049 necessary.
8050 (Plugin_manager::new_undefined_symbol): New function.
8051 (Plugin_manager::rescan): New function.
8052 (Plugin_manager::rescannable_defines): New function.
8053 (Plugin_manager::add_input_file): Set any_added_.
8054 * plugin.h (class Plugin_manager): define new fields rescannable_,
8055 undefined_symbols_, any_claimed_, and any_added_. Declare
8056 Plugin_rescan as friend. Declare new functions.
8057 (Plugin_manager::Rescannable): Define type.
8058 (Plugin_manager::Rescannable_list): Define type.
8059 (Plugin_manager::Undefined_symbol_list): Define type.
8060 (Plugin_manager::Plugin_manager): Initialize new fields.
8061 * archive.cc (Archive::defines_symbol): New function.
8062 (Add_archive_symbols::run): Pass archive to plugins if any.
8063 * archive.h (class Archive): Declare defines_symbol.
8064 * readsyms.cc (Input_group::~Input_group): New function.
8065 (Finish_group::run): Pass input_group to plugins if any.
8066 * readsyms.h (class Input_group): Declare destructor.
8067 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
8068 any.
8069
3bb951e5
ILT
80702011-01-10 Ian Lance Taylor <iant@google.com>
8071
8072 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
8073 section as relro.
8074 (Layout::set_segment_offsets): Reset increase_relro before calling
8075 set_section_addresses a second time.
8076
0aa45fac
CC
80772011-01-04 Cary Coutant <ccoutant@google.com>
8078
8079 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
8080 sections before NOBITS sections.
8081
0db46eb4
L
80822011-01-01 H.J. Lu <hongjiu.lu@intel.com>
8083
8084 * version.cc (print_version): Update copyright to 2011.
8085
829c9745
CC
80862010-12-23 Cary Coutant <ccoutant@google.com>
8087
8088 * output.h (Output_data_reloc::add_output_section): Pass OD instead
8089 of OS to this->add. Add OD parameter to second form of the function.
8090
7500420b
ILT
80912010-12-20 Ian Lance Taylor <iant@google.com>
8092
8093 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
8094 second of two consecutive entries with same offset.
8095
f8e9a930
RW
80962010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8097
8098 * testsuite/Makefile.am (ifuncmain2static_LDADD)
8099 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
8100 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
8101 to avoid unneeded links against $(LDADD).
8102 * testsuite/Makefile.in: Regenerate.
8103
2fbb4320
ILT
81042010-12-15 Ian Lance Taylor <iant@google.com>
8105
8106 PR gold/12324
8107 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
8108 for R_X86_64_32 and R_X86_64_PC32.
8109 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
8110 ver_matching_def_pic.o.
8111 (ver_matching_def_pic.o): New target.
8112
fedb228d
RW
81132010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8114
8115 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
8116 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
8117 Move definition before File_read::View member definitions.
8118 (File_read::View::~View): Initialize and hold lock before
8119 updating current_mapped_bytes.
8120
9b547ce6
RW
81212010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8122
8123 * dwarf_reader.cc: Remove outdated comment.
8124 * gold-threads.cc: Fix typo in error message.
8125 * archive.cc: Fix typos in comments.
8126 * archive.h: Likewise.
8127 * arm-reloc-property.cc: Likewise.
8128 * arm-reloc-property.h: Likewise.
8129 * arm-reloc.def: Likewise.
8130 * arm.cc: Likewise.
8131 * attributes.h: Likewise.
8132 * cref.cc: Likewise.
8133 * ehframe.cc: Likewise.
8134 * fileread.h: Likewise.
8135 * gold.h: Likewise.
8136 * i386.cc: Likewise.
8137 * icf.cc: Likewise.
8138 * incremental.h: Likewise.
8139 * int_encoding.cc: Likewise.
8140 * layout.h: Likewise.
8141 * main.cc: Likewise.
8142 * merge.h: Likewise.
8143 * object.cc: Likewise.
8144 * object.h: Likewise.
8145 * options.cc: Likewise.
8146 * readsyms.cc: Likewise.
8147 * reduced_debug_output.cc: Likewise.
8148 * reloc.cc: Likewise.
8149 * script-sections.cc: Likewise.
8150 * sparc.cc: Likewise.
8151 * symtab.h: Likewise.
8152 * target-reloc.h: Likewise.
8153 * target.cc: Likewise.
8154 * target.h: Likewise.
8155 * timer.cc: Likewise.
8156 * timer.h: Likewise.
8157 * x86_64.cc: Likewise.
8158
83e17bd5
CC
81592010-12-09 Cary Coutant <ccoutant@google.com>
8160
8161 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
8162 stack.
8163 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
8164 parameter; change all callers.
8165 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
8166 * options.h (warn_execstack): New option.
8167
017257f8
DK
81682010-12-07 Doug Kwan <dougkwan@google.com>
8169
8170 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
8171 like function call relocations.
8172
c20cbc06
ILT
81732010-12-07 Ian Lance Taylor <iant@google.com>
8174
8175 * archive.cc (Archive::get_elf_object_for_member): Permit
8176 punconfigured to be NULL.
8177 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
8178 (Archive::include_member): Pass NULL to get_elf_object_for_member
8179 if we searched for the archive and this is the first included
8180 object.
8181
4dbfafcc
ILT
81822010-12-01 Ian Lance Taylor <iant@google.com>
8183
8184 * dwarf_reader.h (class Sized_dwarf_line_info): Add
8185 track_relocs_type_ field.
8186 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8187 Set track_relocs_type_.
8188 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
8189 contents when using RELA relocs.
8190 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
8191 reloc_map_.
8192 * reloc.cc (Track_relocs::next_addend): New function.
8193 * reloc.h (class Track_relocs): Declare next_addend.
8194
e5e19edd
ILT
81952010-12-01 Ian Lance Taylor <iant@google.com>
8196
8197 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
8198 virtual destructor.
8199
9a5ce24c
ILT
82002010-12-01 Ian Lance Taylor <iant@google.com>
8201
8202 * README: Update compilers known to work and fail.
8203
c7791212
NC
82042010-11-23 Matthias Klose <doko@ubuntu.com>
8205
8206 * configure.in: For --enable-gold, handle value `default' instead of
8207 `both*'. Always install ld as ld.bfd, install as ld if gold is
8208 not the default.
8209 * configure: Regenerate.
8210
0ad220c9
DK
82112010-11-18 Doug Kwan <dougkwan@google.com>
8212
8213 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
8214 and right_alignment to be zero. Store result alignment only if it is
8215 greater than existing alignment.
8216
ab8056e0
CC
82172010-11-16 Cary Coutant <ccoutant@google.com>
8218
8219 PR gold/12220
8220 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8221 Check for ".zdebug_line".
8222
fd064a5b
CC
82232010-11-16 Doug Kwan <dougkwan@google.com>
8224 Cary Coutant <ccoutant@google.com>
8225
8226 * output.h (Output_segment::set_section_addresses): Pass increase_relro
8227 by reference; adjust all callers.
8228 * output.cc (Output_segment::set_section_addresses): Adjust references
8229 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
8230 list is empty.
8231 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
8232 end at page boundary.
8233
6fc6ea19
CC
82342010-11-16 Cary Coutant <ccoutant@google.com>
8235
8236 PR gold/12220
8237 * layout.cc (Layout::choose_output_section): Transform names of
8238 compressed sections even when using a script with a SECTIONS clause.
8239 (Layout::output_section_name): Remove code to transform
8240 compressed debug section names.
8241 * output.cc (Output_section::add_input_section): Use uncompressed
8242 section size when tracking input sections.
8243
95a2c8d6
RS
82442010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
8245
8246 * symtab.h (Symbol::NON_PIC_REF): Remove.
8247 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
8248 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
8249 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
8250 (Symbol::use_plt_offset): Take a flags argument and pass it
8251 directly to needs_dynamic_reloc. Restrict check for undefined
8252 weak symbols to function calls.
8253 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
8254 (Target_arm::Scan::global): Use it.
8255 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
8256 (Target_arm::Relocate::relocate): Likewise.
8257 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
8258 parameter with an r_type parameter. Use get_reference_flags
8259 to get the flags.
8260 (Target_arm::Relocate::relocate): Update accordingly.
8261 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
8262 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
8263 (Target_i386::Scan::global): Likewise.
8264 (Target_i386::Relocate::relocate): Likewise.
8265 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
8266 parameter with an r_type parameter. Use get_reference_flags
8267 to get the flags.
8268 (Target_i386::Relocate::relocate): Update accordingly.
8269 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
8270 (Target_powerpc::Scan::global): Use it.
8271 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
8272 (Target_powerpc::Relocate::relocate): Likewise.
8273 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
8274 (Target_sparc::Scan::global): Use it.
8275 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
8276 (Target_sparc::Relocate::relocate): Likewise.
8277 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
8278 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
8279 (Target_x86_64::Scan::global): Likewise.
8280 (Target_x86_64::Relocate::relocate): Likewise.
8281
f625ae50
DK
82822010-11-08 Doug Kwan <dougkwan@google.com>
8283 Cary Coutant <ccoutant@google.com>
8284
8285 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
8286 (Arm_exidx_merge_section::section_contents_): New data member.
8287 (Arm_input_section::Arm_input_section): Initialize original_contents_.
8288 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 8289 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
8290 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
8291 in parameters instead of calling Object::section_contents without
8292 locking.
8293 (Arm_output_section::group_section): New parameter TASK. Pass it
8294 to callees that need locking objects.
8295 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
8296 to lock EXIDX input sections. Fix a formatting issue. Call
8297 Arm_exidx_merged_section::build_contents to create merged section
8298 contents.
8299 (Arm_output_section::create_stub_group): New parameter TASK. Use it
8300 to lock object of stub table owner.
8301 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
8302 TEXT_SIZE to initialize data member TEXT_SIZE_.
8303 (Arm_exidx_input_section::addralign): Fix typo in comment.
8304 (Arm_exidx_input_section::text_size): New method.
8305 (Target_arm::do_relax): New parameter TASK. Pass it to callees
8306 that require locking objects. Lock objects before scanning for stubs
8307 and updating local symbols.
8308 (Arm_input_section<big_endian>::init): Copy contents of original
8309 input section.
2e702c99 8310 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
8311 original input section instead of calling Object::section_contents
8312 without locking.
8313 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
8314 size without calling Object::section_size().
8315 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
8316 for size. Allocate a buffer for merged EXIDX entries.
8317 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 8318 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
8319 building code to Arm_exidx_merged_section::build_contetns. Write
8320 out contetns in buffer instead of building it on the fly.
8321 (Arm_relobj::make_exidx_input_section): Also pass text section size
8322 to Arm_exidx_input_section constructor.
8323 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
8324 (Arm_dynobj::do_read_symbols): Fix memory leak.
8325 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
8326 * target.h: (class Task): Add forward declaration.
8327 (Target::relax): Add new parameter TASK and pass it to
8328 Target::do_relax().
8329 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
8330
5f9bcf58
CC
83312010-11-05 Cary Coutant <ccoutant@google.com>
8332
8333 PR gold/10708
8334 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
8335 object when reading from the file.
8336 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
8337 second layout pass.
8338 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
8339 when reading section contents.
8340 (get_section_contents): Likewise.
8341 (icf::find_identical_sections): Likewise.
8342 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
8343 object when reading from the file.
8344 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
8345 the object when doing deferred section layout.
8346
e597fa08
NC
83472010-11-03 Nick Clifton <nickc@redhat.com>
8348
8349 PR gold/12001
8350 * script.h (class Symbol_assignment: name): New member. Returns
8351 the name of the symbol.
8352 * scrfipt.cc (Script_options::is_pending_assignment): New member.
8353 Returns true if the given symbol name is on the list of
8354 assignments wating to be processed.
8355 * archive.cc (should_incldue_member): If the symbol is undefined,
8356 check to see if it is on the list of symbols pending assignment.
8357
3f9a3278
ILT
83582010-11-03 Ryan Mansfield <rmansfield@qnx.com>
8359
8360 * script-sections.cc (Script_sections::find_memory_region): Check
8361 for a NULL output section pointer.
8362
d06fb4d1
DK
83632010-10-29 Doug Kwan <dougkwan@google.com>
8364
8365 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
8366 Output_section::add_relaxed_input_section.
8367 * output.cc (Output_section::add_relaxed_input_section): Add new
8368 arguments LAYOUT and NAME. Set section order index.
8369 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
8370 Copy section order index.
8371 * output.h (Output_section::add_relaxed_input_section): Add new
8372 arguments LAYOUT and NAME.
8373
90e24de5
ILT
83742010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8375
8376 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 8377 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
8378 * testsuite/Makefile.in: Regenerate.
8379
c9484ea5
DK
83802010-10-20 Doug Kwan <dougkwan@google.com>
8381
8382 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
8383 without SHF_LINK_ORDER flags.
8384 * layout.cc (Layout::choose_output_section): Do not filter
8385 SHF_LINK_ORDER flag in a relocatable link.
8386
5bc2f5be
CC
83872010-10-17 Cary Coutant <ccoutant@google.com>
8388
8389 * output.h (Output_segment::set_section_addresses): Change function
8390 signature. Update all callers.
8391 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
8392 sections.
8393 (Output_segment::set_section_addresses): Align after last TLS
8394 section. Add padding before last relro section instead of after.
8395
0c91cf04
DK
83962010-10-17 Doug Kwan <dougkwan@google.com>
8397
8398 * gold/arm.cc (Target_arm::got_section): Use correct order and set
8399 GOT output section to be writable.
8400
8c21d9d3
CC
84012010-10-14 Cary Coutant <ccoutant@google.com>
8402
8403 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
8404 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
8405 * gold.cc (queue_initial_tasks): Check parameters for incremental link
8406 mode.
8407 * incremental.cc (report_command_line): Ignore all forms of
8408 --incremental.
8409 * layout.cc (Layout::Layout): Check parameters for incremental link
8410 mode.
8411 * options.cc (General_options::parse_incremental): New function.
8412 (General_options::parse_no_incremental): New function.
8413 (General_options::parse_incremental_full): New function.
8414 (General_options::parse_incremental_update): New function.
8415 (General_options::incremental_mode_): New data member.
8416 (General_options::finalize): Check incremental_mode_.
8417 * options.h (General_options): Update help text for --incremental.
8418 Add --no-incremental, --incremental-full, --incremental-update.
8419 (General_options::Incremental_mode): New enum type.
8420 (General_options::incremental_mode): New function.
8421 (General_options::incremental_mode_): New data member.
8422 * parameters.cc (Parameters::incremental_mode_): New data member.
8423 (Parameters::set_options): Set incremental_mode_.
8424 (Parameters::set_incremental_full): New function.
8425 (Parameters::incremental): New function.
8426 (Parameters::incremental_update): New function.
8427 (set_parameters_incremental_full): New function.
8428 * parameters.h (Parameters::set_incremental_full): New function.
8429 (Parameters::incremental): New function.
8430 (Parameters::incremental_update): New function.
8431 (Parameters::incremental_mode_): New data member.
8432 (set_parameters_incremental_full): New function.
8433 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
8434 incremental link mode.
8435 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
8436 (Sized_relobj::do_relocate_sections): Likewise.
8437 * testsuite/Makefile.am (incremental_test): Use --incremental-full
8438 option.
8439 * testsuite/Makefile.in: Regenerate.
8440 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 8441
bb32aa18 84422010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
8443
8444 * script-sections.h (class Script_sections): Make
8445 Sections_elements typedef public.
8446 * script-sections.cc (class Sort_output_sections): Add elements_
8447 field. Add constructor which sets it; change all callers.
8448 (Sort_output_sections::is_before): New function.
8449 (Sort_output_sections::operator()): Call is_before.
8450 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
8451 conditional.
8452 * testsuite/script_test_10.sh: New test. Test script section
8453 order.
8454 * testsuite/script_test_10.t: Likewise.
8455 * testsuite/script_test_10.s: Likewise.
8456 * testsuite/Makefile.am: Wrap the cross linker tests and the
8457 common tests into NATIVE_OR_CROSS_LINKER.
8458 (check_SCRIPTS): Add script_test_10.sh.
8459 (check_DATA): Add script_test_10.stdout.
8460 (script_test_10.o, script_test_10): New targets.
8461 (script_test_10.stdout): New target.
8462 * configure, testsuite/Makefile.in: Regenerate.
8463
3cef7179
ILT
84642010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8465
8466 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
8467 error for the deprecated relocations.
8468 (Target_arm::Scan::global): Likewise.
8469 (Target_arm::Relocate::relocate): Likewise.
8470
7411e9a8
RS
84712010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
8472
8473 * fileread.cc (Input_file::find_file): Initialize *found_name
8474 and *namep when using the fallback search for case 4.
8475
6a9da32a
CC
84762010-10-11 Cary Coutant <ccoutant@google.com>
8477
8478 * options.h (class General_options): Redefine -z lazy as an alias for
8479 the negation of -z now.
8480
ac897c20
ILT
84812010-10-11 Ian Lance Taylor <iant@google.com>
8482
8483 * resolve.cc (symbol_to_bits): Report the value of the unsupported
8484 binding.
8485
ea5cae92
NC
84862010-10-06 Nick Clifton <nickc@redhat.com>
8487
8488 * script-sections.cc(class Memory_region): Remove
8489 current_lma_offset_ field. Rename current_vma_offset_ to
8490 current_offset_. Add last_section_ field.
8491 (Memory_region::get_current_vma_address): Rename to
8492 get_current_address.
8493 (Memory_region::get_current_lma_address): Delete.
8494 (Memory_region::increment_vma_offset): Rename to
8495 increment_offset.
8496 (Memory_region::increment_lma_offset): Delete.
8497 (Memory_region::attributes_compatible): New method. Returns
8498 true if the provided section is compatible with the region.
8499 (Memory_region::get_last_section): New method. Returns the last
8500 section to use the region.
8501 (Memory_region::set_last_section): New method. Stores the last
8502 section to use the region.
8503 (Script_sections::block_in_region): New method. Returns true if
8504 a block of memory is contained within a region.
8505 (Script_sections::find_memory_region): New method. Locates a
8506 memory region to be used to set a VMA or LMA address.
8507 (Output_section_definition::set_section_addresses): Add code to
8508 check for addresses set by memory regions.
8509 (Output_segment::set_section_addresses): Remove memory region
8510 walking code.
8511 (Script_sections::create_segment): Add a warning if a header
8512 segment is created outside of any region.
8513 * script-sections.h (class Script_sections): Add prototypes for
8514 find_memory_region and block_in_region methods.
8515 * testsuite/memory_test.s: Use .long instead of .word.
8516 * testsuite/memory_test.t: Add some more output sections.
8517 * testsuite/memory_test.sh: Update expected output.
8518
a9bfd952
DK
85192010-10-02 Doug Kwan <dougkwan@google.com>
8520
8521 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
8522 defintion to symtab.h
8523 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
8524 declaration to defintion.
8525
bacff3ab
NC
85262010-10-01 Nick Clifton <nickc@redhat.com>
8527
8528 * expression.cc (eval): Replace dummy argument with NULL.
8529 (eval_maybe_dot): Check for a NULL result section pointer.
8530 (Symbol_expression::value): Likewise.
8531 (Dot_expression::value): Likewise.
8532 (BINARY_EXPRESSION): Likewise.
8533 (Max_expression::value): Likewise.
8534 (Min_expression::value): Likewise.
8535 (Absolute_expression::value): Likewise.
8536 (Addr_expression::value_from_output_section): Likewise.
8537 (Loaddddr_expression::value_from_output_section): Likewise.
8538 (Segment_start_expression::value): Likewise.
8539 * script-sections.cc
8540 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
8541 argument with NULL.
8542 (Sections_elememt_dot_assignment::set_section_addresses):
8543 Likewise.
8544 (Output_data_expression::do_write_to_buffer): Likewise.
8545 (Output_section_definition::finalize_symbols): Likewise.
8546 (Output_section_definition::set_section_addresses): Likewise.
8547
f81bc8b5
DK
85482010-09-30 Doug Kwan <dougkwan@google.com>
8549
8550 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
8551
c95e9f27
ST
85522010-09-28 Sriraman Tallam <tmsriram@google.com>
8553
8554 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 8555 function.
c95e9f27
ST
8556 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
8557 virtual function.
8558 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
8559 virtual function.
8560 * icf.cc (get_section_contents): Inline merge sections only when
8561 target allows it.
8562
3cac54d2
RW
85632010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8564
8565 * configure: Regenerate.
8566
2904037a
ILT
85672010-09-17 Ian Lance Taylor <iant@google.com>
8568
8569 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
8570 * testsuite/Makefile.am (memory_test.o): New target.
8571 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
8572 memory_test.t.
8573 * testsuite/Makefile.in: Rebuild.
2904037a 8574
bca7fb63
DK
85752010-09-17 Doug Kwan <dougkwan@google.com>
8576
8577 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
8578 defintion if relocation uses GOT entries of the symbol.
8579 * testsuite/icf_safe_test.sh: Fix test.
8580 * testsuite/icf_safe_so_test.sh: Fix test.
8581
4ef28648
CC
85822010-09-16 Cary Coutant <ccoutant@google.com>
8583
8584 * script_sections.cc (class Memory_region): Remove "NULL" from
8585 vector initializations.
8586
793990de
CC
85872010-09-15 Cary Coutant <ccoutant@google.com>
8588
8589 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
8590 Resolve forwarding symbols.
8591
81e015e2
DK
85922010-09-15 Doug Kwan <dougkwan@google.com>
8593
8594 * gold/testsuite/script_test_3.t: Add ARM special sections.
8595 * gold/testsuite/script_test_4.t: Same.
8596 * gold/testsuite/script_test_5.t: Same.
8597 * gold/testsuite/script_test_6.t: Same.
8598 * gold/testsuite/script_test_7.t: Same.
8599 * gold/testsuite/script_test_7.t: Same.
8600 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
8601
36171d64
CC
86022010-09-14 Cary Coutant <ccoutant@google.com>
8603
8604 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
8605 (Target_x86_64::Relocate::relocate_tls): Replace check for
8606 saw_tls_block_reloc_ with test for executable section.
8607
d89051bd
CC
86082010-09-12 Cary Coutant <ccoutant@google.com>
8609
8610 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
8611 position-independent executables to shared libraries need dynamic
8612 relocations.
8613 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
8614 position-independent executables.
8615 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
8616 * testsuite/Makefile.in: Regenerate.
8617
fca41f0f
NC
86182010-09-10 Nick Clifton <nickc@redhat.com>
8619
8620 PR gold/11997
8621 * testsuite/memory_test.t: Discard any sections that are not
8622 needed.
8623
6695e4b3
L
86242010-09-09 H.J. Lu <hongjiu.lu@intel.com>
8625
8626 PR gold/11996
8627 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
8628 "This::" to work around a bug in gcc 4.2.
8629
8630 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
8631
0f72bf6f
RÁE
86322010-09-09 Rafael Espindola <espindola@google.com>
8633
8634 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
8635 sections with different PF_X flags in the same segment.
8636 (Layout::find_first_load_seg): Search all segments to find the first
8637 one.
8638 * options.h (rosegment): New.
8639
86402010-09-08 Rafael Espindola <espindola@google.com>
a6577478 8641
05a79166 8642 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 8643
aa98ff75
DK
86442010-09-08 Doug Kwan <dougkwan@google.com>
8645
8646 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
8647 (Arm_relobj::do_relocate_sections): Add new parameter for output
8648 file to match the parent.
8649 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
8650 of local symbols instead of input values. Update code to track
8651 changes in gold::relocate_section.
8652 * object.cc (Sized_relobj::compute_final_local_value): New methods.
8653 (Sized_relobj::compute_final_local_value_internal): New methods.
8654 (Sized_relobj::do_finalize_local_symbols): Move code from loop
8655 body into private version of Sized_relobj::compute_final_local_value.
8656 Call the inline method.
8657 * object.h (Symbol_value::Symbol_value): Define destructor. Free
8658 merged symbol value if there is one.
8659 (Symbol_value::has_output_value): New method defintiion.
8660 (Sized_relobj::Compute_final_local_value_status): New enum type.
8661 (Sized_relobj::compute_final_local_value): New methods.
8662 (Sized_relobj::compute_final_local_value_internal): New methods.
8663 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
8664 and arm_cortex_a8.sh.
8665 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
8666 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
8667 New tests.
8668 * Makefile.in: Regenerate.
8669 * testsuite/arm_bl_out_of_range.s: Update test.
8670 * testsuite/thumb_bl_out_of_range.s: Ditto.
8671 * testsuite/thumb_blx_out_of_range.s: Ditto.
8672 * testsuite/arm_branch_out_of_range.sh: New file.
8673 * testsuite/arm_cortex_a8.sh: Ditto.
8674 * testsuite/arm_cortex_a8_b.s: Ditto.
8675 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
8676 * testsuite/arm_cortex_a8_b_local.s: Ditto.
8677 * testsuite/arm_cortex_a8_bl.s: Ditto.
8678 * testsuite/arm_cortex_a8_blx.s: Ditto.
8679 * testsuite/arm_cortex_a8_local.s: Ditto.
8680 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
8681 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
8682
05a79166
L
86832010-09-08 Rafael Espindola <espindola@google.com>
8684
8685 * Makefile.am (memory_test.stdout): Run readelf with -W.
8686 * Makefile.in: Regenerate.
8687 * testsuite/memory_test.sh: Make the regexps accept both 32 and
8688 64 bit output.
8689
33dbc701
RÁE
86902010-09-08 Rafael Espindola <espindola@google.com>
8691
8692 * script-sections.cc (Script_sections::add_memory_region): Convert
8693 field precision to int.
8694 * script.cc (script_set_section_region, script_set_section_region):
8695 Convert field precision to int.
8696
731ca54a
RÁE
86972010-09-08 Rafael Espindola <espindola@google.com>
8698
8699 * arm.cc (do_finalize_sections): Create the __exidx_start and
8700 __exdix_end symbols even when the section is missing.
8701
7f8cd844
NC
87022010-09-08 Nick Clifton <nickc@redhat.com>
8703
8704 * README: Remove claim that MEMORY is not supported.
8705 * expression.cc (script_exp_function_origin)
8706 (script_exp_function_length): Move from here to ...
8707 * script.cc: ... here.
8708 (script_set_section_region, script_add_memory)
8709 (script_parse_memory_attr, script_include_directive): New
8710 functions.
8711 * script-sections.cc
8712 (class Memory_region): New class.
8713 (class Output_section_definition): Add set_memory_region,
8714 set_section_vma, set_section_lma and get_section_name methods.
8715 (class Script_Sections): Add add_memory_region,
8716 find_memory_region, find_memory_region_origin,
8717 find_memory_region_length and set_memory_region methods.
8718 Have set_section_addresses method walk the list of set memory
8719 regions.
8720 Extend the print methos to display memory regions.
8721 * script-sections.h: Add prototypes for new methods.
8722 Add enum for MEMORY region attributes.
8723 * yyscript.y: Add support for parsing MEMORY regions.
8724 * script-c.h: Add prototypes for new functions.
8725 * testsuite/Makefile.am: Add test of MEMORY region functionality.
8726 * testsuite/Makefile.in: Regenerate.
8727 * testsuite/memory_test.sh: New script.
8728 * testsuite/memory_test.s: New assembler source file.
8729 * testsuite/memory_test.t: New linker script.
8730
a4649286
DK
87312010-08-27 Doug Kwan <dougkwan@google.com>
8732
8733 * gold/resolve.cc (Symbol_table::should_override): Let a weak
8734 reference override an existing dynamic weak reference.
8735 * testsuite/Makefile.am: Add new test dyn_weak_ref.
8736 * testsuite/Makefile.in: Regenerate.
8737 * testsuite/dyn_weak_ref.sh: New file.
8738 * testsuite/dyn_weak_ref_1.c: Ditto.
8739 * testsuite/dyn_weak_ref_2.c: Ditto.
8740
b56648ad
ILT
87412010-08-27 Ian Lance Taylor <iant@google.com>
8742
8743 * incremental.h (class Incremental_input_entry): Add virtual
8744 destructor.
8745
809313cb
ILT
87462010-08-27 Ian Lance Taylor <iant@google.com>
8747
8748 * testsuite/start_lib_test_3.c: Mark t3 as used.
8749
11e32464
NC
87502010-08-27 Nick Clifton <nickc@redhat.com>
8751
8752 * options.cc (version_script): Fix small typo in previous
8753 whitespace tidyup.
8754
ca09d69a
NC
87552010-08-25 Nick Clifton <nickc@redhat.com>
8756
8757 * archive.cc: Formatting fixes: Remove whitespace between
8758 typename and following asterisk. Remove whitespace between
8759 function name and opening parenthesis.
8760 * archive.h: Likewise.
8761 * arm.cc: Likewise.
8762 * attributes.cc: Likewise.
8763 * attributes.h: Likewise.
8764 * common.cc: Likewise.
8765 * copy-relocs.cc: Likewise.
8766 * dirsearch.h: Likewise.
8767 * dynobj.cc: Likewise.
8768 * ehframe.cc: Likewise.
8769 * ehframe.h: Likewise.
8770 * expression.cc: Likewise.
8771 * fileread.cc: Likewise.
8772 * fileread.h: Likewise.
8773 * gc.h: Likewise.
8774 * gold-threads.cc: Likewise.
8775 * gold.cc: Likewise.
8776 * i386.cc: Likewise.
8777 * icf.h: Likewise.
8778 * incremental-dump.cc: Likewise.
8779 * incremental.cc: Likewise.
8780 * layout.cc: Likewise.
8781 * layout.h: Likewise.
8782 * main.cc: Likewise.
8783 * merge.cc: Likewise.
8784 * merge.h: Likewise.
8785 * object.cc: Likewise.
8786 * object.h: Likewise.
8787 * options.cc: Likewise.
8788 * options.h: Likewise.
8789 * output.cc: Likewise.
8790 * output.h: Likewise.
8791 * plugin.cc: Likewise.
8792 * plugin.h: Likewise.
8793 * powerpc.cc: Likewise.
8794 * reloc.cc: Likewise.
8795 * script-c.h: Likewise.
8796 * script-sections.cc: Likewise.
8797 * script.cc: Likewise.
8798 * stringpool.cc: Likewise.
8799 * symtab.cc: Likewise.
8800 * symtab.h: Likewise.
8801 * target.cc: Likewise.
8802 * timer.cc: Likewise.
8803 * timer.h: Likewise.
8804 * version.cc: Likewise.
8805 * x86_64.cc: Likewise.
8806
b8fa8750
NC
88072010-08-24 Nick Clifton <nickc@redhat.com>
8808
8809 PR 11899
8810 * layout.cc (segment_precedes): Sort segments by their physical
8811 addresses, if they have been set.
8812
9919d93b
CC
88132010-08-23 Cary Coutant <ccoutant@google.com>
8814
8815 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
8816 symbols data.
8817 (Lib_group::include_member): Unlock object after deleting its
8818 symbols data.
8819 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
8820 the bug fixed here.
8821
97b4be1c
CC
88222010-08-19 Neil Vachharajani <nvachhar@google.com>
8823 Cary Coutant <ccoutant@google.com>
8824
8825 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
8826 constructor, and set_blocker.
8827 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
8828 readsyms_blocker_.
8829 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
8830 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
8831 * testsuite/Makefile.am (start_lib_test): New test case.
8832 * testsuite/Makefile.in: Regenerate.
8833 * testsuite/start_lib_test_main.c: New file.
8834 * testsuite/start_lib_test_1.c: New file.
8835 * testsuite/start_lib_test_2.c: New file.
8836 * testsuite/start_lib_test_3.c: New file.
8837
dd0b1884
ILT
88382010-08-19 Ian Lance Taylor <iant@google.com>
8839
8840 * Makefile.in: Rebuild with automake 1.11.1.
8841 * aclocal.m4: Likewise.
8842 * testsuite/Makefile.in: Likewise.
8843
7223e9ca
ILT
88442010-08-19 Ian Lance Taylor <iant@google.com>
8845
8846 PR 10893
8847 * i386.cc (class Output_data_plt_i386): Update declarations.
8848 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
8849 local_ifuncs_ fields.
8850 (Target_i386::do_plt_section_for_global): New function.
8851 (Target_i386::do_plt_section_for_local): New function.
8852 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
8853 parameter; change all callers. Initialize global_ifuncs_ and
8854 local_ifuncs_. If doing a static link define __rel_iplt_start and
8855 __rel_iplt_end.
8856 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
8857 (Output_data_plt_i386::add_local_ifunc_entry): New function.
8858 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
8859 symbols.
8860 (Target_i386::make_plt_section): New function, broken out of
8861 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
8862 (Target_i386::make_plt_entry): Call make_plt_section.
8863 (Target_i386::make_local_ifunc_plt_entry): New function.
8864 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
8865 (Target_i386::Scan::local): Handle IFUNC symbols. Add
8866 R_386_IRELATIVE to switch.
8867 (Target_i386::Scan::global): Likewise.
8868 (Target_i386::Relocate::relocate): Likewise.
8869 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
8870 switch.
8871 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
8872 (Target_x86_64::do_plt_section_for_global): New function.
8873 (Target_x86_64::do_plt_section_for_local): New function.
8874 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
8875 parameter; change all callers. If doing a static link define
8876 __rela_iplt_start and __rela_iplt_end.
8877 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
8878 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
8879 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
8880 to point to .plt.
8881 (Target_x86_64::make_local_ifunc_plt_entry): New function.
8882 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
8883 switch.
8884 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
8885 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
8886 R_X86_64_IRELATIVE to switch.
8887 (Target_x86_64::Scan::global): Likewise.
8888 (Target_x86_64::Relocate::relocate): Likewise.
8889 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
8890 switch.
8891 * target.h (class Target): Add plt_section_for_global and
8892 plt_section_for_local functions. Add do_plt_section_for_global
8893 and do_plt_section_for_local virtual functions.
8894 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
8895 clarifying comments.
8896 (Symbol::use_plt_offset): Handle IFUNC symbol.
8897 * object.cc (Sized_relobj::Sized_relobj): Initialize
8898 local_plt_offsets_.
8899 (Sized_relobj::local_has_plt_offset): New function.
8900 (Sized_relobj::local_plt_offset): New function.
8901 (Sized_relobj::set_local_plt_offset): New function.
8902 (Sized_relobj::do_count): Handle IFUNC symbol.
8903 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
8904 a bit away from input_shndx_ field. Add set_is_func_symbol and
8905 is_ifunc_symbol functions.
8906 (class Sized_relobj): Update declarations. Remove Tls_got_entry
8907 and Local_tls_got_offsets. Define Local_plt_offsets. Add
8908 local_plt_offsets_ field.
8909 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
8910 * output.h (class Output_section_data): Add non-const
8911 output_section function.
8912 (class Output_data_got): Update declarations.
8913 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
8914 Add use_plt_offset parameter to global and local constructors.
8915 Change all callers. Change local_sym_index_ field to 31 bits.
8916 Change GSYM_CODE and CONSTANT_CODE accordingly.
8917 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
8918 doing a static link don't set sh_link field.
8919 (Output_data_got::Got_entry::write): Use PLT offset if
8920 appropriate.
8921 (Output_data_got::add_global_plt): New function.
8922 (Output_data_got::add_local_plt): New function.
8923 * target-reloc.h (relocate_section): Handle IFUNC symbol.
8924 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
8925 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
8926 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
8927 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
8928 IFUNC conditional.
8929 * testsuite/ifunc-sel.h: New file.
8930 * testsuite/ifuncmain1.c: New file.
8931 * testsuite/ifuncmain1vis.c: New file.
8932 * testsuite/ifuncmod1.c: New file.
8933 * testsuite/ifuncdep2.c: New file.
8934 * testsuite/ifuncmain2.c: New file.
8935 * testsuite/ifuncmain3.c: New file.
8936 * testsuite/ifuncmod3.c: New file.
8937 * testsuite/ifuncmain4.c: New file.
8938 * testsuite/ifuncmain5.c: New file.
8939 * testsuite/ifuncmod5.c: New file.
8940 * testsuite/ifuncmain6pie.c: New file.
8941 * testsuite/ifuncmod6.c: New file.
8942 * testsuite/ifuncmain7.c: New file.
8943 * configure, testsuite/Makefile.in: Rebuild.
8944
56f75c03
ILT
89452010-08-18 Ian Lance Taylor <iant@google.com>
8946
8947 * incremental.cc
8948 (Output_section_incremental_inputs::write_input_files): Add cast
8949 to avoid signed/unsigned comparison warning.
8950 (Output_section_incremental_inputs::write_info_blocks): Likewise.
8951
55455f89
CC
89522010-08-12 Cary Coutant <ccoutant@google.com>
8953
8954 * common.cc (Sort_commons::operator()): Remove unnecessary code.
8955
e2054bcb
ILT
89562010-08-13 Ian Lance Taylor <iant@google.com>
8957
8958 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
8959
74f67560
DK
89602010-08-12 Cary Coutant <ccoutant@google.com>
8961 Doug Kwan <dougkwan@google.com>
8962
8963 * resolve.cc (Symbol_table::should_override): When a weak dynamic
8964 defintion overrides non-weak undef, remember that the original undef
8965 is not weak.
8966 * symtab.cc (Symbol_table::sized_write_global): For undef without
8967 an original weak binding, set binding to global in output.
8968 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
8969 * testsuite/Makefile.in: Regenerate.
8970 * testsuite/strong_ref_weak_def.sh: New file.
8971 * testsuite/strong_ref_weak_def_1.c: Ditto.
8972 * testsuite/strong_ref_weak_def_2.c: Ditto.
8973
d1238d12
CC
89742010-08-12 Cary Coutant <ccoutant@google.com>
8975
8976 * testsuite/incremental_test.sh: Rewrite.
8977 * testsuite/incremental_test_1.c: Rewrite.
8978 * testsuite/incremental_test_2.c: Rewrite.
8979
0e70b911
CC
89802010-08-12 Cary Coutant <ccoutant@google.com>
8981
8982 * arm.cc (Target_arm::got_size): Add const.
8983 (Target_arm::got_entry_count): New function.
8984 (Target_arm::plt_entry_count): New function.
8985 (Target_arm::first_plt_entry_offset): New function.
8986 (Target_arm::plt_entry_size): New function.
8987 (Output_data_plt_arm::entry_count): New function.
8988 (Output_data_plt_arm::first_plt_entry_offset): New function.
8989 (Output_data_plt_arm::get_plt_entry_size): New function.
8990 * i386.cc (Target_i386::got_size): Add const.
8991 (Target_i386::got_entry_count): New function.
8992 (Target_i386::plt_entry_count): New function.
8993 (Target_i386::first_plt_entry_offset): New function.
8994 (Target_i386::plt_entry_size): New function.
8995 (Output_data_plt_i386::entry_count): New function.
8996 (Output_data_plt_i386::first_plt_entry_offset): New function.
8997 (Output_data_plt_i386::get_plt_entry_size): New function.
8998 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
8999 find_incremental_inputs_sections. Dump incremental_got_plt section.
9000 * incremental.cc: Include target.h.
9001 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
9002 parameter. Adjust all callers. Find incremental_got_plt section.
9003 (Incremental_inputs::create_data_sections): Create incremental_got_plt
9004 section.
9005 (Output_section_incremental_inputs::set_final_data_size): Calculate
9006 size of incremental_got_plt section.
9007 (Output_section_incremental_inputs::do_write): Write the
9008 incremental_got_plt section.
9009 (Got_plt_view_info): New struct.
9010 (Local_got_offset_visitor): New class.
9011 (Global_got_offset_visitor): New class.
9012 (Global_symbol_visitor_got_plt): New class.
9013 (Output_section_incremental_inputs::write_got_plt): New function.
9014 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
9015 Add parameter. Adjust all callers.
9016 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
9017 (Incremental_inputs::got_plt_section): New function.
9018 (Incremental_inputs::got_plt_section_): New data member.
9019 (Incremental_got_plt_reader): New class.
9020 * layout.cc (Layout::create_incremental_info_sections): Add the
9021 incremental_got_plt section.
9022 * object.h (Got_offset_list::get_list): New function.
9023 (Got offset_list::for_all_got_offsets): New function.
9024 (Sized_relobj::local_got_offset_list): New function.
9025 * powerpc.cc (Target_powerpc::got_size): Add const.
9026 (Target_powerpc::got_entry_count): New function.
9027 (Target_powerpc::plt_entry_count): New function.
9028 (Target_powerpc::first_plt_entry_offset): New function.
9029 (Target_powerpc::plt_entry_size): New function.
9030 (Output_data_plt_powerpc::entry_count): New function.
9031 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
9032 (Output_data_plt_powerpc::get_plt_entry_size): New function.
9033 * sparc.cc (Target_sparc::got_size): Add const.
9034 (Target_sparc::got_entry_count): New function.
9035 (Target_sparc::plt_entry_count): New function.
9036 (Target_sparc::first_plt_entry_offset): New function.
9037 (Target_sparc::plt_entry_size): New function.
9038 (Output_data_plt_sparc::entry_count): New function.
9039 (Output_data_plt_sparc::first_plt_entry_offset): New function.
9040 (Output_data_plt_sparc::get_plt_entry_size): New function.
9041 * symtab.h (Symbol::got_offset_list): New function.
9042 (Symbol_table::for_all_symbols): New function.
9043 * target.h (Sized_target::got_entry_count): New function.
9044 (Sized_target::plt_entry_count): New function.
9045 (Sized_target::plt_entry_size): New function.
9046 * x86_64.cc (Target_x86_64::got_size): Add const.
9047 (Target_x86_64::got_entry_count): New function.
9048 (Target_x86_64::plt_entry_count): New function.
9049 (Target_x86_64::first_plt_entry_offset): New function.
9050 (Target_x86_64::plt_entry_size): New function.
9051 (Output_data_plt_x86_64::entry_count): New function.
9052 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
9053 (Output_data_plt_x86_64::get_plt_entry_size): New function.
9054
09ec0418
CC
90552010-08-12 Cary Coutant <ccoutant@google.com>
9056
9057 * archive.cc: Include incremental.h.
9058 (Archive::Archive): Initialize incremental_info_.
9059 (Archive::include_member): Record archive members in incremental info.
9060 (Add_archive_symbols::run): Record begin and end of an archive in
9061 incremental info.
9062 (Lib_group::include_member): Record objects in incremental info.
9063 * archive.h (Incremental_archive_entry): Forward declaration.
9064 (Archive::set_incremental_info): New member function.
9065 (Archive::incremental_info): New member function.
9066 (Archive::Unused_symbol_iterator): New class.
9067 (Archive::unused_symbols_begin): New member function.
9068 (Archive::unused_symbols_end): New member function.
9069 (Archive::incremental_info_): New data member.
9070 * incremental-dump.cc (find_input_containing_global): New function.
9071 (dump_incremental_inputs): Dump new incremental info sections.
9072 * incremental.cc: Include symtab.h.
9073 (Output_section_incremental_inputs): New class.
9074 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
9075 new incremental info sections.
9076 (Sized_incremental_binary::do_check_inputs): Likewise.
9077 (Incremental_inputs::report_archive): Remove.
9078 (Incremental_inputs::report_archive_begin): New function.
9079 (Incremental_inputs::report_archive_end): New function.
9080 (Incremental_inputs::report_object): New function.
9081 (Incremental_inputs::finalize_inputs): Remove.
9082 (Incremental_inputs::report_input_section): New function.
9083 (Incremental_inputs::report_script): Rewrite.
9084 (Incremental_inputs::finalize): Do nothing but finalize string table.
9085 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9086 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9087 (Incremental_inputs::create_data_sections): New function.
9088 (Incremental_inputs::relocs_entsize): New function.
9089 (Output_section_incremental_inputs::set_final_data_size): New function.
9090 (Output_section_incremental_inputs::do_write): New function.
9091 (Output_section_incremental_inputs::write_header): New function.
9092 (Output_section_incremental_inputs::write_input_files): New function.
9093 (Output_section_incremental_inputs::write_info_blocks): New function.
9094 (Output_section_incremental_inputs::write_symtab): New function.
9095 * incremental.h (Incremental_script_entry): Forward declaration.
9096 (Incremental_object_entry): Forward declaration.
9097 (Incremental_archive_entry): Forward declaration.
9098 (Incremental_inputs): Forward declaration.
9099 (Incremental_inputs_header_data): Remove.
9100 (Incremental_inputs_header): Remove.
9101 (Incremental_inputs_header_write): Remove.
9102 (Incremental_inputs_entry_data): Remove.
9103 (Incremental_inputs_entry): Remove.
9104 (Incremental_inputs_entry_write): Remove.
9105 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
9106 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
9107 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
9108 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
9109 Likewise.
9110 (Incremental_input_entry): New class.
9111 (Incremental_script_entry): New class.
9112 (Incremental_object_entry): New class.
9113 (Incremental_archive_entry): New class.
9114 (Incremental_inputs::Incremental_inputs): Initialize new data members.
9115 (Incremental_inputs::report_inputs): Remove.
9116 (Incremental_inputs::report_archive): Remove.
9117 (Incremental_inputs::report_archive_begin): New function.
9118 (Incremental_inputs::report_archive_end): New function.
9119 (Incremental_inputs::report_object): Change prototype.
9120 (Incremental_inputs::report_input_section): New function.
9121 (Incremental_inputs::report_script): Change prototype.
9122 (Incremental_inputs::get_reloc_count): New function.
9123 (Incremental_inputs::set_reloc_count): New function.
9124 (Incremental_inputs::create_data_sections): New function.
9125 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9126 (Incremental_inputs::inputs_section): New function.
9127 (Incremental_inputs::symtab_section): New function.
9128 (Incremental_inputs::relocs_section): New function.
9129 (Incremental_inputs::get_stringpool): Add const.
9130 (Incremental_inputs::command_line): Add const.
9131 (Incremental_inputs::inputs): Remove.
9132 (Incremental_inputs::command_line_key): New function.
9133 (Incremental_inputs::input_file_count): New function.
9134 (Incremental_inputs::input_files): New function.
9135 (Incremental_inputs::relocs_entsize): New function.
9136 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9137 (Incremental_inputs::finalize_inputs): Remove.
9138 (Incremental_inputs::Input_info): Remove.
9139 (Incremental_inputs::lock_): Remove.
9140 (Incremental_inputs::inputs_): Change type.
9141 (Incremental_inputs::inputs_map_): Remove.
9142 (Incremental_inputs::current_object_entry_): New data member.
9143 (Incremental_inputs::inputs_section_): New data member.
9144 (Incremental_inputs::symtab_section_): New data member.
9145 (Incremental_inputs::relocs_section_): New data member.
9146 (Incremental_inputs::reloc_count_): New data member.
9147 (Incremental_inputs_reader): New class.
9148 (Incremental_symtab_reader): New class.
9149 (Incremental_relocs_reader): New class.
9150 * layout.cc (Layout::finalize): Move finalization of incremental info
9151 and creation of incremental info sections to follow finalization of
9152 symbol table. Set offsets for postprocessing sections.
9153 (Layout::create_incremental_info_sections): Call
9154 Incremental_inputs::create_data_sections. Add incremental symtab
9155 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
9156 sections to layout after input sections.
9157 * layout.h (struct Timespec): Forward declaration.
9158 (Layout::incremental_inputs): Add const.
9159 (Layout::create_incremental_info_sections): Add parameter.
9160 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
9161 * object.cc: Include incremental.h.
9162 (Relobj::finalize_incremental_relocs): New function.
9163 (Sized_relobj::do_layout): Record input sections in incremental info.
9164 * object.h (Object::output_section): New function.
9165 (Object::output_section_offset): Moved from Relobj.
9166 (Object::get_incremental_reloc_base): New function.
9167 (Object::get_incremental_reloc_count): New function.
9168 (Object::do_output_section): New function.
9169 (Object::do_output_section_offset): Moved from Relobj.
9170 (Object::do_get_incremental_reloc_base): New function.
9171 (Object::do_get_incremental_reloc_count): New function.
9172 (Object::Object): Initialize new data members.
9173 (Relobj::output_section): Renamed do_output_section and moved to
9174 protected.
9175 (Relobj::output_section_offset): Moved to Object.
9176 (Relobj::do_get_incremental_reloc_base): New function.
9177 (Relobj::do_get_incremental_reloc_count): New function.
9178 (Relobj::allocate_incremental_reloc_counts): New function.
9179 (Relobj::count_incremental_reloc): New function.
9180 (Relobj::finalize_incremental_relocs): New function.
9181 (Relobj::next_incremental_reloc_index): New function.
9182 (Relobj::reloc_counts_): New data member.
9183 (Relobj::reloc_bases_): New data member.
9184 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
9185 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
9186 (Sized_relobj::incremental_relocs_scan): New function.
9187 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9188 (Sized_relobj::incremental_relocs_write): New function.
9189 (Sized_relobj::incremental_relocs_write_reltype): New function.
9190 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
9191 incremental link.
9192 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
9193 archives and object files elsewhere.
9194 (Add_symbols::run): Report object files here.
9195 (Finish_group::run): Report end of archive at end of group.
9196 * reloc.cc: Include layout.h, incremental.h.
9197 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
9198 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
9199 (Sized_relobj::incremental_relocs_scan): New function.
9200 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9201 (Sized_relobj::do_relocate_sections): Write incremental relocations.
9202 (Sized_relobj::incremental_relocs_write): New function.
9203 (Sized_relobj::incremental_relocs_write_reltype): New function.
9204 * script.cc (read_input_script): Rewrite test for incremental link.
9205 Change call to Incremental_inputs::report_script.
9206 * symtab.h (Symbol_table::first_global_index): New function.
9207 (Symbol_table::output_count): New function.
9208
ce0d1972
DK
92092010-08-12 Doug Kwan <dougkwan@google.com>
9210
9211 * arm.cc (Target_arm::merge_object_attributes): Check command line
9212 options --no-wchar-size-warning and --no-enum-size-warning.
9213 * options.h (General_options): Add ld-compatible options
9214 --no-enum-size-warning and --no-wchar-size-warning.
9215
6e5710ce
ILT
92162010-08-04 Ian Lance Taylor <iant@google.com>
9217
9218 * x86_64.cc (Target_x86_64::Scan::local): Use
9219 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
9220 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
9221 (Target_x86_64::Scan::global): Likewise.
9222 (Target_x86_64::Relocate::relocate): Likewise.
9223 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
9224 Likewise.
9225
fef830db
CC
92262010-08-03 Cary Coutant <ccoutant@google.com>
9227
9228 * merge.cc (Output_merge_string::do_add_input_section): Count strings
9229 to reserve space in merged_strings vector. Keep total input size
9230 for stats.
9231 (Output_merge_string::do_print_merge_stats): Print total input size.
9232 * merge.h (Output_merge_string): Add input_size_ field.
9233 * stringpool.cc (Stringpool_template::string_length): Move
9234 implementations out of Stringpool_template class and place in
9235 stringpool.h.
9236 * stringpool.h (string_length): Move out of Stringpool_template.
9237
1e3811b0
ILT
92382010-08-03 Ian Lance Taylor <iant@google.com>
9239
9240 PR 11712
9241 * layout.cc (relaxation_loop_body): If address of load segment is
9242 set, adjust address to include headers if possible.
9243
7af0c620
ILT
92442010-08-03 Ian Lance Taylor <iant@google.com>
9245
9246 * version.cc (version_string): Bump to 1.10.
9247
22f0da72
ILT
92482010-08-03 Ian Lance Taylor <iant@google.com>
9249
9250 PR 11805
9251 * layout.h (enum Output_section_order): Define.
9252 (class Layout): Update declarations.
9253 * layout.cc (Layout::get_output_section): Add order parameter.
9254 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
9255 is_first_non_relro parameters. Change all callers.
9256 (Layout::choose_output_section): Likewise.
9257 (Layout::add_output_section_data): Likewise.
9258 (Layout::make_output_section): Likewise. Set order.
9259 (Layout::default_section_order): New function.
9260 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
9261 * output.cc (Output_section::Output_section): Initialize order_.
9262 Don't initialize deleted fields.
9263 (Output_segment::Output_segment): Don't initialize deleted
9264 fields.
9265 (Output_segment::add_output_section_to_load): New function
9266 replacing add_output_section. Change all callers to call this or
9267 add_output_section_to_nonload.
9268 (Output_segment::add_output_section_to_nonload): New function.
9269 (Output_segment::remove_output_section): Rewrite.
9270 (Output_segment::add_initial_output_data): Likewise.
9271 (Output_segment::has_any_data_sections): Likewise.
9272 (Output_segment::is_first_section_relro): Likewise.
9273 (Output_segment::maximum_alignment): Likewise.
9274 (Output_segment::has_dynamic_reloc): New function replacing
9275 dynamic_reloc_count. Change all callers.
9276 (Output_segment::has_dynamic_reloc_list): New function replacing
9277 dynamic_reloc_count_list. Change all callers.
9278 (Output_segment::set_section_addresses): Rewrite.
9279 (Output_segment::set_offset): Rewrite.
9280 (Output_segment::find_first_and_last_list): Remove.
9281 (Output_segment::set_tls_offsets): Rewrite.
9282 (Output_segment::first_section_load_address): Likewise.
9283 (Output_segment::output_section_count): Likewise.
9284 (Output_segment::section_with_lowest_load_address): Likewise.
9285 (Output_segment::write_section_headers): Likewise.
9286 (Output_segment::print_sections_to_map): Likewise.
9287 * output.h (class Output_data): Remove dynamic_reloc_count_
9288 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
9289 (Output_data::add_dynamic_reloc): Rewrite.
9290 (Output_data::has_dynamic_reloc): New function.
9291 (Output_data::dynamic_reloc_count): Remove.
9292 (class Output_section): Add order_ field. Remvoe is_relro_local_,
9293 is_last_relro_, is_first_non_relro_, is_interp_,
9294 is_dynamic_linker_section_ fields. Add order and set_order
9295 functions. Remove is_relro_local, set_is_relro_local,
9296 is_last_relro, set_is_last_relro, is_first_non_relro,
9297 set_is_first_non_relro functions, is_interp, set_is_interp,
9298 is_dynamic_linker_section, and set_is_dynamic_linker_section
9299 functions.
9300 (class Output_segment): Change Output_data_list from std::list to
9301 std:;vector. Add output_lists_ field. Remove output_data_ and
9302 output_bss_ fields. Update declarations.
9303
3ff2ccb0
ILT
93042010-08-02 Ian Lance Taylor <iant@google.com>
9305
9306 * arm.cc (Target_arm::gc_process_relocs): Use typename.
9307 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
9308 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
9309
88a4108b
ILT
93102010-08-02 Ian Lance Taylor <iant@google.com>
9311
9312 PR 11855
9313 * script.cc (Script_options::Script_options): Initialize
9314 symbol_definitions_ and symbol_references_.
9315 (Script_options::add_symbol_assignment): Update
9316 symbol_definitions_ and symbol_references_.
9317 (Script_options::add_symbol_reference): New function.
9318 (script_symbol): New function.
9319 * script.h (class Script_options): Add symbol_definitions_ and
9320 symbol_references_ fields.
9321 (Script_options::referenced_const_iterator): New type.
9322 (Script_options::referenced_begin): New function.
9323 (Script_options::referenced_end): New function.
9324 (Script_options::is_referenced): New function.
9325 (Script_options::any_unreferenced): New function.
9326 * script-c.h (script_symbol): Declare.
9327 * yyscript.y (exp): Call script_symbol.
9328 * symtab.cc: Include "script.h".
9329 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
9330 Change all callers. Check symbols referenced by scripts.
9331 (Symbol_table::add_undefined_symbols_from_command_line): Add
9332 layout parameter. Change all callers.
9333 (Symbol_table::do_add_undefined_symbols_from_command_line):
9334 Likewise. Break out loop body. Check symbols referenced by
9335 scripts.
9336 (Symbol_table::add_undefined_symbol_from_command_line): New
9337 function broken out of
9338 do_add_undefined_symbols_from_command_line.
9339 * symtab.h (class Symbol_table): Update declarations.
9340 * archive.cc: Include "layout.h".
9341 (Archive::should_include_member): Add layout parameter. Change
9342 all callers. Check for symbol mentioned in expression.
9343 * archive.h (class Archive): Update declaration.
9344 * object.cc (Sized_relobj::do_should_include_member): Add layout
9345 parameter.
9346 * object.h (Object::should_include_member): Add layout parameter.
9347 Change all callers.
9348 (Object::do_should_include_member): Add layout parameter.
9349 (class Sized_relobj): Update declaration.
9350 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
9351 parameter.
9352 * dynobj.h (class Sized_dynobj): Update declaration.
9353 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
9354 layout parameter.
9355 * plugin.h (class Sized_pluginobj): Update declaration.
9356
5f1ab67a
ILT
93572010-08-02 Ian Lance Taylor <iant@google.com>
9358
9359 PR 11866
9360 * output.cc (Output_segment::set_offset): Search for the first and
9361 last sections rather than assuming that the list is in order.
9362 (Output_segment::find_first_and_last_list): New function.
9363 * output.h (class Output_segment): Update declarations.
9364 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
9365 (relro_strip_test_SOURCES): New variable.
9366 (relro_strip_test_DEPENDENCIES): New variable.
9367 (relro_strip_test_LDFLAGS): New variable.
9368 (relro_strip_test_LDADD): New variable.
9369 (relro_strip_test.so): New target.
9370
a8df5856
ILT
93712010-08-02 Ian Lance Taylor <iant@google.com>
9372
9373 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
9374 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
9375 (Target_i386::got_tlsdesc_section): New function.
9376 (Target_i386::got_section): Create space for GOT entries for
9377 TLSDESC relocations.
9378 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
9379 R_386_TLS_GOTDESC.
9380 (Target_i386::Scan::global): Likewise.
9381 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
9382 using TLSDESC GOT.
9383 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
9384 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
9385 (Target_x86_64::got_tlsdesc_section): New function.
9386 (Target_x86_64::got_section): Create space for GOT entries for
9387 TLSDESC relocations.
9388 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
9389 R_386_TLS_GOTDESC.
9390 (Target_x86_64::Scan::global): Likewise.
9391 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
9392 using TLSDESC GOT.
9393
0c10a0a6
ILT
93942010-08-02 Ian Lance Taylor <iant@google.com>
9395
9396 * testsuite/final_layout.sh: Use dc to convert from hex to
9397 decimal.
9398
41cbeecc
ST
93992010-07-29 Sriraman Tallam <tmsriram@google.com>
9400
9401 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
9402 paramter to the call to gold::gc_process_relocs.
9403 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
9404 paramter to the call to gold::gc_process_relocs.
9405 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
9406 parameter to the call to gold::gc_process_relocs.
9407 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
9408 template parameter to the call to gold::gc_process_relocs.
9409 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
9410 paramter to the call to gold::gc_process_relocs.
9411 * gc.h (get_embedded_addend_size): New function.
9412 (gc_process_relocs): Save the size of the reloc for use by ICF.
9413 * icf.cc (get_section_contents): Get the addend from the text section
9414 for SHT_REL relocation sections.
9415 * icf.h (Icf::Reloc_addend_size_info): New typedef.
9416 (Icf::Reloc_info): Add new member reloc_addend_size_info.
9417 * int_encoding.h (read_from_pointer): New overloaded function.
9418 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
9419 * testsuite/icf_sht_rel_addend_test.sh: New file.
9420 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
9421 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
9422
6ea55b82
RW
94232010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9424
9425 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
9426 * Makefile.in: Regenerate.
9427 * testsuite/Makefile.in: Regenerate.
9428
9691462b
ILT
94292010-07-27 Jeffrey Yasskin <jyasskin@google.com>
9430
9431 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
9432 * gold/testsuite/debug_msg.cc: Likewise.
9433 * gold/testsuite/odr_violation1.cc
9434 * gold/testsuite/odr_violation2.cc
9435
76897331
CC
94362010-07-21 Cary Coutant <ccoutant@google.com>
9437
9438 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
9439 string, and length fields.
9440 (Output_merge_string::Merged_strings_list): New type.
9441 (Output_merge_string::Merged_strings_lists): New typedef.
9442 (Output_merge_string): Replace merged_strings_ with
9443 merged_strings_lists_.
9444 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
9445 Merged_strings_list per input object and section. Don't store pointer
9446 to the string. Don't store length with each merged string entry.
9447 (Output_merge_string::finalize_merged_data): Loop over list of merged
9448 strings lists. Recompute length of each merged string.
9449
78384e8f
CC
94502010-07-15 Cary Coutant <ccoutant@google.com>
9451
9452 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
9453 here.
9454
783659f9
ILT
94552010-07-14 Ian Lance Taylor <iant@google.com>
9456
9457 * descriptors.cc (Descriptors::open): Report correct name in error
9458 message.
9459
131687b4
DK
94602010-07-13 Doug Kwan <dougkwan@google.com>
9461
9462 * arm.cc (Arm_input_section::Arm_input_section): For a
9463 SHT_ARM_EXIDX section, always keeps the input sections.
9464 (Arm_input_section::set_exidx_section_link): New method.
9465 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
9466 has_errors_ to false.
9467 (Arm_exidx_input_section::has_errors,
9468 Arm_exidx_input_section::set_has_errors): New methods.
9469 (Arm_exidx_input_section::has_errors_): New data member.
9470 (Arm_relobj::get_exidx_shndx_list): New method.
9471 (Arm_output_section::append_text_sections_to_list): Do not skip
9472 section without SHF_EXECINSTR.
9473 (Arm_output_section::fix_exidx_coverage): Skip input sections with
9474 errors.
2e702c99 9475 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
9476 section header. Make error messages more verbose. Check for
9477 a non-executable section linked to an EXIDX section.
9478 (Arm_relobj::do_read_symbols): Remove error checking, which has been
9479 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
9480 check that there is no deferred EXIDX section if we exit early.
9481 Instead of not making an EXIDX section in case of an error, make one
9482 and set the has_errors flag of it.
9483 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
9484 in a relocatable link.
9485 (Target_arm::do_relax): Look for the EXIDX output section instead of
9486 assuming that it is called .ARM.exidx.
2e702c99 9487 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
9488 section list. Do not check for SHF_EXECINSTR section flags but
9489 skip any input section with errors.
9490 * output.cc (Output_section::Output_section): Initialize
9491 always_keeps_input_sections_ to false.
9492 (Output_section::add_input_section): Check for
9493 always_keeps_input_sections_.
9494 * output.h (Output_section::always_keeps_input_sections,
9495 Output_section::set_always_keeps_input_sections): New methods.
9496 (Output_section::always_keeps_input_sections): New data member.
9497
69517287
RÁE
94982010-07-13 Rafael Espindola <espindola@google.com>
9499
9500 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
9501 * fileread.h (Input_file): Add try_extra_search_path and find_file.
9502
82742395
ILT
95032010-07-13 Philip Herron <herron.philip@googlemail.com>
9504 Ian Lance Taylor <iant@google.com>
9505
9506 * output.h (Output_section_lookup_maps::add_merge_section):
9507 Correct check of whether value was inserted.
9508 (Output_section_lookup_maps::add_merge_input_section): Likewise.
9509 (Output_section_lookup_maps::add_relaxed_input_section):
9510 Likewise.
9511 * arm.cc (Target_arm::got_section): Remove used local os.
9512 * i386.cc (Target_i386::got_section): Likewise.
9513 * x86_64.cc (Target_x86_64::got_section): Likewise.
9514 * sparc.cc (Target_sparc::got_section): Likewise.
9515 (Target_sparc::relocate): Remove unused local have_got_offset.
9516 * powerpc.cc (Target_powerpc::relocate): Likewise.
9517
f2d707b5
ILT
95182010-07-13 Ian Lance Taylor <iant@google.com>
9519
241531d6
ILT
9520 * compressed_output.cc (zlib_decompress): Fix signature in
9521 !HAVE_ZLIB_H case.
9522
f2d707b5
ILT
9523 * archive.cc (Archive::include_member): Unlock an external member
9524 of a thin archive. Don't bother to delete an object we know is
9525 NULL.
9526
a2e47362
CC
95272010-07-12 Cary Coutant <ccoutant@google.com>
9528
9529 * compressed_output.cc (zlib_decompress): New function.
9530 (get_uncompressed_size): New function.
9531 (decompress_input_section): New function.
9532 * compressed_output.h (get_uncompressed_size): New function.
9533 (decompress_input_section): New function.
9534 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
9535 Handle compressed debug sections.
9536 * layout.cc (is_compressed_debug_section): New function.
9537 (Layout::output_section_name): Map compressed section names to
9538 canonical names.
9539 * layout.h (is_compressed_debug_section): New function.
9540 (is_debug_info_section): Recognize compressed debug sections.
9541 * merge.cc: Include compressed_output.h.
9542 (Output_merge_data::do_add_input_section): Handle compressed
9543 debug sections.
9544 (Output_merge_string::do_add_input_section): Handle compressed
9545 debug sections.
9546 * object.cc: Include compressed_output.h.
9547 (Sized_relobj::Sized_relobj): Initialize new data members.
9548 (build_compressed_section_map): New function.
9549 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
9550 * object.h (Object::section_is_compressed): New method.
9551 (Object::do_section_is_compressed): New method.
9552 (Sized_relobj::Compressed_section_map): New type.
9553 (Sized_relobj::do_section_is_compressed): New method.
9554 (Sized_relobj::compressed_sections_): New data member.
9555 * output.cc (Output_section::add_input_section): Handle compressed
9556 debug sections.
9557 * reloc.cc: Include compressed_output.h.
9558 (Sized_relobj::write_sections): Handle compressed debug sections.
9559
ce279a62
CC
95602010-07-08 Cary Coutant <ccoutant@google.com>
9561
9562 * resolve.cc (Symbol_table::resolve): Remember whether undef was
9563 weak when resolving to a dynamic def.
9564 (Symbol_table::should_override): Add adjust_dyndef flag; set it
9565 for weak undef/dynamic def cases. Adjust callers.
9566 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
9567 undef_binding_weak_.
9568 (Symbol_table::sized_write_globals): Adjust symbol binding.
9569 (Symbol_table::sized_write_symbol): Add binding parameter.
9570 * symtab.h (Symbol::set_undef_binding): New method.
9571 (Symbol::is_undef_binding_weak): New method.
9572 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
9573 (Symbol_table::should_override): Add new parameter.
9574 (Symbol_table::sized_write_symbol): Add new parameter.
9575
9576 * testsuite/weak_undef_file1.cc: Add new test case.
9577 * testsuite/weak_undef_file2.cc: Fix header comment.
9578 * testsuite/weak_undef_test.cc: Add new test case.
9579
b2286c10
DK
95802010-06-29 Doug Kwan <dougkwan@google.com>
9581
9582 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
9583 Initialize USE_SYMBOL_.
9584 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
9585 definition.
9586 (Arm_reloc_property::uses_symbol_): New data member declaration.
9587 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
9588 uses symbol value and symbol is undefined but not weakly undefined.
9589
4802450a
RÁE
95902010-06-28 Rafael Espindola <espindola@google.com>
9591
9592 * plugin.cc (Plugin::load): Use dlerror.
9593
e5ca47ba
ILT
95942010-06-26 Jeffrey Yaskin <jyasskin@google.com>
9595
9596 * symtab.cc (detect_odr_violations): When reporting an ODR
9597 violation, report an object where the symbol is defined.
9598
8a75a161
DK
95992010-06-25 Doug Kwan <dougkwan@google.com>
9600
9601 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
9602 (Target_arm::section_may_have_icf_unsafe_pointers): New method
9603 definition.
9604 (Target_arm::Scan::local_reloc_may_be_function_pointer,
9605 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
9606 target hook to detect function points.
9607 (Target_arm::Scan::possible_function_pointer_reloc): New method.
9608 * icf.h (Icf::check_section_for_function_pointers): Change type of
9609 parameter SECTION_NAME to const reference to std::string. Use
9610 target hook to determine if section may have unsafe pointers.
9611 * target.h (Target::section_may_have_icf_unsafe_pointers): New
9612 method definition.
9613
42218b9f
RÁE
96142010-06-21 Rafael Espindola <espindola@google.com>
9615
9616 * fileread.cc (Input_file::find_fie): New
9617 (Input_file::open): Use Input_file::find_fie.
9618 * fileread.h (Input_file::find_fie): New
9619 * plugin.cc (set_extra_library_path): New.
9620 (Plugin::load): Add set_extra_library_path to the transfer vector.
9621 (Plugin_manager::set_extra_library_path): New.
9622 (Plugin_manager::add_input_file): Use the extra search path if set.
9623 (set_extra_library_path(): New.
9624 * plugin.h (Plugin_manager): Add set_extra_library_path and
9625 extra_search_path_.
9626
a0506cca
CC
96272010-06-19 Cary Coutant <ccoutant@google.com>
9628
9629 * layout.cc (gdb_sections): Add .debug_types.
9630 (lines_only_debug_sections): Likewise.
9631
6508b958
RÁE
96322010-06-18 Rafael Espindola <espindola@google.com>
9633
9634 * plugin.cc (add_input_file,add_input_library)
9635 (Plugin_manager::add_input_file): Make filename arguments const.
9636 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
9637 const.
9638
3e235302
DK
96392010-06-16 Doug Kwan <dougkwan@google.com>
9640
9641 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
9642 .ARM.attributes section if we have not merged any input
9643 attributes sections.
9644
106e8a6c
DK
96452010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9646
9647 * arm.cc: Allow combining objects with no EABI version
9648 information.
9649
91ff43fe
RÁE
96502010-06-15 Rafael Espindola <espindola@google.com>
9651
9652 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
9653
68ed838c
ILT
96542010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9655
9656 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
9657 (struct iovec): Correct !HAVE_READV definition.
9658
f3a2388f
CC
96592010-06-10 Cary Coutant <ccoutant@google.com>
9660
9661 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
9662 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
9663 reloc sections.
9664 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
9665
9666 PR 11683
9667 * symtab.h (Symbol::is_placeholder): New member function.
9668 * target-reloc.h (relocate_section): Check for placeholder symbols.
9669
9670 * testsuite/Makefile.am (plugin_test_8): New test.
9671 (plugin_test_9): New test.
9672 * testsuite/Makefile.in: Regenerate.
9673
e1df38aa
NC
96742010-06-09 Nick Clifton <nickc@redhat.com>
9675
9676 * yyscript.y (input_list_element): Allow strings prefixed with
9677 the '-' character. Treat these as libraries.
9678 * script.cc (script_add_library): New function. Adds a library
9679 specified by "-l<name>" found in an input script.
9680 * script-c.h: Add prototype for script_add_library.
9681
25bbe950
DK
96822010-06-07 Doug Kwan <dougkwan@google.com>
9683
9684 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
9685 Restrict stub-group size to be within long conditional branch
9686 range when working around cortex-A8 erratum.
9687
0f32ea4c
ILT
96882010-06-07 Damien Diederen <dd@crosstwine.com>
9689
9690 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
9691 #ifdef typo.
9692
8fe2a369
ST
96932010-06-03 Sriraman Tallam <tmsriram@google.com>
9694
9695 PR gold/11658
9696 * output.cc
9697 (Output_section::Input_section_sort_entry::compare_section_ordering):
9698 Change to return non-zero correctly.
9699 (Output_section::Input_section_sort_section_order_index_compare
9700 ::operator()): Change to fix ambiguity in comparisons.
9701
6e9ba2ca
ST
97022010-06-01 Sriraman Tallam <tmsriram@google.com>
9703
9704 * gold.h (is_wildcard_string): New function.
9705 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
9706 (Layout::layout_eh_frame): Ditto.
9707 (Layout::find_section_order_index): New method.
9708 (Layout::read_layout_from_file): New method.
9709 * layout.h (Layout::find_section_order_index): New method.
9710 (Layout::read_layout_from_file): New method.
9711 (Layout::input_section_position_): New private member.
9712 (Layout::input_section_glob_): New private member.
9713 * main.cc (main): Call read_layout_from_file here.
9714 * options.h (--section-ordering-file): New option.
9715 * output.cc (Output_section::input_section_order_specified_): New
9716 member.
9717 (Output_section::Output_section): Initialize new member.
9718 (Output_section::add_input_section): Add new parameter.
9719 Keep input sections when --section-ordering-file is used.
9720 (Output_section::set_final_data_size): Sort input sections when
9721 section ordering file is specified.
9722 (Output_section::Input_section_sort_entry): Add new parameter.
9723 Check sorting type.
9724 (Output_section::Input_section_sort_entry::compare_section_ordering):
9725 New method.
9726 (Output_section::Input_section_sort_compare::operator()): Change to
9727 consider section_order_index.
9728 (Output_section::Input_section_sort_init_fini_compare::operator()):
9729 Change to consider section_order_index.
9730 (Output_section::Input_section_sort_section_order_index_compare
9731 ::operator()): New method.
9732 (Output_section::sort_attached_input_sections): Change to sort
9733 according to section order when specified.
e1df38aa
NC
9734 (Output_section::add_input_section<32, true>): Add new parameter.
9735 (Output_section::add_input_section<64, true>): Add new parameter.
9736 (Output_section::add_input_section<32, false>): Add new parameter.
9737 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
9738 * output.h (Output_section::add_input_section): Add new parameter.
9739 (Output_section::input_section_order_specified): New
9740 method.
9741 (Output_section::set_input_section_order_specified): New method.
9742 (Input_section::Input_section): Initialize section_order_index_.
9743 (Input_section::section_order_index): New method.
9744 (Input_section::set_section_order_index): New method.
9745 (Input_section::section_order_index_): New member.
9746 (Input_section::Input_section_sort_section_order_index_compare): New
9747 struct.
9748 (Output_section::input_section_order_specified_): New member.
9749 * script-sections.cc (is_wildcard_string): Delete and move modified
9750 method to gold.h.
9751 (Output_section_element_input::Output_section_element_input): Modify
9752 call to is_wildcard_string.
9753 (Output_section_element_input::Input_section_pattern
9754 ::Input_section_pattern): Ditto.
9755 (Output_section_element_input::Output_section_element_input): Ditto.
9756 * testsuite/Makefile.am (final_layout): New test case.
9757 * testsuite/Makefile.in: Regenerate.
9758 * testsuite/final_layout.cc: New file.
9759 * testsuite/final_layout.sh: New file.
9760
3537c84b
RÁE
97612010-06-01 Rafael Espindola <espindola@google.com>
9762
9763 * plugin.cc (Plugin::load): Pass the output name to the plugin.
9764
105b6afd
RÁE
97652010-06-01 Rafael Espindola <espindola@google.com>
9766
9767 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
9768 visibility of symbols.
9769
29e11421
DK
97702010-05-27 Doug Kwan <dougkwan@google.com>
9771
9772 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
9773 from start of output section instead of address for a local symbol
9774 in a merged or relaxed section when doing a relocatable link.
9775
5e0f337e
RÁE
97762010-05-26 Rafael Espindola <espindola@google.com>
9777
703d02da 9778 PR 11604
5e0f337e
RÁE
9779 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
9780 adding sections the garbage collector removed.
9781 * gold/testsuite/Makefile.am: Add test.
9782 * gold/testsuite/Makefile.in: Regenerate.
9783 * gold/testsuite/plugin_test_7.sh: New.
9784 * gold/testsuite/plugin_test_7_1.c: New.
9785 * gold/testsuite/plugin_test_7_2.c: New.
9786
f4187277
RÁE
97872010-05-26 Rafael Espindola <espindola@google.com>
9788
9789 * script-sections.cc (Output_section_definition::set_section_addresses):
9790 Check for --section-start.
9791
5c388529
DK
97922010-05-26 Doug Kwan <dougkwan@google.com>
9793
9794 * arm.cc (Arm_scan_relocatable_relocs): New class.
9795 (Target_arm::relocate_special_relocatable): New method.
9796 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
9797 (Arm_relocate_functions::thumb_branch_common): Same.
9798 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
9799 instead of Default_scan_relocatable_relocs.
9800 * target-reloc.h (relocate_for_relocatable): Let target handle
9801 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
9802 * target.h (Sized_target::relocate_special_relocatable): New method.
9803
bca1c3ae
ILT
98042010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9805
9806 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
9807
0439c796
DK
98082010-05-23 Doug Kwan <dougkwan@google.com>
9809
9810 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
9811 instead of a cast.
9812 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
9813 with a direct branch, not a conditional branch, to a stub.
9814 * merge.cc (Output_merge_base::record_input_section): New method
9815 defintion.
9816 (Output_merge_data::do_add_input_section): Record input section if
9817 keeps-input-sections flag is set.
9818 (Output_merge_string::do_add_input_section): Ditto.
9819 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
9820 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
9821 INPUT_SECTIONS_.
9822 (Output_merge_base::keeps_input_sections,
9823 Output_merge_base::set_keeps_input_sections,
9824 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
9825 method definitions.
9826 (Output_merge_base::Input_sections): New type declaration.
9827 (Output_merge_base::input_sections_begin,
9828 Output_merge_base::input_sections_end,
9829 Output_merge_base::do_set_keeps_input_sections): New method definitions.
9830 (Output_merge_base::bool keeps_input_sections_,
9831 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
9832 Output_merge_base::input_sections_): New data members.
9833 (Output_merge_data::do_set_keeps_input_sections): New method
9834 defintion.
9835 (Output_merge_string::do_set_keeps_input_sections): Ditto.
9836 * output.cc (Output_section::Input_section::relobj): Move method
9837 defintion from class declaration to here and handle merge sections.
9838 (Output_section::Input_section::shndx): Ditto.
9839 (Output_section::Output_section): Remove initializations of removed
9840 data members and initialize new data member LOOKUP_MAPS_.
9841 (Output_section::add_input_section): Set keeps-input-sections flag
9842 for a newly created merge output section as appropriate. Adjust code
9843 to use Output_section_lookup_maps class.
9844 (Output_section::add_relaxed_input_section): Adjst code for lookup
9845 maps code refactoring.
2e702c99 9846 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
9847 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
9848 class. If adding input section to a newly created merge output
9849 section fails, remove the new merge section.
9850 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 9851 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 9852 (Output_section::find_merge_section): Ditto.
0439c796 9853 (Output_section::build_lookup_maps): New method defintion.
2e702c99 9854 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
9855 Output_section_lookup_maps class.
9856 (Output_section::get_input_sections): Export merge sections. Adjust
9857 code to use Output_section_lookup_maps class.
9858 (Output_section:::add_script_input_section): Adjust code to use
9859 Output_section_lookup_maps class. Update lookup maps for merge
9860 sections also.
9861 (Output_section::discard_states): Use Output_section_lookup_maps.
9862 (Output_section::restore_states): Same.
9863 * output.h (Merge_section_properties): Move class defintion out of
9864 Output_section.
9865 (Output_section_lookup_maps): New class.
9866 (Output_section::Input_section::is_merge_section): New method
9867 defintion.
9868 (Output_section::Input_section::relobj): Move defintion out of class
9869 defintion. Declare method only.
9870 (Output_section::Input_section::shndx): Ditto.
9871 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 9872 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
9873 (Output_section::Merge_section_by_properties_map,
9874 Output_section::Output_section_data_by_input_section_map,
9875 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
9876 Remove types.
2e702c99 9877 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
9878 KEEPS_INPUT_SECTIONS.
9879 (Output_section::build_lookup_maps): New method declaration.
9880 (Output_section::merge_section_map_,
9881 Output_section::merge_section_by_properties_map_,
9882 Output_section::relaxed_input_section_map_,
9883 Output_section::is_relaxed_input_section_map_valid_): Remove data
9884 members.
9885 (Output_section::lookup_maps_): New data member.
9886
76295588
L
98872010-05-21 Doug Kwan <dougkwan@google.com>
9888
9889 PR gold/11619
9890 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
9891 avoid a compilation error.
9892
d103a984
RÁE
98932010-05-19 Rafael Espindola <espindola@google.com>
9894
9895 * script-sections.cc (Output_section_definition::allocate_to_segment):
9896 Update the phdrs_list even when the output section is NULL.
9897 * testsuite/Makefile.am: Add test.
9898 * testsuite/Makefile.in: Regenerate.
9899 * testsuite/script_test_9.cc: New.
9900 * testsuite/script_test_9.sh: New.
9901 * testsuite/script_test_9.t: New.
9902
6625d24e
DK
99032010-05-19 Doug Kwan <dougkwan@google.com>
9904
9905 * arm.cc (Arm_input_section::original_size): New method.
9906 (Arm_input_section::do_addralign): Add a cast.
9907 (Arm_input_section::do_output_offset): Remove static cast.
9908 (Arm_input_section::original_addralign,
9909 Arm_input_section::original_size_): Change type to uint32_t.
9910 (Arm_input_section::init): Add safe casts for section alignment
9911 and size.
9912 (Arm_input_section::set_final_data_size): Do not set address and
9913 offset of stub table.
9914 (Arm_output_section::fix_exidx_coverage): Change use of of
9915 Output_section::Simple_input_section to that of
9916 Output_section::Input_section.
9917 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
9918 except for the first pass.
9919 * output.cc (Output_section::get_input_sections): Change type of
9920 input_sections to std::list<Input_section>.
9921 (Output_section::add_script_input_section): Rename from
9922 Output_section::add_simple_input_section. Change type of SIS
9923 parameter from Simple_input_section to Input_section.
9924 * output.h (Output_section::Simple_input_section): Remove class.
9925 (Output_section::Input_section): Change class visibility to public.
9926 (Output_section::Input_section::addralign): Use stored alignments
9927 for special input sections if set.
9928 (Output_section::Input_section::set_addralign): New method.
9929 (Output_section::get_input_sections): Change parameter type from
9930 list of Simple_input_section to list of Input_section.
9931 (Output_section::add_script_input_section): Rename from
9932 Output_section::add_simple_input_section. Change first parameter's
9933 type from Simple_input_section to Input_section and remove the
9934 second and third parameters.
9935 * script-sections.cc (Input_section::Input_section_list): Change
9936 type to list of Output_section::Input_section/
9937 (Input_section_info::Input_section_info): Change parameter type of
9938 INPUT_SECTION to Output_section::Input_section.
9939 (Input_section_info::input_section): Change return type.
9940 (Input_section_info::input_section_): Change type to
9941 Output_section::Input_section.
9942 (Output_section_element_input::set_section_addresses): Adjust code
9943 to use Output_section::Input_section instead of
9944 Output_section::Simple_input_section. Adjust code for renaming
9945 of Output_section::add_simple_input_section.
9946 (Orphan_output_section::set_section_addresses): Ditto.
9947
e1e82ea4
RW
99482010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9949
9950 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
9951 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
9952
91e75c8a
RÁE
99532010-05-18 Rafael Espindola <espindola@google.com>
9954
9955 * options.cc (General_options::finalize): Handle -nostdlib.
9956 * options.h (nostdlib): New option.
9957 * script.cc (script_add_search_dir): Handle -nostdlib.
9958
da59ad79
DK
99592010-05-12 Doug Kwan <dougkwan@google.com>
9960
9961 * arm.cc (Target_arm::do_finalize_sections): Create an empty
9962 attributes section only if there no attributes section after merging.
9963 (Target_arm::merge_object_attributes): Move value of
e1df38aa 9964 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
9965 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
9966 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
9967 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
9968 and arm_attr_merge_7.stdout.
9969 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
9970 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
9971 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
9972 arm_attr_merge_7b.o): New rules.
9973 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
9974 arm_attr_merge_7
9975 * testsuite/Makefile.in: Regenerate.
9976 * testsuite/arm_attr_merge.sh: New file.
9977 * testsuite/arm_attr_merge_[67][ab].s: Same.
9978
3e01a7fd
NC
99792010-05-05 Nick Clifton <nickc@redhat.com>
9980
9981 * po/es.po: Updated Spanish translation.
9982
7ad2014a
L
99832010-04-27 H.J. Lu <hongjiu.lu@intel.com>
9984
9985 * Makefile.am (install-exec-local): Properly install gold as
9986 default cross linker.
9987 * Makefile.in: Regenerated.
9988
4fda8867
NC
99892010-04-27 H.J. Lu <hongjiu.lu@intel.com>
9990 Nick Clifton <nickc@redhat.com>
9991
9992 * configure.ac (install_as_default): Define and set to false
9993 unless --enable-gold or --enable-gold=both/gold has been
9994 specified.
9995 * configure: Regenerate.
9996
9997 * Makefile.am (install-exec-local): Install the executable as
9998 'ld.gold'. If install_as_default is true then also install it as
9999 'ld'.
10000 * Makefile.in: Regenerated.
10001
bd288ea2
ILT
100022010-04-24 Ian Lance Taylor <iant@google.com>
10003
10004 * layout.cc (Layout::layout_reloc): In relocatable link don't
10005 combine reloc sections for grouped sections.
10006
ef38fd8a
ST
100072010-04-23 Sriraman Tallam <tmsriram@google.com>
10008
10009 * gc.h (gc_process_relocs): Pass information on relocs pointing to
10010 sections that are not ordinary to icf.
10011 * icf.cc (get_section_contents): Handle relocation pointing to section
10012 with no object or shndx information.
10013 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
10014 * testsuite/Makefile.in: Regenerate.
10015 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
10016 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
10017
f6973bdc
ILT
100182010-04-22 Ian Lance Taylor <iant@google.com>
10019
10020 * expression.cc (Expression::Expression_eval_info): Add
10021 result_alignment_pointer field.
10022 (Expression::eval_with_dot): Add result_alignment_pointer
10023 parameter. Change all callers.
10024 (Expression::eval_maybe_dot): Likewise.
10025 (class Binary_expression): Add alignment_pointer parameter to
10026 left_value and right_value. Change all callers.
10027 (BINARY_EXPRESSION): Set result alignment.
10028 (class Trinary_expression): Add alignment_pointer parameter to
10029 arg2_value and arg3_value. Change all callers.
10030 (Trinary_cond::value): Set result alignment.
10031 (Max_expression::value, Min_expression::value): Likewise.
10032 (Align_expression::value): Likewise.
10033 * script-sections.cc (class Sections_element): Add dot_alignment
10034 parameter to set_section_addresses virtual function. Update
10035 instantiations.
10036 (class Output_section_element): Likewise.
10037 (Script_sections::create_segments): Add dot_alignment parameter.
10038 Change all callers.
10039 (Script_sections::create_segments_from_phdrs_clause): Likewise.
10040 (Script_sections::set_phdrs_clause_addresses): Likewise.
10041 * script-sections.h: Update declarations.
10042 * script.h: Update declarations.
10043 * output.h (Output_segment::set_minimum_p_align): Don't decrease
10044 min_p_align.
10045 * testsuite/script_test_3.t: Set large alignment.
10046 * testsuite/script_test_3.sh: Make sure that at least one LOAD
10047 segment has expected alignment.
10048
9c9c98a5
NC
100492010-04-22 Nick Clifton <nickc@redhat.com>
10050
10051 * po/gold.pot: Updated by the Translation project.
10052 * po/vi.po: Updated Vietnamese translation.
10053
2253bfba
L
100542010-04-22 H.J. Lu <hongjiu.lu@intel.com>
10055
10056 * testsuite/Makefile.am (check_PROGRAMS): Add
10057 icf_virtual_function_folding_test.
10058 * testsuite/Makefile.in: Regenerated.
10059
85fdf906
AH
100602010-04-15 Andrew Haley <aph@redhat.com>
10061
10062 * options.h (merge_exidx_entries): New option.
10063 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
10064 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
10065 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
10066 (Target_arm::merge_exidx_entries): New function.
10067 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
10068 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
10069 to Arm_exidx_fixup constructor.
10070 Add new arg, merge_exidx_entries.
10071 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
10072 Arm_output_section::fix_exidx_coverage.
10073
ce97fa81
ST
100742010-04-18 Sriraman Tallam <tmsriram@google.com>
10075
10076 * icf.cc (get_section_contents): Check for preemptible functions.
10077 Ignore addend when appropriate.
10078 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
10079 section folded.
10080 (add_from_relobj): Check for section folded.
10081 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
10082 * symtab.h (should_add_dynsym_entry): Add new parameter.
10083 * target-reloc.h (scan_relocs): Check for section folded.
10084 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
10085 Check reloc types for function pointers in shared objects.
10086 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
10087 case.
10088 (icf_preemptible_functions_test): New test case.
10089 (icf_string_merge_test): New test case.
10090 * testsuite.Makefile.in: Regenerate.
10091 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
10092 bar_glob. Refactor code.
10093 * testsuite/icf_preemptible_functions_test.cc: New file.
10094 * testsuite/icf_preemptible_functions_test.sh: New file.
10095 * testsuite/icf_string_merge_test.cc: New file.
10096 * testsuite/icf_string_merge_test.sh: New file.
10097 * testsuite/icf_virtual_function_folding_test.cc: New file.
10098 * testsuite/icf_virtual_function_folding_test.sh: New file.
10099
04ceb17c
DK
101002010-04-14 Doug Kwan <dougkwan@google.com>
10101
10102 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
10103 for local symbol recounting if we remove a section due to ICF.
10104 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
10105 there are no regular objects in input.
10106
153e7da4
DK
101072010-04-13 Doug Kwan <dougkwan@google.com>
10108
10109 * arm.cc (Arm_input_section::set_final_data_size): Compute
10110 accurate final data size instead of using current data size.
10111
4dbd9faf
DK
101122010-04-09 Doug Kwan <dougkwan@google.com>
10113
10114 * layout.cc (Layout::choose_output_section): Handle script section
10115 types.
10116 (Layout::make_output_section_for_script): Add section type parameter.
10117 Handle script section types.
10118 * layout.h (Layout::make_output_section_for_script): Add section
10119 type parameter.
10120 * output.cc (Output_section::Output_section): Initialize data member
10121 is_noload_.
10122 (Output_section::do_reset_address_and_file_offset): Do not set address
10123 to 0 if section is a NOLOAD section.
10124 * output.h (Output_section::is_noload): New method.
10125 (Output_section::set_is_noload): Ditto.
10126 (Output_section::is_noload_): New data member.
10127 * script-c.h (Script_section_type): New enum type.
10128 (struct Parser_output_section_header): Add new file section_type.
10129 * script-sections.cc (Sections_element::output_section_name): Add
10130 parameter for returning script section type.
10131 (Output_section_definition::output_section_name): Ditto.
10132 (Output_section_definition::section_type)P; New method.
10133 (Output_section_definiton::script_section_type_name): Ditto.
10134 (Output_section_definition::script_section_type_): New data member.
10135 (Output_section_definition::Output_section_definition): Initialize
10136 data member Output_section_definition::script_section_type_.
10137 (Output_section_definition::create_sections): Pass script section type
10138 to Layout::make_output_section_for_script.
10139 (Output_section_definition::output_section_name): Return script
10140 section type to caller.
10141 (Output_section_definition::set_section_address): Do not advance
10142 dot value and load address if section type is NOLOAD. Set address
10143 of NOLOAD sections regardless of section flags.
10144 (Output_section_definition::print): Print section type if it is
10145 not SCRIPT_SECTION_TYPE_NONE.
10146 (Output_section_definition::section_type): New method.
10147 (Output_section_definition::script_section_type_name): Ditto.
10148 (Script_sections::output_section_name): Add new parameter
10149 PSECTION_TYPE for returning script section type. Pass it to
10150 section elements. Handle discard sections.
10151 (Sort_output_sections::operator()): Handle NOLOAD sections.
10152 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 10153 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
10154 returning script section type.
10155 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
10156 INFO and NOLOAD.
10157 * yyscript.y (union): Add new field SECTION_TYPE.
10158 (COPY, DSECT, INFO, NOLOAD): New tokens.
10159 (opt_address_and_section_type): Change type to output_section_header.
10160 (section_type): New non-terminal
10161 (section_header): Handle section type.
2253bfba 10162 (opt_address_and_section_type): Return section type value.
4dbd9faf 10163
721ea635
L
101642010-04-09 H.J. Lu <hongjiu.lu@intel.com>
10165
10166 * testsuite/plugin_common_test_1.c (foo): Add prototype.
10167 * testsuite/plugin_common_test_2.c (foo): Likewise.
10168
6bf924b0
DK
101692010-04-08 Doug Kwan <dougkwan@google.com>
10170
10171 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
10172 Output_merge_data.
10173 * output.cc (Output_section::add_merge_input_section): Simplify
10174 code and return status of Output_merge_base::add_input_section.
e1df38aa 10175 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
10176 returns true.
10177
24af6f92
DK
101782010-04-07 Doug Kwan <dougkwan@google.com>
10179
10180 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
10181 if section is marked as containing instructions but has no mapping
10182 symbols.
10183 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
10184 correct section index.
10185 (Arm_relobj::find_linked_text_section): Ditto.
10186
00698fc5
CC
101872010-04-07 Cary Coutant <ccoutant@google.com>
10188
10189 * archive.cc (include_member): Destroy Read_symbols_data object before
10190 releasing file.
10191 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
10192 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
10193 (Read_symbols_data::~Read_symbols_data) New destructor.
10194 (Section_relocs::Section_relocs) New constructor.
10195 (Section_relocs::~Section_relocs) New destructor.
10196 (Read_relocs_data::Read_relocs_data) New constructor.
10197 (Read_relocs_data::~Read_relocs_data) New destructor.
10198 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
10199 pointers to NULL after deleting.
10200
7296d933
DK
102012010-04-07 Doug Kwan <dougkwan@google.com>
10202
10203 * arm.cc: Replace "endianity" with "endianness" in comments.
10204 (Arm_exidx_cantunwind): Ditto.
10205 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
10206 (Arm_relobj::merge_flags_and_attributes): New method.
10207 (Arm_relobj::merge_flags_and_attributes_): New data member.
10208 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
10209 (Arm_relobj::scan_sections_for_stubs): Ditto.
10210 (Arm_relobj::do_read_symbols): Check to see if we really want to
10211 merge processor-specific flags and attributes. Exit early if
10212 an object is empty except for section names and the undefined symbol.
10213 (Target_arm::do_finalize_sections): Move check for ELF format to
10214 Arm_relobj::do_read_symbols. Merge processor specific flags and
10215 attributes from a regular object only when we have determined that
10216 it is aapropriate. Do not create an .ARM.attributes section in
10217 output if there is no regular input object.
10218 (Target_arm::merge_processor_specific_flags): Check
10219 --warn-mismatch before printing any error.
10220 (Target_arm::merge_object_attributes): Ditto.
10221 * gold.cc (queue_middle_tasks): Handle the case in which there is
10222 no regular object in input.
10223 * options.cc (General_options::parse_EB): New method.
10224 (General_options::parse_EL): Same.
10225 (General_options::General_options): Initialize endianness_.
10226 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
10227 New options.
10228 (General_options::Endianness): New enum.
10229 (General_options::endianness): New method.
10230 (General_options::endianness_): New data member.
10231 * parameters.cc (Parameters::set_options): Check target endianness.
10232 (Parameters::set_target_once): Ditto.
10233 (Parameters::check_target_endianness): New method.
10234 (parameters_force_valid_target): If either -EL or -EB is specified,
10235 use it to define endianness of default target.
10236 * parameters.h (Parameters::check_target_endianness): New method
10237 declaration.
10238 * target.h (class Target): Change "endianity" to "endianness"
10239 in comments.
10240
efc8d4f2
RW
102412010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10242
10243 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
10244 * configure: Regenerate.
10245 * Makefile.in: Regenerate.
10246 * testsuite/Makefile.in: Regenerate.
10247
be234d88
CC
102482010-04-06 Cary Coutant <ccoutant@google.com>
10249
10250 gcc PR lto/42757
10251 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
10252 prevailing definitions of common symbols.
10253 * testsuite/plugin_test_6.sh: New test case.
10254 * testsuite/plugin_common_test_1.c: New test case.
10255 * testsuite/plugin_common_test_2.c: New test case.
10256 * testsuite/Makefile.am (plugin_test_6): New test case.
10257 * testsuite/Makefile.in: Regenerate.
10258
bd32c6bd
NC
102592010-04-06 Nick Clifton <nickc@redhat.com>
10260
10261 * po/vi.po: New Vietnamese translation.
10262
323c532f
DK
102632010-03-30 Doug Kwan <dougkwan@google.com>
10264
10265 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
10266
4fcd97eb
DK
102672010-03-25 Doug Kwan <dougkwan@google.com>
10268
10269 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
10270 to avoid a conversion warning on a 32-bit host.
10271
4ebf39db
ILT
102722010-03-24 Ian Lance Taylor <iant@google.com>
10273
10274 * testsuite/script_test_3.t: Add a TLS segment.
10275 * testsuite/Makefile.am (check_PROGRAMS): Add
10276 tls_phdrs_script_test.
10277 (tls_phdrs_script_test_SOURCES): Define.
10278 (tls_phdrs_script_test_DEPENDENCIES): Define.
10279 (tls_phdrs_script_test_LDFLAGS): Define.
10280 (tls_phdrs_script_test_LDADD): Define.
10281 * testsuite/Makefile.in: Rebuild.
10282
4a599bdd
CC
102832010-03-23 Cary Coutant <ccoutant@google.com>
10284
10285 * fileread.cc (find_or_make_view): Fix comment.
10286
6c93b22c
ILT
102872010-03-23 Ian Lance Taylor <iant@google.com>
10288
10289 * script-sections.cc (class Orphan_section_placement): Define
10290 PLACE_TLS and PLACE_TLS_BSS.
10291 (Orphan_section_placement::Orphan_section_placement): Initialize
10292 new places.
10293 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
10294 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
10295 (tls_script_test_SOURCES): Define.
10296 (tls_script_test_DEPENDENCIES): Define.
10297 (tls_script_test_LDFLAGS): Define.
10298 (tls_script_test_LDADD): Define.
10299 * testsuite/Makefile.in: Rebuild.
10300
a2c7281b
DK
103012010-03-22 Doug Kwan <dougkwan@google.com>
10302
10303 * arm.cc (Arm_relocate_functions::abs8,
10304 Arm_relocate_functions::abs16): Use correct check for overflow
10305 specified in the ARM ELF specs.
10306 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
10307 target of a BLX instruction specially.
10308 (Reloc_stub::stub_type_for_reloc): Ditto.
10309 (Relocate::relocate): Use symbolic names instead of numeric relocation
10310 codes to report error.
10311 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
10312 workaround.
10313 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
10314 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
10315 thumb2_blx_out_of_range.stdout
10316 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
10317 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
10318 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
10319 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
10320 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
10321 thumb2_blx_in_range, thumb2_blx_in_range.o,
10322 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
10323 thumb2_blx_out_of_range.o): New rules.
2e702c99 10324 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
10325 thumb2_blx_in_range and thumb2_blx_out_of_range.
10326 * testsuite/Makefile.in: Regenerate.
10327 * arm_branch_in_range.sh: Add tests for THUMB BLX.
10328 * testsuite/thumb_blx_in_range.s: New file.
10329 * testsuite/thumb_blx_out_of_range.s: New file.
10330
b0193076
RÁE
103312010-03-22 Rafael Espindola <espindola@google.com>
10332
10333 * archive.cc (Should_include): Move to archive.h.
10334 (should_include_member): Make it a member of Archive.
10335 (Lib_group): New.
10336 (Add_lib_group_symbols): New.
10337 * archive.h: Include options.h.
10338 (Archive_member): Moved from Archive.
10339 (Should_include): Moved from archive.cc.
10340 (Lib_group): New.
10341 (Add_lib_group_symbols): New.
10342 * dynobj.cc (do_should_include_member): New.
10343 * dynobj.h (do_should_include_member): New.
10344 * gold.cc (queue_initial_tasks): Update call to queue.
10345 * main.cc (main): Print lib group stats.
10346 * object.cc (do_should_include_member): New.
10347 * object.h: Include archive.h.
10348 (Object::should_include_member): New.
10349 (Object::do_should_include_member): New.
10350 (Sized_relobj::do_should_include_member): New.
10351 * options.cc (General_options::parse_start_lib): New.
10352 (General_options::parse_end_lib): New.
10353 (Input_arguments::add_file): Handle lib groups.
10354 (Input_arguments::start_group): Check we are not in a lib.
10355 (Input_arguments::start_lib): New.
10356 (Input_arguments::end_lib): New.
10357 * options.h (General_options): Add start_lib and end_lib.
10358 (Input_argument::lib_): New.
10359 (Input_argument::lib): New.
10360 (Input_argument::is_lib): New.
10361 (Input_file_lib): New.
10362 (Input_arguments::in_lib_): New.
10363 (Input_arguments::in_lib): New.
10364 (Input_arguments::start_lib): New.
10365 (Input_arguments::end_lib_): New.
10366 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
10367 in unused members as preempted.
10368 (Sized_pluginobj::do_should_include_member): New.
10369 * plugin.h (Sized_pluginobj::do_should_include_member): New.
10370 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
10371 return the blocker.
10372 (Read_symbols::do_whole_lib_group): New.
10373 (Read_symbols::do_lib_group): New.
10374 (Read_symbols::do_read_symbols): Handle lib groups.
10375 (Read_symbols::get_name): Handle lib groups.
10376 * readsyms.h (Read_symbols): Add an archive member pointer.
10377 (Read_symbols::do_whole_lib_group): New.
10378 (Read_symbols::do_lib_group): New.
10379 (Read_symbols::member_): New.
10380 * script.cc (read_input_script): Update call to queue_soon.
10381
d099120c
DK
103822010-03-19 Doug Kwan <dougkwan@google.com>
10383
10384 * arm.cc (Stub_table::Stub_table): Initialize new data members
10385 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10386 (Stub_table::add_reloc_stub): Assign stub offset and update
10387 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10388 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
10389 New data members.
2e702c99 10390 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
10391 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
10392 instead of going over all reloc stubs.
2e702c99 10393 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
10394 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10395 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 10396 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
10397 Stringpool_template::offset_.
10398 * stringpool.h (Stringpool_template::set_no_zero_null): Set
10399 Stringpool_template::offset_ to zero.
10400
1aa37384
DK
104012010-03-15 Doug Kwan <dougkwan@google.com>
10402
10403 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10404 offset_.
10405 (Stringpool_template::new_key_offset): New method.
10406 (Stringpool_template::add_string): Assign offsets when adding new
10407 strings.
10408 (Stringpool_template::set_string_offsets): Do not set string offsets
10409 when not optimizing.
10410 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
10411 member size_.
2e702c99
RM
10412 (Chunked_vector::clear): Clear size_.
10413 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
10414 (Chunked_vector::size): Return size_.
10415 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 10416 (Chunked_vector::size_): New data member.
1aa37384
DK
10417 (Stringpool_template::set_no_zero_null): Assert string set is empty.
10418 (Stringpool_template::new_key_offset): New method declaration.
10419 (Stringpool_template::offset_): New data member.
10420
b672b057
RÁE
104212010-03-15 Rafael Espindola <espindola@google.com>
10422
10423 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
10424 Add_symbols' constructor.
10425 * readsyms.h (Add_symbols): Remove the input_group member.
10426
b6848d3c
ILT
104272010-03-10 Ian Lance Taylor <iant@google.com>
10428
10429 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
10430 target to ask whether a reference to a symbol requires a stack
10431 split.
10432 * target.h (Target::is_call_to_non_split): New function.
10433 (Target::do_is_call_to_non_split): Declare virtual function.
10434 * target.cc: Include "symtab.h".
10435 (Target::do_is_call_to_non_split): New function.
10436 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
10437
a2a5469e
CC
104382010-03-10 Cary Coutant <ccoutant@google.com>
10439
10440 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
10441 (File_read::open[1]): Remove initial mapping of whole_file_view_.
10442 (File_read::open[2]): Add whole_file_view_ to list of views.
10443 (File_read::make_view): Remove test of whole_file_view_.
10444 (File_read::find_or_make_view): Create whole_file_view_ if
10445 necessary.
10446 (File_read::clear_views): Replace bool parameter with enum;
10447 adjust all callers. Don't delete views with permanent data;
10448 do delete cached views and views from archives if
10449 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
10450 if clearing the corresponding view.
10451 * fileread.h (File_read::Clear_views_mode): New enum.
10452 (File_read::View::is_permanent_view): New method.
10453 (File_read::clear_views): Replace bool parameter
10454 with enum; adjust all callers.
10455 * options.h (General_options): Change keep_files_mapped option;
10456 add map_whole_files.
10457 * readsyms.cc (Add_symbols::run): Delete sd_ object before
10458 releasing the file.
10459 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
10460 the file.
10461
8861f32b
DM
104622010-03-10 David S. Miller <davem@davemloft.net>
10463
10464 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
10465
d62d0f5f
ST
104662010-03-09 Sriraman Tallam <tmsriram@google.com>
10467
10468 * icf.cc (get_section_contents): Add '@' marker after processing the
10469 merge reloc.
10470
9177756d
DK
104712010-03-08 Doug Kwan <dougkwan@google.com>
10472
10473 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
10474 due to a conversion warning.
10475 (Arm_relobj::update_output_local_symbol_count): Check for local
10476 symbol with unset output index.
10477
9e9e071b
ILT
104782010-03-05 Ian Lance Taylor <iant@google.com>
10479
10480 * options.h (class General_options): Add --spare-dynamic-tags.
10481 * output.cc (Output_data_dynamic::set_final_data_size): Implement
10482 --spare-dynamic-tags.
10483
a81ee015
ILT
104842010-03-05 Ian Lance Taylor <iant@google.com>
10485
10486 * incremental.cc: Include "libiberty.h".
10487
44ec90b9
RO
104882010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
10489
10490 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
10491 function, is_info_ member.
10492 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
10493 (Versions::Versions): Update caller.
10494 (Versions::define_base_version): Likewise.
10495 (Versions::add_def): Likewise.
10496
0897ed3b
ST
104972010-03-03 Sriraman Tallam <tmsriram@google.com>
10498
10499 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
10500 (Scan::possible_function_pointer_reloc): New function.
10501 (Scan::local_reloc_may_be_function_pointer): Change to call
10502 possible_function_pointer_reloc.
10503 (Scan::global_reloc_may_be_function_pointer): Ditto.
10504 * icf.h (Icf::check_section_for_function_pointers): Change to reject
10505 relocations in ".data.rel.ro._ZTV" section.
10506 * testsuite/icf_safe_so_test.sh: Change to pass i386.
10507 * testsuite/icf_safe_so_test.cc: Ditto.
10508 * testsuite/icf_safe_test.cc: Ditto.
10509 * testsuite/icf_safe_test.sh: Ditto.
10510
d3bbad62
ILT
105112010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10512 Ian Lance Taylor <iant@google.com>
10513
10514 * target-reloc.h (relocate_section): Check the symbol table index
10515 for -1U before setting the local symbol index.
10516 (scan_relocatable_relocs): If copying the relocation, record that
10517 the local symbol is required.
10518 * object.h (Symbol_value::is_output_symtab_index_set): New
10519 function.
10520 (Symbol_value::may_be_discarded_from_output_symtab): New
10521 function.
10522 (Symbol_value::has_output_symtab_entry): New function.
10523 (Symbol_value::needs_output_symtab_entry): Remove.
10524 (Symbol_value::output_symtab_index): Make sure the symbol index is
10525 set.
10526 (Symbol_value::set_output_symtab_index): Make sure the symbol
10527 index is not set. Make sure the new index is valid.
10528 (Symbol_value::set_must_have_output_symtab_entry): New function.
10529 (Symbol_value::has_output_dynsym_entry): New function.
10530 (Symbol_value::set_output_dynsym_index): Make sure the new index
10531 is valid.
10532 (Sized_relobj::set_must_have_output_symtab_entry): New function.
10533 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
10534 local symbol if permitted.
10535 (Sized_relobj::do_finalize_local_symbols): Call
10536 is_output_symtab_index_set rather than needs_output_symtab_entry.
10537 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
10538 rather than needs_output_symtab_entry. Call
10539 has_output_dynsym_entry rather than needs_output_dynsym_entry.
10540 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
10541 is_output_symtab_index_set rather than needs_output_symtab_entry.
10542 * testsuite/discard_locals_relocatable_test.c: New file.
10543 * testsuite/discard_locals_test.sh: Test -r.
10544 * testsuite/Makefile.am (check_DATA): Add
10545 discard_locals_relocatable_test1.syms,
10546 discard_local_relocatable_test2.syms.
10547 (MOSTLYCLEANFILES): Likewise. Also add
10548 discard_locals_relocatable_test1.lout and
10549 discard_locals_relocatable_test2.out.
10550 (discard_locals_relocatable_test1.syms): New target.
10551 (discard_locals_relocatable_test.o): New target.
10552 (discard_locals_relocatable_test1.out): New target.
10553 (discard_locals_relocatable_test2.syms): New target.
10554 (discard_locals_relocatable_test2.out): New target.
10555 (various): Add missing ../ld-new dependencies.
10556 * testsuite/Makefile.in: Rebuild.
10557
7e8ccf26
NC
105582010-03-03 Nick Clifton <nickc@redhat.com>
10559
10560 * po/fi.po: New Finnish translation.
10561
2a0ff005
DK
105622010-03-01 Doug Kwan <dougkwan@google.com>
10563
10564 * layout.cc (Layout::Layout): Force section types of .init_array*,
10565 .preinit_array* and .fini_array* sections.
10566 * output.cc (Output_section::Input_section_sort_entry::has_priority):
10567 Fix check of return value of std::string::find.().
10568 (Output_section::Input_section_sort_compare::operator()): Remove
10569 comment about .init_array.
10570 (Output_section::Input_section_sort_init_fini_compare::operator()):
10571 New method.
10572 (Output_section::sort_attached_input_sections): Handle .init_array
10573 and .fini_array specially.
10574 * output.h (Output_section::Inut_section_sort_compare): Update
10575 comment.
10576 (Output_section::Input_section_sort_init_fini_compare): New struct.
10577
c3e4ae29
DK
105782010-02-26 Doug Kwan <dougkwan@google.com>
10579
10580 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
10581 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
10582 * testsuite/debug_msg.sh: Avoid matching source line number for
10583 use of global variable undef_int.
10584
2fd9ae7a
DK
105852010-02-26 Doug Kwan <dougkwan@google.com>
10586
10587 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
10588 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
10589 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
10590 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
10591 * options.cc (General_options::General_options): Initialize member
10592 fix_v4bx_.
10593 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
10594 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
10595 and rm_no_fix_v4bx.stdout
10596 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
10597 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
10598 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
10599 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
10600 and arm_no_fix_v4bx.
10601 * Makefile.in: Regenerate.
10602 * testsuite/arm_fix_v4bx.s: New file.
10603 * testsuite/arm_fix_v4bx.sh: Ditto.
10604
67ec7d0b
DK
106052010-02-24 Doug Kwan <dougkwan@google.com>
10606
10607 * arm.cc (Target_arm::got_section): Make the .got section the first
10608 non RELRO section in the data segment.
10609 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
10610 suffixes of section names.
10611
10165461
DK
106122010-02-24 Doug Kwan <dougkwan@google.com>
10613
10614 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
10615 flags and attributes merging if an input file is a binary file.
10616 * fileread.cc (Input_file::open): Record format of original file.
10617 * fileread.h (Input_file::Format): New enum type.
2e702c99 10618 (Input_file::Input_file): Initialize data member format_.
10165461
DK
10619 (Input_file::format): New method definition.
10620 (Input_file::format_):: New data member.
10621
4a54abbb
DK
106222010-02-24 Doug Kwan <dougkwan@google.com>
10623
10624 * arm.cc (Arm_output_data_got): New class.
10625 (ARM_TCB_SIZE): New constant
10626 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
10627 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
10628 If user uses a script with a SECTIONS clause, issue only a warning
10629 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 10630 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
10631 garbage collection.
10632 (Target_arm::got_mode_index_entry): Handle static linking.
10633 (Target_arm::Scan::local): Ditto.
10634 (Target_arm::Scan::global): Ditto.
10635 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
10636 all incorrectly implemented relocations.
e1df38aa 10637 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
10638 Arm_output_section::fix_exidx_coverage.
10639 * layout.cc (Layout::section_name_mapping): Remove trailing dots
10640 from ".ARM.exidx." and ".ARM.extab.".
10641
ca419a6f
ILT
106422010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10643
10644 * arm.cc (Target_arm::do_finalize_sections): Create attribute
10645 section if it does not already exist.
10646 * attributes.cc (Attributes_section_data::Attributes_section_data):
10647 Don't crash if size is zero.
10648
135b9c78
ILT
106492010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10650 Ian Lance Taylor <iant@google.com>
10651
10652 * gold.cc (queue_middle_tasks): If no input files were opened,
10653 exit.
10654 * workqueue.h (Task_function::Task_function): Assert that there is
10655 a blocker.
10656
bb0bfe4f
DK
106572010-02-22 Doug Kwan <dougkwan@google.com>
10658
10659 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
10660 * icf.cc (get_section_contents): Cast snprintf arguments to long long
10661 types to avoid warnings due to different uint64_t implementations
10662 on different hosts.
10663
2a2b6d42
DK
106642010-02-21 Doug Kwan <dougkwan@google.com>
10665
10666 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
10667 handling of the maximum backward branch offset.
2e702c99 10668 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
10669 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
10670 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 10671 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
10672 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
10673 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
10674 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
10675 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
10676 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
10677 thumb_bl_out_of_range thumb_bl_out_of_range.o,
10678 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
10679 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
10680 thumb2_bl_out_of_range.o): New rules.
10681 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
10682 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
10683 thumb2_bl_out_of_range
10684 * testsuite/Makefile.in: Regenerate.
10685 * testsuite/arm_bl_in_range.s: New file.
10686 * testsuite/arm_bl_out_of_range.s: Ditto.
10687 * testsuite/arm_branch_in_range.sh: Ditto.
10688 * testsuite/arm_branch_range.t: Ditto.
10689 * testsuite/thumb2_branch_range.t: Ditto.
10690 * testsuite/thumb_bl_in_range.s: Ditto.
10691 * testsuite/thumb_bl_out_of_range.s: Ditto.
10692 * testsuite/thumb_branch_range.t: Ditto.
10693
b487ad64
ST
106942010-02-20 Sriraman Tallam <tmsriram@google.com>
10695
10696 * gc.h (gc_process_relocs): Change vectors to point to the new list.
10697 Add reloc offset information.
10698 * icf.cc (get_section_contents): Change iterators to point to the new
10699 vectors. Add reloc offset information to the contents.
10700 * icf.h (Icf::Sections_reachable_info): New typedef.
10701 (Icf::Sections_reachable_list): New typedef.
10702 (Icf::Offset_info): New typedef.
10703 (Icf::Reloc_info): New struct typedef.
10704 (Icf::Reloc_info_list): New typedef.
10705 (Icf::symbol_reloc_list): Delete method.
10706 (Icf::addend_reloc_list): Delete method.
10707 (Icf::section_reloc_list): Delete method.
10708 (Icf::reloc_info_list): New method.
10709 (Icf::reloc_info_list_): New member.
10710
f96accdf
DK
107112010-02-19 Doug Kwan <dougkwan@google.com>
10712
10713 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
10714 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
10715 * arm.cc (Arm_relocation_functions): New forward declaration.
10716 (Target_arm::Target_arm): Initialize new data members
10717 got_mod_index_offset_ and tls_base_symbol_defined_.
10718 (Target_arm::Relocate::relocate_tls): New method.
10719 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
10720 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
10721 New methods.
2e702c99 10722 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
10723 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
10724 (Target_arm::got_mod_index_offset_,
10725 Target_arm::tls_base_symbol_defined_): New data members.
10726 (Target_arm::Scan::local, Target::Scan::global,
10727 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
10728 relocations.
10729
c8761b9a
DK
107302010-02-18 Doug Kwan <dougkwan@google.com>
10731
10732 * arm.cc (Arm_relobj::find_linked_text_section): New method.
10733 (Arm_relobj::make_exidx_input_section): Pass section index of linked
10734 text section as a parameter becuase some broken tools may not set
10735 the link in section header.
10736 (Target_arm::has_got_section): New method.
10737 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
10738 without any mapping symbol as data only. Remove warning.
10739 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
10740 link in its section header, try to discover the link by inspecting the
10741 REL31 relocation at the beginning of the section.
10742 (Target_arm::Scan::check_non_pic): Report name of offending relocation
10743 in error message.
10744 (Target_arm::Scan::global): Treat any reference to the symbol
10745 _GLOBAL_OFFSET_TABLE_ as a GOT access.
10746
21bb3914
ST
107472010-02-12 Sriraman Tallam <tmsriram@google.com>
10748
10749 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
10750 (Scan::global_reloc_may_be_function_pointer): New function.
10751 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10752 (Scan::global_reloc_may_be_function_pointer): New function.
10753 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10754 (Scan::global_reloc_may_be_function_pointer): New function.
10755 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
10756 (Scan::global_reloc_may_be_function_pointer): New function.
10757 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
10758 (Scan::global_reloc_may_be_function_pointer): New function.
10759 (Scan::possible_function_pointer_reloc): New function.
10760 (Target_x86_64::can_check_for_function_pointers): New function.
10761 * gc.h (gc_process_relocs): Scan relocation types to determine if
10762 function pointers were taken for targets that support it.
10763 * icf.cc (Icf::find_identical_sections): Include functions for
10764 folding in safe ICF whose pointer is not taken.
10765 * icf.h (Secn_fptr_taken_set): New typedef.
10766 (fptr_section_id_): New member.
10767 (section_has_function_pointers): New function.
10768 (set_section_has_function_pointers): New function.
10769 (check_section_for_function_pointers): New function.
10770 * options.h: Fix comment for safe ICF option.
10771 * target.h (can_check_for_function_pointers): New function.
10772 * testsuite/Makefile.am: Add icf_safe_so_test test case.
10773 Modify icf_safe_test for X86-64.
10774 * testsuite/Makefile.in: Regenerate.
10775 * testsuite/icf_safe_so_test.cc: New file.
10776 * testsuite/icf_safe_so_test.sh: New file.
10777 * testsuite/icf_safe_test.cc (kept_func_3): New function.
10778 (main): Change to take pointer to function kept_func_3.
10779 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
10780 folding is done correctly for X86-64.
10781
0da6fa6c
DM
107822010-02-12 David S. Miller <davem@davemloft.net>
10783
10784 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
10785 is_symbolless parameter.
10786 (Output_reloc<SHT_REL>::is_symbolless): New.
10787 (Output_reloc<SHT_REL>::is_symbolless_): New.
10788 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
10789 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
10790 (Output_reloc<SHT_RELA>::is_symbolless): New.
10791 (Output_data_reloc::add_global): Handle is_symbolless.
10792 (Output_data_reloc::add_global_relative): Likewise.
10793 (Output_data_reloc::add_local): Likewise.
10794 (Output_data_reloc::add_local_relative): Likewise.
10795 (Output_data_reloc::add_symbolless_global_addend): New.
10796 (Output_data_reloc::add_symbolless_local_addend): New.
10797 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
10798 is_symbolless.
10799 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
10800 instead of ->is_relative_
10801 (Output_reloc::write): Likewise.
10802 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
10803 (Output_reloc::write_rel): Simplify.
10804
10805 * sparc.cc (Target_sparc::Scan::local): Use
10806 ->add_symbolless_local_addend as needed.
10807 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
10808 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
10809 based upon relocation offset.
10810
e4782e83
DK
108112010-02-11 Doug Kwan <dougkwan@google.com>
10812
10813 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
10814 (Target_arm::Scan::global): Ditto. Also remove a comment before the
10815 beginning of function.
10816 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
10817 and MOVT_ABS relocations. Those are non issued in scanning. Fix
10818 parameter is_32bit in calls to should_apply_static_reloc.
10819 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
10820 (check_DATA): Add arm_abs_global.stdout.
10821 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
10822 arm_abs_global.stdout): New rules.
10823 (MOSTLLYCLEANFILES): Add arm_abs_global
10824 * Makefile.in: Regenerate.
10825 * testsuite/arm_abs_global.s: New file.
10826 * testsuite/arm_abs_global.sh: Ditto.
10827 * testsuite/arm_abs_lib.s: Ditto.
10828
93ceb764
ILT
108292010-02-11 Ian Lance Taylor <iant@google.com>
10830
10831 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
10832 Read_relocs task.
10833 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
10834 Allocate_commons_task first.
10835 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
10836 task, rather than symtab_lock_.
10837 (Gc_process_relocs::~Gc_process_relocs): New function.
10838 (Gc_process_relocs::is_runnable): Check this_blocker_.
10839 (Gc_process_relocs::locks): Use next_blocker_ rather than
10840 blocker_.
10841 (Scan_relocs::~Scan_relocs): New function.
10842 (Scan_relocs::is_runnable): Check this_blocker_ rather than
10843 symtab_lock_.
10844 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
10845 next_blocker_.
10846 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
10847 fields. Add this_blocker_ and next_blocker_ fields. Adjust
10848 constructor accordingly.
10849 (class Gc_process_relocs): Likewise.
10850 (class Scan_relocs): Likewise.
10851 * common.h (class Allocate_commons_task): Remove symtab_lock_
10852 field, and corresponding constructor parameter.
10853 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
10854 symtab_lock_.
10855 (Allocate_commons_task::locks): Likewise.
10856
114dfbe1
ILT
108572010-02-11 Ian Lance Taylor <iant@google.com>
10858
10859 * gold-threads.h (class Once): Define.
10860 (class Initialize_lock): Rewrite as child of Once.
10861 * gold-threads.cc (class Once_initialize): Define.
10862 (once_pointer_control): New static variable.
10863 (once_pointer, once_arg): New static variables.
10864 (c_run_once): New static function.
10865 (Once::Once, Once::run_once, Once::internal_run): New functions.
10866 (class Initialize_lock_once): Remove.
10867 (initialize_lock_control): Remove.
10868 (initialize_lock_pointer): Remove.
10869 (initialize_lock_once): Remove.
10870 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
10871 (Initialize_lock::initialize): Rewrite.
10872 (Initialize_lock::do_run_once): New function.
10873 * archive.cc (Archive::interpret_header): Only clear name if it is
10874 not already empty.
10875 * fileread.cc: Include "gold-threads.h"
10876 (file_counts_lock): New static variable.
10877 (file_counts_initialize_lock): Likewise.
10878 (File_read::release): Only increment counts when using --stats.
10879 Use a lock around the increment.
10880 * parameters.cc (class Set_parameters_target_once): Define.
10881 (set_parameters_target_once): New static variable.
10882 (Parameters::Parameters): Move here from parameters.h.
10883 (Parameters::set_target): Rewrite.
10884 (Parameters::set_target_once): New function.
10885 (Parameters::clear_target): Move here and rewrite.
10886 * parameters.h (class Parameters): Update declarations. Add
10887 set_parameters_target_once_ field.
10888 (Parameters::Parameters): Move to parameters.cc.
10889 (Parameters::clear_target): Likewise.
10890 * readsyms.cc (Read_symbols::do_group): Create a Start_group
10891 task.
10892 (Start_group::~Start_group): New function.
10893 (Start_group::is_runnable): New function.
10894 (Start_group::locks, Start_group::run): New functions.
10895 (Finish_group::run): Change saw_undefined to size_t.
10896 * readsyms.h (class Start_group): Define.
10897 (class Finish_group): Change saw_undefined_ field to size_t.
10898 (Finish_group::Finish_group): Remove saw_undefined and
10899 this_blocker parameters. Change all callers.
10900 (Finish_group::set_saw_undefined): New function.
10901 (Finish_group::set_blocker): New function.
10902 * symtab.h (class Symbol_table): Change saw_undefined to return
10903 size_t. Change saw_undefined_ field to size_t.
10904 * target-select.cc (Set_target_once::do_run_once): New function.
10905 (Target_selector::Target_selector): Initialize set_target_once_
10906 field. Don't initialize lock_ and initialize_lock_ fields.
10907 (Target_selector::instantiate_target): Rewrite.
10908 (Target_selector::set_target): New function.
10909 * target-select.h (class Set_target_once): Define.
10910 (class Target_selector): Update declarations. Make
10911 Set_target_once a friend. Remove lock_ and initialize_lock_
10912 fields. Add set_target_once_ field.
10913
fa17a3f4
ILT
109142010-02-10 Ian Lance Taylor <iant@google.com>
10915
10916 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
10917 queueing any tasks.
10918 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
10919 (queue_middle_tasks): Add all blockers before queueing any tasks.
10920 (queue_final_tasks): Likewise.
10921 * token.h (Task_token::add_blockers): New function.
10922 * object.h (Input_objects::number_of_relobjs): New function.
10923
c7177d31
ILT
109242010-02-10 Ian Lance Taylor <iant@google.com>
10925
5de0e392
ILT
10926 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
10927 shared, not if not position independent.
10928 * x86_64.cc (Relocate::relocate_tls): Likewise.
10929 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
10930 (tls_pie_pic_test): New target.
10931 * testsuite/Makefile.in: Rebuild.
10932
c7177d31
ILT
10933 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
10934 (tls_test_main_pie.o, tls_test_pie.o): New targets.
10935 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
10936 * testsuite/Makefile.in: Rebuild.
10937
684b268a
DM
109382010-02-09 David S. Miller <davem@davemloft.net>
10939
10940 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
10941 R_SPARC_RELATIVE using ->add_local_relative().
10942 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
10943
612a8d3d
DM
10944 * output.h (Output_data_dynamic::add_section_size): New method
10945 that takes two Output_data objects.
10946 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
10947 entry param. Handle it in initializers.
10948 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
10949 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
10950 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
10951 arg.
10952 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
10953 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
10954 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
10955 for dynrel_includes_plt.
10956 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10957 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10958 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
10959 before .rela.plt
10960 (Target_sparc::do_finalize_sections): Update to pass true for
10961 dynrel_includes_plt.
10962 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
10963 output before .rela.plt
10964 (Target_powerpc::do_finalize_sections): Update to pass true for
10965 dynrel_includes_plt when 32-bit.
10966
cb1be87e
DK
109672010-02-08 Doug Kwan <dougkwan@google.com>
10968
10969 * arm.cc (Arm_relobj::simple_input_section_output_address): New
10970 method.
10971 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
10972 Arm_relobj::scan_section_for_cortex_a8_stubs,
10973 Arm_relobj::do_relocation_section): Instead of calling
10974 Output_section::output_address, use faster
10975 Arm_relobj::simple_input_section_output_address.
10976
705b5121
DM
109772010-02-08 David S. Miller <davem@davemloft.net>
10978
10979 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
10980 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
10981 relocation helper function.
10982
024c4466
DM
10983 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
10984 just like R_SPARC_GOT{10,13,22}.
10985 (Target_sparc::Scan::local): Likewise.
10986 (Target_sparc::Relocate:relocate): Likewise.
10987
9109c078
ILT
109882010-02-06 Ian Lance Taylor <iant@google.com>
10989
10990 * configure.ac: Rewrite targetobjs duplicate removal code to use
10991 only shell constructs.
10992 * configure: Rebuild.
10993
cf846138
DK
109942010-02-05 Doug Kwan <dougkwan@google.com>
10995
10996 PR 11247
10997 * arm.cc (Arm_relobj::section_is_scannable): New method.
10998 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
10999 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
11000
6cfaf60b
DK
110012010-02-04 Doug Kwan <dougkwan@google.com>
11002
11003 PR 11247
11004 * arm-reloc-property.cc (cstdio): Include.
11005 * configure.ac (targetobjs): Remove duplicates.
11006 * configure: Regenerate.
11007 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
11008 big and little endian version for a given address size.
11009
5c57f1be
DK
110102010-02-03 Doug Kwan <dougkwan@google.com>
11011
11012 * arm-reloc-property.cc
11013 (Arm_reloc_property_table::reloc_name_in_error_message): New method
11014 definition.
11015 * arm-reloc-property.h
11016 (Arm_reloc_property_table::get_implemented_static_reloc_property):
11017 New method definition.
11018 (Arm_reloc_property_table::reloc_name_in_error_message): New method
11019 declaration.
11020 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
11021 overflow to N.
11022 (GOT_PREL): Change implemented to Y.
11023 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
11024 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
11025 (Arm_relocate_functions::movw_abs_nc): Remove method.
11026 (Arm_relocate_functions::movt_abs): Ditto.
11027 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
11028 (Arm_relocate_functions::thm_movt_abs): Ditto.
11029 (Arm_relocate_functions::movw_rel_nc): Ditto.
11030 (Arm_relocate_functions::movw_rel): Ditto.
11031 (Arm_relocate_functions::movt_rel): Ditto.
11032 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
11033 (Arm_relocate_functions:thm_movw_rel): Ditto.
11034 (Arm_relocate_functions:thm_movt_rel): Ditto.
11035 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
11036 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
11037 New method definitions.
11038 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
11039 (Arm_relocation_functions::arm_grp_ldr): Ditto.
11040 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
11041 (Arm_relocation_functions::arm_grp_ldc): Ditto.
11042 (Target_arm::Relocate::relocate): Check for non-static or
11043 unimplemented relocation code and exit early. Change calls to
11044 Target_arm::reloc_uses_thumb_bit and
11045 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
11046 instead. Refactor code to handle similar relocations to increase
11047 code sharing. Remove check for unsupported relocation code in switch
11048 statement.
11049 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
11050 relocation property table to find out size. Change error message to
11051 print out the name of a relocation code instead of the numeric value.
11052 (Target_arm::scan_reloc_for_stub): Use relocation property table
11053 instead of calling Target_arm::reloc_uses_thumb_bit().
11054
218c5831
DK
110552010-02-02 Doug Kwan <dougkwan@google.com>
11056
11057 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
11058 types of relaxed input section.
11059
0d31c79d
DK
110602010-02-02 Doug Kwan <dougkwan@google.com>
11061
11062 * Makefile.am (HFILES): Add arm-reloc-property.h.
11063 (DEFFILES): New.
2e702c99
RM
11064 (TARGETSOURCES): Add arm-reloc-property.cc
11065 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
11066 (libgold_a_SOURCES): $(DEFFILES)
11067 * Makefile.in: Regenerate.
11068 * arm-reloc-property.cc: New file.
11069 * arm-reloc-property.h: New file.
11070 * arm-reloc.def: New file.
11071 * arm.cc: Update comments.
11072 (arm-reloc-property.h): New included header.
11073 (arm_reloc_property_table): New global variable.
11074 (Target_arm::do_select_as_default_target): New method definition.
11075 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
11076 arm-reloc-property to targ_extra_obj.
11077 * parameters.cc (set_parameters_target): Call
11078 Target::select_as_default_target().
11079 * target.h (Target::select_as_default_target): New method definition.
11080 (Target::do_select_as_default_target): Same.
11081
546c7457
DK
110822010-02-01 Doug Kwan <dougkwan@google.com>
11083
11084 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
11085 first_output_text_section_.
11086 (Arm_exidx_fixup::first_output_text_section): New method definition.
11087 (Arm_exidx_fixup::first_output_text_section_): New data member.
11088 (Arm_exidx_fixup::process_exidx_section): Record the first text
11089 output section seen.
11090 (Arm_output_section::fix_exidx_coverage): Set correct linked section
11091 and entsize in output section header.
11092
11b861d5
DK
110932010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11094
11095 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
11096 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
11097 (Arm_relocate_functions::thm_alu11): New Method.
11098 (Arm_relocate_functions::thm_pc8): New Method.
11099 (Arm_relocate_functions::thm_pc12): New Method.
11100 (Target_arm::Scan::local): Handle the relocations.
11101 (Target_arm::Scan::global): Likewise.
11102 (Target_arm::Relocate::relocate): Likewise.
11103 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11104
c9a2c125
DK
111052010-01-29 Doug Kwan <dougkwan@google.com>
11106
11107 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
11108 of relocation types as ld.
11109
1521477a
DK
111102010-01-29 Doug Kwan <dougkwan@google.com>
11111
11112 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
11113 to public.
11114 (Arm_relocate_functions::thumb_branch_common): Ditto.
11115 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
11116 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
11117 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
11118 Arm_relocate_functions::jump24): Remove.
11119 (Target_arm::Relocate::relocate): Adjust code to call
11120 Arm_relocation_functions::arm_branch_common and
11121 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 11122 wrappers. Merge switch-cases together to reduce source code size.
1521477a 11123
e7eca48c
DK
111242010-01-29 Doug Kwan <dougkwan@google.com>
11125
11126 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
11127 output_local_symbol_count_needs_update_.
11128 (Arm_relobj::output_local_symbol_count_needs_update,
11129 Arm_relobj::set_output_local_symbol_count_needs_update,
11130 Arm_relobj::update_output_local_symbol_count): New methods.
11131 (Arm_relobj::output_local_symbol_count_needs_update_): New data
11132 member.
11133 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
11134 of pointed function as in a R_ARM_PREL31 relocation.
11135 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
11136 for output local symbol count updating.
11137 (Target_arm::do_relax): Update output local symbol counts in objects
11138 if necessary.
11139 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
11140
02961d7e
ILT
111412010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11142
11143 * arm.cc: Added support for the ARM relocations:
11144 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
11145 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
11146 (Arm_relocate_functions::movw_rel_nc): Renamed (was
11147 movw_prel_nc).
11148 (Arm_relocate_functions::movw_rel): New method.
11149 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
11150 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
11151 thm_movw_prel_nc).
11152 (Arm_relocate_functions::thm_movw_rel): New method.
11153 (Arm_relocate_functions::thm_movt_rel): Renamed (was
11154 thm_movt_prel).
11155 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
11156 relocations.
11157 (Target_arm::Scan::global): Likewise.
11158 (Target_arm::Relocate::relocate): Likewise.
11159 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11160 Likewise.
11161
b10d2873
ILT
111622010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11163
11164 * arm.cc: Added support for ARM group relocations.
11165 (Target_arm::reloc_needs_sym_origin): New method.
11166 (Arm_relocate_functions::calc_grp_kn): New method.
11167 (Arm_relocate_functions::calc_grp_residual): New method.
11168 (Arm_relocate_functions::calc_grp_gn): New method.
11169 (Arm_relocate_functions::arm_grp_alu): New Method.
11170 (Arm_relocate_functions::arm_grp_ldr): New Method.
11171 (Arm_relocate_functions::arm_grp_ldrs): New Method.
11172 (Arm_relocate_functions::arm_grp_ldc): New Method.
11173 (Target_arm::Scan::local): Handle the ARM group relocations.
11174 (Target_arm::Scan::global): Likewise.
11175 (Target_arm::Relocate::relocate): Likewise.
11176 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11177 Likewise.
11178
2b328d4e
DK
111792010-01-26 Doug Kwan <dougkwan@google.com>
11180
11181 * arm.cc (set): Include.
11182 (class Arm_exidx_fixup): Change type of last_input_section_ to const
11183 pointer type.
2e702c99 11184 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
11185 (Arm_output_section::append_text_sections_to_list): New method.
11186 (Arm_output_section::fix_exidx_coverage): Ditto.
11187 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 11188 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
11189 Relobj::set_section_offset() instead of
11190 Sized_relobj::invalidate_section_offset().
2e702c99 11191 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
11192 parameter for section headers. Ignore relocation sections for
11193 unallocated sections and EXIDX sections.
11194 (Target_arm::fix_exidx_coverage): New method.
11195 (Target_arm::output_section_address_less_than): New type.
11196 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
11197 linked text section instead of the EXIDX section.
11198 (Arm_output_section::create_stub_group): Add an assertion to check
11199 that this is not an EXIDX output section.
11200 (Arm_output_section::append_text_sections_to_list): New method.
11201 (Arm_output_section::fix_exidx_coverage): Ditto.
11202 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 11203 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
11204 (Target_arm::do_relax): Fix EXIDX output section coverage in the
11205 first pass.
11206 (Target_arm::fix_exidx_coverage): New method.
11207 * object.h (Relobj::set_output_section): New method.
11208 (Sized_relobj::invalidate_section_offset): Remove method.
11209 (Sized_relobj::do_invalidate_section_offset): Remove method.
11210 (Sized_relobj::do_set_section_offset): Handle offset value -1.
11211
c7f3c371
DK
112122010-01-25 Doug Kwan <dougkwan@google.com>
11213
11214 * arm.cc (Arm_exidx_merged_section::do_output_offset):
11215 Fix warning due to signed and unsigned comparison on a 32-bit host.
11216
8923b24c
DK
112172010-01-22 Doug Kwan <dougkwan@google.com>
11218
11219 * arm.cc (Target_arm::do_relax): Record an output section for section
11220 offset adjustment it contains any stub table that has changed.
11221 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
11222 offsets in an output section if necessary.
11223 * output.cc (Output_section::Output_section): Initialize
11224 section_offsets_need_adjustments_.
11225 (Output_section::add_input_section_for_script): Renamed to
11226 Output_section::add_simple_input_section.
11227 (Output_section::save_states): Add a comment.
11228 (Output_section::discard_states): New method defintion.
11229 (Output_section::adjust_section_offsets): Same.
11230 * output.h (Output_section::add_input_section_for_script): Renamed to
11231 Output_section::add_simple_input_section.
11232 (Output_section::discard_states): New method declaration.
11233 (Output_section::adjust_section_offsets): Same.
11234 (Output_section::section_offsets_need_adjustment,
11235 Output_section::set_section_offsets_need_adjustment): New method
11236 definitions.
11237 (Output_section::section_offsets_need_adjustment_): New data member.
11238 * script-sections.cc
11239 (Output_section_element_input::set_section_address): Adjust code for
11240 renaming of Output_section::add_input_section_for_script.
11241 (Orphan_output_section::set_section_address): Same.
11242
9b2fd367
DK
112432010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11244
11245 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
11246 Fix_v4bx enum values .
11247 * gold/options.h (General_options): New option definitions.
11248 (General_options::fix_v4bx): New method.
11249 (General_options::Fix_v4bx): New enum.
11250 * gold/options.cc (General_options::parse_fix_v4bx): New method.
11251 (General_options::parse_fix_v4bx_interworking): New method.
11252
80d0d023
DK
112532010-01-22 Doug Kwan <dougkwan@google.com>
11254
11255 * arm.cc (Arm_exidx_fixup): New class.
11256
af2cdeae
DK
112572010-01-21 Doug Kwan <dougkwan@google.com>
11258
11259 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
11260 classes.
11261 (Arm_exidx_section_offset_map): New type.
11262
993d07c1
DK
112632010-01-21 Doug Kwan <dougkwan@google.com>
11264
11265 * arm.cc (Arm_exidx_input_section): New class.
11266 (Arm_relobj::exidx_input_section_by_link,
11267 Arm_relobj::exidx_input_section_by_shndx,
11268 Arm_relobj::make_exidx_input_section): New methods.
11269 (read_arm_attributes_section): Remove.
11270 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
11271 information about them.
11272 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
11273 to here.
11274
5ac169d4
DK
112752010-01-20 Doug Kwan <dougkwan@google.com>
11276
11277 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
11278 Input_section_specifier to Section_id.
11279 (Target_arm::new_arm_input_section: Adjust code for change of key
11280 type.
11281 (Target_arm::find_arm_input_section): Ditto.
11282 * gc.h (object.h): Include for Section_id nand Section_id_hash.
11283 (Section_id): Remove.
11284 (Garbage_collection::Section_id_hash): Remove.
11285 * icf.h (object.h): Include for Section_id nand Section_id_hash.
11286 (Section_id): Remove.
11287 (Icf::Section_id_hash): Remove.
11288 * object.h (Section_id, Const_section_id, Section_id_hash,
11289 Const_section_id_hash): New type definitions.
11290 * output.cc (Output_section::add_relaxed_input_section): Change to
11291 use Const_section_id instead of Input_section_specifier as key type.
11292 (Output_section::add_merge_input_section): Ditto.
11293 (Output_section::build_relaxation_map): Change to use Section_id
11294 instead of Input_section_specifier as key type.
2e702c99 11295 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
11296 Ditto.
11297 (Output_section::convert_input_sections_to_relaxed_sections): Change
11298 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 11299 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
11300 (Output_section::find_relaxed_input_section): Ditto.
11301 * output.h (Input_section_specifier): Remove class.
11302 (Output_section::Output_section_data_by_input_section_map): Change
11303 key type to Const_section_id.
11304 (Output_section::Output_relaxed_input_section_by_input_section_map):
11305 Ditto.
11306 (Output_section::Relaxation_map): Change key type to Section_id.
11307
a2162063
ILT
113082010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11309
11310 * gold/arm.cc: Added support for R_ARM_V4BX relocation
11311 (class Arm_v4bx_stub): New class.
11312 (DEF_STUBS): Updated definition to support v4_veneer_bx.
11313 (Stub_factory::make_arm_v4bx_stub): New method.
11314 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
11315 (Stub_table::empty): Handle v4bx stubs.
11316 (Stub_table::add_arm_v4bx_stub): New method.
11317 (Stub_table::find_arm_v4bx_stub): New method.
11318 (Arm_relocate_functions::v4bx): New method.
11319 (Target_arm::fix_v4bx): New method.
11320 (Target_arm::Target_arm): Handle R_ARM_V4BX.
11321 (Stub_table::relocate_stubs): Likewise.
11322 (Stub_table::do_write): Likewise.
11323 (Stub_table::update_data_size_and_addralign): Likewise.
11324 (Stub_table::finalize_stubs): Likewise.
11325 (Target_arm::Scan::local): Likewise.
11326 (Target_arm::Scan::global): Likewise.
11327 (Target_arm::do_finalize_sections): Likewise.
11328 (Target_arm::Relocate::relocate): Likewise.
11329 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11330 Likewise.
11331 (Target_arm::scan_reloc_for_stub): Likewise.
11332 (Target_arm::scan_reloc_section_for_stubs): Likewise.
11333
5696ab0b
ILT
113342010-01-19 Ian Lance Taylor <iant@google.com>
11335
11336 * output.cc (Output_section_headers::do_sized_write): Write large
11337 segment count to sh_info field.
11338 (Output_file_header::do_sized_write): For large segment count,
11339 write PN_XNUM to e_phnum field.
11340
800d0f56
ILT
113412010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11342
11343 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
11344 (Arm_relocate_functions::thm_jump8): New function.
11345 (Arm_relocate_functions::thm_jump11): New function.
11346 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
11347 R_ARM_THM_JUMP11.
11348 (Target_arm::Scan::global): Likewise.
11349 (Target_arm::Relocate::relocate): Likewise.
11350 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11351 Likewise.
11352
41263c05
DK
113532010-01-14 Doug Kwan <dougkwan@google.com>
11354
11355 * arm.cc (map, utility): Include headers.
11356 (Target_arm::apply_cortex_a8_workaround): New method.
11357 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
11358 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
11359 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
11360 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
11361 the --[no-]fix-cortex-a8 command line options.
11362 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
11363 (Target_arm::relocate_stub): Use addend in instruction template.
11364 * options.h (DEFINE_bool): Set the user-set flag.
11365 (General_options): Add --[no-]-fix-cortex options.
11366 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 11367 : Update fast look-up map after conversion.
41263c05 11368
459e9b03
ST
113692010-01-14 Sriraman Tallam <tmsriram@google.com>
11370
11371 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
11372 in the first pass of do_layout.
11373
b521dfe4
DK
113742010-01-13 Doug Kwan <dougkwan@google.com>
11375
11376 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11377 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
11378 apparent compiler problem of not folding static constant integral
11379 data members of elfcpp::Elf_sizes<32>.
11380
44272192
DK
113812010-01-13 Doug Kwan <dougkwan@google.com>
11382
11383 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11384 Arm_relobj::section_needs_cortex_a8_stub_scanning,
11385 Arm_relobj::scan_section_for_cortex_a8_erratum,
11386 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
11387 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
11388 sections to scan for relocation stubs into a new method
11389 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
11390 relocation and Cortex-A8 stub scanning.
11391 (Target_arm::do_relax): Force stubs to be after stubbed sections
11392 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 11393 the beginning of a new relaxation pass. Update a comment.
44272192
DK
11394 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
11395
44b71ece
ILT
113962010-01-12 Ian Lance Taylor <iant@google.com>
11397
11398 * target-reloc.h (visibility_error): New inline function.
11399 (relocate_section): Call visibility_error.
11400 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
11401 (MOSTLYCLEANFILES): Likewise.
11402 (protected_4_pic.o, protected_3.err): New targets.
11403 * testsuite/protected_4.cc: New file.
11404
a120bc7f
DK
114052010-01-12 Doug Kwan <dougkwan@google.com>
11406
11407 * arm.cc (Cortex_a8_reloc): New class.
11408 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
11409 and cortex_a8_relocs_info_.
11410 (Target_arm::fix_cortex_a8): New method definition.
11411 (Target_arm::Cortex_a8_relocs_info): New type.
11412 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
11413 New data member declarations.
11414 (Target_arm::scan_reloc_for_stub): Record information about
11415 relocations for THUMB branches that might be exempted from the
11416 Cortex-A8 workaround.
11417 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
11418 at the beginning of a relaxation pass.
11419
20138696
DK
114202010-01-12 Doug Kwan <dougkwan@google.com>
11421
11422 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
11423 (Arm_relobj::Mapping_symbol_position,
11424 Arm_reloj::Mapping_symbol_position_less,
11425 Arm_relobj::Mapping_symbols_info): New types.
11426 (Target_arm::is_mapping_symbol_name): New method definition.
11427 (Arm_relobj::do_count_local_symbols): Save information about mapping
11428 symbols.
11429
089d69dc
DK
114302010-01-11 Doug Kwan <dougkwan@google.com>
11431
11432 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
11433 Arm_relocate_functions::thumb32_branch_upper,
11434 Arm_relocate_functions::thumb32_branch_lower,
11435 Arm_relocate_functions::thumb32_cond_branch_offset,
11436 Arm_relocate_functions::thumb32_cond_branch_upper,
11437 Arm_relocate_functions::thumb32_cond_branch_lower,
11438 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
11439 branch offset encoding.
11440 (Arm_relocate_functions::thumb_branch_common): Use new branch
11441 offset encoding methods to avoid code duplication.
11442 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
11443 (Stub_addend_reader::operator()): Use new branch encoding method
11444 to avoid code duplication.
11445
99e5bff2
DK
114462010-01-11 Doug Kwan <dougkwan@google.com>
11447
11448 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
11449 (Target_arm::do_finalize_sections): Define special EXIDX section
11450 symbols only if referenced.
11451 * gc.h (Garbage_collection::add_reference): New method.
11452 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
11453 code duplication.
11454
98e090bd
ILT
114552010-01-11 Ian Lance Taylor <iant@google.com>
11456
d0a91bd8
ILT
11457 * script.cc (Version_script_info::build_expression_list_lookup):
11458 Change complaing about duplicate wildcard match from error to
11459 warning.
11460
98e090bd
ILT
11461 * script.cc (class Lazy_demangler): Recreate--revert part of patch
11462 of 2009-12-30.
11463 (Version_script_info::Version_script_info): Initialize globs_,
11464 default_version_, default_is_global_, and exact_. Don't
11465 initialize globals_ or locals_.
11466 (Version_script_info::build_lookup_tables): Build local symbols
11467 first.
11468 (Version_script_info::unquote): New function.
11469 (Version_script_info::add_exact_match): New function.
11470 (Version_script_info::build_expression_list_lookup): Remove lookup
11471 parameter. Add is_global parameter. Change all callers. Handle
11472 wildcard pattern specially. Unquote pattern. Call
11473 add_exact_match.
11474 (Version_script_info::get_name_to_match): New function.
11475 (Version_script_info::get_symbol_version): New function.
11476 (Version_script_info::get_symbol_version_helper): Remove.
11477 (Version_script_info::check_unmatched_names): Call unquote.
11478 * script.h (class Version_script_info): Change get_symbol_version
11479 to be non-inline and add is_global parameter; change all callers.
11480 Rewrite symbol_is_local. Update declarations. Define struct
11481 Version_tree_match, Exact, Globs. Don't define struct Lookup.
11482 Remove globals_ and locals_ members. Add exact_, globs_,
11483 default_version_, is_global_.
11484 (Version_script_info::Glob): Remove pattern, add expression and
11485 is_global. Update constructor. Change all callers.
11486 * dynobj.cc (Versions::finalize): Mark the version symbol as the
11487 default version.
11488 (Versions::symbol_section_contents): If a symbol is undefined, or
11489 defined in a dynamic object, set the version index to
11490 VER_NDX_LOCAL.
11491 * symtab.cc (Symbol_table::add_from_relobj): Don't call
11492 symbol_is_local.
11493 (Symbol_table::add_from_pluginobj): Likewise.
11494 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
11495
d56962d3
DK
114962010-01-11 Doug Kwan <dougkwan@google.com>
11497
11498 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
11499 (incremental_dump_LDADD): Add linking option for libintl.
11500 * Makefile.in: Regenerate.
11501
94e6ee91
L
115022010-01-11 H.J. Lu <hongjiu.lu@intel.com>
11503
11504 PR gold/11144
11505 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
11506 instead of -Ds.
11507 * testsuite/Makefile.in: Regenerated.
11508
e96c574b
DK
115092010-01-10 Doug Kwan <dougkwan@google.com>
11510
11511 * options.h (DEFINE_var): Use parentheses around argument varname__
11512 in macro body to avoid any unintended subsequent substitutions.
11513
7198066b
ILT
115142010-01-10 Ian Lance Taylor <iant@google.com>
11515
ba4d53bf
ILT
11516 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
11517 candidates before doing symbol resolution.
11518
7198066b
ILT
11519 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
11520 ODR candidates if only one is weak.
11521
a2beed37
ILT
115222010-01-08 Ian Lance Taylor <iant@google.com>
11523
11524 * script.cc (Version_script_info::build_expression_list_lookup):
11525 Don't warn about ambiguous version, just record the ambiguity.
11526 (Version_script_info::get_symbol_version_helper): Give error if
11527 version is ambiguous.
11528
2fb7225c
DK
115292010-01-08 Doug Kwan <dougkwan@google.com>
11530
11531 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
11532 prev_data_size_ and prev_addralign_. Remove initializer for
11533 deleted data member has_been_changed_.
11534 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
11535 to determine if the table is empty.
11536 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
11537 Remove.
11538 (Stub_table::add_reloc_stub): Define method in class definition
11539 instead of just declaring it there.
11540 (Stub_table::add_cortex_a8_stub): New method definition.
11541 (Stub_table::update_data_size_and_addralign): Ditto.
11542 (Stub_table::finalize_stubs): Ditto.
11543 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
11544 (Stub_table::do_addralign_): Return address alignment in the
11545 (Stub_table::do_reset_address_and_file_offset): Define method in
11546 class definition instead of declaring it there. Set current data
11547 size to be the data size of the previous pass.
11548 (Stub_table::set_final_data_size): Use current data size as the
11549 final data size.
11550 (Stub_table::relocate_stub): Change parameter type of stub from
11551 Reloc_stub pointer to Stub pointer.
11552 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
11553 (Stub_table::Cortex_a8_stub_list): New typedef.
11554 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
11555 Stub_table::prev_addralign_): New data member.
11556 (Arm_relobj::Arm_relobj): Initialize data member
11557 section_has_cortex_a8_workaround_.
11558 (Arm_relobj::section_has_cortex_a8_workaround,
11559 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
11560 definitions.
11561 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
11562 declarations.
11563 (Target_arm::relocate_stub): Change parameter type of stub from
11564 Reloc_stub pointer to Stub pointer.
11565 (Insn_template::size, Insn_template::alignment): Handle
11566 THUMB16_SPECIAL_TYPE.
11567 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
11568 Stub_table::update_data_size_and_addralign,
11569 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
11570 definitions.
11571 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
11572 (Stub_table::do_write): Ditto.
11573 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 11574
880cd20d
ILT
115752010-01-08 Ian Lance Taylor <iant@google.com>
11576
11577 PR 11108
11578 * symtab.h (class Symbol): Remove fields is_target_special_ and
11579 has_plt_offset_. Add field is_defined_in_discarded_section_.
11580 (Symbol::is_defined_in_discarded_section): New function.
11581 (Symbol::set_is_defined_in_discarded_section): New function.
11582 (Symbol::has_plt_offset): Rewrite.
11583 (Symbol::set_plt_offset): Verify that new offset is not -1U.
11584 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
11585 Don't initialize is_target_special_ or has_plt_offset_.
11586 Initialize is_defined_in_discarded_section_.
11587 (Symbol_table::add_from_relobj): If appropriate, set
11588 is_defined_in_discarded_section.
11589 * resolve.cc (Symbol::override_base_with_special): Don't test
11590 is_target_special_. Change has_plt_offset_ to has_plt_offset().
11591 * target-reloc.h (relocate_section): Do special handling for
11592 symbols defined in discarded sections for global symbols as well
11593 as local symbols.
11594
2703e3eb
ILT
115952010-01-08 Ian Lance Taylor <iant@google.com>
11596
11597 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
11598 the SHT_SYMTAB case.
11599
339d40a3
ILT
116002010-01-08 Ian Lance Taylor <iant@google.com>
11601
11602 * object.cc (Sized_relobj::do_layout): Don't get confused if
11603 layout_eh_frame returns NULL.
11604
abecea76
ILT
116052010-01-08 Ian Lance Taylor <iant@google.com>
11606
11607 PR 11084
11608 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
11609 dynamic symbol table, use the normal symbol table.
11610 (Sized_dynobj::do_read_symbols): Remove assertion about type of
11611 symbol table.
11612
6b7dd3f3
ILT
116132010-01-08 Ian Lance Taylor <iant@google.com>
11614
11615 PR 11072
11616 * layout.cc (Layout::include_section): Remove .gnu_debuglink
11617 sections.
11618
36c50e63
L
116192010-01-08 H.J. Lu <hongjiu.lu@intel.com>
11620
11621 * version.cc (print_version): Change to "Copyright 2010".
11622
e291e7b9
ILT
116232010-01-08 Ian Lance Taylor <iant@google.com>
11624
11625 PR 10287
11626 PR 11063
11627 * i386.cc (class Target_i386): Change return type of plt_section
11628 to be non-const.
11629 (class Output_data_plt_i386): Add tls_desc_rel_ field.
11630 (Output_data_plt_i386::Output_data_plt_i386): Initialize
11631 tls_desc_rel_ field.
11632 (Output_data_plt_i386::rel_tls_desc): New function.
11633 (Target_i386::rel_tls_desc_section): New function.
11634 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
11635 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
11636 R_386_TLS_DESC reloc in rel_tls_desc_section.
11637 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
11638 Define struct Tlsdesc_info.
11639 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
11640 (Target_x86_64::do_reloc_symbol_index): New function.
11641 (Target_x86_64::add_tlsdesc_info): New function.
11642 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
11643 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
11644 tlsdesc_rel_ field.
11645 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
11646 all callers.
11647 (Output_data_plt_x86_64::rela_tlsdesc): New function.
11648 (Target_x86_64::rela_tlsdesc_section): New function.
11649 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
11650 handling.
11651 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
11652 (Target_x86_64::do_reloc_addend): New function.
11653 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
11654 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
11655 declarations. Define TARGET_CODE. Add arg field to u1_ union.
11656 (Output_reloc::type): New function.
11657 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
11658 (Output_reloc::is_target_specific): New function.
11659 (Output_reloc::target_arg): New function.
11660 (class Output_reloc) [SHT_RELA]: Add four new constructors for
11661 absolute relocs and target specific relocs.
11662 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
11663 add_target_specific.
11664 (class Output_data_reloc) [SHT_RELA]: Likewise.
11665 * output.cc (Output_reloc::Output_reloc): Add four new versions
11666 for absolute relocs and target specific relocs.
11667 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
11668 (Output_reloc::get_symbol_index): Likewise.
11669 (Output_reloc::local_section_offset): Check that local_sym_index_
11670 is not TARGET_CODE or 0.
11671 (Output_reloc::symbol_value): Likewise.
11672 (Output_reloc::write) [SHT_RELA]: Call target for target specific
11673 reloc.
11674 * target.h (class Target): Add reloc_symbol_index and reloc_addend
11675 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
11676 functions.
11677 * layout.cc (add_target_dynamic_tags): Use output section for
11678 DT_PLTRELSZ and DT_JMPREL.
11679
3a44184e
ILT
116802010-01-07 Ian Lance Taylor <iant@google.com>
11681
11682 PR 11061
11683 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
11684 function.
11685 (class Output_data_reloc_generic): Define.
11686 (class Output_data_reloc_base): Change base class to
11687 Output_data_reloc_generic. Change add() method to call
11688 bump_relative_reloc_count for a relative reloc. Remove
11689 sort_relocs_ field.
11690 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
11691 to sort_relocs().
11692 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
11693 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
11694 appropriate.
11695 * layout.h (class Layout): Update declaration.
11696
ea715a34
ILT
116972010-01-07 Ian Lance Taylor <iant@google.com>
11698
11699 * output.h (class Output_data): Add const version of
11700 output_section and do_output_section.
11701 (class Output_section_data): Add const version of
11702 do_output_section.
11703 (class Output_section): Likewise.
11704 * layout.cc (Layout::add_target_dynamic_tags): New function.
11705 * layout.h (class Layout): Update declarations.
11706 * arm.cc (Target_arm::do_finalize_sections): Use
11707 add_target_dynamic_tags.
11708 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11709 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11710 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11711 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11712
659948a4
ILT
117132010-01-07 Ian Lance Taylor <iant@google.com>
11714
11715 PR 11042
11716 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
11717 object as needed.
11718
9d3b86f6
ILT
117192010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
11720 Ian Lance Taylor <iant@google.com>
11721
11722 PR 11019
11723 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
11724 Xindex::read_symtab_xindex.
11725
bb0d3eb0
DK
117262010-01-07 Doug Kwan <dougkwan@google.com>
11727
11728 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
11729 (Insn_template::thumb16_bcond_insn): New method declaration.
11730 (Insn_template): Fix spelling.
11731 (Stub::thumb16_special): New method declaration.
11732 (Stub::do_write): Define virtual method which was previously pure
11733 virtual.
11734 (Stub::do_thumb16_special): New method declaration.
11735 (Stub::do_fixed_endian_write): New template member.
11736 (Reloc_stub::do_write): Remove.
11737 (Reloc_stub::do_fixed_endian_write): Remove.
11738 (Cortex_a8_stub): New class definition.
11739 (Stub_factory::make_cortex_a8_stub): New method definition.
11740 (Stub_factory::Stub_factory): Add missing static storage class
11741 qualifier for elf32_arm_stub_a8_veneer_blx.
11742
ffeef7df
ILT
117432010-01-07 Ian Lance Taylor <iant@google.com>
11744
dc3f80fe
ILT
11745 PR 10980
11746 * options.h (class General_options): Add --warn-unresolved-symbols
11747 and --error-unresolved-symbols.
11748 * errors.cc (Errors::undefined_symbol): Implement
11749 --warn-unresolved-symbols.
11750
ffeef7df
ILT
11751 * options.h (class General_options): Add -z text and -z textoff.
11752 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
11753
f1ec9ded
ST
117542010-01-06 Sriraman Tallam <tmsriram@google.com>
11755
11756 * gc.h (Garbage_collection::Cident_section_map): New typedef.
11757 (Garbage_collection::cident_sections): New function.
11758 (Garbage_collection::add_cident_section): New function.
11759 (Garbage_collection::cident_sections_): New member.
11760 (gc_process_relocs): Add references to sections whose names are C
11761 identifiers.
11762 * gold.h (cident_section_start_prefix): New constant.
11763 (cident_section_stop_prefix): New constant.
11764 (is_cident): New function.
11765 * layout.cc (Layout::define_section_symbols): Replace string constants
11766 with the newly defined constants.
11767 * object.cc (Sized_relobj::do_layout): Track sections whose names are
11768 C identifiers.
11769 * testsuite/Makefile.am: Add gc_orphan_section_test.
11770 * testsuite/Makefile.in: Regenerate.
11771 * testsuite/gc_orphan_section_test.cc: New file.
11772 * testsuite/gc_orphan_section_test.sh: New file.
11773
6eda8c29
ILT
117742010-01-06 Ian Lance Taylor <iant@google.com>
11775
b9674e17
ILT
11776 PR 10980
11777 * options.h (class General_options): Add --warn-shared-textrel.
11778 * layout.cc (Layout::finish_dynamic_section): Implement
11779 --warn-shared-textrel.
11780
6eda8c29
ILT
11781 PR 10980
11782 * options.h (class General_options): Add --warn-multiple-gp.
11783
32dcd44e
ILT
117842010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11785
11786 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
11787 $(THREADSLIB) and $(LIBDL).
11788 * Makefile.in: Rebuild.
11789
a192ba05
ILT
117902010-01-06 Ian Lance Taylor <iant@google.com>
11791
11792 PR 10980
11793 * options.cc (General_options::parse_section_start): New function.
11794 (General_options::section_start): New function.
11795 (General_options::General_options): Initialize all members.
11796 * options.h: Include <map>
11797 (class General_options): Add --section-start. Add section_starts_
11798 member.
11799 * layout.cc (Layout::attach_allocated_section_to_segment): If
11800 --section-start was used, set the address of the segment. Remove
11801 local sort_sections.
11802 (Layout::relaxation_loop_body): If the address of the load segment
11803 has been set by --section-start, don't use it.
11804 * output.h (Output_segment::update_flags_for_output_section): New
11805 function.
11806 * output.cc (Output_segment::add_output_section): Call
11807 update_flags_for_output_section.
11808
dde3f402
ILT
118092010-01-05 Ian Lance Taylor <iant@google.com>
11810
62dfdd4d
ILT
11811 PR 10980
11812 * options.h (class General_options): Add --undefined-version.
11813 * script.cc (struct Version_expression): Add was_matched_by_symbol
11814 field.
11815 (Version_script_info::matched_symbol): New function.
11816 (Version_script_info::get_symbol_version_helper): Call
11817 matched_symbol.
11818 (Version_script_info::check_unmatched_names): New function.
11819 * script.h (class Version_script_info): Update declarations.
11820 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
11821
9c4ae156
ILT
11822 * options.h (class General_options): Use DEFINE_bool_alias for
11823 allow_multiple_definition.
11824 * resolve.cc (Symbol_table::should_override): Don't test
11825 allow_multiple_definition.
11826
dde3f402
ILT
11827 PR 10980
11828 * options.h (class General_options): Add --cref.
11829 * main.cc (main): Print cref table if --cref. Don't close mapfile
11830 until after printing cref table.
11831 * cref.cc: Include "symtab.h".
11832 (class Cref_inputs): Define Cref_table_compare and Cref_table.
11833 (Cref_table_compare::operator()): New function.
11834 (Cref_inputs::gather_cref): New function.
11835 (filecol): New static const.
11836 (Cref_inputs::print_cref): New function.
11837 (Cref::print_cref): New function.
11838 * cref.h: Include <cstdio>.
11839 (class Cref): Update declarations.
11840 * mapfile.h (Mapfile::file): New function.
11841 * object.h (class Object): Define Symbols. Declare virtual
11842 do_get_global_symbols.
11843 (Object::get_global_symbols): New function.
11844 * object.cc (Input_objects::add_object): Pass object to cref_ if
11845 --cref.
11846 (Input_objects::archive_start): Likewise.
11847 (Input_objects::archive_stop): Likewise.
11848 (Input_objects::print_cref): New function.
11849 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
11850 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
11851 --cref.
11852 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
11853 function.
11854 * plugin.h (class Sized_pluginobj): Update declarations.
11855
8781f709
ILT
118562010-01-05 Ian Lance Taylor <iant@google.com>
11857
11858 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
11859 to is_default_version. Rename insdef to insdefault.
11860 (Symbol_table::add_from_relobj): Rename def to is_default_version
11861 and local to is_forced_local.
11862 (Symbol_table::add_from_pluginobj): Likewise.
11863 (Symbol_table::add_from_dynobj): Likewise.
11864 (Symbol_table::define_special_symbol): Rename insdef to
11865 insdefault.
11866
fe35d28d
ILT
118672010-01-04 Ian Lance Taylor <iant@google.com>
11868
30bc8c46
ILT
11869 PR 10980
11870 * options.h (class General_options): Add
11871 --allow-multiple-definition and -z muldefs.
11872 * resolve.cc (Symbol_table::should_override): Don't warn about a
11873 multiple symbol definition if --allow-multiple-definition or -z
11874 muldefs.
11875
7eaea549
ILT
11876 PR 10980
11877 * options.h (class General_options): Add --add-needed and
11878 --copy-dt-needed-entries. Tweak --as-needed help entry.
11879 * object.cc (Input_objects::check_dynamic_dependencies): Give an
11880 error if --copy-dt-needed-entries aka --add-needed is used and
11881 would cause a change in behaviour.
11882
fe35d28d
ILT
11883 PR 10980
11884 * options.h (class General_options): Add -G as a short version of
11885 --shared. Add no-op options -assert, -g, and -i.
11886
55a2bb35
ST
118872010-01-04 Sriraman Tallam <tmsriram@google.com>
11888
11889 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
11890 check for .text or .gnu.linkonce.t sections.
11891 * icf.cc (Icf::find_identical_sections): Ditto.
11892 Change the detection for mangled function name within the section
11893 name.
11894 * icf.h (is_section_foldable_candidate): New function.
11895
719328e1
ILT
118962009-12-30 Ian Lance Taylor <iant@google.com>
11897
11898 PR 10980
11899 * options.h (class General_options): Permit two dashes with
11900 --retain-symbols-file.
11901
d7bb5745
ILT
119022009-12-30 Ian Lance Taylor <iant@google.com>
11903
403a15dd
ILT
11904 PR 10979
11905 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
11906 don't put the file header and segment headers in the text
11907 segment.
11908
eda294df
ILT
11909 PR 10979
11910 * common.cc (Sort_commons::operator()): Stabilize sort when both
11911 entries are NULL.
11912 (Symbol_table::do_allocate_commons_list): When allocating common
11913 symbols, skip a symbol which is no longer common.
11914 * symtab.h (Symbol::is_common): Test whether the symbol comes from
11915 an object before checking its type.
11916 * testsuite/common_test_2.c: New file.
11917 * testsuite/common_test_3.c: New file.
11918 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
11919 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
11920 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
11921 (common_test_2_pic.o, common_test_2.so): New targets.
11922 (common_test_3_pic.o, common_test_3.so): New targets.
11923 * testsuite/Makefile.in: Rebuild.
11924
d7bb5745
ILT
11925 PR 10979
11926 * script.cc (read_input_script): If we see a new SECTIONS clause,
11927 and we have added an input section, give an error.
11928 * layout.h (class Layout): Add have_added_input_section function.
11929 Add have_added_input_section_ field.
11930 * layout.cc (Layout::Layout): Initialize
11931 have_added_input_section_.
11932 (Layout::layout): Set have_added_input_section_.
11933 (Layout::layout_eh_frame): Likewise.
11934
fc59c572
ILT
119352009-12-30 Ian Lance Taylor <iant@google.com>
11936
11937 PR 10931
11938 * options.h (class General_options): Add --sort-common option.
11939 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
11940 * common.cc (Sort_common): Add sort_order parameter to
11941 constructor. Add sort_order_ field.
11942 (Sort_commons::operator): Check sort_order_.
11943 (Symbol_table::allocate_commons): Determine the sort order.
11944 (Symbol_table::do_allocate_commons): Add sort_order parameter.
11945 Change all callers.
11946 (Symbol_table::do_allocate_commons_list): Likewise.
11947
1c74fab0
ILT
119482009-12-30 Ian Lance Taylor <iant@google.com>
11949
11950 PR 10916
11951 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
11952 symbols from this object, don't change the visibility of an
11953 undefined symbol.
11954 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
11955
6affe781
ILT
119562009-12-30 Ian Lance Taylor <iant@google.com>
11957
11958 PR 10861
11959 * script.h (class Version_script_info): Define Language enum.
11960 Update declarations. Define Glob, Exact, and Lookup types. Add
11961 new fields globals_, locals_, and is_finalized_.
11962 * script.cc: Various formatting fixes.
11963 (class Parser_closure): Change language_stack_ from a vector of
11964 std::string to one of Version_script_info::Language. Adjust all
11965 uses accordingly.
11966 (class Lazy_demangler): Remove.
11967 (struct Version_expression): Change language from std::string to
11968 Version_script_info::Language.
11969 (Version_script_info::Version_script_info): New function.
11970 (Version_script_info::~Version_script_info): Don't call clear.
11971 (Version_script_info::finalize): New function.
11972 (Version_script_info::build_lookup_tables): New function.
11973 (Version_script_info::build_expression_list_lookup): New
11974 function.
11975 (Version_script_info::get_symbol_version_helper): Rewrite to use
11976 lookup tables.
11977 (Version_script_info::print_expression_list): Adjust to use
11978 Version_script_info::Language.
11979 (script_push_lex_into_version_mode): Check that the version script
11980 has not been finalized.
11981 (version_script_push_lang): Change language string to
11982 Version_script_info::Language.
11983 * options.cc (Command_line::version_script): New function.
11984 * options.h (class General_options): Add finalize_dynamic_list
11985 function. Change version_script from declaration to definition.
11986 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
11987 * testsuite/version_script.map: Remove duplicate def of foo.
11988 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
11989 version_script.map.
11990 * testsuite/Makefile.in: Rebuild.
11991
818bf354
ILT
119922009-12-30 Ian Lance Taylor <iant@google.com>
11993
11994 PR 10843
11995 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
11996 if the input symbol index is 0, make the output symbol index 0.
11997
ebcc8304
ILT
119982009-12-30 Ian Lance Taylor <iant@google.com>
11999
12000 PR 10670
12001 * options.h (class General_options): Add -x/--discard-all.
12002 * object.cc (Sized_relobj::do_count_local_symbols): Handle
12003 --discard-all. If the local symbol needs a dynamic entry, check
12004 that before handling --discard-locals.
12005
176fe33f
ILT
120062009-12-30 Ian Lance Taylor <iant@google.com>
12007
bb321bb1
ILT
12008 PR 10450
12009 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
12010 flags to PF_R.
12011 (Output_segment::add_output_section): Don't change the flags if
12012 the type is PT_TLS.
12013
176fe33f
ILT
12014 PR 10450
12015 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
12016 GNU hash table if they need a dynamic value. Otherwise, don't add
12017 them if they are defined in a dynamic object or are forced local.
12018
e8cd95c7
ILT
120192009-12-29 Ian Lance Taylor <iant@google.com>
12020
1b81fb71
ILT
12021 PR 10450
12022 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
12023 .gnu.hash table for a 32-bit target.
12024
8d6d383d
ILT
12025 PR 10450
12026 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
12027 regular and a dynamic object only needs a dynamic symbol table
12028 entry if it is externally visible.
12029
e785ec03
ILT
12030 PR 10450
12031 * i386.cc (class Target_i386): Initialize global_offset_table_ in
12032 constructor. Add global_offset_table_ field.
12033 (Target_i386::got_section): Set global_offset_table_.
12034 (Target_i386::do_finalize_sections): Set global_offset_table_
12035 size.
12036 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
12037 in constructor. Add global_offset_table_ field.
12038 (Target_x86_64::got_section): Set global_offset_table_.
12039 (Target_x86_64::do_finalize_sections): Set global_offset_table_
12040 size.
12041
1a2dff53
ILT
12042 * layout.cc (Layout::Layout): Initialize increase_relro_.
12043 (Layout::get_output_section): Add is_relro, is_last_relro, and
12044 is_first_non_relro parameters. Change all callers.
12045 (Layout::choose_output_section): Likewise.
12046 (Layout::add_output_section_data): Likewise.
12047 (Layout::make_output_section): Likewise.
12048 (Layout::set_segment_offsets): Clear increase_relro when using a
12049 linker script.
12050 * layout.h (class Layout): Add increase_relro method. Add
12051 increase_relro_ field. Update declarations.
12052 * output.cc (Output_section::Output_section): Initialize
12053 is_last_relro_ and is_first_non_relro_.
12054 (Output_segment::add_output_section): Group relro sections is
12055 do_sort is true. Handle is_last_relro and is_first_non_relro.
12056 (Output_segment::maximum_alignment): Remove relro handling.
12057 (Output_segment::set_section_addresses): Add increase_relro
12058 parameter. Change all callers. Add initial alignment to align
12059 relro sections on separate page. Remove old relro handling.
12060 (Output_segment::set_section_list_addresses): Remove in_relro
12061 parameter. Change all callers.
12062 (Output_segment::set_offset): Add increase parameter. Change all
12063 callers. Remove old relro handling.
12064 * output.h (class Output_section): Add new methods: is_last_relro,
12065 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
12066 Add is_last_relro_ and is_first_non_relro_ fields.
12067 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
12068 Create separate .got.plt section. Call increase_relro.
12069 * x86_64.cc (Target_x86_64::got_section): Likewise.
12070 * testsuite/relro_script_test.t: Add .got.plt.
12071
f0ba79e2
ILT
12072 PR 10450
12073 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
12074 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
12075 (Layout::finalize): Call set_dynamic_symbol_size.
12076 (Layout::set_dynamic_symbol_size): New function.
12077 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
12078 set_dynamic_symbol_size.
12079
e8cd95c7
ILT
12080 PR 10450
12081 * output.h (class Output_section): Add is_entsize_zero_ field.
12082 * output.cc (Output_section::Output_section): Initialize
12083 is_entsize_zero_.
12084 (Output_section::set_entsize): If two different entsizes are
12085 requested, force it to zero.
12086 (Output_section::add_input_section): Set flags for .debug_str
12087 before updating section flags. Set entsize.
12088 (Output_section::update_flags_for_input_section): Set SHF_MERGE
12089 and SHF_STRING if all input sections have those flags.
12090
3e1b9a8a
RÁE
120912009-12-29 Rafael Espindola <espindola@google.com>
12092
12093 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
12094 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
12095 reporting.
3e1b9a8a 12096
3dcad376
ST
120972009-12-29 Sriraman Tallam <tmsriram@google.com>
12098
12099 * options.cc (General_options::parse_version): Allow -v to exit
12100 without an error if there is nothing to link.
12101
084e2665
ILT
121022009-12-29 Ian Lance Taylor <iant@google.com>
12103
12104 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
12105 using a version of gcc before 4.1.
12106 * configure: Rebuild.
12107
250acde3
CD
121082009-12-28 Chris Demetriou <cgd@google.com>
12109
12110 * attributes.cc (Output_attributes_section_data::do_write): Use
12111 std::vector::front rather than std::vector::data.
12112
99fff23b
ILT
121132009-12-28 Ian Lance Taylor <iant@google.com>
12114
12115 * symtab.h (class Symbol_table): Add enum Defined.
12116 * resolve.cc (Symbol_table::should_override): Add defined
12117 parameter. Change all callers. Test whether object is NULL
12118 before calling a method on it.
12119 (Symbol_table::report_resolve_problem): Add defined parameter.
12120 Change all callers.
12121 (Symbol_table::should_override_with_special): Likewise.
12122 * symtab.cc (Symbol_table::define_in_output_data): Add defined
12123 parameter. Change all callers.
12124 (Symbol_table::do_define_in_output_data): Likewise.
12125 (Symbol_table::define_in_output_segment): Likewise.
12126 (Symbol_table::do_define_in_output_segment): Likewise.
12127 (Symbol_table::define_as_constant): Likewise.
12128 (Symbol_table::do_define_as_constant): Likewise.
12129 * script.h (class Symbol_assignment): Add is_defsym parameter to
12130 constructor; change all callers.
12131 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
12132 parameter. Change all callers. Add is_defsym_ field.
12133 (class Parser_closure): Add parsing_defsym parameter to
12134 constructor; change all callers. Add parsing_defsym accessor
12135 function. Add parsing_defsym_ field.
12136
556bd683
ILT
121372009-12-28 Ian Lance Taylor <iant@google.com>
12138
12139 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 12140 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 12141
1782c879
ILT
121422009-12-23 Ian Lance Taylor <iant@google.com>
12143
12144 * i386.cc (Target_i386::do_calls_non_split): Recognize
12145 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
12146 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
12147 -fsplit-stack prologue when using %r11.
1782c879 12148
329ca2b1
ST
121492009-12-21 Sriraman Tallam <tmsriram@google.com>
12150
12151 * options.cc (General_options::parse_version): Make -v continue and do
12152 the link like GNU ld does.
12153
d675ff46
RÁE
121542009-12-17 Rafael Avila de Espindola <espindola@google.com>
12155
12156 * Makefile.am (CCFILES): Add timer.cc.
12157 (HFILES): Add timer.h.
12158 * configure.ac: Check for sysconf and times.
12159 * main.cc: include timer.h.
12160 (main): Use Timer instead of get_run_time.
12161 * timer.cc: New.
12162 * timer.h: New.
12163 * workqueue.cc: include timer.h.
12164 (Workqueue::find_and_run_task):
12165 Report user, sys and wall time.
12166 * Makefile.in: Regenerate.
12167 * config.in: Regenerate.
12168 * configure: Regenerate.
12169
d6344fb5
DK
121702009-12-16 Doug Kwan <dougkwan@google.com>
12171
12172 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
12173 sections.
12174 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
12175 relaxed input sections.
12176 * output.cc (Output_section::find_relaxed_input_section): Change
12177 return type to Output_relaxed_input_section pointer. Adjust code
12178 for new type of relaxed_input_section_map_.
12179 * output.h (Output_section::find_relaxed_input_section): Change
12180 return type to Output_relaxed_input_section pointer.
12181 (Output_section::Output_relaxed_input_section_by_input_section_map):
12182 New type.
12183 (Output_section::relaxed_input_section_map_): Change type to
12184 Output_section::Output_relaxed_input_section_by_input_section_map.
12185 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
12186 input section.
12187
0e0d5469
ILT
121882009-12-15 Ian Lance Taylor <iant@google.com>
12189
12190 * layout.cc (Layout::create_shstrtab): Only write out after input
12191 sections if we are compressing debug sections.
12192
0649a889
ILT
121932009-12-15 Ian Lance Taylor <iant@google.com>
12194
12195 * archive.cc (Archive::add_symbols): Only look up a symbol without
12196 a version if there is, in fact, a version.
12197
2ea97941
ILT
121982009-12-14 Ian Lance Taylor <iant@google.com>
12199
12200 Revert -Wshadow changes, all changes from:
12201 2009-12-11 Doug Kwan <dougkwan@google.com>
12202 2009-12-11 Nick Clifton <nickc@redhat.com>
12203 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
12204
b0eec2cc
DK
122052009-12-11 Doug Kwan <dougkwan@google.com>
12206
12207 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
12208 due to -Wshadow.
12209 * attributes.cc (Object_attribute::size): Ditto.
12210 (Attributes_section_data::size): Ditto.
12211 (Attributes_section_data::Attributes_section_data): Ditto.
12212 (Output_attributes_section_data::do_write): Ditto.
12213 * attributes.h (Object_attribute::set_type): Ditto.
12214 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
12215
91d6fa6a
NC
122162009-12-11 Nick Clifton <nickc@redhat.com>
12217
12218 * archive.cc: Fix shadowed variable warnings.
12219 * arm.cc: Likewise.
12220 * compressed_output.cc: Likewise.
12221 * compressed_output.h: Likewise.
12222 * configure: Likewise.
12223 * dwarf_reader.cc: Likewise.
12224 * dynobj.cc: Likewise.
12225 * dynobj.h: Likewise.
12226 * ehframe.cc: Likewise.
12227 * ehframe.h: Likewise.
12228 * errors.cc: Likewise.
12229 * expression.cc: Likewise.
12230 * fileread.cc: Likewise.
12231 * fileread.h: Likewise.
12232 * freebsd.h: Likewise.
12233 * i386.cc: Likewise.
12234 * icf.cc: Likewise.
12235 * incremental.h: Likewise.
12236 * layout.cc: Likewise.
12237 * layout.h: Likewise.
12238 * mapfile.cc: Likewise.
12239 * merge.cc: Likewise.
12240 * merge.h: Likewise.
12241 * object.cc: Likewise.
12242 * object.h: Likewise.
12243 * options.h: Likewise.
12244 * output.cc: Likewise.
12245 * output.h: Likewise.
12246 * parameters.cc: Likewise.
12247 * plugin.cc: Likewise.
12248 * powerpc.cc: Likewise.
12249 * reduced_debug_output.cc: Likewise.
12250 * reduced_debug_output.h: Likewise.
12251 * reloc.cc: Likewise.
12252 * reloc.h: Likewise.
12253 * resolve.cc: Likewise.
12254 * script-sections.cc: Likewise.
12255 * script.cc: Likewise.
12256 * script.h: Likewise.
12257 * sparc.cc: Likewise.
12258 * symtab.cc: Likewise.
12259 * symtab.h: Likewise.
12260 * target-select.cc: Likewise.
12261 * target-select.h: Likewise.
12262 * token.h: Likewise.
12263 * workqueue.cc: Likewise.
12264 * workqueue.h: Likewise.
12265 * x86_64.cc: Likewise.
12266
a0351a69
DK
122672009-12-10 Doug Kwan <dougkwan@google.com>
12268
12269 * arm.cc (attributes.h): New include.
12270 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
12271 (Arm_relobj::~Arm_relobj): Delete object pointed by
12272 attributes_section_data_.
12273 (Arm_relobj::attributes_section_data): New method definition.
12274 (Arm_relobj::attributes_section_data_): New data member declaration.
12275 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
12276 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
12277 attributes_section_data_.
12278 (Arm_dynobj::attributes_section_data): New method definition.
12279 (Arm_dynobj::attributes_section_data_): New data member declaration.
12280 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
12281 initialization value of may_use_blx_ to false.
2e702c99 12282 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
12283 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
12284 object attributes to compute results instead of hard-coding.
12285 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
12286 Target_arm::get_secondary_compatible_arch,
12287 Target_arm::set_secondary_compatible_arch
12288 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12289 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
12290 New method declarations.
12291 (Target_arm::get_aeabi_object_attribute): New method definition.
12292 (Target_arm::attributes_section_data_): New data member declaration.
12293 (read_arm_attributes_section): New template definition.
12294 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
12295 (Arm_dynobj::do_read_symbols): Ditto.
12296 (Target_arm::do_finalize_sections): Merge attributes sections from
12297 input. Check for BLX use after attributes section merging.
12298 Fix __exidx_start and __exidx_end visibility. Create an
12299 .ARM.attributes section if necessary.
12300 (Target_arm::get_secondary_compatible_arch,
12301 Target_arm::set_secondary_compatible_arch,
12302 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12303 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 12304 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
12305 New method definitions.
12306
b59befec
ILT
123072009-12-09 Ian Lance Taylor <iant@google.com>
12308
12309 * plugin.cc (Plugin::load): Don't cast from void* to a function
12310 pointer.
12311
1276bc89
ILT
123122009-12-09 Ian Lance Taylor <iant@google.com>
12313
12314 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
12315 information fields.
12316
2f2de248
L
123172009-12-09 H.J. Lu <hongjiu.lu@intel.com>
12318
12319 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
12320 Replace two_file_shared_1.so with two_file_shared_2.so.
12321 * testsuite/Makefile.in: Regenerated.
12322
4f787271
DK
123232009-12-08 Doug Kwan <dougkwan@google.com>
12324
12325 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
12326 (HFILES): Add attributes.h and int_encoding.h.
12327 * Makefile.in: Regenerate.
12328 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
12329 function definitions to int_encoding.cc
12330 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
12331 prototypes to int_encoding.h
12332 * reduced_debug_output.cc (int_encoding.h): New include.
12333 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
12334 function definitions to int_encoding.cc
12335 (insert_into_vector, read_from_pointer): Move template definitions to
12336 int_encoding.h
12337 * attributes.cc: New file.
12338 * attributes.h: New file.
12339 * int_encoding.cc: New file.
12340 * int_encoding.h: New file.
12341
20b52f1a
RÁE
123422009-12-07 Rafael Avila de Espindola <espindola@google.com>
12343
12344 PR gold/11055
12345 * incremental-dump.cc (dump_incremental_inputs): New.
12346 (main): Use dump_incremental_inputs.
12347
53d7974c
L
123482009-12-07 H.J. Lu <hongjiu.lu@intel.com>
12349
12350 PR gold/10893
12351 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
12352 checking elfcpp::STT_FUNC.
12353 (Target_i386::Relocate::relocate): Likewise.
12354 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
12355
12356 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
12357 symbols from shared libraries into normal FUNC symbols.
12358
12359 * symtab.h (Symbol): Add is_func and use it.
12360
05a352e6
DK
123612009-12-05 Doug Kwan <dougkwan@google.com>
12362
12363 * arm.cc (Target_arm::arm_info): Initialize new fields
12364 attributes_section and attributes_vendor.
12365 * i386.cc (Target_i386::i386_info): Same.
12366 * object.cc (Sized_relobj::do_layout): Skip attribute section.
12367 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
12368 fields attributes_section and attributes_vendor.
53d7974c 12369 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
12370 * target.h (Target::attributes_section, Target::attributes_vendor,
12371 Target::is_attributes_section, Target::attribute_arg_type,
12372 Target::attributes_order): New method definitions.
12373 (Target::Target_info::attributes_section,
12374 Target::Target_info::attributes_vendor): New fields.
12375 (Target::do_attribute_arg_type, Target::do_attributes_order): New
12376 virtual method definitions.
12377 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
12378 attributes_section and attributes_vendor.
12379 * testsuite/testfile.cc (Target_test::test_target_info): Same.
12380
f4e5969c
DK
123812009-12-05 Doug Kwan <dougkwan@google.com>
12382
12383 * arm.cc: Update comments about interworking and stub generation.
12384 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
12385 considered as non-PIC.
12386 (Arm_relocate_functions::base_abs): Fix formatting.
12387 (Arm_relocate_functions::got_prel): Fix comment. Change interface
12388 of function to use GOT entry address instead of offset.
12389 (Target_arm::Scan::global): Issue an error if a symbol would need a
12390 PLT does not get one because it is untyped. Remove code to create
12391 dynamic symbols for relative branches.
12392 (Target_arm::Relocate::relocate: Use 0 instead of false since function
12393 takes unsigned integer instead of boolean.
12394
1abce4a6
L
123952009-12-05 H.J. Lu <hongjiu.lu@intel.com>
12396
12397 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
12398 (two_file_test_LDADD): Likewise.
12399 (common_test_1_LDADD): Likewise.
12400 (exception_test_LDADD) Likewise.
12401 (weak_test_LDADD): Likewise.
12402 (many_sections_test_LDADD): Likewise.
12403 (initpri1_LDADD): Likewise.
12404 (script_test_1_LDADD): Likewise.
12405 (script_test_2_LDADD): Likewise.
12406 (justsyms_LDADD): Likewise.
12407 (binary_test_LDADD): Likewise.
12408 (large_LDADD): Likewise.
12409 * testsuite/Makefile.in: Regenerated.
12410
adcf2816 124112009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 12412
adcf2816
L
12413 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
12414 (Symbol_table::override_with_special): Likewise.
12415 (Symbol_table::add_from_object): Likewise.
12416
28e67f5d
RÁE
124172009-12-04 Rafael Avila de Espindola <espindola@google.com>
12418
12419 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12420 Don't set the data_offset twice.
12421
ae10a101
RÁE
124222009-12-04 Rafael Avila de Espindola <espindola@google.com>
12423
12424 * testsuite/Makefile.in: Regenerate.
12425
f59f41f3
DK
124262009-12-03 Doug Kwan <dougkwan@google.com>
12427
12428 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
12429 (Target_arm::do_finalize_sections): Add parameter for symbol table
12430 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
12431 * i386.cc (Target_i386::do_finalize_sections): Add an additional
12432 parameter for symbol table pointer.
12433 * layout.cc (Layout::finalize): Call Target::finalize_sections with
12434 an additional parameter for a pointer to symbol table.
12435 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
12436 parameter for a symbol table pointer.
12437 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
12438 * target.h (Target::finalize_sections, Target::do_finalize_sections):
12439 Ditto.
12440 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
12441 parameter for a symbol table pointer.
12442
ca55d848
RÁE
124432009-12-03 Rafael Avila de Espindola <espindola@google.com>
12444
12445 * incremental.cc (Incremental_inputs_header)
12446 (Incremental_inputs_header_write, Incremental_inputs_entry)
12447 (Incremental_inputs_entry_write): Move ...
12448 * incremental.h (Incremental_inputs_header)
12449 (Incremental_inputs_header_write, Incremental_inputs_entry)
12450 (Incremental_inputs_entry_write): here.
12451
3aec4f9c
RÁE
124522009-12-02 Rafael Avila de Espindola <espindola@google.com>
12453
12454 * incremental.cc (make_sized_incremental_binary): Set the target.
12455 Error if it is incompatible.
12456 * output.h (Output_file): Add filename method.
12457
9c0ae74d
RÁE
124582009-12-02 Rafael Avila de Espindola <espindola@google.com>
12459
12460 * incremental.cc (Incremental_inputs_entry): Remove unused argument
12461 from the get_* methods.
12462
a45500ae
RÁE
124632009-12-02 Rafael Avila de Espindola <espindola@google.com>
12464
12465 * incremental-dump.cc (main): Check that the offeset of a script is 0.
12466 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12467 Write 0 for the data_offset of scripts.
12468
325e6408
RÁE
124692009-12-02 Rafael Avila de Espindola <espindola@google.com>
12470
12471 * testsuite/Makefile.am: Add the incremental_test.sh test.
12472 * testsuite/incremental_test.sh: New.
12473 * testsuite/incremental_test_1.c: New.
12474 * testsuite/incremental_test_2.c: New.
12475
954c3e2e
RÁE
124762009-12-01 Rafael Avila de Espindola <espindola@google.com>
12477
703d02da 12478 * incremental-dump.cc (main): Fix typos.
954c3e2e 12479
f8086623
RÁE
124802009-11-27 Rafael Avila de Espindola <espindola@google.com>
12481
12482 PR gold/11025
12483 * incremental-dump.cc (main): Use llu to print 64 bit values.
12484
3b0dd6ac
L
124852009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
12486 H.J. Lu <hongjiu.lu@intel.com>
12487
12488 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
12489 $(LIBDL).
12490 (incremental_dump_LDADD): Likewise.
12491 * Makefile.in: Regenerated.
12492
a6d1ef57 124932009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 12494
a6d1ef57
DK
12495 Revert:
12496
12497 2009-11-25 Doug Kwan <dougkwan@google.com>
12498
12499 * arm.cc (Target_arm::Target_arm): Move method definition
12500 outside of class definition. Add code to handle
12501 --target1-rel, --target1-abs and --target2= options.
12502 (Target_arm::get_reloc_reloc_type): Change method to be
12503 non-static and const.
12504 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
12505 New data member declaration.
12506 (Target_arm::Scan::local, Target_arm::Scan::global,
12507 Target_arm::Relocate::relocate,
12508 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12509 Adjust call to Target_arm::get_real_reloc_type.
12510 (Target_arm::get_real_reloc_type): Use command line options
12511 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12512 * options.h (--target1-rel, --target1-abs, --target2): New
12513 ARM-only options.
12514
50aeb7d4
DK
125152009-11-25 Doug Kwan <dougkwan@google.com>
12516
12517 * arm.cc (Target_arm::Target_arm): Move method definition outside of
12518 class definition. Add code to handle --target1-rel, --target1-abs
12519 and --target2= options.
12520 (Target_arm::get_reloc_reloc_type): Change method to be non-static
12521 and const.
12522 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
12523 member declaration.
12524 (Target_arm::Scan::local, Target_arm::Scan::global,
12525 Target_arm::Relocate::relocate,
12526 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
12527 call to Target_arm::get_real_reloc_type.
12528 (Target_arm::get_real_reloc_type): Use command line options to
12529 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12530 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
12531 options.
12532
51938283
DK
125332009-11-25 Doug Kwan <dougkwan@google.com>
12534
12535 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
12536 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
12537 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
12538 formatting.
12539 (Arm_relocate_functions::thm_call): Replace body with a call to
12540 Arm_relocate_functions::thumb_branch_common.
12541 (Arm_relocate_functions::thm_jump24,
12542 Arm_relocate_functions::thm_xpc22): New method definitions.
12543 (Arm_relocate_functions::thumb_branch_common): New method definition.
12544 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
12545 operator.
12546 (Target_arm::Relocate::relocate): Adjust call to thm_call.
12547 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
12548
e2b8f3c4
RÁE
125492009-11-24 Rafael Avila de Espindola <espindola@google.com>
12550
12551 * Makefile.am: Build incremental-dump
12552 * Makefile.in: Regenerate.
12553 * incremental-dump.cc: New.
12554 * incremental.cc (Incremental_inputs_header_data,
12555 Incremental_inputs_entry_data): Move to incremental.h
12556 * incremental.h: (Incremental_inputs_header_data,
12557 Incremental_inputs_entry_data): Move from incremental.cc
12558
bcba9aec
RÁE
125592009-11-24 Rafael Avila de Espindola <espindola@google.com>
12560
12561 * incremental.cc (Incremental_inputs_header,
12562 Incremental_inputs_header_write, Incremental_inputs_entry,
12563 Incremental_inputs_entry_write): Add a typedef with the data type.
12564
7c3afe08
RÁE
125652009-11-24 Rafael Avila de Espindola <espindola@google.com>
12566
12567 * incremental.cc (Incremental_inputs_header,
12568 Incremental_inputs_header_write, Incremental_inputs_entry,
12569 Incremental_inputs_entry_write): Update comment about which
12570 type has the filed descriptions.
12571
d204b6e9
DK
125722009-11-15 Doug Kwan <dougkwan@google.com>
12573
12574 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
12575 (Arm_relocate_functions::arm_branch_common): Change method defintion
12576 in class definition to a method declaration and update list of formal
12577 parameters.
12578 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
12579 Arm_relocation_functions::jump24): Adjust call to
12580 Arm_relocate_functions::arm_branch_common. Update list of formal
12581 parameters.
12582 (Arm_relocate_functions::xpc25): New method definition.
12583 (Arm_relocate_functions::arm_branch_common): Move method defintion
12584 out from class definition. Use stubs for mode-switching and extending
12585 branch ranges.
12586 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
12587 specially. Change code to enable use of stubs in ARM branches.
12588
43d12afe
DK
125892009-11-10 Doug Kwan <dougkwan@google.com>
12590
12591 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
12592 in method declaration.
12593 (Target_arm::relocate_stub): New method declaration.
12594 (Target_arm::default_target): Change to return a pointer instead of
12595 a const reference.
12596 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
12597 Target_arm::default_target.
12598 (Arm_Relobj::do_relocate_sections): Remove options paramater in
12599 method definition.
12600 (Target_arm::relocate_section): Adjust view.
12601 (Target_arm::relocate_stub): New method definition.
12602
ac33a407
DK
126032009-11-10 Doug Kwan <dougkwan@google.com>
12604
12605 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
12606 a format warning.
12607 * incremental.cc (open_incremental_binary): Initialized local
12608 variables to avoid warnings.
12609 * object.cc (make_elf_object): Ditto.
12610 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
12611 a format warning.
e1df38aa 12612
88ee28e9
L
12613009-11-09 H.J. Lu <hongjiu.lu@intel.com>
12614
12615 PR gold/10930
12616 * testsuite/plugin_test.c: Include "config.h".
12617
2daedcd6
DK
126182009-11-09 Doug Kwan <dougkwan@google.com>
12619
12620 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
12621 (arm_symbol_value): Remove.
12622 (Arm_relocate_functions::arm_branch_common,
12623 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
12624 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
12625 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
12626 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
12627 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
12628 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
12629 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
12630 Arm_relocate_functions::thm_mobw_abs_nc,
12631 Arm_relocate_functions::thm_mov_abs,
12632 Arm_relocate_functions::movw_prel_nc,
12633 Arm_relocate_functions::thm_movt_abs,
12634 Arm_relocate_functions::movt_prel,
12635 Arm_relocate_functions::thm_movw_prel_nc,
12636 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
12637 (Target_arm::Relocate::relocate): Only decompose address into two
12638 parts if relocation type uses the thumb-bit and pass the actual
12639 bit instead of a flag indicating that the thumb-bit is used. Adjust
12640 calls to methods in Arm_relocate_functions for this change.
12641
1276bc89 126422009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
12643
12644 PR 10925
12645 * reloc.cc: Instantiate
12646 Sized_relobj::initialize_input_to_output_maps and
12647 Sized_relobj:free_input_to_output_maps.
12648
e53ad1b5
ILT
126492009-11-06 Ian Lance Taylor <iant@google.com>
12650
12651 PR 10876
12652 * defstd.cc (in_segment): Set only_if_ref true for "end".
12653
eb44217c
DK
126542009-11-06 Doug Kwan <dougkwan@google.com>
12655
12656 * arm.cc (class Reloc_stub): Correct a comment.
12657 (Target_arm::Target_arm): Initialize arm_input_section_map_.
12658 (Target_arm::scan_section_for_stubs): New method declaration.
12659 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
12660 Change methods from private to protected.
12661 (Target_arm::do_may_relax): New method definition.
12662 (Target_arm::do_relax, Target_arm::group_sections,
12663 Target_arm::scan_reloc_for_stub,
12664 Target_arm::scan_reloc_section_for_stubs): New method declarations.
12665 (Target_arm::arm_input_section_map_): New data member declaration.
12666 (Target_arm::scan_reloc_for_stub,
12667 Target_arm::scan_reloc_section_for_stubs,
12668 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
12669 Target_arm::do_relax): New method definitions.
12670
5d329b7d
ILT
126712009-11-06 Mikolaj Zalewski <mikolaj@google.com>
12672
12673 * configure.ac: Check for (struct stat)::st_mtim
12674 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
12675 * config.in: Regenerate.
12676 * configure: Regenerate.
12677
96a0d71b
ILT
126782009-11-05 Ian Lance Taylor <iant@google.com>
12679
12680 PR 10910
12681 * output.cc (Output_segment::add_output_section): Add missing
12682 return statement.
12683
594c8e5e
ILT
126842009-11-04 Ian Lance Taylor <iant@google.com>
12685
12686 PR 10880
12687 * object.h (class Object): Add is_needed and set_is_needed
12688 methods. Add is_needed_ field. Make bool fields into bitfields.
12689 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
12690 defined in a dynamic object and referenced by a regular object,
12691 set is_needed for the dynamic object.
12692 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
12693 if the file is marked with as_needed and it is not needed.
12694
22b127cc
ILT
126952009-11-04 Ian Lance Taylor <iant@google.com>
12696
12697 PR 10887
12698 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
12699 tags if data is discarded by linker script.
12700 * i386.cc (Target_i386::do_finalize_sections): Likewise.
12701 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
12702 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
12703 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
12704
f5c870d2
ILT
127052009-11-04 Ian Lance Taylor <iant@google.com>
12706
12707 * layout.cc (Layout::get_output_section): Add is_interp and
12708 is_dynamic_linker_section parameters. Change all callers.
12709 (Layout::choose_output_section): Likewise.
12710 (Layout::make_output_section): Likewise.
12711 (Layout::add_output_section_data): Add is_dynamic_linker_section
12712 parameter. Change all callers.
12713 * layout.h (class Layout): Update declarations.
12714 * output.h (class Output_section): Add is_interp, set_is_interp,
12715 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
12716 Add is_interp_, is_dynamic_linker_section_ fields. Change
12717 generate_code_fills_at_write_ to a bitfield.
12718 * output.cc (Output_section::Output_sections): Initialize new
12719 fields.
12720 (Output_segment::add_output_section): Add do_sort parameter.
12721 Change all callers.
12722
1ae4d23b
ILT
127232009-11-03 Ian Lance Taylor <iant@google.com>
12724
12725 PR 10860
12726 * options.h (class General_options): Add --warn-common.
12727 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
12728 merging two common symbols.
12729 (Symbol_table::should_override): Handle --warn-common when merging
12730 a common symbol with a defined symbol. Use report_resolve_problem
12731 for multiple definitions.
12732 (Symbol_table::report_resolve_problem): New function.
12733 * symtab.h (class Symbol_table): Declare report_resolve_problem.
12734
55da9579
DK
127352009-11-03 Doug Kwan <dougkwan@google.com>
12736
12737 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
12738 stub_factory_.
12739 (Target_arm::stub_factory): New method definition.
12740 (Target_arm::new_arm_input_section,
12741 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
12742 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 12743 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
12744 New type definitions.
12745 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
12746 member declarations.
12747 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
12748 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
12749 New method definitions.
12750
37a9ac43
ILT
127512009-11-03 Ian Lance Taylor <iant@google.com>
12752
12753 * options.h (class General_options): Add --warn_constructors.
12754
b3d6a3d4
ILT
127552009-11-03 Ian Lance Taylor <iant@google.com>
12756
12757 PR 10893
12758 * defstd.cc (in_section): Add entries for __rel_iplt_start,
12759 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
12760
934b01dd
ILT
127612009-11-03 Ian Lance Taylor <iant@google.com>
12762
12763 PR 10895
12764 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
12765 --msgid-bugs-address.
12766 (install-pdf): New target.
12767 (install-data_yes): Look up one directory to find mkinstalldirs.
12768
03c1939b
L
127692009-11-03 H.J. Lu <hongjiu.lu@intel.com>
12770
12771 * po/Make-in (.po.gmo): Don't generate .gmo files in source
12772 tree.
12773
ebd95253
DK
127742009-10-30 Doug Kwan <dougkwan@google.com>
12775
12776 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
12777
e9bbb538
DK
127782009-10-30 Doug Kwan <dougkwan@google.com>
12779
12780 * arm.cc (Stub_addend_reader): New struct template definition
12781 and partial specializations.
12782 (Stub_addend_reader::operator()): New method definition for a
12783 partially specialized template.
12784
d5b40221
DK
127852009-10-30 Doug Kwan <dougkwan@google.com>
12786
12787 * arm.cc (Arm_relobj::processor_specific_flags): New method
12788 definition.
12789 (Arm_relobj::do_read_symbols): New method declaration.
12790 (Arm_relobj::processor_specific_flags_): New data member declaration.
12791 (Arm_dynobj): New class definition.
12792 (Target_arm::do_finalize_sections): Add input_objects parameter.
12793 (Target_arm::do_adjust_elf_header): New method declaration.
12794 (Target_arm::are_eabi_versions_compatible,
12795 (Target_arm::merge_processor_specific_flags): New method declaration.
12796 (Target_arm::do_make_elf_object): New overloaded method definitions
12797 and declaration.
12798 (Arm_relobj::do_read_symbols): New method definition.
12799 (Arm_dynobj::do_read_symbols): Ditto.
12800 (Target_arm::do_finalize_sections): Add input_objects parameters.
12801 Merge processor-specific flags from all input objects.
12802 (Target_arm::are_eabi_versions_compatible,
12803 Target_arm::merge_processor_specific_flags,
12804 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
12805 New method definitions.
12806 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
12807 Input_objects pointer type parameter.
12808 * layout.cc (Layout::finalize): Pass input objects to target's.
12809 finalize_sections function.
12810 * output.cc (Output_file_header::do_sized_write): Set ELF file
12811 header's processor-specific flags.
12812 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
12813 Input_objects pointer type parameter.
12814 * sparc.cc (Target_sparc::do_finalize_sections): Same.
12815 * target.h (Input_objects): New forward class declaration.
12816 (Target::processor_specific_flags,
12817 Target::are_processor_specific_flags_sect): New method definitions.
12818 (Target::finalize_sections): Add input_objects parameter.
12819 (Target::Target): Initialize processor_specific_flags_ and
12820 are_processor_specific_flags_set_.
12821 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
12822 parameter.
12823 (Target::set_processor_specific_flags): New method definition.
12824 (Target::processor_specific_flags_,
12825 Target::are_processor_specific_flags_set_): New data member
12826 declarations.
12827 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
12828 Input_objects pointer type parameter.
12829
ebabffbd
DK
128302009-10-30 Doug Kwan <dougkwan@google.com>
12831
12832 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
12833
ad0f2072
ILT
128342009-10-28 Ian Lance Taylor <iant@google.com>
12835
12836 * object.h (class Relobj): Drop options parameter from
12837 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
12838 do_scan_relocs, do_relocate. Change all callers.
12839 (class Sized_relobj): Drop options parameters from
12840 do_gc_process_relocs, do_scan_relocs, do_relocate,
12841 do_relocate_sections, relocate_sections, emit_relocs_scan,
12842 emit_relocs_scan_reltype. Change all callers.
12843 (struct Relocate_info): Remove options field and all references to
12844 it.
12845 * reloc.h (class Read_relocs): Remove options constructor
12846 parameter and options_ field. Change all callers.
12847 (class Gc_process_relocs, class Scan_relocs): Likewise.
12848 (class Relocate_task): Likewise.
12849 * target-reloc.h (scan_relocs): Remove options parameter. Change
12850 all callers.
12851 (scan_relocatable_relocs): Likewise.
12852 * target.h (class Sized_target): Remove options parameter from
12853 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
12854 all callers.
12855 * gc.h (gc_process_relocs): Remove options parameter. Change all
12856 callers.
12857 * arm.cc: Update functions to remove options parameters.
12858 * i386.cc: Likewise.
12859 * powerpc.cc: Likewise.
12860 * sparc.cc: Likewise.
12861 * x86_64.cc: Likewise.
12862 * testsuite/testfile.cc: Likewise.
12863
8ffa3667
DK
128642009-10-28 Doug Kwan <dougkwan@google.com>
12865
12866 * arm.cc (Arm_relobj): New class definition.
e1df38aa 12867 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
12868 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
12869 New method definitions.
12870
40f36857
CC
128712009-10-28 Cary Coutant <ccoutant@google.com>
12872
12873 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
12874 (Plugin::cleanup_done_): New member.
12875 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
12876 (Plugin_manager::cleanup_done_): Remove.
12877 (Plugin_manager::add_input_file): Edit error message.
12878 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
12879 (Plugin_manager::cleanup): Remove use of cleanup_done_.
12880
2c849493
ILT
128812009-10-27 Mikolaj Zalewski <mikolajz@google.com>
12882
12883 * fileread.cc: (File_read::View::~View): Use the new
12884 data_ownership_ filed.
12885 (File_read::~File_read): Dispose the new whole_file_view_.
12886 (File_read::open): Mmap the whole file if needed.
12887 (File_read::open): Use whole_file_view_ instead of contents_.
12888 (File_read::find_view): Use whole_file_view_ if applicable.
12889 (File_read::do_read): Use whole_file_view_ instead of contents_.
12890 (File_read::make_view): Use whole_file_view_ instead of contents_,
12891 update File_read::View::View call.
12892 (File_read::find_or_make_view): Update File_read::View::View
12893 call.
12894 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
12895 remove contents_
12896 (File_read::View::Data_ownership): New enum.
12897 (File_read::View::View): Replace bool mapped_ with Data_ownership
12898 argument.
12899 (File_read::View::mapped_): Remove (replaced by data_ownership_).
12900 (File_read::View::data_ownership_): New field.
12901 (File_read::contents_): Remove (replaced by whole_file_view_).
12902 (File_read::whole_file_view_): New field.
12903 * options.h (class General_options): Add --keep-files-mapped.
12904
24998053
CC
129052009-10-27 Cary Coutant <ccoutant@google.com>
12906
12907 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
12908 * testsuite/Makefile.am (plugin_test_5): New test case.
12909 * testsuite/Makefile.in: Regenerate.
12910
72adc4fa
DK
129112009-10-25 Doug Kwan <dougkwan@google.com>
12912
12913 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
12914 from private to protected to allow access by child class.
12915 (Sized_relobj::do_relocate_sections): New method declaration.
12916 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 12917 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
12918 Sized_relobj::relocate_sections. Instantiate template explicitly
12919 for different target sizes and endianity.
12920
07f508a2
DK
129212009-10-24 Doug Kwan <dougkwan@google.com>
12922
12923 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
12924 (Arm_input_section::as_arm_input_section): New method.
12925 (Arm_output_section): New class definition.
12926 (Arm_output_section::create_stub_group,
12927 Arm_output_section::group_sections): New method definitions.
12928
10ad9fe5
DK
129292009-10-22 Doug Kwan <dougkwan@google.com>
12930
12931 * arm.cc (Arm_input_section): New class definition.
12932 (Arm_input_section::init, Arm_input_section:do_write,
12933 Arm_input_section::set_final_data_size,
12934 Arm_input_section::do_reset_address_and_file_offset): New method
12935 definitions.
12936
56ee5e00
DK
129372009-10-21 Doug Kwan <dougkwan@google.com>
12938
12939 * arm.cc (Stub_table, Arm_input_section): New forward class
12940 declarations.
12941 (Stub_table): New class defintion.
12942 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
12943 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
12944 New method definition.
12945
b569affa
DK
129462009-10-21 Doug Kwan <dougkwan@google.com>
12947
12948 * arm.cc: Update copyright comments.
12949 (Target_arm): New forward class template declaration.
12950 (Arm_address): New type.
12951 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
12952 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
12953 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
12954 constants.
12955 (Insn_template): Same.
12956 (DEF_STUBS): New macro.
12957 (Stub_type): New enum type.
12958 (Stub_template): New class definition.
12959 (Stub): Same.
12960 (Reloc_stub): Same.
12961 (Stub_factory): Same.
12962 (Target_arm::Target_arm): Initialize may_use_blx_ and
12963 should_force_pic_veneer_.
12964 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
12965 Target_arm::should_force_pic_veneer,
12966 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
12967 Target_arm::using_thumb_only, Target_arm:;default_target): New
12968 method defintions.
12969 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
12970 New data member declarations.
12971 (Insn_template::size, Insn_template::alignment): New method defintions.
12972 (Stub_template::Stub_template): New method definition.
12973 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
12974 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
12975 (Stub_factory::Stub_factory): New method definition.
12976 * gold.h (string_hash): New template.
12977 * output.h (Input_section_specifier::hash_value): Use
12978 gold::string_hash.
12979 (Input_section_specifier::string_hash): Remove.
12980 * stringpool.cc (Stringpool_template::string_hash): Use
12981 gold::string_hash.
12982
6c172549
DK
129832009-10-20 Doug Kwan <dougkwan@google.com>
12984
12985 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
12986 symbols of relaxed input sections.
12987 * output.h (Output_section::find_relaxed_input_section): Make
12988 method public.
12989
c5617f2f
DK
129902009-10-16 Doug Kwan <dougkwan@google.com>
12991
12992 * dynobj.cc (Versions::Versions): Initialize version_script_.
12993 Only insert base version symbol definition for a shared object
12994 if version script defines any version versions.
12995 (Versions::define_base_version): New method definition.
12996 (Versions::add_def): Check that base version is not needed.
12997 (Versions::add_need): Define base version lazily.
12998 * dynobj.h (Versions::define_base_version): New method declaration.
12999 (Versions::needs_base_version_): New data member declaration.
13000 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
13001 (check_DATA): Add no_version_test.stdout.
13002 (libno_version_test.so, no_version_test.o no_version_test.stdout):
13003 New make rules.
13004 * testsuite/Makefile.in: Regenerate.
13005 * testsuite/no_version_test.c: New file.
13006 * testsuite/no_version_test.sh: Ditto.
13007
3c12dcdb
DK
130082009-10-16 Doug Kwan <dougkwan@google.com>
13009
13010 * expression.cc (class Segment_start_expression): New class definition.
13011 (Segment_start_expression::value): New method definition.
13012 (script_exp_function_segment_start): Return a new
13013 Segment_start_expression.
13014 * gold/script-c.h (script_saw_segment_start_expression): New function
13015 prototype.
13016 * script-sections.cc (Script_sections::Script_sections): Initialize
13017 SAW_SEGMENT_START_EXPRESSION_ to false.
13018 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
13019 and -Tbbs options to specify section addresses if given in
13020 command line and no SEGMENT_START expression is seen in a script.
13021 * script-sections.h (Script_sections::saw_segment_start_expression,
13022 Script_sections::set_saw_segment_start_expression): New method
13023 definition.
13024 (Script_sections::saw_segment_start_expression_): New data member
13025 declaration.
13026 * script.cc (script_saw_segment_start_expression): New function.
13027 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
13028 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
13029 script_test_7.sh and script_test_8.sh.
13030 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
13031 script_test_8.stdout.
13032 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
13033 (script_test_6, script_test_6.stdout, script_test_7,
13034 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
13035 * Makefile.in: Regenerate.
13036 * testsuite/script_test_6.sh: New file.
13037 * testsuite/script_test_6.t: Same.
13038 * testsuite/script_test_7.sh: Same.
13039 * testsuite/script_test_7.t: Same.
13040 * testsuite/script_test_8.sh: Same.
13041
64b1ae37
DK
130422009-10-16 Doug Kwan <dougkwan@google.com>
13043
13044 * output.cc (Output_segment::set_section_list_address): Cast
13045 expressions to unsigned long long type to avoid format warnings.
13046
661be1e2
ILT
130472009-10-15 Ian Lance Taylor <iant@google.com>
13048
12edd763 13049 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 13050 dot assignment to script_sections_.
12edd763
ILT
13051 * script-sections.cc (Script_sections::add_dot_assignment):
13052 Initialize if necessary.
13053
68b6574b
ILT
13054 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
13055 program headers with no load segment if there is a linker script.
13056
661be1e2
ILT
13057 * layout.cc (Layout::set_segment_offsets): Align the file offset
13058 to the segment aligment for -N or -n with no load segment.
13059 * output.cc (Output_segment::add_output_section): Don't crash if
13060 the first section is a TLS section.
13061 (Output_segment::set_section_list_addresses): Print an error
13062 message if the address moves backward in a linker script.
13063 * script-sections.cc
13064 (Output_section_element_input::set_section_addresses): Don't
13065 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
13066 (Orphan_output_section::set_section_addresses): Likewise.
13067
f15f61a7
DK
130682009-10-15 Doug Kwan <dougkwan@google.com>
13069
13070 * layout.cc (Layout::finish_dynamic_section): Generate tags
13071 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
13072 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
13073 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
13074
82bb573a
ILT
130752009-10-14 Ian Lance Taylor <iant@google.com>
13076
13077 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
13078 fields.
13079 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
13080 data_shdr fields of relinfo.
13081 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
13082 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
13083 R_386_TLS_LDO_32, adjust based on section flags.
13084 (Target_i386::Relocate::fix_up_ldo): Remove.
13085
374ad285
ILT
130862009-10-13 Ian Lance Taylor <iant@google.com>
13087
13088 Add support for -pie.
13089 * options.h (class General_options): Add -pie and
13090 --pic-executable.
13091 (General_options::output_is_position_independent): Test -pie.
13092 (General_options::output_is_executable): Return true if not shared
13093 and not relocatable.
13094 (General_options::output_is_pie): Remove.
13095 * options.cc (General_options::finalize): Reject incompatible uses
13096 of -pie.
13097 * gold.cc (queue_middle_tasks): A -pie link is not static.
13098 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
13099 * symtab.cc (Symbol::final_value_is_known): Return false if
13100 output_is_position_independent.
13101 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
13102 output_is_position_independent.
13103 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
13104 output_is_position_independent.
13105 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
13106 output_is_position_independent.
13107 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
13108 two_file_pie_test.
13109 (basic_pie_test.o, basic_pie_test): New targets.
13110 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
13111 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
13112 (two_file_pie_test): New target.
13113 * testsuite/Makefile.in: Rebuild.
13114 * README: Remove note saying that -pie is not supported.
13115
c6585162
ILT
131162009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
13117
13118 * options.h (class General_options): Add -init and -fini.
13119 * layout.cc (Layout::finish_dynamic_section): Emit
13120 given init and fini functions.
13121
032ce4e9
ST
131222009-10-13 Sriraman Tallam <tmsriram@google.com>
13123
13124 * gc.h (gc_process_relocs): Check if icf is enabled using new
13125 function.
13126 * gold.cc (queue_initial_tasks): Likewise.
13127 (queue_middle_tasks): Likewise.
13128 * object.cc (do_layout): Likewise.
13129 * symtab.cc (is_section_folded): Likewise.
13130 * main.cc (main): Likewise.
13131 * reloc.cc (Read_relocs::run): Likewise.
13132 (Sized_relobj::do_scan_relocs): Likewise.
13133 * icf.cc (is_function_ctor_or_dtor): New function.
13134 (Icf::find_identical_sections): Check if function is ctor or dtor when
13135 safe icf is chosen.
13136 * options.h (General_options::icf): Change option to be an enum.
13137 (Icf_status): New enum.
13138 (icf_enabled): New method.
13139 (icf_safe_folding): New method.
13140 (set_icf_status): New method.
13141 (icf_status_): New variable.
13142 * (options.cc) (General_options::finalize): Set icf_status_.
13143 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
13144 icf_test and icf_keep_unique_test to use the --icf enum flag.
13145 * testsuite/icf_safe_test.sh: New file.
e1df38aa 13146 * testsuite/icf_safe_test.cc: New file.
032ce4e9 13147
f345227a
ST
131482009-10-12 Sriraman Tallam <tmsriram@google.com>
13149
13150 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
13151 includes to gc.h and icf.h.
13152 * arm.cc: Include gc.h.
13153 * gold.cc: Likewise.
13154 * i386.cc: Likewise.
13155 * powerpc.cc: Likewise.
13156 * sparc.cc: Likewise.
13157 * x86_64.cc: Likewise.
13158 * gc.h: Include icf.h.
13159
1c7814ed
ILT
131602009-10-11 Ian Lance Taylor <iant@google.com>
13161
13162 * plugin.cc: Include "gold.h" before other header files.
13163
ae3b5189
CD
131642009-10-10 Chris Demetriou <cgd@google.com>
13165
13166 * options.h (Input_file_argument::Input_file_type): New enum.
13167 (Input_file_argument::is_lib_): Replace with...
13168 (Input_file_argument::type_): New member.
13169 (Input_file_argument::Input_file_argument): Take Input_file_type
13170 'type' rather than boolean 'is_lib' as second argument.
13171 (Input_file_argument::is_lib): Use type_.
13172 (Input_file_argument::is_searched_file): New function.
13173 (Input_file_argument::may_need_search): Handle is_searched_file.
13174 * options.cc (General_options::parse_library): Support -l:filename.
13175 (General_options::parse_just_symbols): Update for Input_file_argument
13176 changes.
13177 (Command_line::process): Likewise.
13178 * archive.cc (Archive::get_file_and_offset): Likewise.
13179 * plugin.cc (Plugin_manager::release_input_file): Likewise.
13180 * script.cc (read_script_file, script_add_file): Likewise.
13181 * fileread.cc (Input_file::Input_file): Likewise.
13182 (Input_file::will_search_for): Handle is_searched_file.
13183 (Input_file::open): Likewise.
13184 * readsyms.cc (Read_symbols::get_name): Likewise.
13185 * testsuite/Makefile.am (searched_file_test): New test.
13186 * testsuite/Makefile.in: Regenerate.
13187 * testsuite/searched_file_test.cc: New file.
13188 * testsuite/searched_file_test_lib.cc: New file.
13189
f3048a1d
ILT
131902009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13191 Ian Lance Taylor <iant@google.com>
13192
13193 * descriptor.cc: Include <cstdio> and "binary-io.h".
13194 (Descriptors::open): Open the files in binary mode always.
13195 * script.cc (Lex::get_token): Treat \r as whitespace.
13196
d4780e57
ILT
131972009-10-09 Ian Lance Taylor <iant@google.com>
13198
13199 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
13200
d9a893b8
ILT
132012009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13202 Ian Lance Taylor <iant@google.com>
13203
13204 * configure.ac: Check for readv function also.
13205 * fileread.cc (readv): Define if not HAVE_READV.
13206 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
13207 does not exist.
13208 * config.in: Regenerate.
13209 * configure: Regenerate.
13210
c0a62865
DK
132112009-10-09 Doug Kwan <dougkwan@google.com>
13212
13213 * layout.cc (Layout::make_output_section): Call target hook to make
13214 ordinary output section.
13215 (Layout::finalize): Adjust parameter list of call the
13216 Target::may_relax().
13217 * layout.h (class Layout::section_list): New method.
13218 * merge.h (Output_merge_base::entsize): Change visibility to public.
13219 (Output_merge_base::is_string, Output_merge_base::do_is_string):
13220 New methods.
13221 (Output_merge_string::do_is_string): New method.
13222 * object.cc (Sized_relobj::do_setup): renamed from
13223 Sized_relobj::set_up.
13224 * object.h (Sized_relobj::adjust_shndx,
13225 Sized_relobj::initializ_input_to_output_maps,
13226 Sized_relobj::free_input_to_output_maps): Change visibilities to
13227 protected.
13228 (Sized_relobj::setup): Virtualize.
13229 (Sized_relobj::do_setup): New method declaration.
13230 (Sized_relobj::invalidate_section_offset,
13231 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
13232 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
13233 * options.cc (parse_int): New function.
13234 * options.h (parse_int): New declaration.
13235 (DEFINE_int): New macro.
13236 (stub_group_size): New option.
13237 * output.cc (Output_section::Output_section): Initialize memebers
13238 merge_section_map_, merge_section_by_properties_map_,
13239 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
13240 (Output_section::add_input_section): Handled deferred code-fill
13241 generation and remove an old comment.
13242 (Output_section::add_relaxed_input_section): New method definition.
13243 (Output_section::add_merge_input_section): Use merge section by
13244 properties map to speed to search. Update merge section maps
13245 as appropriate.
13246 (Output_section::build_relaxation_map): New method definition.
13247 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
13248 Same.
13249 (Output_section::relax_input_section): Renamed to
13250 Output_section::convert_input_sections_to_relaxed_sections and change
13251 interface to take a vector of pointers to relaxed sections.
13252 (Output_section::find_merge_section,
13253 Output_section::find_relaxed_input_section): New method definitions.
13254 (Output_section::is_input_address_mapped,
13255 Output_section::output_offset, Output_section::output_address):
13256 Use output section data maps to speed up searching.
13257 (Output_section::find_starting_output_address): Add comments.
13258 (Output_section::do_write,
13259 Output_section::write_to_postprocessing_buffer): Do code-fill
13260 generation as appropriate.
13261 (Output_section::get_input_sections): Invalidate relaxed input section
13262 map.
13263 (Output_section::restore_states): Adjust type of checkpoint .
13264 Invalidate relaxed input section map.
13265 * output.h (Output_merge_base): New class declaration.
13266 (Input_section_specifier): New class defintion.
13267 (class Output_relaxed_input_section) Change base class to
13268 Output_section_data_build.
13269 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
13270 base class initializer.
13271 (Output_section::add_relaxed_input_section): New method declaration.
13272 (Output_section::Input_section): Change visibility to protected.
2e702c99 13273 (Output_section::Input_section::relobj,
c0a62865
DK
13274 Output_section::Input_section::shndx): Handle relaxed input sections.
13275 Output_section::input_sections) Change visibility to protected. Also
13276 define overload to return a non-const pointer.
13277 (Output_section::Merge_section_properties): New class defintion.
13278 (Output_section::Merge_section_by_properties_map,
13279 Output_section::Output_section_data_by_input_section_map,
13280 Output_section::Relaxation_map): New types.
13281 (Output_section::relax_input_section): Rename method to
13282 Output_section::convert_input_sections_to_relaxed_sections and change
13283 interface to take a vector of relaxed section pointers.
13284 (Output_section::find_merge_section,
13285 Output_section::find_relaxed_input_section,
13286 Output_section::build_relaxation_map,
13287 Output_section::convert_input_sections_in_list_to_relaxed_sections):
13288 New method declarations.
13289 (Output_section::merge_section_map_
13290 Output_section::merge_section_by_properties_map_,
13291 Output_section::relaxed_input_section_map_,
13292 Output_section::is_relaxed_input_section_map_valid_,
13293 Output_section::generate_code_fills_at_write_): New data members.
13294 * script-sections.cc
13295 (Output_section_element_input::set_section_addresses): Call
13296 current_data_size and addralign methods of relaxed input sections.
13297 (Orphan_output_section::set_section_addresses): Call current_data_size
13298 and addralign methods of relaxed input sections.
13299 * symtab.cc (Symbol_table::compute_final_value): Extract template
13300 from the body of Symbol_table::sized_finalize_symbol.
13301 (Symbol_table::sized_finalized_symbol): Call
13302 Symbol_table::compute_final_value.
13303 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
13304 (Symbol_table::compute_final_value): New templated method declaration.
13305 * target.cc (Target::do_make_output_section): New method defintion.
13306 * target.h (Target::make_output_section): New method declaration.
13307 (Target::relax): Add more parameters for input objects, symbol table
13308 and layout. Adjust call to do_relax.
13309 (Target::do_make_output_section): New method declaration.
13310 (Target::do_relax): Add parameters for input objects, symbol table
13311 and layout.
13312
d446d6c4
ILT
133132009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13314
13315 * pread.c: Include stdio.h.
13316
bc06c745
ILT
133172009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13318
13319 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
13320 defined.
13321
75aea3d0
ILT
133222009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13323
13324 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
13325 Change read_shndx type to unsigned int.
13326 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13327 int.
13328 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13329 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
13330 Change read_shndx type to unsigned int.
13331 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13332 int.
13333 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13334 * layout.cc (Layout::create_symtab_sections): Cast the result of
13335 local_symcount * symsize to off_t in the gold_assert.
13336
be8fcb75
ILT
133372009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13338
13339 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
13340 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
13341 R_ARM_BASE_ABS.
13342 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
13343 (Arm_relocate_functions::thm_abs5): New function.
13344 (Arm_relocate_functions::abs12): New function.
13345 (Arm_relocate_functions::abs16): New function.
13346 (Arm_relocate_functions::base_abs): New function.
13347 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
13348 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
13349 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
13350 R_ARM_BASE_ABS.
13351 (Scan::global): Likewise.
13352 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
13353 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
13354 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
13355 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
13356 R_ARM_BASE_ABS.
13357
c2a122b6
ILT
133582009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13359
13360 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
13361 (Arm_relocate_functions::movt_prel): New function.
13362 (Arm_relocate_functions::thm_movw_prel_nc): New function.
13363 (Arm_relocate_functions::thm_movt_prel): New function.
13364 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
13365 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
13366 (Scan::global, Relocate::relocate): Likewise.
13367 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13368
c4aa1e2d
ILT
133692009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13370
13371 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
13372 Incremental_checker.
13373 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
13374 unsigned int.
13375 (class Incremental_inputs_header): New class.
13376 (Incremental_inputs_header_writer): Edit comment.
13377 (Incremental_inputs_entry): New class.
13378 (Incremental_inputs_entry_writer): Edit comment.
13379 (Sized_incremental_binary::do_find_incremental_inputs_section):
13380 Add *strtab_shndx parameter, fill it.
13381 (Sized_incremental_binary::do_check_inputs): New method.
13382 (Incremental_checker::can_incrementally_link_output_file): Use
13383 Sized_incremental_binary::check_inputs.
13384 (Incremental_inputs::report_command_line): Save command line in
13385 command_line_.
13386 * incremental.h:
13387 (Incremental_binary::find_incremental_inputs_section): New
13388 method.
13389 (Incremental_binary::do_find_incremental_inputs_section): Add
13390 strtab_shndx parameter.
13391 (Incremental_binary::do_check_inputs): New pure virtual method.
13392 (Sized_incremental_binary::do_check_inputs): Declare.
13393 (Incremental_checker::Incremental_checker): Add incremental_inputs
13394 parameter, use it to initialize incremental_inputs_.
13395 (Incremental_checker::incremental_inputs_): New field.
13396 (Incremental_checker::command_line): New method.
13397 (Incremental_checker::inputs): New method.
13398 (Incremental_checker::command_line_): New field.
13399
c549a694
ILT
134002009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13401
13402 * incremental.cc: Include <cstdarg> and "target-select.h".
13403 (vexplain_no_incremental): New function.
13404 (explain_no_incremental): New function.
13405 (Incremental_binary::error): New method.
13406 (Sized_incremental_binary::do_find_incremental_inputs_section): New
13407 method.
13408 (make_sized_incremental_binary): New function.
13409 (open_incremental_binary): New function.
13410 (can_incrementally_link_file): Add checks if output is ELF and has
13411 inputs section.
13412 * incremental.h: Include "elfcpp_file.h" and "output.h".
13413 (Incremental_binary): New class.
13414 (Sized_incremental_binary): New class.
13415 (open_incremental_binary): Declare.
13416 * object.cc (is_elf_object): Use
13417 elfcpp::Elf_recognizer::is_elf_file.
13418 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
13419 * output.h (Output_file::filesize): New method.
13420
fd3c5f0b
ILT
134212009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13422
13423 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
13424 New function.
13425 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
13426 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
13427 function.
13428 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
13429 function.
13430 (Arm_relocate_functions::movw_abs_nc): New function.
13431 (Arm_relocate_functions::movt_abs): New function.
13432 (Arm_relocate_functions::thm_movw_abs_nc): New function.
13433 (Arm_relocate_functions::thm_movt_abs): New function.
13434 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
13435 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
13436 (Scan::global): Likewise.
13437 (Relocate::relocate): Likewise.
13438 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13439
7f5309a5
ILT
134402009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13441
13442 * arm.cc (Arm_relocate_functions::got_prel) New function.
13443 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
13444 (Relocate::relocate): Likewise.
13445 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13446
364c7fa5
ILT
134472009-10-06 Ian Lance Taylor <iant@google.com>
13448
13449 * options.h (class General_options): Define
13450 split_stack_adjust_size parameter.
13451 * object.h (class Object): Add uses_split_stack_ and
13452 has_no_split_stack_ fields. Add uses_split_stack and
13453 has_no_split_stack accessor functions. Declare
13454 handle_split_stack_section.
13455 (class Reloc_symbol_changes): Define.
13456 (class Sized_relobj): Define Function_offsets. Declare
13457 split_stack_adjust, split_stack_adjust_reltype, and
13458 find_functions.
13459 * object.cc (Object::handle_split_stack_section): New function.
13460 (Sized_relobj::do_layout): Call handle_split_stack_section.
13461 * dynobj.cc (Sized_dynobj::do_layout): Call
13462 handle_split_stack_section.
13463 * reloc.cc (Sized_relobj::relocate_sections): Call
13464 split_stack_adjust for executable sections in split_stack
13465 objects. Pass reloc_map to relocate_section.
13466 (Sized_relobj::split_stack_adjust): New function.
13467 (Sized_relobj::split_stack_adjust_reltype): New function.
13468 (Sized_relobj::find_functions): New function.
13469 * target-reloc.h: Include "object.h".
13470 (relocate_section): Add reloc_symbol_changes parameter. Change
13471 all callers.
13472 * target.h (class Target): Add calls_non_split method. Declare
13473 do_calls_non_split virtual method. Declare match_view and
13474 set_view_to_nop.
13475 * target.cc: Include "elfcpp.h".
13476 (Target::do_calls_non_split): New function.
13477 (Target::match_view): New function.
13478 (Target::set_view_to_nop): New function.
13479 * gold.cc (queue_middle_tasks): Give an error if mixing
13480 split-stack and non-split-stack objects with -r.
13481 * i386.cc (Target_i386::relocate_section): Add
13482 reloc_symbol_changes parameter.
13483 (Target_i386::do_calls_non_split): New function.
13484 * x86_64.cc (Target_x86_64::relocate_section): Add
13485 reloc_symbol_changes parameter.
13486 (Target_x86_64::do_calls_non_split): New function.
13487 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
13488 parameter.
13489 * powerpc.cc (Target_powerpc::relocate_section): Add
13490 reloc_symbol_changes parameter.
13491 * sparc.cc (Target_sparc::relocate_section): Add
13492 reloc_symbol_changes parameter.
13493 * configure.ac: Call AM_CONDITIONAL for the default target.
13494 * configure: Rebuild.
13495 * testsuite/Makefile.am (TEST_AS): New variable.
13496 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
13497 (check_DATA): Add split_i386 and split_x86_64 files.
13498 (SPLIT_DEFSYMS): Define.
13499 (split_i386_[1234n].o): New targets.
13500 (split_i386_[124]): New targets.
13501 (split_i386_[1234r].stdout): New targets.
13502 (split_x86_64_[1234n].o): New targets.
13503 (split_x86_64_[124]): New targets.
13504 (split_x86_64_[1234r].stdout): New targets.
13505 (MOSTLYCLEANFILES): Add new executables.
13506 * testsuite/split_i386.sh: New file.
13507 * testsuite/split_x86_64.sh: New file.
13508 * testsuite/split_i386_1.s: New file.
13509 * testsuite/split_i386_2.s: New file.
13510 * testsuite/split_i386_3.s: New file.
13511 * testsuite/split_i386_4.s: New file.
13512 * testsuite/split_i386_n.s: New file.
13513 * testsuite/split_x86_64_1.s: New file.
13514 * testsuite/split_x86_64_2.s: New file.
13515 * testsuite/split_x86_64_3.s: New file.
13516 * testsuite/split_x86_64_4.s: New file.
13517 * testsuite/split_x86_64_n.s: New file.
13518 * testsuite/testfile.cc (Target_test): Update relocation_section
13519 function.
13520 * testsuite/Makefile.in: Rebuild.
13521
e8a9fcda
ILT
135222009-10-06 Ian Lance Taylor <iant@google.com>
13523
13524 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
13525 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
13526 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
13527 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
13528 the address on ldo_addrs_.
13529 (Target_i386::Relocate::fix_up_ldo): New function.
13530
e99daf92
ILT
135312009-10-06 Rafael Espindola <espindola@google.com>
13532
13533 * plugin.cc (add_input_library): New.
13534 (Plugin::load): Add add_input_library to tv.
13535 (Plugin_manager::add_input_file): Add the is_lib argument.
13536 (add_input_file): Update call to Plugin_manager::add_input_file.
13537 (add_input_library): New.
13538 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
13539
966d4097
DK
135402009-09-30 Doug Kwan <dougkwan@google.com>
13541
13542 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
13543 symbol and call Symbol::may_need_copy_reloc to determine if
13544 a copy reloc is needed.
13545 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
13546 nocopyreloc is given in command line.
13547 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
13548 given in command line.
13549 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
13550 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
13551 of the removed Target_i386::may_need_copy_reloc.
13552 * options.h (copyreloc): New option with default value false.
13553 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13554 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
13555 instead of the removed Target_powerpc::may_need_copy_reloc.
13556 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13557 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
13558 instead of the removed Target_sparc::may_need_copy_reloc.
13559 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
13560 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
13561 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
13562 instead of the removed Target_x86_64::may_need_copy_reloc.
13563
029ba973
ILT
135642009-09-30 Ian Lance Taylor <iant@google.com>
13565
13566 * object.h (class Object): Remove target_ field, and target,
13567 sized_target, and set_target methods.
13568 (Object::sized_target): Remove.
13569 (class Sized_relobj): Update declarations. Remove sized_target.
13570 * object.cc (Sized_relobj::setup): Remove target parameter.
13571 Change all callers.
13572 (Input_objects::add_object): Don't do anything with the target.
13573 (make_elf_sized_object): Add punconfigured parameter. Change all
13574 callers. Set or test parameter target.
13575 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
13576 Change all callers.
13577 * parameters.cc (Parameters::set_target): Change parameter type to
13578 be non-const.
13579 (Parameters::default_target): Remove.
13580 (set_parameters_target): Change parameter type to be non-const.
13581 (parameters_force_valid_target): New function.
13582 (parameters_clear_target): New function.
13583 * parameters.h (class Parameters): Update declarations. Remove
13584 default_target method. Add sized_target and clear_target
13585 methods. Change target_ to be non-const.
13586 (set_parameters_target): Update declaration.
13587 (parameters_force_valid_target): Declare.
13588 (parameters_clear_target): Declare.
13589 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
13590 as NULL if we aren't searching.
13591 (Add_symbols::run): Don't check for compatible target.
13592 * fileread.cc (Input_file::open_binary): Call
13593 parameters_force_valid_target.
13594 * gold.cc (queue_middle_tasks): Likewise.
13595 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
13596 set_target on object.
13597 * dynobj.h (class Sized_dynobj): Update declarations.
13598 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
13599 make_elf_object returns NULL.
13600 (Archive::include_member): Don't check whether object target is
13601 compatible.
13602 * output.cc (Output_section::add_input_section): Get target from
13603 parameters.
13604 (Output_section::relax_input_section): Likewise.
13605 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
13606 parameters.
13607 (Sized_relobj::do_scan_relocs): Likewise.
13608 (Sized_relobj::relocate_sections): Likewise.
13609 * resolve.cc (Symbol_table::resolve): Likewise.
13610 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
13611 parameter. Change all callers.
13612 (Symbol_table::add_from_object): Get target from parameters.
13613 (Symbol_table::add_from_relobj): Don't check object target.
13614 (Symbol_table::add_from_dynobj): Likewise.
13615 (Symbol_table::define_special_symbol): Get target from
13616 parameters.
13617 * symtab.h (class Symbol_table): Update declaration.
13618 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
13619 parameter. Change all callers. Clear parameter target.
13620 (Binary_test): Test target here.
13621 * testsuite/object_unittest.cc (gold_testsuite): Remove
13622 target_test_pointer parameter. Change all callers.
13623 (Object_test): Test target here.
13624
a6a22b83
ILT
136252009-09-26 Ian Lance Taylor <iant@google.com>
13626
13627 * testsuite/initpri1.c: Don't try to use constructor priorities if
13628 compiling with gcc before 4.3.
13629
6a8f49fe
ILT
136302009-09-22 Mikolaj Zalewski <mikolajz@google.com>
13631
13632 * testsuite/retain_symbols_file_test.sh (check_present): Change
13633 output file name to retain_symbols_file_test.stdout.
13634 (check_absent): Likewise.
13635
8c604651
CS
136362009-09-18 Craig Silverstein <csilvers@google.com>
13637
13638 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
13639 * options.cc: Include <cerrno> and <fstream>.
13640 (General_options::finalize): Parse -retain-symbols-file tag.
13641 * options.h: New flag.
13642 (General_options): New method should_retain_symbol, new
13643 variable symbols_to_retain.
13644 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
13645 should_retain_symbol map.
13646 * testsuite/Makefile.am (retain_symbols_file_test): New test.
13647 * testsuite/Makefile.in: Regenerate.
13648 * testsuite/retain_symbols_file_test.sh: New file.
13649
ca58b19f
NC
136502009-09-18 Nick Clifton <nickc@redhat.com>
13651
13652 * po/es.po: Updated Spanish translation.
13653
20e6d0d6
DK
136542009-09-17 Doug Kwan <dougkwan@google.com>
13655
13656 * debug.h (DEBUG_RELAXATION): New constant.
13657 (DEBUG_ALL): Add DEBUG_RELAXATION.
13658 (debug_string_to_enum): Add relaxation debug option.
13659 * layout.cc
13660 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
13661 Layout::Relaxation_debug_check::read_sections,
13662 Layout::Relaxation_debug_check::read_sections): New method definitions.
13663 (Layout::Layout): Initialize data members
13664 record_output_section_data_from_scrips_,
13665 script_output_section_data_list_ and relaxation_debug_check_.
13666 (Layout::save_segments, Layout::restore_segments,
13667 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13668 Layout::relaxation_loop_body): New method definitions.
13669 (Layout::finalize): Support relaxation. Move section layout code to
13670 Layout::relaxation_loop_body.
13671 (Layout::set_asection_address_from_script): Move code for orphan
13672 section placement out.
13673 (Layout::place_orphan_sections_in_script): New method definition.
13674 * layout.h (Output_segment_headers, Output_file_header):
13675 New forward class declarations.
13676 (Layout::~Layout): Define.
13677 (Layout::new_output_section_data_from_script): New method definition.
13678 (Layout::place_orphan_sections_in_script): New method declaration.
13679 (Layout::Segment_states): New type declaration.
13680 (Layout::save_segments, Layout::restore_segments,
13681 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13682 Layout::relaxation_loop_body): New method declarations.
13683 (Layout::Output_section_data_list): New type declaration.
13684 (Layout::Relaxation_debug_check): New class definition.
13685 (Layout::record_output_section_data_from_script_,
13686 Layout::script_output_section_data_list_, Layout::segment_states_,
13687 Layout::relaxation_debug_check_): New data members.
13688 * output.cc: (Output_section_headers::do_size): New method definition.
13689 (Output_section_headers::Output_section_headers): Move size
13690 computation to Output_section_headers::do_size.
13691 (Output_segment_headers::do_size): New method definition.
e1df38aa 13692 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
13693 Output_file_header::do_size and call it.
13694 (Output_file_header::do_size): New method definition.
13695 (Output_data_group::Output_data_group): Adjust call to
13696 Output_section_data.
13697 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
13698 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 13699 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
13700 RELAXED_INPUT_SECTION_CODE.
13701 (Output_section::Output_section): Initialize data member checkpoint_.
13702 (Output_section::~Output_section): Delete checkpoint object pointed
13703 by checkpoint_.
13704 (Output_section::add_input_section): Always add an Input_section if
13705 relaxing.
13706 (Output_section::add_merge_input_section): Add assert.
13707 (Output_section::relax_input_section): New method definition.
13708 (Output_section::set_final_data_size): Set load address to zero for
13709 an unallocated section.
13710 (Output_section::do_address_and_file_offset_have_reset_values):
13711 New method definition.
13712 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
13713 Handle relaxed input section.
13714 (Output_section::sort_attached_input_sections): Checkpoint input
13715 section list lazily.
13716 (Output_section::get_input_sections): Change type of input_sections to
13717 list of Simple_input_section pointers. Checkpoint input section list
13718 lazily. Also handle relaxed input sections.
13719 (Output_section::add_input_section_for_script): Take a reference to
13720 a Simple_input_section object instead of Relobj pointer and section
13721 index as parameter. Handle relaxed input sections.
13722 (Output_section::save_states, Output_section::restore_states): New
13723 method definitions.
13724 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
13725 (Output_data::is_data_size_fixed): New method definition.
13726 (Output_data::reset_addresss_and_file_offset): Do not reset data size
13727 if it is fixed.
13728 (Output_data::address_and_file_offset_have_reset_values): New method
13729 definition.
13730 (Output_data::do_address_and_file_offset_have_reset_values): New method
13731 definition.
13732 (Output_data::set_data_size): Check that data size is not fixed.
13733 (Output_data::fix_data_size): New method definition.
13734 (Output_data::is_data_size_fixed_): New data member.
13735 (Output_section_headers::set_final_data_size): New method definition.
13736 (Output_section_headers::do_size): New method declaration.
13737 (Output_segment_headers::set_final_data_size): New method definition.
13738 (Output_segment_headers::do_size): New method declaration.
13739 (Output_file_header::set_final_data_size)::New method definition.
13740 (Output_file_header::do_size)::New method declaration.
13741 (Output_section_data::Output_section_data): Add new parameter
13742 is_data_size_fixed and use it to fix data size.
13743 (Output_data_const::Output_data_const): Adjust call to base class
13744 constructor and fix data size.
13745 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
13746 base class constructor and fix data size.
13747 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
13748 base class constructor and fix data size.
13749 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
13750 class constructor and fix data size.
13751 (Output_data_group::set_final_data_size): New method definition.
13752 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
13753 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
13754 class constructor and fix data size.
13755 (Output_relaxed_input_section): New class definition.
13756 (Output_section::Simple_input_section): New class definition.
13757 (Output_section::get_input_sections): Adjust parameter list.
13758 (Output_section::add_input_section_for_script): Same.
13759 (Output_section::save_states, Output_section::restore_states,
13760 Output_section::do_address_and_file_offset_have_reset_values,
13761 (Output_section::Input_section::Input_section): Handle
13762 RELAXED_INPUT_SECTION_CODE. Add new overload for
13763 Output_relaxed_input_section.
13764 (Output_section::Input_section::is_input_section,
13765 Output_section::Input_section::set_output_section): Handle relaxed
13766 input section.
13767 (Output_section::Input_section::is_relaxed_input_section,
13768 Output_section::Input_section::output_section_data,
13769 Output_section::Input_section::relaxed_input_section): New method
13770 definitions.
13771 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
13772 value.
13773 (Output_section::Input_section::u1_): Update comments.
13774 (Output_section::Input_section::u2_): Add new union member poris.
13775 (Output_section::Checkpoint_output_section): New classs definition.
13776 (Output_section::relax_input_section): New method declaration.
13777 (Output_section::checkpoint_): New data member.
13778 (Output_segment): Update comments.
13779 (Output_segment::Output_segment): Un-privatize copy constructor.
13780 (Output_segment::operator=): Un-privatize.
13781 * script-sections.cc (Output_section_element::Input_section_list):
13782 Change element type to Output_section::Simple_input_section.
13783 (Output_section_element_dot_assignment::set_section_addresses):
13784 Register output section data for relaxation clean up.
13785 (Output_data_exression::Output_data_expression): Adjust call to base
13786 constructor to fix data size.
13787 (Output_section_element_data::set_section_addresses): Register
13788 Output_data_expression object for relaxation clean up.
13789 (struct Input_section_info): Replace Relobj pointer and section index
13790 pair with Output_section::Simple_input_section and Convert struct to a
13791 class.
13792 (Input_section_sorter::operator()): Adjust access to
e1df38aa 13793 Input_section_info data member to use accessors.
20e6d0d6
DK
13794 (Output_section_element_input::set_section_addresses): Use layout
13795 parameter. Adjust code to use Output_section::Simple_input_section
13796 and Input_secction_info classes. Register filler for relaxation
13797 clean up.
13798 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
13799 and section index pair with Output_section::Simple_input_section
13800 class. Adjust code accordingly.
13801 (Phdrs_element::release_segment): New method definition.
13802 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
13803 segment list.
13804 (Script_sections::release_segments): New method definition.
13805 * gold/script-sections.h (Script_sections::release_segments): New
13806 method declaration.
13807 * gold/target.h (Target::may_relax, Target::relax,
13808 Target::do_may_relax, Target::do_relax): New method definitions.
13809
5e445df6
ILT
138102009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13811
13812 * arm.cc (has_signed_unsigned_overflow): New function.
13813 (Arm_relocate_functions::abs8): New function.
13814 (Target_arm::Scan::local): Handle R_ARM_ABS8.
13815 (Target_arm::Scan::global): Likewise.
13816 (Target_arm::relocate::relocate): Likewise.
13817 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
13818 Likewise.
13819
8c604651 138202009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
13821
13822 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
13823 * testsuite/Makefile.in: Regenerate.
13824
1e9cc1c2
NC
138252009-09-11 Nick Clifton <nickc@redhat.com>
13826
13827 * po/gold.pot: Updated by the Translation project.
13828
6a89f575
CC
138292009-09-08 Cary Coutant <ccoutant@google.com>
13830
13831 * output.cc (Output_file::open): Add execute permission to empty file.
13832 * testsuite/Makefile.am (permission_test): New test.
13833 * testsuite/Makefile.in: Regenerate.
13834
fdcac5af
ILT
138352009-09-02 Ian Lance Taylor <iant@google.com>
13836
13837 * output.cc (Output_file::resize): Call map_no_anonymous rather
13838 than map.
13839
44453f85
ILT
138402009-09-01 Mikolaj Zalewski <mikolajz@google.com>
13841
13842 * gold.cc: Include "incremental.h".
13843 (queue_initial_tasks): Call Incremental_checker methods.
13844 * incremental.cc: Include "output.h".
13845 (Incremental_checker::can_incrementally_link_output_file): New
13846 method.
13847 * incremental.h (Incremental_checker): New class.
13848
13849 * output.cc (Output_file::open_for_modification): New method.
13850 (Output_file::map_anonymous): Changed return type to bool. Record
13851 map in base_ field.
13852 (Output_file::map_no_anonymous): New method, broken out of map.
13853 (Output_file::map): Use map_no_anonymous and map_anonymous.
13854 * output.h (class Output_file): Update declarations.
13855
293c1386
CC
138562009-08-24 Cary Coutant <ccoutant@google.com>
13857
13858 * options.h (Command_line::Pre_options): New class.
13859 (Command_line::pre_options): New member.
13860 * options.cc (gold::options::ready_to_register): New variable.
13861 (One_option::register_option): Do nothing if not registering options.
13862 Assert if same short option registered twice.
13863 (General_options::General_options): Turn off option registration when
13864 done constructing.
13865 (Command_line::Pre_options::Pre_options): New constructor.
13866
f773f3d2
CC
138672009-08-24 Cary Coutant <ccoutant@google.com>
13868
06a73cfe
CC
13869 * options.h (General_options::no_keep_memory): Remove incorrect
13870 short option.
f773f3d2 13871
a15af8e2
RW
138722009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13873
13874 * Makefile.am (am__skiplex, am__skipyacc): New.
13875 * Makefile.in: Regenerate.
13876
c462b41b
RW
138772009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13878
14ec8efd
RW
13879 * Makefile.am (AM_CPPFLAGS): Renamed from ...
13880 (INCLUDES): ... this.
13881 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
13882 (AM_CPPFLAGS): Renamed from ...
13883 (INCLUDE): ... this.
13884 * Makefile.in, testsuite/Makefile.in: Regenerate.
13885
81ecdfbb
RW
13886 * Makefile.in: Regenerate.
13887 * aclocal.m4: Likewise.
13888 * config.in: Likewise.
13889 * configure: Likewise.
13890 * testsuite/Makefile.in: Likewise.
13891
c462b41b
RW
13892 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
13893 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
13894 * Makefile.in: Regenerate.
13895 * testsuite/Makefile.in: Regenerate.
13896
2da73f13
CC
138972009-08-19 Cary Coutant <ccoutant@google.com>
13898
13899 * resolve.cc (Symbol_table::resolve): Don't complain about defined
13900 symbols in shared libraries overridden by hidden or internal symbols
13901 in the main program.
13902
2db70501
CD
139032009-08-19 Chris Demetriou <cgd@google.com>
13904
13905 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
13906 checking source file names in error messages.
13907
f733487b
DK
139082009-08-18 Doug Kwan <dougkwan@google.com>
13909
13910 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
13911 an elcpp::Ehdr as parameter. Adjust call to set_target.
13912 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
13913 an elfcpp::Ehdr as parameter.
13914 * object.cc (Object::set_target): Remove the version that looks up
13915 a target and sets it.
13916 (Sized_relobj::setup): Take a Target object instead of
13917 an elfcpp::Ehdr as parameter. Adjust call to set_target.
13918 (make_elf_sized_object): Find target and ask target to
13919 make an ELF object.
13920 * object.h: (Object::set_target): Remove the version that looks up
13921 a target and sets it.
13922 (Sized_relobj::setup): Take a Target object instead of
13923 an elfcpp:Ehdr as parameter.
13924 * target.cc: Include dynobj.h.
13925 (Target::do_make_elf_object_implementation): New.
2e702c99 13926 (Target::do_make_elf_object): New.
f733487b
DK
13927 * target.h (Target::make_elf_object): New template declaration.
13928 (Target::do_make_elf_object): New method declarations.
13929 (Target::do_make_elf_object_implementation): New template declaration.
13930
cc70f101
ILT
139312009-08-14 Ian Lance Taylor <iant@google.com>
13932
13933 * gold.h (FUNCTION_NAME): Define.
13934 (gold_unreachable): Use FUNCTION_NAME.
13935
ef5e0cb1
ST
139362009-08-12 Sriraman Tallam <tmsriram@google.com>
13937
13938 * icf.cc (Icf::find_identical_sections): Issue a warning when a
13939 symbol in the --keep-unique list is not found.
13940
48c187ce
ST
139412009-08-12 Sriraman Tallam <tmsriram@google.com>
13942
13943 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
13944 been maked as --keep-unique.
13945 (Icf::unfold_section): New function.
13946 * icf.h (Icf::unfold_section): New function.
13947 * options.h (General_options::keep_unique): New option.
13948 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
13949 * testsuite/Makefile.in: Regenerate.
13950 * testsuite/icf_keep_unique_test.sh: New file.
13951 * testsuite/icf_keep_unique_test.cc: New file.
13952
645afe0c
CC
139532009-08-12 Cary Coutant <ccoutant@google.com>
13954
13955 PR 10471
13956 * resolve.cc (Symbol_table::resolve): Check for references from
13957 dynamic objects to hidden and internal symbols.
13958 * testsuite/Makefile.am (hidden_test.sh): New test.
13959 * testsuite/Makefile.in: Regenerate.
13960 * testsuite/hidden_test.sh: New script.
13961 * testsuite/hidden_test_1.c: New test source.
13962 * testsuite/hidden_test_main.c: New test source.
13963
11af873f
DK
139642009-08-11 Doug Kwan <dougkwan@google.com>
13965
13966 * arm.cc: Update comments.
13967 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
13968 segment to locate the .ARM.exidx section if present.
13969
b9f7d72d
DK
139702009-08-09 Doug Kwan <dougkwan@google.com>
13971
13972 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
13973 patch.
13974
ddd3c53c
ST
139752009-08-07 Sriraman Tallam <tmsriram@google.com>
13976 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
13977 compiler warnings.
13978
27721062
ST
139792009-08-06 Sriraman Tallam <tmsriram@google.com>
13980
13981 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
13982 valid tls_segment only for non-debug-section relocations.
13983 * testsuite/Makefile.am: Add gc_tls_test.
13984 * testsuite/Makefile.in: Regenerate.
13985 * testsuite/gc_tls_test.cc: New file.
13986 * testsuite/gc_tls_test.sh: New file.
13987
ef15dade 139882009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 13989
ef15dade
ST
13990 * icf.cc: New file.
13991 * icf.h: New file.
13992 * Makefile.am (CCFILES): Add icf.cc.
13993 (HFILES): Add icf.h
13994 * Makefile.in: Regenerate.
13995 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
13996 * gc.h (gc_process_relocs): Populate lists used by icf to contain
13997 section, symbol and addend information for the relocs.
13998 * gold.cc (queue_middle_tasks): Call identical code folding.
13999 * gold.h: Add defines for multimap.
14000 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
14001 to the call of finalize_local_symbols.
14002 * main.cc (main): Create object of class Icf.
14003 * object.cc (Sized_relobj::do_layout): Allow this function to be
14004 called twice during icf.
14005 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
14006 to sections marked as identical by icf.
14007 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
14008 when available.
14009 (Sized_relobj::do_section_entsize): New function.
14010 * object.h (Object::section_entsize): New function.
14011 (Object::do_section_entsize): New pure virtual function.
14012 (Relobj::finalize_local_symbols): Add new parameter.
14013 (Relobj::do_section_entsize): New function.
14014 * options.h (General_options::icf): New option.
14015 (General_options::icf_iterations): New option.
14016 (General_options::print_icf_sections): New option.
14017 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
14018 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
14019 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
14020 icf.
14021 * symtab.cc (Symbol_table::is_section_folded): New function.
14022 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
14023 to sections marked as identical by icf.
14024 * symtab.h (Symbol_table::set_icf): New function.
14025 (Symbol_table::icf): New function.
14026 (Symbol_table::is_section_folded): New function.
14027 (Symbol_table::icf_): New data member.
14028 * target-reloc.h (relocate_section): Ignore sections folded by icf.
14029 * testsuite/Makefile.am: Add commands to build icf_test.
14030 * testsuite/Makefile.in: Regenerate.
14031 * testsuite/icf_test.sh: New file.
14032 * testsuite/icf_test.cc: New file.
14033
c3b65ac4
CD
140342009-07-24 Chris Demetriou <cgd@google.com>
14035
14036 * layout.cc (is_compressible_debug_section): Fix incorrect
14037 comment about compressed section names.
14038
1caf2c51
ILT
140392009-07-20 Ian Lance Taylor <ian@airs.com>
14040
14041 PR 10419
14042 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
14043
1ef4d87f
ILT
140442009-07-16 Ian Lance Taylor <iant@google.com>
14045
14046 PR 10400
14047 * layout.h: #include <map>.
14048 (class Kept_section): Change from struct to class. Add accessors
14049 and setters. Add section size to Comdat_group mapping. Change
14050 Comdat_group to std::map. Add is_comdat_ field. Add
14051 linkonce_size field in union.
14052 (class Layout): Update declaration of find_or_add_kept_section.
14053 Don't declare find_kept_object.
14054 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
14055 parameter. Add object, shndx, is_comdat, and is_group_name
14056 parameters. Change all callers. Adjust for new Kept_section.
14057 (Layout::find_kept_object): Remove.
14058 * object.cc (Sized_relobj::include_section_group): Update use of
14059 Kept_section. Rename secnum to shndx. Only record
14060 Kept_comdat_section if sections are the same size.
14061 (Sized_relobj::include_linkonce_section): Update use of
14062 Kept_section. Only record Kept_comdat_section if sections are the
14063 same size. Set size of linkonce section.
14064 (Sized_relobj::map_to_kept_section): Update call to
14065 get_kept_comdat_section.
14066 * object.h (class Sized_relobj): Rename fields in
14067 Kept_comdat_section to drop trailing underscores; change object
14068 field to Relobj*. Change Kept_comdat_section_table to store
14069 struct rather than pointer.
14070 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
14071 Add kept_object and kept_shndx parameters. Change all callers.
14072 (Sized_relobj::get_kept_comdat_section): Change return type to
14073 bool. Add kept_object and kept_shndx parameters. Change all
14074 callers.
14075 * plugin.cc (Pluginobj::include_comdat_group): Update call to
14076 Layout::find_or_add_kept_section.
14077
37c3b7b0
ILT
140782009-07-09 Ian Lance Taylor <iant@google.com>
14079
14080 * merge.cc (Object_merge_map::initialize_input_to_output_map):
14081 Reserve space in the hash table.
14082
98fa85cb
ILT
140832009-07-06 Mikolaj Zalewski <mikolajz@google.com>
14084
14085 * fileread.cc (File_read::get_mtime): New method.
14086 * fileread.h (Timespec): New structure.
14087 (File_read::get_mtime): New method.
14088 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
14089 Renamed from timestamp_nsec.
14090 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
14091 Elf_Xword.
e1df38aa 14092 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 14093 timestamp_nsec.
e1df38aa 14094 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
14095 (Incremental_inputs::report_obejct): Save mtime; style fix.
14096 (Incremental_inputs::report_script): Save mtime; style fix.
14097 (Incremental_inputs::finalize_inputs): Style fix.
14098 (Incremental_inputs::finalize): Style fix.
14099 (Incremental_inputs::create_input_section_data): Store inputs
14100 mtime.
14101 * incremental.h (Incremental_inputs::report_script): Add mtime
14102 argument.
14103 (Incremental_inputs::Input_info::Input_info): Intialize only one
14104 union member.
14105 (Incremental_inputs::Input_info::archive): Move to nameless
14106 union.
14107 (Incremental_inputs::Input_info::obejct): Move to nameless union.
14108 (Incremental_inputs::Input_info::script): Move to nameless union.
14109 (Incremental_inputs::mtime): New field.
14110 * script.cc (read_input_script): Pass file mtime to
14111 Incremental_input.
14112 * script.h (Script_info::inputs): Style fix.
14113
c9d70757
ILT
141142009-07-01 Ian Lance Taylor <ian@airs.com>
14115
14116 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
14117 instead of 32.
14118
9c547ec3
ILT
141192009-06-24 Ian Lance Taylor <iant@google.com>
14120
14121 PR 10156
14122 * layout.cc (Layout::choose_output_section): If we find an
14123 existing section, update the flags.
14124 (Layout::create_notes): New function, broken out of
14125 Layout::finalize.
14126 (Layout::finalize): Don't create note sections.
14127 (Layout::create_note): Don't crash if linker script discards
14128 section.
14129 (Layout::create_gold_note): Likewise.
14130 (Layout::create_build_id): Likewise. Don't set
14131 after_input_sections on the section.
14132 (Layout::create_executable_stack_info): Remove target parameter.
14133 Change caller.
14134 * layout.h (class Layout): Declare create_notes. Update
14135 declaration of create_executable_stack_info.
14136 * gold.cc (queue_middle_tasks): Call create_notes.
14137 * output.cc (Output_section::update_flags_for_input_section): Move
14138 here from output.h. If SHF_ALLOC flag is newly set, mark address
14139 invalid.
14140 * output.h (Output_data::mark_address_invalid): New function.
14141 (class Output_section): Only declare, not define,
14142 update_flags_for_input_section. Remove set_flags.
14143
55458500
ILT
141442009-06-24 Ian Lance Taylor <iant@google.com>
14145
14146 * script-sections.cc (Output_section_definition::
14147 set_section_addresses): Rename shadowing local load_address to
14148 laddr.
14149
1307d6cd
ILT
141502009-06-24 Ian Lance Taylor <iant@google.com>
14151
14152 PR 10244
14153 * reloc.cc (relocate_sections): Skip empty relocation sections.
14154
ec3f783e
ILT
141552009-06-23 Ian Lance Taylor <iant@google.com>
14156
14157 PR 10156
14158 * layout.cc (Layout::create_note): Use choose_output_section
14159 rather than make_output_section.
14160
459c9f1c
ILT
141612009-06-23 Ian Lance Taylor <iant@google.com>
14162
14163 PR 10237
14164 * options.cc (General_options::parse_V): Set printed_version_.
14165 (General_options::General_options): Initialize printed_version_.
14166 * options.h (class General_options): Add printed_version_ field.
14167 * gold.cc (queue_initial_tasks): If there are no input files,
14168 don't give a fatal error if we printed the version information.
14169 (queue_middle_tasks): If using -r with a shared object, give a
14170 fatal error rather than an ordinary error.
14171
1518dc8f
ILT
141722009-06-23 Ian Lance Taylor <iant@google.com>
14173
14174 PR 10219
14175 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
14176 (Layout::make_output_section): Set have_stabstr_section_ if we see
14177 a .stab*str section.
14178 (Layout::finalize): Call link_stabs_sections.
14179 (Layout::link_stabs_sections): New file.
14180 * layout.h (class Layout): Add have_stabstr_section_ field.
14181 Declare link_stabs_sections.
14182
3d857b98
DK
141832009-06-23 Doug Kwan <dougkwan@google.com>
14184
14185 * Makefile.am (libgold_a_LIBADD): New.
14186 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 14187 * Makefile.in: Regenerate.
3d857b98
DK
14188 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
14189 * configure: Regenerate.
14190 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
14191 * fileread.cc: Include sys/state.h
14192 * gold.h: Declare memmem and strndup if found missing.
14193 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
14194
0639a6f6
ILT
141952009-06-23 Ian Lance Taylor <iant@google.com>
14196
14197 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
14198 * configure: Rebuild.
14199
8d63875c
ILT
142002009-06-23 Ian Lance Taylor <iant@google.com>
14201
14202 PR 10147
14203 * object.cc (Object::section_contents): Don't try to get a view if
14204 the section has length zero.
14205 (Object::handle_gnu_warning_section): If the section is empty, use
14206 the name of the section as the warning.
14207
f7c8a183
ILT
142082009-06-23 Ian Lance Taylor <iant@google.com>
14209
14210 PR 10133
14211 * stringpool.h (class Stringpool_template): Add optimize_ field.
14212 (Stringpool_template::set_optimize): New function.
14213 * stringpool.cc (Stringpool_template::Stringpool_template):
14214 Initialize optimize_ field.
14215 (Stringpool_template::set_string_offsets): Test local optimize
14216 fild rather than parameter.
14217 * layout.cc (Layout::Layout): Call set_optimize on the section
14218 name stringpool.
14219
e6a307ba
ILT
142202009-06-22 Ian Lance Taylor <iant@google.com>
14221
14222 PR 10030
14223 * yyscript.y: Parse TARGET.
14224 * script.cc (script_set_target): New function.
14225 * script-c.h (script_set_target): Declare.
14226 * options.cc (General_options::string_to_object_format): Rename
14227 from string_to_object_format in anonymous namespace. Change
14228 callers.
14229 * options.h (class General_options): Declare
14230 string_to_object_format.
14231
3ee173de
ILT
142322009-06-22 Ian Lance Taylor <iant@google.com>
14233
14234 * script-sections.cc (Script_sections::create_segments): Don't put
14235 program headers in a PT_LOAD segment if -n or -N.
14236
142372009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
14238
14239 PR 10141
14240 * options.h (class General_options): Add -z lazy and -z now. Sort
14241 -z options into alphabetical order.
14242 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
14243
cd6739a1 142442009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
14245
14246 * layout.cc (Layout::make_output_section): Call
14247 Target::new_output_section.
14248 (Layout::attach_allocated_section_to_segment): Put large section
14249 sections in a separate load segment with the large segment flag
14250 set.
14251 (Layout::segment_precedes): Sort large data segments after other
14252 load segments.
14253 (align_file_offset): New static function.
14254 (Layout::set_segment_offsets): Use align_file_offset.
14255 * output.h (class Output_section): Add is_small_section_ and
14256 is_large_section_ fields.
14257 (Output_section::is_small_section): New function.
14258 (Output_section::set_is_small_section): New function.
14259 (Output_section::is_large_section): New function.
14260 (Output_section::set_is_large_section): New function.
14261 (Output_section::is_large_data_section): New function.
14262 (class Output_segment): Add is_large_data_segment_ field.
14263 (Output_segment::is_large_data_segment): New function.
14264 (Output_segment::set_is_large_data_segment): New function.
14265 * output.cc (Output_section::Output_section): Initialize new
14266 fields.
14267 (Output_segment::Output_segment): Likewise.
14268 (Output_segment::add_output_section): Add assertion that large
14269 data sections always go in large data segments. Force small data
14270 sections to the end of the list of data sections. Force small BSS
14271 sections to the start of the list of BSS sections. For large BSS
14272 sections to the end of the list of BSS sections.
14273 * symtab.h (class Symbol): Declare is_common_shndx.
14274 (Symbol::is_defined): Check Symbol::is_common_shndx.
14275 (Symbol::is_common): Likewise.
14276 (class Symbol_table): Define enum Commons_section_type. Update
14277 declarations. Add small_commons_ and large_commons_ fields.
14278 * symtab.cc (Symbol::is_common_shndx): New function.
14279 (Symbol_table::Symbol_table): Initialize new fields.
14280 (Symbol_table::add_from_object): Put small and large common
14281 symbols in the right list.
14282 (Symbol_table::sized_finalized_symbol): Check
14283 Symbol::is_common_shndx.
14284 (Symbol_table::sized_write_globals): Likewise.
14285 * common.cc (Symbol_table::do_allocate_commons): Allocate new
14286 common symbol lists. Don't call do_allocate_commons_list if the
14287 list is empty.
14288 (Symbol_table::do_allocate_commons_list): Remove is_tls
14289 parameter. Add comons_section_type parameter. Change all
14290 callers. Handle small and large common symbols.
14291 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
14292 Symbol::is_common_shndx.
14293 * resolve.cc (symbol_to_bits): Likewise.
14294 * target.h (Target::small_common_shndx): New function.
14295 (Target::small_common_section_flags): New function.
14296 (Target::large_common_shndx): New function.
14297 (Target::large_common_section_flags): New function.
14298 (Target::new_output_section): New function.
14299 (Target::Target_info): Add small_common_shndx, large_common_shndx,
14300 small_common_section_flags, and large_common_section_flags
14301 fields.
14302 (Target::do_new_output_section): New virtual function.
14303 * arm.cc (Target_arm::arm_info): Initialize new fields.
14304 * i386.cc (Target_i386::i386_info): Likewise.
14305 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
14306 Likewise.
14307 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
14308 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
14309 (Target_x86_64::do_new_output_section): New function.
14310 * configure.ac: Define conditional MCMODEL_MEDIUM.
14311 * testsuite/Makefile.am (check_PROGRAMS): Add large.
14312 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
14313 (large_LDFLAGS): Define.
14314 * testsuite/large.c: New file.
14315 * testsuite/testfile.cc (Target_test::test_target_info):
14316 Initialize new fields.
14317 * configure, testsuite/Makefile.in: Rebuild.
14318
bb04269c
DK
143192009-06-05 Doug Kwan <dougkwan@google.com>
14320
14321 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 14322 * Makefile.in: Regenerate.
bb04269c
DK
14323 * i386.cc (class Target_i386): Define new virtual method to
14324 override do_is_local_label_name in parent.
14325 * object.cc (Sized_relobj::do_count_local_symbols): Discard
14326 local symbols if --discard-locals or -X is given.
14327 * options.h (class General_options): Declare new options
14328 '--discard-locals' and '-X' for discarding locals.
14329 * target.h (class Target): Define new methods is_local_label_name.
14330 Declare new virtual method do_is_local_label_name.
14331 * target.cc: New file.
14332 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
14333 (check_SCRIPTS): Add discard_locals_test.sh.
14334 (check_DATA): Add discard_local_tests.syms.
14335 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
14336 (discard_local_tests.syms, discard_locals_test.o): New make rules.
14337 * testsuite/Makefile.in: Regenerate.
14338 * testsuite/discard_locals_test.c: New file.
14339 * testsuite/discard_locals_test.sh: Same.
14340
805bb01c
DK
143412009-06-05 Doug Kwan <dougkwan@google.com>
14342
14343 * object.cc (Sized_relobj::Sized_relobj): Initialize
14344 discarded_eh_frame_shndx_ to -1U.
14345 (Sized_relobj::do_layout): Record index of a discard .eh_frame
14346 section.
14347 (Sized_relobj::do_count_local_symbols): Skip local symbols in
14348 a discarded .eh_frame section.
14349 (Sized_relobj::do_finalize_local_symbols): Ditto.
14350 * object.h (class Sized_relobj): Declare new member
14351 discarded_eh_frame_shndx_.
14352 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
14353 (local_labels_test.o, local_labels_test): New rules.
14354 * testsuite/Makefile.in: Regenerate.
14355
1dcd334d
DK
143562009-06-04 Doug Kwan <dougkwan@google.com>
14357
14358 * layout.cc (Layout::section_name_mapping): Add mapping for
14359 special ARM sections.
14360
96d49306
DK
143612009-06-03 Doug Kwan <dougkwan@google.com>
14362
14363 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
14364 (utils::has_overflow): Same.
14365
dff16297
ILT
143662009-06-03 Ian Lance Taylor <iant@google.com>
14367
14368 * layout.cc (Layout::section_name_mapping): New array, replacing
14369 Layout::linkonce_mapping.
14370 (Layout::section_name_mapping_count): New variable, replacing
14371 Layout::linkonce_mapping_count.
14372 (Layout::linkonce_output_name): Remove.
14373 (Layout::output_section_name): Rewrite.
14374 * layout.h (class Layout): Rename Linkonce_mapping to
14375 Section_name_mapping, linkonce_mapping to section_name_mapping,
14376 linkonce_mapping_count to section_name_mapping_count. Don't
14377 declare linkonce_output_name.
14378
c121c671
DK
143792009-06-03 Doug Kwan <dougkwan@google.com>
14380
14381 * gold/arm.cc (namespace utils): New.
14382 (Target_arm::reloc_is_non_pic): Define new method.
14383 (class Arm_relocate_functions): New.
14384 (Target_arm::Relocate::relocate): Handle relocation types used by
14385 Android.
14386
07800fab
ILT
143872009-06-03 Ian Lance Taylor <iant@google.com>
14388
14389 * arm.cc (Target_arm::scan::global): Use || instead of |.
14390
c121c671
DK
143912009-06-02 Doug Kwan <dougkwan@google.com>
14392
14393 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
14394 issued_non_pic_error_.
14395 (class Target_arm::Scan): Declare new method check_non_pic.
14396 Define new method symbol_needs_plt_entry.
14397 Declare new data member issued_non_pic_error_.
14398 (class Target_arm::Relocate): Declare new method
14399 should_apply_static_reloc.
14400 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
14401 (Target_arm::Scan::check_non_pic): Define new method.
14402 (Target_arm::Scan::local): Handle a small subset of reloc types used
14403 by Android.
14404 (Target_arm::Scan::local): Same.
14405 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
14406
b19b0c6d
ILT
144072009-05-31 Mikolaj Zalewski <mikolajz@google.com>
14408
14409 * incremental.cc (Incremental_inputs::report_command_line): Filter
14410 out --incremental-* options.
14411
94cdfcff
DK
144122009-05-29 Doug Kwan <dougkwan@google.com>
14413
14414 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
14415 template class.
14416 (class Target_arm): Update comment.
14417 (Target_arm::Target_arm): Initialize new data members GOT_,
14418 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
14419 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
14420 and Target_arm::rel_dyn_section.
14421 Declare new_enum Target_arm::Got_type.
14422 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
14423 and DYNBSS_.
14424 Update commments for member do_dynsym_value.
14425 (Target_arm::got_size, Target_arm::plt_section,
14426 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
14427 new methods inside class defintion.
14428 (Target_arm::got_section): Define new method.
14429 (Target_arm::rel_dyn_section): Same.
14430 (Output_data_plt_arm): New template class.
14431 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
14432 (Output_data_plt_arm:do_adjust_output_section): Define new method.
14433 (Output_data_plt_arm::add_entry): Same.
14434 (Output_data_plt_arm::first_plt_entry): Define new
14435 static data member for PLT instruction template.
14436 (Output_data_plt_arm::plt_entry): Same.
14437 (Output_data_plt_arm::do_write): Define new method.
14438 (Target_arm::make_plt_entry): Same.
14439 (Target_arm::do_finalize_sections): Same.
14440 (Target_arm::do_dynsym_value): Same.
14441
4a657b0d
DK
144422009-05-28 Doug Kwan <dougkwan@google.com>
14443
14444 * Makefile.am (TARGETSOURCES): Add arm.cc.
14445 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
14446 * Makefile.in: Regenerate.
14447 * arm.cc: New file.
14448 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
14449
e7ae8c36
DK
144502009-05-26 Doug Kwan <dougkwan@google.com>
14451
14452 * options.cc (General_options::parse_exclude_libs). Fix a comment.
14453 (General_options::check_excluded_libs): Strip off directories in
14454 archive name before matching like GNU ld does.
14455 * testsuite/Makefile.am (MOSTLYCLEANFILES,
14456 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
14457 (exclude_libs_test_LDFLAGS): Add linker option
14458 -Wl,--exclude-libs,libexclude_libs_test_3
14459 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
14460 an explicit archive without using -l.
14461 (alt/libexclude_libs_test_3.a): New make rule.
14462 * testsuite/Makefile.in: Regenerate.
14463 * testsuite/exclude_libs_test.c : Declare lib3_default().
14464 (main): Call it.
14465 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
14466 * exclude_libs_test_3.c: New file.
14467
f12e7348
NC
144682009-05-26 Nick Clifton <nickc@redhat.com>
14469
14470 * po/id.po: New Indonesian translation.
14471 * po/gold.pot: Updated template file.
14472
4daadc0d
ST
144732009-05-22 Sriraman Tallam <tmsriram@google.com>
14474
e1df38aa 14475 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
14476 gc_comdat_test files. Add -Wl,--gc-sections to build
14477 gc_comdat_test.
14478 * testsuite/Makefile.in: Regenerate.
14479 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
14480
531813ad
ST
144812009-05-21 Sriraman Tallam <tmsriram@google.com>
14482
14483 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
14484 kept comdat section was garbage collected.
14485 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
14486 * testsuite/Makefile.in: Regenerate.
14487 * testsuite/gc_comdat_test.sh: New file.
14488 * testsuite/gc_comdat_test_1.cc: New file.
14489 * testsuite/gc_comdat_test_2.cc: New file.
14490
65514900
CC
144912009-05-19 Doug Kwan <dougkwan@google.com>
14492
14493 * archive.cc (Archive::Archive): Move constructor from archive.h
14494 to here. Initialize no_export_.
14495 (Archive::get_elf_object_for_member): Set no_export flag of object.
14496 * archive.h (Archive::Archive): Move constructor body to
14497 archive.cc.
14498 (Archive::no_export): New method.
14499 (Archive::no_export_): New field.
14500 * object.h (Object::Object): Initialize no_export_ to false.
14501 (Object::no_export, Object::set_no_export): New methods.
14502 (Object::no_export_): New field.
14503 * options.cc (General_options::parse_exclude_libs): New method.
14504 (General_options::check_excluded_libs) Same.
14505 * options.h (exclude_libs): New option.
14506 (General_options::check_excluded_libs): New method declaration.
14507 (General_options::excluded_libs_): New field.
14508 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
14509 default or protected visibility if an object has no-export flag set.
14510 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
14511 (check_SCRIPTS): Add exclude_libs_test.sh.
14512 (check_DATA): Add exclude_libs_test.syms.
14513 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
14514 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
14515 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
14516 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
14517 (exclude_libs_test.syms, libexclude_libs_test_1.a,
14518 libexclude_libs_test_2.a): New rules.
14519 * testsuite/Makefile.in: Regenerate.
14520 * testsuite/exclude_libs_test.c: New file.
14521 * testsuite/exclude_libs_test.sh: Ditto.
14522 * testsuite/exclude_libs_test_1.c: Ditto.
14523 * testsuite/exclude_libs_test_2.c: Ditto.
14524
1b77ea50
ILT
145252009-05-15 Ian Lance Taylor <iant@google.com>
14526
14527 * configure.ac: Check for declarations for cases where libiberty.h
14528 checks HAVE_DECL_xxx.
14529 * configure, config.in: Rebuild.
14530
072fe7ce
ILT
145312009-05-15 Mikolaj Zalewski <mikolajz@google.com>
14532
14533 * gold.h (Incremental_argument_list): Remove (invalid) forward
14534 declaration.
14535 * incremental.cc (Incremental_inputs::report_achive): New method.
14536 (Incremental_inputs::report_object): New method.
14537 (Incremental_inputs::report_script): New method.
14538 (Incremental_inputs::finalize_inputs): New method.
14539 (Incremental_inputs::finalize): Call finalize_inputs().
14540 (Incremental_inputs::sized_create_incremental_inputs_section_data):
14541 Create inputs entries.
14542 * incremental.h (Incremental_input_type): New enum.
14543 (Incremental_inputs::Incremental_input): Initialize new fields.
14544 (Incremental_inputs::report_inputs): New method.
14545 (Incremental_inputs::report_achive): New method.
14546 (Incremental_inputs::report_object): New method.
14547 (Incremental_inputs::report_script): New method.
14548 (Incremental_inputs::finalize_inputs): New method.
14549 (Incremental_inputs::Input_info): New struct.
14550 (Incremental_inputs::Input_info_map): New typedef.
14551 (Incremental_inputs::lock_): New field.
14552 (Incremental_inputs::Inputs_): New field.
14553 (Incremental_inputs::Inputs_map): New field.
14554 * main.cc (main): Call Incremental_input::report_inputs.
14555 * options.h (Input_argument_list): Typedef moved from
14556 Input_arguments.
14557 (Input_file_group::Files): Remove, use ::Input_argument_list.
14558 (Input_file_group::Input_argument_list): Remove, use
14559 ::Input_argument_list.
14560 * plugin.cc (Plugin_manager::add_input_file): Add error in
14561 incremental build.
14562 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
14563 functions.
14564 * script.cc (read_input_script): Call
14565 Incremental_input::report_script.
14566 * script.h (Script_info): New class.
14567
b0481b0b
ILT
145682009-04-27 Ian Lance Taylor <iant@google.com>
14569
14570 * x86_64.cc (do_adjust_output_section): Set entsize to
14571 plt_entry_size.
14572
b22a5a41 145732009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
14574
14575 * output.cc (Output_file::close): After short writes, continue
14576 writing from the correct offset in the buffer being written.
14577
40fde488
CD
145782009-04-23 Chris Demetriou <cgd@google.com>
14579
14580 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
14581 * configure: Regenerate.
14582 * config.in: Regenerate.
14583 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
14584 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
14585
3ce2c28e
ILT
145862009-04-21 Mikolaj Zalewski <mikolajz@google.com>
14587
14588 * incremental.cc (Incremental_inputs_header_data): Renamed from
14589 Incremental_input_header_data.
14590 (Incremental_inputs_header_data::data_size): New field.
14591 (Incremental_inputs_header_data::put_input_file_count): Renamed
14592 from input_file_count.
14593 (Incremental_inputs_header_data::put_command_line_offset): Renamed
14594 from command_line_offset.
14595 (Incremental_inputs_header_data::put_reserved): Renamed from
14596 put_reserved.
14597 (Incremental_inputs_entry_data): Renamed from
14598 Incremental_input_entry_data.
14599 (Incremental_inputs_entry_data::data_size): New field.
14600 (Incremental_inputs::report_command_line): New method.
14601 (Incremental_inputs::finalize): New method.
14602 (Incremental_inputs::create_incremental_inputs_data): New method.
14603 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
14604 * incremental.h: New file.
14605 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 14606 (Layout::finalize): Create incremental inputs section in
3ce2c28e 14607 incremental builds.
703d02da 14608 (Layout::create_incremental_info_sections): New method.
3ce2c28e 14609 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
14610 (Layout::create_incremental_info_sections): New method.
14611 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
14612 * main.cc (main): Notify Incremental_input of the command line.
14613
e55bde5e
ILT
146142009-04-01 Ian Lance Taylor <iant@google.com>
14615 Mikolaj Zalewski <mikolajz@google.com>
14616
14617 * gold.h (reserve_unordered_map): Define, three versions, one for
14618 each version of Unordered_map.
14619 * layout.cc (Layout::Layout): Remove options parameter. Add
14620 number_of_input_files parameter. Don't initialize options_.
14621 Initialize number_of_input_files_ and resized_signatures_. Move
14622 sections_are_attached_.
14623 (Layout::layout_group): Reserve space for group_signatures_.
14624 (Layout::find_or_add_kept_section): Change name parameter to be a
14625 reference. Resize signatures_ map when it gets large enough.
14626 (Layout::layout_eh_frame): Use parameters->options() instead of
14627 this->options_.
14628 (Layout::make_output_section): Likewise.
14629 (Layout::attach_allocated_section_to_segment): Likewise.
14630 (Layout::finalize, Layout::create_executable_stack): Likewise.
14631 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
14632 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
14633 * layout.h (class Layout): Update declarations. Remove options_
14634 field. Add number_of_input_files_ and resized_signatures_
14635 fields. Move sections_are_attached_ field.
14636 * main.cc (main): Pass number of input files to Layout
14637 constructor. Don't pass options.
14638
154b857c
ILT
146392009-03-30 Ian Lance Taylor <iant@google.com>
14640
14641 * ffsll.c (ffsll): Correct implementation.
14642
2f35ab9b
ILT
146432009-03-27 Ian Lance Taylor <iant@google.com>
14644
fd03461a
ILT
14645 * ffsll.c: New file.
14646 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
14647 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
14648 * ftruncate.c (ftruncate): Declare before definition.
14649 * mremap.c (mremap): Likewise.
14650 * pread.c (pread): Likewise.
14651 * configure, Makefile.in, config.in: Rebuild.
14652
2f35ab9b
ILT
14653 * mremap.c: New file.
14654 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
14655 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
14656 (mremap): Declare if HAVE_MREMAP is not defined.
14657 * configure, Makefile.in, config.in: Rebuild.
14658
33aea2fd
CC
146592009-03-27 Cary Coutant <ccoutant@google.com>
14660
14661 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
14662 position independent.
14663 * sparc.cc (Target_sparc::check_non_pic): Likewise.
14664 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
14665
6d479619
CC
146662009-03-24 Cary Coutant <ccoutant@google.com>
14667
14668 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
14669 an executable.
14670 (needs_dynamic_reloc): Likewise.
14671
afc06bb8
ILT
146722009-03-24 Ian Lance Taylor <iant@google.com>
14673
14674 * yyscript.y (file_cmd): Recognize EXTERN.
14675 (extern_name_list, extern_name_list_body): New nonterminals.
14676 * script.cc (script_add_extern): Define.
14677 * script-c.h (script_add_extern): Declare.
14678
f6060a4d
ILT
146792009-03-24 Rafael Avila de Espindola <espindola@google.com>
14680
14681 * object.cc (is_elf_object): Define.
14682 * object.h (is_elf_object): Declare.
14683 * archive.cc (Archive::get_elf_object_for_member): Call
14684 is_elf_object.
33aea2fd 14685 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 14686
26736d8e
ILT
146872009-03-24 Elliott Hughes <enh@google.com>
14688
14689 * output.cc (Output_file::map_anonymous): Define.
14690 (Output_file::map): Use map_anonymous. If the regular mmap fails,
14691 try an anonymous one. Report the size if the mmap fails.
14692 * output.h (class Output_file): Declare map_anonymous.
14693
22fd9730
ILT
146942009-03-24 Ian Lance Taylor <iant@google.com>
14695
14696 * target-select.cc (instantiate_target): Don't acquire the lock if
14697 the instantiated_target_ field has already been set.
14698
cb010894
ILT
146992009-03-23 Ian Lance Taylor <iant@google.com>
14700
7f055c20
ILT
14701 * gold-threads.h (class Initialize_lock): Define.
14702 * gold-threads.cc (class Initialize_lock_once): Define.
14703 (initialize_lock_control): New static variable.
14704 (initialize_lock_pointer): New static variable.
14705 (initialize_lock_once): New static function.
14706 (Initialize_lock::Initialize_lock): Define.
14707 (Initialize_lock::initialize): Define.
14708 * target-select.h: Include "gold-threads.h".
14709 (class Target_selector): Add lock_ and initialize_lock_ fields.
14710 Don't define instantiate_target, just declare it.
14711 * target-select.cc (Target_selector::Target_selector): Initialize
14712 new fields.
14713 (Target_selector::instantiate_target): Define.
14714 * descriptors.h: Include "gold-threads.h".
14715 (class Descriptors): Add initialize_lock_ field.
14716 * descriptors.cc (Descriptors::Descriptors): Initialize new
14717 field.
14718 (Descriptors::open): Use initialize_lock_ field
14719 * errors.h (class Errors): Add initialize_lock_ field.
14720 * errors.cc (Errors::Errors): Initialize new field.
14721 (Errors::initialize_lock): Use initialize_lock_ field.
14722 * powerpc.cc (class Target_selector_powerpc): Remove
14723 instantiated_target_ field. In do_recognize call
14724 instantiate_target rather than do_instantiate_target. In
14725 do_instantiate_target just allocate a new target.
14726 * sparc.cc (class Target_selector_sparc): Likewise.
14727
36959681
ILT
14728 * freebsd.h: New file.
14729 * i386.cc: Include "freebsd.h".
14730 (Target_i386): Derive from Target_freebsd rather than
14731 Sized_target.
14732 (Target_selector_i386): Derive from Target_selector_freebsd rather
14733 than Target_selector.
14734 * x86_64.cc: Include "freebsd.h".
14735 (Target_x86_64): Derive from Target_freebsd rather than
14736 Sized_target.
14737 (Target_selector_x86_64): Derive from Target_selector_freebsd
14738 rather than Target_selector.
14739 * target.h (class Target): Add adjust_elf_header and
14740 do_adjust_elf_header.
14741 * output.cc (Output_file_header:: do_sized_write): Call target
14742 adjust_elf_header routine.
14743 * configure.tgt: Set targ_osabi.
14744 * configure.ac: Define GOLD_DEFAULT_OSABI.
14745 * parameters.cc (Parameters::default_target): Pass
14746 GOLD_DEFAULT_OSABI to select_target.
14747 * target-select.h (class Target_selector): Make instantiate_target
14748 protected rather than private.
14749 * Makefile.am (HFILES): Add freebsd.h.
14750 * configure, Makefile.in, config.in: Rebuild.
14751
cb010894
ILT
14752 * merge.cc (do_add_input_section): Correct pend value. Change
14753 message about last entry not being null terminated from error to
14754 warning.
14755
0e879927
ILT
147562009-03-20 Mikolaj Zalewski <mikolajz@google.com>
14757
14758 * incremental.cc: New file.
14759 * Makefile.am (CCFILES): Add incremental.cc.
14760 * Makefile.in: Rebuild.
14761
41105937
PP
147622009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
14763
14764 * layout.cc (Layout::output_section_name): Preserve names
14765 of '.note.' sections.
e1df38aa 14766
60439920
ILT
147672009-03-19 Ian Lance Taylor <iant@google.com>
14768
14769 * descriptors.cc (Descriptors::open): Check that the options are
14770 valid before using them.
14771
0d371ad3
ILT
147722009-03-18 Ian Lance Taylor <iant@google.com>
14773
14774 * script-sections.h: Include <list>.
14775 (class Script_sections): Change Sections_elements from std::vector
14776 to std::list. Typedef public Elements_iterator. Add
14777 orphan_section_placement_, data_segment_align_start_, and
14778 saw_data_segment_align_ fields. Remove data_segment_align_index_
14779 field.
14780 * script-sections.cc (class Orphan_section_placement): New class.
14781 (class Sections_element): Add virtual functions is_relro and
14782 orphan_section_init. Remove virtual function place_orphan_here.
14783 (class Output_section_definition): Add is_relro and
14784 orphan_section_init. Remove place_orphan_here.
14785 (class Orphan_output_section): Likewise.
14786 (Script_sections::Script_sections): Update for field changes.
14787 (Script_sections::data_segment_align): Set saw_data_segment_align_
14788 and data_segment_align_start_, not data_segment_align_index.
14789 (Script_sections::data_segment_relro_end): Check
14790 saw_data_segment_align_. Use data_segment_align_start_ rather
14791 than data_segment_align_index_.
14792 (Script_sections::place_orphan): Rewrite to use
14793 Orphan_section_placement.
14794
9201d894
ILT
147952009-03-17 Ian Lance Taylor <iant@google.com>
14796
9c5b8369
ILT
14797 * archive.cc (Archive::add_symbols): Check for a version attached
14798 to the symbol name in the archive map.
14799 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
14800 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
14801 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
14802 (ver_test_11.a): New target.
14803 * testsuite/Makefile.in: Rebuild.
14804
9201d894
ILT
14805 * configure.ac: Check for chsize and posix_fallocate. Replace
14806 ftruncate.
14807 * ftruncate.c: New file, from gnulib.
14808 * output.cc (posix_fallocate): Define dummy version if not
14809 HAVE_POSIX_FALLOCATE.
14810 (Output_file::map): Call posix_fallocate rather than lseek and
14811 write.
14812 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
14813 * configure, Makefile.in, config.in: Rebuild.
14814
ef4ab7a8 148152009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 14816
ef4ab7a8
PP
14817 * layout.h (Layout::create_note): Add section_name parameter.
14818 * layout.cc (Layout::create_note): Likewise.
14819 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 14820
8c500701
ILT
148212009-03-17 Ian Lance Taylor <iant@google.com>
14822
e85b18e1
ILT
14823 * descriptors.cc: Include "options.h".
14824 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
14825 (Descriptors::open): Always use O_CLOEXEC when opening a new
14826 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
14827 then set FD_CLOEXEC.
14828
9efe6174
ILT
14829 * sparc.cc (class Target_sparc): Add has_got_section.
14830 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
14831 make sure we have a GOT section.
14832
14833 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
14834 (Target_sparc::Scan::local): Likewise.
14835 (Target_sparc::Scan::global): Likewise.
14836 (Target_sparc::Relocate::relocate): Likewise.
14837 (Target_sparc::Relocate::relocate_tls): Likewise.
14838
8c500701
ILT
14839 * symtab.cc (Symbol_table::define_default_version): New function,
14840 broken out of add_from_object.
14841 (Symbol_table::add_from_object): Call define_default_version.
14842 (Symbol_table::define_special_symbol): Add resolve_oldsym
14843 parameter. Change all callers. If the version for a symbol comes
14844 from a version script, resolve it with the symbol with the same
14845 name with no version. Also add the symbol without a version if
14846 appropriate.
14847 (do_define_in_output_data): If resolving with oldsym, don't delete
14848 sym.
14849 (do_define_in_output_segment): Likewise.
14850 (do_define_as_constant): Likewise.
14851 * symtab.h (class Symbol_table): Update declarations.
14852
f1ed28fb
ILT
148532009-03-13 Ian Lance Taylor <iant@google.com>
14854
15f8229b
ILT
14855 * readsyms.cc (Read_symbols::incompatible_warning): New function.
14856 (Read_symbols::requeue): New function.
14857 (Read_symbols::do_read_symbols): If make_elf_object fails because
14858 the target type is not configured, and the file was searched for,
14859 issue a warning and retry with the next directory.
14860 (Add_symbols::run): If the file has an incompatible format, and
14861 it was searched for, requeue the Read_symbols task. On error,
14862 release the object.
14863 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
14864 dirindex parameter to constructor. Change all callers. Declare
14865 incompatible_warning and requeue.
14866 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
14867 input_argument_ and input_group_ fields. Add them to
14868 constructor. Change all callers.
14869 (class Read_script): Add dirindex_ field. Add it to constructor.
14870 Change all callers.
14871 * archive.cc (Archive::setup): Remove input_objects parameter.
14872 Change all callers.
14873 (Archive::get_file_and_offset): Likewise.
14874 (Archive::read_all_symbols): Likewise.
14875 (Archive::read_symbols): Likewise.
14876 (Archive::get_elf_object_for_member): Remove input_objects
14877 parameter. Add punconfigured parameter. Change all callers.
14878 (Archive::add_symbols): Change return type to bool. Check return
14879 value of include_member.
14880 (Archive::include_all_members): Likewise.
14881 (Archive::include_member): Change return type to bool. Return
14882 false if first included object has incompatible target. Set
14883 included_member_ field.
14884 (Add_archive_symbols::run): If add_symbols returns false, requeue
14885 Read_symbols task.
14886 * archive.h (class Archive): Add included_member_ field.
14887 Initialize it in constructor. Add input_file and searched_for
14888 methods. Update declarations.
14889 (class Add_archive_symbols): Add dirpath_, dirindex_, and
14890 input_argument_ fields. Add them to constructor. Change all
14891 callers.
14892 * script.cc: Include "target-select.h".
14893 (class Parser_closure): Add skip_on_incompatible_target_ and
14894 found_incompatible_target_ fields. Add
14895 skip_on_incompatible_target parameter to constructor. Change all
14896 callers. Add methods skip_on_incompatible_target,
14897 clear_skip_on_incompatible_target, found_incompatible_target, and
14898 set_found_incompatible_target.
14899 (read_input_script): Add dirindex parameter. Change all callers.
14900 If parser finds an incompatible target, requeue Read_symbols
14901 task.
14902 (script_set_symbol): Clear skip_on_incompatible_target in
14903 closure.
14904 (script_add_assertion, script_parse_option): Likewise.
14905 (script_start_sections, script_add_phdr): Likewise.
14906 (script_check_output_format): New function.
14907 * script.h (read_input_script): Update declaration.
14908 * script-c.h (script_check_output_format): Declare.
14909 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
14910 (ignore_cmd): Remove OUTPUT_FORMAT.
14911 * fileread.cc (Input_file::Input_file): Add explicit this.
14912 (Input_file::will_search_for): New function.
14913 (Input_file::open): Add pindex parameter. Change all callers.
14914 * fileread.h (class Input_file): Add input_file_argument method.
14915 Declare will_search_for. Update declarations.
14916 * object.cc (make_elf_object): Add punconfigured parameter.
14917 Change all callers.
14918 * object.h (class Object): Make input_file public. Add
14919 searched_for method.
14920 (make_elf_object): Update declaration.
14921 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
14922 restart search.
14923 * dirsearch.h (class Dirsearch): Update declaration.
14924 * options.h (class General_options): Add --warn-search-mismatch.
14925 * parameters.cc (Parameters::is_compatible_target): New function.
14926 * parameters.h (class Parameters): Declare is_compatible_target.
14927 * workqueue.cc (Workqueue::add_blocker): New function.
14928 * workqueue.h (class Workqueue): Declare add_blocker.
14929
f1ed28fb
ILT
14930 * fileread.cc (Input_file::open): Remove options parameter.
14931 Change all callers.
14932 (Input_file::open_binary): Likewise.
14933 * script.cc (read_input_script): Likewise.
14934 * readsyms.h (class Read_symbols): Remove options_ field. Remove
14935 options parameter from constructor. Change all callers.
14936 (class Read_script): Likewise.
14937 * fileread.h (class Input_file): Update declarations.
14938 * script.h (read_input_script): Update declaration.
14939
34dd024a
NC
149402009-03-10 Nick Clifton <nickc@redhat.com>
14941
14942 * po/es.po: New Spanish translation.
14943
6d71b17c
CC
149442009-03-06 Cary Coutant <ccoutant@google.com>
14945
14946 * options.cc (parse_short_option): Keep dash_z from registering itself.
14947
031cdbed
ILT
149482009-03-03 Ian Lance Taylor <iant@google.com>
14949
14950 PR 9918
14951 * target-reloc.h (relocate_section): Pass output_section to
14952 relocate.
14953 * i386.cc (Target_i386::should_apply_static_reloc): Add
14954 output_section parameter. Change all callers.
14955 (Target_i386::Relocate::relocate): Add output_section parameter.
14956 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
14957 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
14958 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
14959 * testsuite/two_file_shared.sh: New script.
14960 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
14961 (check_DATA): Add two_file_shared.dbg.
14962 (two_file_shared.dbg): New target.
14963 * testsuite/Makefile.in: Rebuild.
14964
15d5fa16
ILT
149652009-03-01 Ian Lance Taylor <iant@google.com>
14966
14967 * configure.ac: Check for byteswap.h.
14968 * configure: Rebuild.
14969 * config.in: Rebuild.
14970
8a4c0b0d
ILT
149712009-03-01 Mikolaj Zalewski <mikolajz@google.com>
14972
14973 * layout.cc (Layout::find_or_add_kept_section): New function.
14974 (Layout::add_comdat): Removed.
14975 * layout.h (struct Kept_section): Move out of class Layout.
14976 Remove trailing underscores from field names. Add group_sections
14977 field. Rename group_ field to is_group. Change all uses.
14978 (class Layout): Declare find_or_add_kept_section, not add_comdat.
14979 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
14980 comdat_groups_ field.
14981 (Sized_relobj::include_section_group): Use
14982 find_or_add_kept_section and Kept_section::group_sections.
14983 (Sized_relobj::include_linkonce_section): Likewise.
14984 * object.cc (class Sized_relobj): Don't define Comdat_group or
14985 Comdat_group_table. Remove find_comdat_group and
14986 add_comdat_group. Remove comdat_groups_ field.
14987 * plugin.cc (include_comdat_group): Use
14988 Layout::find_or_add_kept_section.
14989
b4ecf66b
ILT
149902009-02-28 Ian Lance Taylor <iant@google.com>
14991
14359ca0
ILT
14992 * README: --gc-sections and map files are now supported. Document
14993 some build requirements.
14994
b4ecf66b
ILT
14995 PR 6992
14996 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
14997 relocatable link set the value of the section symbol to zero.
14998 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
14999 relocatable link don't include the section address in the local
15000 symbol value.
15001
0602e05a
ILT
150022009-02-27 Ian Lance Taylor <iant@google.com>
15003
fd9d194f
ILT
15004 PR 6811
15005 * options.h (class Search_directory): Add is_system_directory.
15006 (class General_options): Declare is_in_system_directory.
15007 * options.cc (get_relative_sysroot): Make static.
15008 (get_default_sysroot): Make static.
15009 (General_optoins::is_in_system_directory): New function.
15010 * fileread.cc (Input_file::is_in_system_directory): New function.
15011 * fileread.h (class Input_file): Declare is_in_system_directory.
15012 * object.h (class Object): Add is_in_system_directory.
15013 (class Input_objects): Remove system_library_directory_ field.
15014 * object.cc (Input_objects::add_object): Don't set
15015 system_library_directory_.
15016 (input_objects::found_in_system_library_directory): Remove.
15017 * symtab.cc (Symbol_table::write_globals): Remove input_objects
15018 parameter. Change all callers.
15019 (Symbol_table::sized_write_globals): Likewise.
15020 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
15021 Call Object::is_in_system_directory.
15022 * symtab.h (class Symbol_table): Update declarations.
15023
61edd21f
ILT
15024 PR 5990
15025 * descriptors.h (Open_descriptor): Add is_on_stack field.
15026 * descriptors.cc (Descriptors::open): If the descriptor is on the
15027 top of the stack, remove it. Initialize is_on_stack field.
15028 (Descriptors::release): Only add pod to stack if it is not on the
15029 stack already.
15030 (Descriptors::close_some_descriptor): Clear stack_next and
15031 is_on_stack fields.
15032
e29e076a
ILT
15033 PR 7091
15034 * output.cc (Output_section::find_starting_output_address): Rename
15035 from starting_output_address; add PADDR parameter; change return
15036 type.
15037 * output.h (class Output_section): Declare
15038 find_starting_output_address instead of starting_output_address.
15039 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
15040 section symbol for which we can't find a merge section.
15041
0602e05a
ILT
15042 PR 9836
15043 * symtab.cc (Symbol_table::add_from_object): If the visibility is
15044 hidden or internal, force the symbol to be local.
15045 * resolve.cc (Symbol::override_visibility): Define.
15046 (Symbol::override_base): Use override_visibility.
15047 (Symbol_table::resolve): Likewise.
15048 (Symbol::override_base_with_special): Likewise.
15049 (Symbol_table::override_with_special): If the visibility is hidden
15050 or internal, force the symbol to be local.
15051 * symtab.h (class Symbol): Add set_visibility and
15052 override_visibility.
15053 * testsuite/ver_test_1.sh: New file.
15054 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
15055 (check_DATA): Add ver_test_1.syms.
15056 (ver_test_1.syms): New target.
15057 * testsuite/Makefile.in: Rebuild.
15058
401a9a73
CC
150592009-02-25 Cary Coutant <ccoutant@google.com>
15060
15061 * layout.cc (Layout::choose_output_section): Don't rename sections
15062 when using a linker script that has a SECTIONS clause.
15063 * Makefile.in: Regenerate.
15064
15065 * testsuite/Makefile.am (script_test_5.sh): New test case.
15066 * testsuite/Makefile.in: Regenerate.
15067 * testsuite/script_test_5.cc: New file.
15068 * testsuite/script_test_5.sh: New file.
15069 * testsuite/script_test_5.t: New file.
15070
f488e4b0
CC
150712009-02-13 Rafael Avila de Espindola <espindola@google.com>
15072
15073 * archive.cc (Archive::include_member): Update calls to add_symbols.
15074 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
15075 the Layout argument.
15076 * dynobj.h (do_add_symbols): Add the Layout argument.
15077 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
15078 Layout argument.
15079 * object.h (Object::add_symbols): Add the Layout argument.
15080 (Object::do_add_symbols): Add the Layout argument.
15081 (Sized_relobj::do_add_symbols): Add the Layout argument.
15082 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
15083 Unify the two versions.
15084 (Add_plugin_symbols): Remove.
15085 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
15086 (Sized_pluginobj::do_add_symbols): Unify the two versions.
15087 (Add_plugin_symbols): Remove.
15088 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
15089 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
15090 (Add_symbols::run): Make it work with Pulginobj.
15091
89dd1680
ILT
150922009-02-06 Ian Lance Taylor <iant@google.com>
15093
15094 * object.cc (Sized_relobj::do_layout): Make info message start
15095 with lower case letter.
15096
266d0a74
ILT
150972009-02-06 Mikolaj Zalewski <mikolajz@google.com>
15098
602b464e
ILT
15099 * binary.cc: Fix file comment.
15100
266d0a74
ILT
15101 * options.h (enum Incremental_disposition): Define.
15102 (class General_options): Add new options: --incremental,
15103 --incremental_changed, --incremental_unchanged,
15104 --incremental_unknown. Add incremental_disposition_ and
15105 implicit_incremental_ fields.
15106 (General_options::incremental_disposition): New function.
15107 (class Position_dependent_options): Add incremental_disposition
15108 option.
15109 (Position_dependent_options::copy_from_options): Set incremental
15110 dispositions.
15111 * options.cc (General_options::parse_incremental_changed): New
15112 function.
2e702c99
RM
15113 (General_options::parse_incremental_unchanged): New function.
15114 (General_options::parse_incremental_unknown): New function.
15115 (General_options::General_options): Initialize new fields
266d0a74 15116 incremental_disposition_ and implicit_incremental_.
2e702c99 15117 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
15118 without --incremental.
15119
f073bbf7
CD
151202009-02-06 Chris Demetriou <cgd@google.com>
15121
15122 * gold.h (gold_undefined_symbol): Change to take only a Symbol
15123 pointer and to report location as the file name associated with
15124 the symbol.
15125 (gold_undefined_symbol_at_location): New function to replace the
15126 old gold_undefined_symbol functionality.
15127 * target-reloc.h (relocate_section): Update to use
15128 gold_undefined_symbol_at_location.
15129 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
15130 Call gold_undefined_symbol function rather than gold_error.
15131 * errors.h (Errors::undefined_symbol): Take location as a
15132 string, rather than calculating it from a relocation.
15133 * errors.cc (Errors::fatal): Print "fatal error:" before the
15134 formatted message.
15135 (Errors::error, Errors::error_at_location): Print "error: "
15136 before the formatted message.
15137 (Errors::undefined_symbol): Take location as a string, rather
15138 than calculating it from a relocation.
15139 (gold_undefined_symbol_at_location): New function akin to
15140 old gold_undefined_symbol, calculates location from relocation.
15141 (gold_undefined_symbol): Change to take only a Symbol pointer
15142 and to report location as the file name associated with the symbol.
15143 * testsuite/debug_msg.sh: Update for changed error messages.
15144 * testsuite/undef_symbol.sh: Likewise.
15145
8e94a90c
ILT
151462009-02-04 Duncan Sands <baldrick@free.fr>
15147
15148 PR 9812
15149 * reduced_debug_output.h
15150 (Output_reduced_debug_abbrev_section::failed): Use format for
15151 gold_warning.
15152 (Output_reduced_debug_info_section::faild): Likewise.
15153
88a0e15b
ILT
151542009-01-31 Mikolaj Zalewski <mikolajz@google.com>
15155
15156 * script.cc (Lazy_demangler): New class.
2e702c99 15157 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
15158 symbol only once.
15159
5efc7cd2
CC
151602009-01-29 Cary Coutant <ccoutant@google.com>
15161
15162 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
15163 to __tls_get_addr.
15164 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
15165
e0ebcf42
ILT
151662009-01-28 Ian Lance Taylor <iant@google.com>
15167
5efc7cd2 15168 * version.cc (version_string): Bump to 1.9.
75fe7426 15169
e0ebcf42
ILT
15170 * gold.h: Include <cstring> and <stdint.h>.
15171 * version.cc: Include <cstdio>.
15172 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
15173 warning.
15174 * reduced_debug_output.cc (insert_into_vector): Rename from
15175 Insert_into_vector; change all callers. Use Swap_unaligned to
15176 avoid aliasing issue; remove union since it is unnecessary.
15177
8e2813be 151782009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
15179
15180 * Makefile.am (CCFILES): Add gc.cc.
15181 (HFILES): Add gc.h.
15182 * Makefile.in: Regenerate.
15183 * gold.cc (Gc_runner): New class.
15184 (queue_initial_tasks): Call garbage collection related tasks
15185 when corresponding options are invoked.
15186 (queue_middle_gc_tasks): New function.
15187 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
15188 processed early before laying out sections during garbage collection.
15189 * gold.h (queue_middle_gc_tasks): New function.
15190 (is_prefix_of): Move from "layout.cc".
15191 * i386.cc (Target_i386::gc_process_relocs): New function.
15192 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
15193 * main.cc (main): Create object of class "Garbage_collection".
15194 * object.cc (Relobj::copy_symbols_data): New function.
15195 (Relobj::is_section_name_included): New function.
e1df38aa
NC
15196 (Sized_relobj::do_layout): Allow this function to be called twice
15197 during garbage collection and defer layout of section during the
6d03d481
ST
15198 first call.
15199 * object.h (Relobj::get_symbols_data): New function.
15200 (Relobj::is_section_name_included): New function.
15201 (Relobj::copy_symbols_data): New function.
15202 (Relobj::set_symbols_data): New function.
15203 (Relobj::get_relocs_data): New function.
15204 (Relobj::set_relocs_data): New function.
15205 (Relobj::is_output_section_offset_invalid): New pure virtual function.
15206 (Relobj::gc_process_relocs): New function.
15207 (Relobj::do_gc_process_relocs): New pure virtual function.
15208 (Relobj::sd_): New data member.
15209 (Sized_relobj::is_output_section_offset_invalid): New function.
15210 (Sized_relobj::do_gc_process_relocs): New function.
15211 * options.h (General_options::gc_sections): Modify to not be a no-op.
15212 (General_options::print_gc_sections): New option.
15213 * plugin.cc (Plugin_finish::run): Remove function call to
15214 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
15215 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
15216 * reloc.cc (Read_relocs::run): Add task to process relocs and
15217 determine unreferenced sections when doing garbage collection.
15218 (Gc_process_relocs): New class.
15219 (Sized_relobj::do_gc_process_relocs): New function.
15220 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
15221 sections that are garbage collected.
15222 * reloc.h (Gc_process_relocs): New class.
15223 * sparc.cc (Target_sparc::gc_process_relocs): New function.
15224 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
15225 symbols whose corresponding sections are garbage collected.
15226 (Symbol_table::Symbol_table): Add new parameter for the garbage
15227 collection object.
15228 (Symbol_table::gc_mark_undef_symbols): New function.
15229 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15230 (Symbol_table::gc_mark_dyn_syms): New function.
15231 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
15232 as garbage.
15233 (Symbol_table::add_from_object): Likewise.
15234 (Symbol_table::add_from_relobj): When building shared objects, do not
15235 treat externally visible symbols as garbage.
15236 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
15237 table information for static and relocatable links.
15238 * symtab.h (Symbol_table::set_gc): New function.
15239 (Symbol_table::gc): New function.
15240 (Symbol_table::gc_mark_undef_symbols): New function.
15241 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15242 (Symbol_table::gc_mark_dyn_syms): New function.
15243 (Symbol_table::gc_): New data member.
e1df38aa 15244 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
15245 function.
15246 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
15247 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
15248
3b293544
CF
152492009-01-20 Chris Faylor <me.sourceware@sourceware.org>
15250
15251 * options.h (General_options::gc_sections): Define as a no-op for now.
15252 (General_options::no_keep_memory): Ditto.
15253 (General_options::Bshareable): Define.
15254 * options.cc (General_options::finalize): Honor -Bshareable.
15255
83d22aa8
AS
152562009-01-20 Andreas Schwab <schwab@suse.de>
15257
15258 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
15259 read the value in the contents, since we don't use it. Use the
15260 template endianness when writing.
15261 (Relocate::relocate): Use it for R_PPC_REL16_HA.
15262
cd536b21
AS
152632009-01-19 Andreas Schwab <schwab@suse.de>
15264
15265 * configure.tgt (powerpc64-*): Fix targ_obj.
15266
99e9a495
ILT
152672009-01-15 Ian Lance Taylor <iant@google.com>
15268
15269 * object.cc (Sized_relobj::write_local_symbols): Don't write out
15270 local symbols when stripping all symbols.
15271
bbbfea06
CC
152722009-01-14 Cary Coutant <ccoutant@google.com>
15273
99e9a495 15274 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 15275
0f7c0701
CC
152762009-01-14 Cary Coutant <ccoutant@google.com>
15277
15278 * archive.cc (Archive::get_elf_object_for_member): Remove call
15279 to File_read::claim_for_plugin.
15280 * descriptors.cc (Descriptors::open): Remove reference to
15281 is_claimed.
15282 (Descriptors::claim_for_plugin): Remove.
15283 * descriptors.h (Descriptors::claim_for_plugin): Remove.
15284 (Descriptors::is_claimed): Remove.
15285 (claim_descriptor_for_plugin): Remove.
15286 * fileread.cc (File_read::claim_for_plugin): Remove.
15287 * fileread.h (File_read::claim_for_plugin): Remove.
15288 (File_read::descriptor): Reopen descriptor if necessary.
15289 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
15290 (Plugin_manager::all_symbols_read): Add task parameter. Change
15291 all callers.
15292 (Plugin_manager::get_input_file): New function.
15293 (Plugin_manager::release_input_file): New function.
15294 (Pluginobj::Pluginobj): Add filesize parameter and initialize
15295 corresponding data member.
15296 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
15297 and pass to base constructor. Change all callers.
15298 (get_input_file, release_input_file): New functions.
15299 (make_sized_plugin_object): Add filesize parameter. Change all callers.
15300 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
15301 (Plugin_manager::all_symbols_read): Add task parameter.
15302 (Plugin_manager::get_input_file): New function.
15303 (Plugin_manager::release_input_file): New function.
15304 (Plugin_manager::task_): New data member.
15305 (Pluginobj::Pluginobj): Add filesize parameter.
15306 (Pluginobj::filename): New function.
15307 (Pluginobj::descriptor): New function.
15308 (Pluginobj::filesize): New function.
15309 (Pluginobj::filesize_): New data member.
15310 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
15311 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
15312 File_read::claim_for_plugin; use Object::unlock to unlock the file.
15313
15314 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
15315 with archive libraries.
15316 * testsuite/Makefile.in: Regenerate.
15317 * testsuite/plugin_test.c (struct sym_info): New type.
15318 (get_input_file, release_input_file): New static variables.
15319 (onload): Capture new transfer vector entries.
15320 (claim_file_hook): Stop reading at end of file according to filesize.
15321 Factor out parsing of readelf output into separate function.
15322 (all_symbols_read_hook): Exercise get_input_file and release_input_file
15323 APIs and get the source file name from the symbol table. Convert
15324 source file name to corresponding object file name. Print info
15325 message when adding new input files.
15326 (parse_readelf_line): New function.
15327 * testsuite/plugin_test_1.sh: Add checks for new info messages.
15328 * testsuite/plugin_test_2.sh: Likewise.
15329 * testsuite/plugin_test_3.sh: Likewise.
15330 * testsuite/plugin_test_4.sh: New test case.
15331
62a6d109
ILT
153322009-01-07 Ian Lance Taylor <iant@google.com>
15333
15334 * version.cc (version_string): Bump to 1.8.
15335
483620e8
CC
153362008-12-23 Cary Coutant <ccoutant@google.com>
15337
15338 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
15339 * plugin.cc (Plugin_manager::finish): Rename as
15340 layout_deferred_objects. Move cleanup to separate function.
15341 (Plugin_manager::cleanup): New function.
15342 (Plugin_finish::run): Call layout_deferred_objects and cleanup
15343 separately.
15344 * plugin.h (Plugin_manager::finish): Rename as
15345 layout_deferred_objects.
15346 (Plugin_manager::cleanup): New function.
15347 (Plugin_manager::cleanup_done): New field.
15348
d66a9eb3
CC
153492008-12-23 Cary Coutant <ccoutant@google.com>
15350
15351 * plugin.cc (is_visible_from_outside): New function.
15352 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
15353 so we don't return "IR only" status for exported symbols or -r links.
15354
15355 * testsuite/Makefile.am (plugin_test_3): New test case.
15356 * testsuite/Makefile.in: Regenerate.
15357 * testsuite/plugin_test_3.sh: New file.
15358
5995b570
CC
153592008-12-22 Cary Coutant <ccoutant@google.com>
15360
15361 * object.cc (Sized_relobj::layout_section): New function.
15362 (Sized_relobj::do_layout): Defer layout of input sections until after
15363 plugin has provided replacement files.
15364 (Sized_relobj::do_layout_deferred_sections): New function.
15365 * object.h (Relobj::set_section_offset): Remove virtual keyword.
15366 (Relobj::layout_deferred_sections): New function.
15367 (Relobj::do_layout_deferred_sections): New function.
15368 (Sized_relobj::do_layout_deferred_sections): New function.
15369 (Sized_relobj::layout_section): New function.
15370 (Sized_relobj::Deferred_layout): New structure.
15371 (Sized_relobj::deferred_layout_): New field.
15372 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
15373 Change all callers. Layout deferred sections.
15374 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
15375 references.
15376 (Plugin_hook::run): Move code from do_plugin_hook inline.
15377 (Plugin_hook::do_plugin_hook): Remove.
15378 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
15379 (Plugin_manager::finish): Renamed, was cleanup.
15380 (Plugin_manager::should_defer_layout): New function.
15381 (Plugin_manager::add_deferred_layout_object): New function.
15382 (Plugin_manager::Deferred_layout_list): New type.
15383 (Plugin_manager::deferred_layout_objects_): New field.
15384 (Plugin_hook::do_plugin_hook): Remove.
15385
ee769c88
ILT
153862008-12-17 Ian Lance Taylor <iant@google.com>
15387
15388 * options.h (class General_options): Add --no case for
15389 --export-dynamic.
15390
abc8dcba
CC
153912008-12-16 Cary Coutant <ccoutant@google.com>
15392
15393 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
15394 vector.
15395 (Plugin_manager::claim_file): Create plugin object even if
15396 plugin did not call the add_symbols callback.
15397 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
15398 asking for more symbols than were added.
15399 * testsuite/Makefile.am (plugin_test_1): Add test case with
15400 no global symbols.
15401 (empty.syms): New target.
15402 * testsuite/Makefile.in: Regenerate.
15403 * testsuite/plugin_test.c (claim_file_hook): Add new debug
15404 message. Don't call add_symbols if no globals.
15405 (all_symbols_read_hook): Don't provide replacement for empty
15406 claimed file.
15407
b0074644
ILT
154082008-12-12 Ian Lance Taylor <iant@google.com>
15409
68943102
ILT
15410 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
15411 r_type == 0 for a local symbol with r_sym == 0.
15412 (scan_relocatable_relocs): Pass r_sym to
15413 local_non_section_strategy.
15414 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
15415 r_sym parameter.
15416
b0074644
ILT
15417 * configure.ac: Update test for TLS descriptors: they are
15418 supported as of glibc 2.9.
15419 * configure: Rebuild.
15420
c2508178
ILT
154212008-12-11 Ian Lance Taylor <iant@google.com>
15422
15423 PR 7091
15424 * target-reloc.h (Default_scan_relocatable_relocs): For each
15425 function, map r_type == 0 to RELOC_DISCARD.
15426
2756a258
CC
154272008-12-10 Cary Coutant <ccoutant@google.com>
15428
15429 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
15430 object to override a kept COMDAT group from a plugin object.
15431
bb6f53d3
ILT
154322008-12-09 Ian Lance Taylor <iant@google.com>
15433
fbc558e1
ILT
15434 PR 7088
15435 * yyscript.y (file_cmd): Handle INPUT.
15436
bb6f53d3
ILT
15437 * testsuite/initpri1.c: Change all declarations to be full
15438 prototypes by adding void, to avoid compiler warnings.
15439
4674ecfc
CC
154402008-12-05 Rafael Avila de Espindola <espindola@google.com>
15441
15442 * options.cc (General_options::parse_plugin_opt): New.
15443 (General_options::add_plugin): The argument now is just the filename.
15444 (General_options::add_plugin_option): New.
15445 * options.h (plugin_opt): New.
15446 (add_plugin): Change argument name.
15447 (add_plugin_option): New.
15448 * plugin.cc (Plugin::load): Don't parse the plugin option.
15449 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
15450 (Plugin::add_option): New.
15451 (Plugin::args_): Change type.
15452 (Plugin::filename_): New.
15453 (Plugin_manager::add_plugin_option): New.
15454 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
15455 * testsuite/Makefile.in: Regenerate.
15456
fd06b4aa
CC
154572008-12-05 Cary Coutant <ccoutant@google.com>
15458
15459 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
15460 Handle --strip-lto-sections option.
15461 * options.h (strip_lto_sections): New option.
15462
6c52134c
CC
154632008-12-01 Cary Coutant <ccoutant@google.com>
15464
15465 * plugin.cc (ld_plugin_message): Change format parameter to const.
15466 Fix mismatch between new[] and delete.
15467
a45248e0
CC
154682008-11-14 Cary Coutant <ccoutant@google.com>
15469
15470 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
15471 instead of -1U.
15472
c82fbeee
CS
154732008-11-05 Craig Silverstein <csilvers@google.com>
15474
15475 * options.cc (General_options::parse_dynamic_list): New function.
15476 * options.h (General_options): New flags dynamic_list,
15477 dynamic_list_data, dynamic_list_cpp_new, and
15478 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
15479 (General_options::in_dynamic_list): New function.
15480 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
15481 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
15482 (Lex::can_continue_name): Likewise.
15483 (yylex): Likewise.
15484 (read_script_file): New parameter script_options.
15485 (read_dynamic_list): New function.
15486 (Script_options::define_dynamic_list): New function.
15487 (dynamic_list_keyword_parsecodes): New variable.
15488 (dynamic_list_keywords): New variable.
15489 * script.h (Script_options::define_dynamic_list): New function
15490 prototype.
15491 (read_dynamic_list): New function prototype.
15492 * symtab.cc (strprefix): New macro.
15493 (Symbol::should_add_dynsym_entry): Support dynamic_list,
15494 dynamic_list_data, dynamic_list_cpp_new, and
15495 dynamic_list_cpp_typeinfo.
15496 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
15497 (dynamic_list_expr): New rule.
15498 (dynamic_list_nodes): Likewise.
15499 (dynamic_list_node): Likewise.
15500 * testsuite/Makefile.am (dynamic_list): New test.
15501 * testsuite/Makefile.in: Regenerated.
15502 * testsuite/dynamic_list.t: New file.
15503 * testsuite/dynamic_list.sh: New file.
15504
e0bb29a5
CS
155052008-11-05 Craig Silverstein <csilvers@google.com>
15506
15507 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
15508 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
15509 (t11_last): Likewise.
15510 * testsuite/ver_test_6.c (main): Likewise.
15511
4e1e25e0
CC
155122008-10-07 Cary Coutant <ccoutant@google.com>
15513
15514 * options.c (General_options::finalize): Add check for -static and
15515 -shared.
15516 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
15517 is not empty.
15518
92f03fcb
CC
155192008-10-02 Cary Coutant <ccoutant@google.com>
15520
15521 * plugin.cc (make_sized_plugin_object): Fix conditional
15522 compilation to work when not all targets are enabled.
15523
fbd8a257
CC
155242008-09-29 Cary Coutant <ccoutant@google.com>
15525
15526 * archive.cc (Archive::get_file_and_offset): Use filename instead
15527 of name to get library path.
15528 (Archive::include_member): Unlock external member of a thin archive.
15529
15530 * testsuite/Makefile.am (TEST_AR): New variable.
15531 (thin_archive_test_1): New test.
15532 (thin_archive_test_2): New test.
81636b3f
CC
15533 * testsuite/Makefile.in: Regenerate.
15534 * testsuite/thin_archive_main.cc: New file.
15535 * testsuite/thin_archive_test_1.cc: New file.
15536 * testsuite/thin_archive_test_2.cc: New file.
15537 * testsuite/thin_archive_test_3.cc: New file.
15538 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 15539
eff45813
CC
155402008-09-29 Cary Coutant <ccoutant@google.com>
15541
15542 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
15543 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
15544 instead of -1U.
15545 (Sized_relobj::do_finalize_local_symbols): Likewise.
15546 (Sized_relobj::map_to_kept_section): Likewise.
15547 * object.h (Sized_relobj::invalid_address): New constant.
15548 (Sized_relobj::do_output_section_offset): Check for invalid_address
15549 and return -1ULL.
15550 * output.cc (Output_reloc::local_section_offset): Use constant
15551 invalid_address instead of -1U.
15552 (Output_reloc::get_address): Likewise.
15553 (Output_section::output_address): Change -1U to -1ULL.
15554 * output.h (Output_reloc::invalid_address): New constant.
15555 * reloc.cc (Sized_relobj::write_sections): Use constant
15556 invalid_address instead of -1U.
15557 (Sized_relobj::relocate_sections): Likewise.
15558 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
15559 values for merge sections.
15560 * target-reloc.h (relocate_for_relocatable): Use constant
15561 invalid_address instead of -1U.
15562
89fc3421
CC
155632008-09-19 Cary Coutant <ccoutant@google.com>
15564
15565 Add plugin functionality for link-time optimization (LTO).
15566 * configure.ac (plugins): Add --enable-plugins option.
15567 * configure: Regenerate.
15568 * config.in: Regenerate.
15569 * Makefile.am (LIBDL): New variable.
15570 (CCFILES): Add plugin.cc.
15571 (HFILES): Add plugin.h.
15572 (ldadd_var): Add LIBDL.
15573 * Makefile.in: Regenerate.
15574
15575 * archive.cc: Include "plugin.h".
15576 (Archive::setup): Don't preread archive symbols when using a plugin.
15577 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
15578 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
15579 files.
15580 (Archive::include_member): Add symbols from plugin objects.
15581 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
15582 * descriptors.cc (Descriptors::open): Check for file descriptors
15583 abandoned by plugins.
15584 (Descriptors::claim_for_plugin): New function.
15585 * descriptors.h (Descriptors::claim_for_plugin): New function.
15586 (Open_descriptor::is_claimed): New field.
15587 (claim_descriptor_for_plugin): New function.
15588 * fileread.cc (File_read::claim_for_plugin): New function.
15589 * fileread.h (File_read::claim_for_plugin): New function.
15590 (File_read::descriptor): New function.
15591 * gold.cc: Include "plugin.h".
15592 (queue_initial_tasks): Add task to call plugin hooks for generating
15593 new object files.
15594 * main.cc: Include "plugin.h".
15595 (main): Load plugin libraries.
15596 * object.h (Pluginobj): Declare.
15597 (Object::pluginobj): New function.
15598 (Object::do_pluginobj): New function.
15599 (Object::set_target): New function.
15600 * options.cc: Include "plugin.h".
15601 (General_options::parse_plugin): New function.
15602 (General_options::General_options): Initialize plugins_ field.
15603 (General_options::add_plugin): New function.
15604 * options.h (Plugin_manager): Declare.
15605 (General_options): Add --plugin option.
15606 (General_options::has_plugins): New function.
15607 (General_options::plugins): New function.
15608 (General_options::add_plugin): New function.
15609 (General_options::plugins_): New field.
15610 * plugin.cc: New file.
15611 * plugin.h: New file.
15612 * readsyms.cc: Include "plugin.h".
15613 (Read_symbols::do_read_symbols): Check for archive before checking
15614 for ELF file. Call plugin hooks to claim files.
15615 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
15616 from a real object file; force override when processing replacement
15617 files.
15618 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
15619 (Symbol::init_base_object): Likewise.
15620 (Symbol::init_base_output_data): Likewise.
15621 (Symbol::init_base_output_segment): Likewise.
15622 (Symbol::init_base_constant): Likewise.
15623 (Symbol::init_base_undefined): Likewise.
15624 (Symbol::output_section): Assert that object is not a plugin.
15625 (Symbol_table::add_from_pluginobj): New function.
15626 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
15627 undefined.
15628 (Symbol_table::sized_write_globals): Likewise.
15629 (Symbol_table::add_from_pluginobj): Instantiate template.
15630 * symtab.h (Sized_pluginobj): Declare.
15631 (Symbol::in_real_elf): New function.
15632 (Symbol::set_in_real_elf): New function.
15633 (Symbol::in_real_elf_): New field.
15634 (Symbol_table::add_from_pluginobj): New function.
15635
15636 * testsuite/Makefile.am (AM_CFLAGS): New variable.
15637 (LIBDL): New variable.
15638 (LDADD): Add LIBDL.
15639 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
15640 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
15641 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
15642 (MOSTLYCLEANFILES): Likewise.
15643 * testsuite/Makefile.in: Regenerate.
15644 * testsuite/plugin_test.c: New file.
15645 * testsuite/plugin_test_1.sh: New file.
15646 * testsuite/plugin_test_2.sh: New file.
15647
de31bda5
ILT
156482008-09-16 Ian Lance Taylor <iant@google.com>
15649
9c2d0ef9
ILT
15650 * target-reloc.h (relocate_section): Check whether a symbol is
15651 defined by the ABI before reporting an undefined symbol error.
15652 * target.h (Target::is_defined_by_abi): Make parameter const.
15653 (Target::do_is_defined_by_abi): Likewise.
15654 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
15655 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
15656 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
15657 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
15658 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
15659 * testsuite/Makefile.in: Rebuild.
15660
de31bda5
ILT
15661 * fileread.cc (make_view): Add casts to avoid warning.
15662
9fa33bee
AO
156632008-09-16 Alexandre Oliva <aoliva@redhat.com>
15664
15665 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
15666 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15667
183fd0e3
AO
156682008-09-16 Alexandre Oliva <aoliva@redhat.com>
15669
15670 * options.h (General_options::output_is_executable): New.
15671 (General_options::output_is_pie): New.
15672 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
15673 for shared libraries.
15674 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15675
7be8330a
CD
156762008-09-11 Chris Demetriou <cgd@google.com>
15677
15678 * options.h (origin): New -z option.
15679 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
15680 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
15681 in DT_FLAGS_1.
15682
a9caad02
CC
156832008-09-05 Cary Coutant <ccoutant@google.com>
15684
15685 * fileread.cc (File_read::make_view): Add check for attempt to map
15686 beyond end of file.
15687
ae6dce4d
CC
156882008-09-05 Cary Coutant <ccoutant@google.com>
15689
15690 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
15691 explicit instantiations.
15692
d7ab2a47
KVH
156932008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
15694
15695 PR gold/6858
15696 * options.cc (General_options::finalize): Allow undefined symbols
15697 in shlibs if linking -shared.
15698
15699 PR gold/6859
15700 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
15701 symbols as not needing a dynsym entry.
15702
1e52a9c1
CS
157032008-08-20 Craig Silverstein <csilvers@google.com>
15704
15705 * fileread.cc (File_read::open): Do not lock the file unless it
15706 was successfully opened.
15707
d85c80a3
CC
157082008-08-14 Cary Coutant <ccoutant@google.com>
15709
15710 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
15711 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
15712 * testsuite/tls_test.cc (struct int128): 128-bit struct
15713 for testing TLS relocs with non-zero addend.
15714 (v12): New TLS variable.
15715 (t12): New test.
15716 (t_last): Add check for v12.
15717 * testsuite/tls_test.h (t12): New function.
15718 * testsuite/tls_test_main.cc (thread_routine): Call new test.
15719
2d924fd9
ILT
157202008-08-13 Ian Lance Taylor <iant@google.com>
15721
15722 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
15723 set tls_segment_ or relro_segment_.
15724 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
15725 when appropriate.
15726 * output.h (Output_section::clear_is_relro): New function.
15727 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
15728 sections specially even when output_data_ is empty.
15729 (Output_segment::maximum_alignment): When first section is relro,
15730 only force alignment for PT_LOAD segments.
15731 * script.cc (script_data_segment_align): New function.
15732 (script_data_segment_relro_end): New function.
15733 * script-c.h (script_data_segment_align): Declare.
15734 (script_data_segment_relro_end): Declare.
15735 * script-sections.h (class Script_sections): Declare
15736 data_segment_align and data_segment_relro_end. Add fields
15737 segment_align_index_ and saw_relro_end_.
15738 * script-sections.cc (class Sections_element): Add set_is_relro
15739 virtual function. Add new bool* parameter to place_orphan_here.
15740 Add get_output_section virtual function.
15741 (class Output_section_definition): Add set_is_relro. Add new
15742 bool* parameter to place_orphan_here. Add get_output_section.
15743 Add is_relro_ field.
15744 (Output_section_definition::Output_section_definition): Initialize
15745 evaluated_address_, evaluated_load_address, evaluated_addralign_,
15746 and is_relro_ fields.
15747 (Output_section_definition::place_orphan_here): Add is_relro
15748 parameter.
15749 (Output_section_definition::set_section_addresses): Set relro for
15750 output section.
15751 (Output_section_definition::alternate_constraint): Likewise.
15752 (class Orphan_output_section): Add new bool* parameter to
15753 place_orphan_here. Add get_output_section.
15754 (Orphan_output_section::place_orphan_here): Add is_relro
15755 parameter.
15756 (Script_sections::Script_sections): Initialize
15757 data_segment_align_index_ and saw_relro_end_.
15758 (Script_sections::data_segment_align): New function.
15759 (Script_sections::data_segment_relro_end): New function.
15760 (Script_sections::place_orphan): Set or clear is_relro.
15761 (Script_sections::set_section_addresses): Force alignment of first
15762 TLS section.
15763 * yyscript.y (exp): Call script_data_segment_align and
15764 script_data_segment_relro_end.
15765 * testsuite/relro_script_test.t: New file.
15766 * testsuite/relro_test.cc (using_script): Declare.
15767 (t1, t2): Test using_script.
15768 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
15769 (relro_script_test_SOURCES): Define.
15770 (relro_script_test_DEPENDENCIES): Define.
15771 (relro_script_test_LDFLAGS): Define.
15772 (relro_script_test_LDADD): Define.
15773 (relro_script_test.so): New target.
15774 * testsuite/Makefile.in: Rebuild.
15775
f827c9a9
CC
157762008-08-06 Cary Coutant <ccoutant@google.com>
15777
15778 * archive.cc (Archive::total_archives, Archive::total_members)
15779 (Archive::total_members_loaded): New variables.
15780 (Archive::setup): Add parameter. Add option to preread
15781 archive symbols.
15782 (Archive::read_armap): Add counter.
15783 (Archive::get_file_and_offset): New function.
15784 (Archive::get_elf_object_for_member): New function.
15785 (Archive::read_all_symbols): New function.
15786 (Archive::read_symbols): New function.
15787 (Archive::add_symbols): Add counters.
15788 (Archive::include_all_members): Use armap to find members if it's
15789 already built.
15790 (Archive::include_member): Skip reading symbols if already read.
15791 Factored code into Archive::get_file_and_offset and
15792 Archive::get_elf_object_for_member. Changed call to
15793 Mapfile::report_include_archive_member.
15794 (Archive::print_stats): New function.
15795 * archive.h: Declare Object and Read_symbols_data classes.
15796 (Archive::Archive): Add initializers for new members.
15797 (Archive::setup): Add parameter.
15798 (Archive::print_stats): New function.
15799 (Archive::total_archives, Archive::total_members)
15800 (Archive::total_members_loaded): New variables.
15801 (Archive::get_file_and_offset): New function.
15802 (Archive::get_elf_object_for_member): New function.
15803 (Archive::read_all_symbols): New function.
15804 (Archive::read_symbols): New function.
15805 (Archive::Archive_member): New class.
15806 (Archive::members_): New member.
15807 (Archive::num_members_): New member.
15808 * main.cc: Include archive.h.
15809 (main): Call Archive::print_stats.
15810 * mapfile.cc (Mapfile::report_include_archive_member): Delete
15811 archive parameter; member_name is now the fully-decorated name.
15812 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
15813 * options.h: (General_options): Add --preread-archive-symbols option.
15814 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
15815 Archive::setup.
15816
de4c45bd
ILT
158172008-08-04 Ian Lance Taylor <iant@google.com>
15818
15819 * symtab.h (Symbol::use_plt_offset): New function.
15820 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
15821 * powerpc.cc (Relocate::relocate): Likewise.
15822 * sparc.cc (Relocate::relocate): Likewise.
15823 * x86_64.cc (Relocate::relocate): Likewise.
15824 * testsuite/weak_plt.sh: New test.
15825 * testsuite/weak_plt_main.cc: New test.
15826 * testsuite/weak_plt_shared.cc: New test.
15827 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
15828 (check_PROGRAMS): Add weak_plt.
15829 (check_DATA): Add weak_plt_shared.so.
15830 (weak_plt_main_pic.o, weak_plt): New targets.
15831 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
15832 * testsuite/Makefile.in: Rebuild.
15833
15834 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
15835 gcctestdir/ld.
15836 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
15837 * testsuite/Makefile.in: Rebuild.
15838
323ee3f4
AM
158392008-08-04 Alan Modra <amodra@bigpond.net.au>
15840
15841 * Makefile.am (POTFILES.in): Set LC_ALL=C.
15842 * Makefile.in: Regenerate.
15843 * po/POTFILES.in: Regenerate.
15844
7c07ecec
ILT
158452008-07-29 Ian Lance Taylor <iant@google.com>
15846
15847 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
15848 symbols before other symbols.
15849 * testsuite/script_test_2.cc (test_addr): Declare.
15850 (test_addr_alias): Declare.
15851 (main): Check that test_addr and test_addr_alias have the right
cd536b21 15852 values.
7c07ecec
ILT
15853 * testsuite/script_test_2.t: Define test_addr_alias and
15854 test_addr.
15855
5778530e
ILT
158562008-07-24 Ian Lance Taylor <iant@google.com>
15857
2a00e4fb
ILT
15858 PR 5990
15859 * descriptors.cc: New file.
15860 * descriptors.h: New file.
15861 * gold-threads.h (class Hold_optional_lock): New class.
15862 * fileread.cc: Include "descriptors.h".
15863 (File_read::~File_read): Release descriptor rather than closing
15864 it.
15865 (File_read::open) [file]: Call open_descriptor rather than open.
15866 Set is_descriptor_opened_.
15867 (File_read::open) [memory]: Assert that descriptor is not open.
15868 (File_read::reopen_descriptor): New function.
15869 (File_read::release): Release descriptor.
15870 (File_read::do_read): Make non-const. Reopen descriptor.
15871 (File_read::read): Make non-const.
15872 (File_read::make_view): Reopen descriptor.
15873 (File_read::do_readv): Likewise.
15874 * fileread.h (class File_read): Add is_descriptor_opened_ field.
15875 Update declarations.
15876 * layout.cc: Include "descriptors.h".
15877 (Layout::create_build_id): Use open_descriptor rather than open.
15878 * output.cc: Include "descriptors.h".
15879 (Output_file::open): Use open_descriptor rather than open.
15880 * archive.cc (Archive::const_iterator): Change Archive to be
15881 non-const.
15882 (Archive::begin, Archive::end): Make non-const.
15883 (Archive::count_members): Likewise.
15884 * archive.h (class Archive): Update declarations.
15885 * object.h (Object::read): Make non-const.
15886 * Makefile.am (CCFILES): Add descriptors.cc.
15887 (HFILES): Add descriptors.h.
15888 * Makefile.in: Rebuild.
15889
801647d1
ILT
15890 PR 6716
15891 * gold.h: Always include <clocale>. Add Solaris workarounds
15892 following code in binutils/sysdep.h.
15893
5edd166e
ILT
15894 PR 6048
15895 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
15896 this->eh_frame_hdr_ is NULL before using it.
15897
c89ad728
ILT
15898 * dynobj.cc (Versions::Versions): Update comment.
15899
aa86f06b
ILT
15900 * dynobj.cc (Versions::Versions): If there is an soname, use it as
15901 the base version name.
15902
5778530e
ILT
15903 * stringpool.cc (Stringpool_template::add_with_length): Set key to
15904 array size plus one.
15905 (Stringpool_template::set_string_offsets): Subtract one from key
15906 before using it as an array index.
15907 (Stringpool_template::get_offset_with_length): Likewise.
15908 (Stringpool_template::write_to_buffer): Likewise.
15909 * stringpool.h (Stringpool_template::get_offset_from_key):
15910 Likewise.
15911
057ead22
ILT
159122008-07-23 Ian Lance Taylor <iant@google.com>
15913
7f649c59
ILT
15914 PR 6658
15915 * object.h (Merged_symbol_value::value): Do our best to handle a
15916 negative addend.
15917
057ead22
ILT
15918 PR 6647
15919 * script.cc (Version_script_info::get_versions): Don't add empty
15920 version tag to return value.
15921 (Version_script_info::get_symbol_version_helper): Change return
15922 type to bool. Add pversion parameter. Change all callers.
15923 (script_register_vers_node): Don't require a non-NULL tag.
15924 * script.h (class Version_script_info): Update declarations.
15925 (Version_script_info::get_symbol_version): Change return type to
15926 bool. Add version parameter. Change all callers.
15927 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
15928 handling. Handle an empty version from a version script.
15929 (Symbol_table::define_special_symbol): Likewise.
15930 * testsuite/ver_test_10.script: New file.
15931 * testsuite/ver_test_10.sh: New file.
15932 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
15933 (check_DATA): Add ver_test_10.syms.
15934 (ver_test_10.syms, ver_test_10.so): New target.
15935 * testsuite/Makefile.in: Rebuild.
15936
58e54ac2
CD
159372008-07-23 Simon Baldwin <simonb@google.com>
15938
15939 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
15940 to zero for undefined symbols from dynamic libraries.
15941
95d14cd3
ILT
159422008-07-23 Ian Lance Taylor <iant@google.com>
15943
15944 * symtab.cc (Symbol_table::resolve): Remove version parameter.
15945 Change all callers.
15946 * symtab.h (class Symbol_table): Update declaration.
15947 * testsuite/ver_test_9.cc: New file.
15948 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
15949 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
15950 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
15951 (ver_test_9.so, ver_test_9.o): New targets.
15952 * testsuite/Makefile.in: Rebuild.
15953
92de84a6
ILT
159542008-07-22 Ian Lance Taylor <iant@google.com>
15955
34810851
ILT
15956 * options.h (class General_options): Define --check-sections.
15957 * layout.cc (Layout::set_segment_offsets): Handle
15958 --check-sections.
15959
af6156ef
ILT
15960 * options.h (class General_options): Define -n/--nmagic and
15961 -N/--omagic.
15962 * options.cc (General_options::finalize): For -n/--nmagic or
15963 -N/--omagic, set -static.
15964 * layout.cc (Layout::attach_allocated_section_to_segment): If
15965 -N/--omagic, don't put read-only and read-write sections in
15966 different segments.
15967 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
15968 finding a read-only segment.
15969 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
15970 don't set the minimum segment alignment to the common page size,
15971 and don't set the file offset to the address modulo the page size.
15972 * script-sections.cc (Script_sections::create_segments): If
15973 -n/--omagic, don't put read-only and read-write sections in
15974 different segments.
15975
92de84a6
ILT
15976 * cref.cc: New file.
15977 * cref.h: New file.
15978 * options.h (class General_options): Add --print-symbol-counts.
15979 * main.cc (main): Issue defined symbol report if requested.
15980 * archive.cc (Archive::interpret_header): Make into a const member
15981 function.
15982 (Archive::add_symbols): Call Input_objects::archive_start and
15983 archive_stop.
15984 (Archive::const_iterator): Define new class.
15985 (Archive::begin, Archive::end): New functions.
15986 (Archive::include_all_members): Rewrite to use iterator.
15987 (Archive::count_members): New function.
15988 * archive.h (class Archive): Update declarations.
15989 (Archive::filename): New function.
15990 * object.cc: Include "cref.h".
15991 (Sized_relobj::Sized_relobj): Initialize defined_count_.
15992 (Sized_relobj::do_get_global_symbol_counts): New function.
15993 (Input_objects::add_object): Add object to cross-referencer.
15994 (Input_objects::archive_start): New function.
15995 (Input_objects::archive_stop): New function.
15996 (Input_objects::print_symbol_counts): New function.
15997 * object.h: Declare Cref and Archive.
15998 (Object::get_global_symbol_counts): New function.
15999 (Object::do_get_global_symbol_counts): New pure virtual function.
16000 (class Sized_relobj): Add defined_count_ field. Update
16001 declarations.
16002 (class Input_objects): Add cref_ field. Update constructor.
16003 Update declarations.
16004 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
16005 defined_count_.
16006 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
16007 symbol counts.
16008 (Sized_dynobj::do_get_global_symbol_counts): New function.
16009 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
16010 defined_count_. Update declarations. Define Symbols typedef.
16011 * symtab.cc (Symbol_table::add_from_relobj): Add defined
16012 parameter. Change all callers.
16013 (Symbol_table::add_from_dynobj): Add sympointers and defined
16014 parameters. Change all callers.
16015 * symtab.h (class Symbol_table): Update declarations.
16016 * Makefile.am (CCFILES): Add cref.cc.
16017 (HFILES): Add cref.h.
16018 * Makefile.in: Rebuild.
16019
3f7c5e1d
CD
160202008-07-22 Simon Baldwin <simonb@google.com>
16021
16022 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
16023 to zero when writing undefined symbols.
16024
e0b64032
ILT
160252008-07-22 Ian Lance Taylor <iant@google.com>
16026
16027 * output.cc (Output_section::add_input_section): Don't try to
16028 merge empty merge sections.
16029
096b02cf
CS
160302008-07-21 Craig Silverstein <csilvers@google.com>
16031
16032 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
16033 Include symbol version in error message.
cd536b21 16034
1d1f116d
CD
160352008-07-20 Chris Demetriou <cgd@google.com>
16036
cd536b21 16037 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
16038 (RANDOM_SEED_CFLAGS): New substituted variable.
16039 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
16040 * configure: Rebuild.
16041 * Makefile.in: Likewise.
16042 * testsuite/Makefile.in: Likewise.
16043
a18f591e
ILT
160442008-07-18 Ian Lance Taylor <iant@google.com>
16045
16046 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
16047 where we see NAME/NULL and NAME/VERSION as separate symbols.
16048 * testsuite/ver_test_main.cc (main): Call t4.
16049 (t4, t4_2a): Define.
16050 * testsuite/ver_test_2.cc (t4_2): Define.
16051 * testsuite/ver_test_2.script: Put t4_2a in VER2.
16052 * testsuite/ver_test_4.cc (t4_2a): Define.
16053 * testsuite/ver_test_4.script: Put t4_2a in VER2.
16054 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
16055
c6e3f6ed
ILT
160562008-07-17 Ian Lance Taylor <iant@google.com>
16057
16058 * dynobj.cc (Versions::add_def): If we give an error about a
16059 missing version, go ahead and create the version anyhow.
16060
ef9beddf
ILT
160612008-07-10 Ian Lance Taylor <iant@google.com>
16062
16063 Handle output sections with more than 0x7fffffff bytes.
16064 * object.h (class Relobj): Change map_to_output_ to
16065 output_sections_, and just keep a section pointer. Change all
16066 uses. Move comdat group support to Sized_relobj.
16067 (Relobj::is_section_specially_mapped): Remove.
16068 (Relobj::output_section): Remove poff parameter. Change all
16069 callers.
16070 (Relobj::output_section_offset): New function.
16071 (Relobj::set_section_offset): Rewrite.
16072 (Relobj::map_to_output): Remove.
16073 (Relobj::output_sections): New function.
16074 (Relobj::do_output_section_offset): New pure virtual function.
16075 (Relobj::do_set_section_offset): Likewise.
16076 (class Sized_relobj): Add section_offsets_ field. Add comdat
16077 group support from Relobj. Update declarations.
16078 (Sized_relobj::get_output_section_offset): New function.
16079 (Sized_relobj::do_output_section_offset): New function.
16080 (Sized_relobj::do_set_section_offset): New function.
16081 * object.cc (Relobj::output_section_address): Remove.
16082 (Sized_relobj::Sized_relobj): Initialize new fields.
16083 (Sized_relobj::include_section_group): Cast find_kept_object to
16084 Sized_relobj.
16085 (Sized_relobj::include_linkonce_section): Likewise.
16086 (Sized_relobj::do_layout): Use separate arrays for output section
16087 and output offset.
16088 (Sized_relobj::do_count_local_symbols): Change map_to_output to
16089 output_sections.
16090 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
16091 output_sections and section_offsets.
16092 (Sized_relobj::write_local_symbols): Likewise.
16093 (map_to_kept_section): Compute output address directly.
16094 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
16095 output_sections and section_offsets.
16096 (Sized_relobj::write_sections): Likewise.
16097 (Sized_relobj::relocate_sections): Likewise.
16098 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
16099 * output.h (class Output_reloc): Update declarations. Change
16100 u2_.relobj to Sized_relobj*.
16101 (class Output_data_reloc): Change add functions to use
16102 Sized_relobj*.
16103 * output.cc (Output_reloc::Output_reloc): Change relobj to
16104 Sized_relobj*.
16105 (Output_reloc::local_section_offset): Change return type to
16106 Elf_Addr. Use get_output_section_offset.
16107 (Output_reloc::get_address): Likewise.
16108 (Output_section::is_input_address_mapped): Don't call
16109 is_section_specially_mapped.
16110 (Output_section::output_offset): Likewise.
16111 (Output_section::output_address): Likewise.
16112 (Output_section::starting_output_address): Likewise.
16113 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
16114 parameter to Sized_relobj*.
16115 (Copy_relocs::need_copy_reloc): Likewise.
16116 (Copy_relocs::save): Likewise.
16117 * copy-relocs.h (class Copy_relocs): Update declarations.
16118 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
16119 Sized_relobj*. Change relobj_ field to Sized_relobj*.
16120 * target-reloc.h (relocate_for_relocatable): Change
16121 offset_in_output_section type to Elf_Addr. Change code that uses
16122 it as well.
16123 * layout.cc (Layout::layout): Always set *off.
16124 * mapfile.cc (Mapfile::print_input_section): Use
16125 output_section_offset.
16126 * i386.cc (Target_i386::copy_reloc): Change object parameter to
16127 Sized_relobj*.
16128 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
16129 * sparc.cc (Target_sparc::copy_reloc): Likewise.
16130 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
16131
5cb66f97
ILT
161322008-07-03 Ian Lance Taylor <iant@google.com>
16133
16134 * layout.cc (Layout::include_section): Do not discard unrecognized
16135 SHT_STRTAB sections.
16136
afe47622
CS
161372008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
16138
16139 * script.cc (Lex::can_continue_name): Make '?' allowable in
16140 version-script names.
16141 * testsuite/version_script.map: Change glob pattern to use '?'
16142
5adf9721
ILT
161432008-06-30 Manish Singh <yosh@gimp.org>
16144
16145 PR 6585
16146 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
16147 Correct typo.
16148
e6fde208
ILT
161492008-06-30 Ian Lance Taylor <iant@google.com>
16150
16151 PR 6660
16152 PR 6682
16153 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
16154 versions]: Don't try to read the value in the contents, since we
16155 don't use it. Use the template endianness when writing.
16156
3f2e6a2d
CC
161572008-06-25 Cary Coutant <ccoutant@google.com>
16158
16159 * fileread.cc (File_read::make_view): Assert on zero-length view.
16160 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
16161 symbol table when there are no symbols to read.
16162
c43d3a48
CS
161632008-06-23 Craig Silverstein <csilvers@google.com>
16164
16165 * version.cc (version_string): Bump to 1.7
16166
5f494ea0
CS
161672008-06-18 Craig Silverstein <csilvers@google.com>
16168
16169 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
16170 constant 0xFFFF to type Valtype.
16171 (Powerpc_relocate_functions::rel16_ha): Likewise.
16172
c42e122e
ILT
161732008-06-17 Ian Lance Taylor <iant@google.com>
16174
f34787f8
ILT
16175 * output.h (Output_section::Input_section): Initialize p2align_ to
16176 zero for Output_section_data constructors.
16177 (Output_section::Input_section::addralign): If not an input
16178 section, return the alignment of the Output_section_data.
16179 * testsuite/copy_test.cc: New file.
16180 * testsuite/copy_test_1.cc: New file.
16181 * testsuite/copy_test_2.cc: New file.
16182 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
16183 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
16184 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
16185 (copy_test_1_pic.o, copy_test_1.so): New targets.
16186 (copy_test_2_pic.o, copy_test_2.so): New targets.
16187 * testsuite/Makefile.in: Rebuild.
16188
c42e122e
ILT
16189 * script-sections.cc (Script_sections::place_orphan): Initialize
16190 local variable exact.
16191
ce3ac18a
DE
161922008-06-13 David Edelsohn <edelsohn@gnu.org>
16193
16194 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
16195
42cacb20
DE
161962008-06-12 David Edelsohn <edelsohn@gnu.org>
16197 David S. Miller <davem@davemloft.net>
16198
16199 * powerpc.cc: New file.
16200 * Makefile.am (TARGETSOURCES): Add powerpc.cc
16201 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
16202 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
16203 * Makefile.in: Rebuild.
16204
7b308235
ILT
162052008-06-09 Ian Lance Taylor <iant@google.com>
16206
16207 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
16208 <exception>.
16209 (throwing, orig_terminate): New static variables.
16210 (terminate_handler): New static function.
16211 (t2): Set terminate handler.
16212
f0b886e3
ILT
162132008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
16214
16215 PR 6584
cd536b21 16216 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
16217 alignment.
16218
3e90f135
CC
162192008-05-30 Cary Coutant <ccoutant@google.com>
16220
16221 * archive.cc (Archive::include_all_members) Correct to step
16222 over symbol table and extended name table in thin archives.
16223
e09ad04a
ILT
162242008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
16225
16226 PR 6407
16227 * target-reloc.h (relocate_for_relocatable): Fix new_offset
16228 calculation.
16229
62b01cb5
ILT
162302008-05-28 Caleb Howe <cshowe@google.com>
16231
16232 * reduced_debug_output.cc: New file.
16233 * reduced_debug_output.h: New file.
92de84a6 16234 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
16235 * options.cc (General_options::finalize): Add strip_debug_non_line
16236 to the strip heirarchy.
16237 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
16238 fields.
16239 * layout.cc: Include "reduced_debug_output.h".
16240 (Layout::Layout): Initialize new fields.
16241 (line_only_debug_sections): New static array.
16242 (is_lines_only_debug_sections): New static inline function.
16243 (Layout::include_section): Handle --strip-debug-non-line.
16244 (Layout::make_output_section): If --strip-debug-non-line, build
16245 new output sections for .debug_abbrev and .debug_info.
16246 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
16247 gold. Warn about possible overflow.
16248 (read_signed_LEB_128): Likewise.
16249 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
16250 (read_signed_LEB_128): Declare.
16251 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
16252 (HFILES): Add reduced_debug_output.h.
16253 * Makefile.in: Rebuild.
16254
7d9e3d98
ILT
162552008-05-21 Ian Lance Taylor <iant@google.com>
16256
16257 * mapfile.cc: New file.
16258 * mapfile.h: New file.
16259 * options.h (class General_options): Add -M/--print-map and -Map.
16260 * options.cc (General_options::finalize): Make -M equivalent to
16261 -Map -.
16262 * main.cc: Include <cstdio> and "mapfile.h".
16263 (main): Open mapfile if requested.
16264 * gold.cc (class Middle_runner): Add mapfile_ field. Update
16265 constructor. Change caller.
16266 (queue_initial_tasks): Add mapfile parameter. Change caller.
16267 (queue_middle_tasks): Likewise.
16268 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
16269 declarations.
16270 * archive.cc: Include "mapfile.h".
16271 (Archive::add_symbols): Add mapfile parameter. Change all
16272 callers. Pass mapfile, symbol, and reason to include_member.
16273 (Archive::include_all_members): Add mapfile parameter. Change all
16274 callers.
16275 (Archive::include_member): Add mapfile, sym, and why parameters.
16276 Change all callers. Report inclusion to map file.
16277 * archive.h: Include "fileread.h".
16278 (class Archive): Update declarations.
16279 (Archive::file): New const method.
16280 (class Add_archive_symbols): Add mapfile_ field. Update
16281 constructor. Change all callers.
16282 * readsyms.h (class Read_symbols): Likewise.
16283 (class Finish_group): Likewise.
16284 (class Read_script): Likewise.
16285 * common.cc: Include "mapfile.h".
16286 (Symbol_table::allocate_commons): Add mapfile parameter. Change
16287 all callers.
16288 (Symbol_table::do_allocate_commons): Likewise.
16289 (Symbol_table::do_allocate_commons_list): Likewise. Report common
16290 symbol allocation to mapfile.
16291 * common.h (class Allocate_commons_task): Add mapfile_ field.
16292 Update constructor. Change all callers.
16293 * symtab.h (class Symbol_table): Update declarations.
16294 * layout.cc: Include "mapfile.h".
16295 (Layout_task_runner::run): Print information to mapfile.
16296 (Layout::create_gold_note): Change Output_data_fixed_space to
16297 Output_data_zero_fill.
16298 (Layout::create_build_id): Likewise.
16299 (Layout::print_to_mapfile): New function.
16300 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
16301 constructor. Change caller.
16302 (class Layout): Declare print_to_mapfile.
16303 * output.cc (Output_section::Input_section::print_to_mapfile): New
16304 function.
16305 (Output_section::add_input_section): If producing a map, always
16306 add to input_sections_ list.
16307 (Output_section::do_print_to_mapfile): New function.
16308 (Output_segment::print_sections_to_mapfile): New function.
16309 (Output_segment::print_section_list_to_mapfile): New function.
16310 * output.h: Include "mapfile.h".
16311 (Output_data::print_to_mapfile): New function.
16312 (Output_data::do_print_to_mapfile): New virtual function.
16313 (Output_segment_headers::do_print_to_mapfile): New function.
16314 (Output_file_header::do_print_to_mapfile): New function.
16315 (Output_data_const::do_print_to_mapfile): New function.
16316 (class Output_data_const_buffer): Add map_name_ field. Update
16317 constructor. Change all callers. Add do_print_to_mapfile
16318 function.
16319 (class Output_data_fixed_space): Likewise.
16320 (class Output_data_space): Likewise.
16321 (class Output_data_zero_fill): New class.
16322 (Output_data_strtab::do_print_to_mapfile): New function.
16323 (Output_data_reloc_base::do_print_to_mapfile): New function.
16324 (Output_relocatable_relocs::do_print_to_mapfile): New function.
16325 (Output_data_group::do_print_to_mapfile): New function.
16326 (Output_data_got::do_print_to_mapfile): New function.
16327 (Output_data_dynamic::do_print_to_mapfile): New function.
16328 (Output_symtab_xindex::do_print_to_mapfile): New function.
16329 (class Output_section): Declare do_print_to_mapflie. Declare
16330 print_to_mapfile in Input_section.
16331 (class Output_segment): Declare new functions.
16332 * object.h (Sized_relobj::symbol_count): New function.
16333 * script-sections.cc
16334 (Output_section_element_dot_assignment::set_section_addresses):
16335 Change Output_data_fixed_space to Output_data_zero_fill.
16336 (Output_data_expression::do_print_to_mapfile): New function.
16337 * script.cc (read_input_script): Add mapfile parameter. Change
16338 all callers.
16339 * script.h (read_input_script): Update declaration.
16340 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
16341 (Eh_frame::do_print_to_mapfile): New function.
16342 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
16343 (Output_merge_string::do_print_to_mapfile): New function.
16344 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
16345 function.
16346 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
16347 function.
16348 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
16349 function.
16350 * Makefile.am (CCFILES): Add mapfile.cc.
16351 (HFILES): Add mapfile.h.
16352 * Makefile.in: Rebuild.
16353
9f1d377b
ILT
163542008-05-19 Ian Lance Taylor <iant@google.com>
16355
16356 * options.h (class General_options): Add -z relro.
16357 * layout.cc (Layout::Layout): Initialize relro_segment_.
16358 (Layout::add_output_section_data): Return the output section.
16359 (Layout::make_output_section): Rcognize relro sections and mark
16360 them appropriately.
16361 (Layout::attach_allocated_section_to_segment): Put relro sections
16362 in a PT_GNU_RELRO segment.
16363 (Layout::create_initial_dynamic_sections): Mark the .dynamic
16364 section as relro.
16365 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
16366 PT_TLS segments.
16367 (Layout::linkonce_mapping): Map d.rel.ro.local to
16368 .data.rel.ro.local.
16369 (Layout::output_section_name): Us .data.rel.ro.local for any
16370 section which begins with that.
16371 * layout.h (class Layout): Update add_output_section_data
16372 declaration. Add relro_segment_ field.
16373 * output.cc (Output_section::Output_section): Initialize is_relro_
16374 and is_relro_local_ fields.
16375 (Output_segment::add_output_section): Group relro sections.
16376 (Output_segment::is_first_section_relro): New function.
16377 (Output_segment::maximum_alignment): If there is a relro section,
16378 align the segment to the common page size.
16379 (Output_segment::set_section_addresses): Track whether we are
16380 looking at relro sections. If the last section is a relro
16381 section, align to the common page size.
16382 (Output_segment::set_section_list_addresses): Add in_relro
16383 parameter. Change all callers. Align to the page size when
16384 moving from relro to non-relro section.
16385 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
16386 segment.
16387 * output.h (class Output_section): Add is_relro_ and
16388 is_relro_local_ fields.
16389 (Output_section::is_relro): New function.
16390 (Output_section::set_is_relro): New function.
16391 (Output_section::is_relro_local): New function.
16392 (Output_section::set_is_relro_local): New function.
16393 (class Output_segment): Update declarations.
16394 * i386.cc (Target_i386::got_section): Mark .got section as relro.
16395 * sparc.cc (Target_sparc::got_section): Likewise.
16396 * x86_64.cc (Target_x86_64::got_section): Likewise.
16397 * testsuite/relro_test_main.cc: New file.
16398 * testsuite/relro_test.cc: New file.
16399 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
16400 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
16401 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
16402 (relro_test.so, relro_test_pic.o): New targets.
16403 * testsuite/Makefile.in: Rebuild.
16404
a984ee1d
ILT
164052008-05-16 Ian Lance Taylor <iant@google.com>
16406
01676dcd
ILT
16407 * output.cc (Output_segment::add_output_section): Remove front
16408 parameter.
16409 * output.h (class Output_segment): Remove
16410 add_initial_output_section and overloaded add_output_section.
16411 Update declaration of remaining add_output_section.
16412 * layout.cc (Layout::create_interp): Call add_output_section
16413 rather than add_initial_output_section.
16414 (Layout::finish_dynamic_section): Likewise.
16415
497897f9
ILT
16416 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
16417 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
16418 know the dynamic type.
16419 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
16420 field. Initialize it in constructor.
16421 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
16422 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
16423 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
16424 reloc.
16425
a984ee1d
ILT
16426 * output.cc (Output_reloc::get_address): Change return type to
16427 Elf_Addr.
16428 * output.h (class Output_reloc): Update get_address declaration.
16429 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
16430 for section addresses.
16431
55ba0940
ILT
164322008-05-09 Ian Lance Taylor <iant@google.com>
16433
16434 PR 6493
16435 * gold.cc (gold_nomem): Use return value of write.
16436
75517b77
ILT
164372008-05-08 Ian Lance Taylor <iant@google.com>
16438
16439 * symtab.c (Symbol::init_base_output_data): Add version
16440 parameter. Change all callers.
16441 (Symbol::init_base_output_segment): Likewise.
16442 (Symbol::init_base_constant): Likewise.
16443 (Symbol::init_base_undefined): Likewise.
16444 (Sized_symbol::init_output_data): Likewise.
16445 (Sized_symbol::init_output_segment): Likewise.
16446 (Sized_symbol::init_constant): Likewise.
16447 (Sized_symbol::init_undefined): Likewise.
16448 (Symbol_table::do_define_in_output_data): If the new symbol has a
16449 version, mark it as the default.
16450 (Symbol_table::do_define_in_output_segment): Likewise.
16451 (Symbol_table::do_define_as_constant): Likewise.
16452 * symtab.h (class Symbol): Update declarations.
16453 (class Sized_symbol): Likewise.
16454 * resolve.cc (Symbol::override_version): New function.
c42e122e 16455 (Symbol::override_base): Call override_version.
75517b77
ILT
16456 (Symbol::override_base_with_special): Likewise.
16457 * testsuite/ver_script_8.script: New file.
16458 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
16459 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
16460 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
16461 (ver_test_8_1.so, ver_test_8_2.so): New targets.
16462
f1f70eae
ILT
164632008-05-06 Ian Lance Taylor <iant@google.com>
16464
f3e9c5c5
ILT
16465 PR 6049
16466 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
16467 functions.
16468 (class General_options): Remove existing --undefined, and add
16469 --no-undefined instead. Add new --undefined as synonym for -u.
16470 * archive.cc (Archive::add_symbols): Check whether symbol was
16471 named with -u.
16472 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
16473 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
16474 all uses. Add IS_UNDEFINED. Update declarations to split
16475 different versions of init_base. Declare init_base_undefined.
16476 (Symbol::is_defined): Handle IS_UNDEFINED.
16477 (Symbol::is_undefined): Likewise.
16478 (Symbol::is_weak_undefined): Call is_undefined.
16479 (Symbol::is_absolute): Handle IS_CONSTANT.
16480 (class Sized_symbol): Update declarations to split different
16481 versions of init. Declare init_undefined.
16482 (class Symbol_table): Declare new functions.
16483 * symtab.cc (Symbol::init_base_object): Rename from init_base.
16484 Change all callers.
16485 (Symbol::init_base_output_data): Likewise.
16486 (Symbol::init_base_output_segment): Likewise.
16487 (Symbol::init_base_constant): Likewise.
16488 (Symbol::init_base_undefined): New function.
16489 (Sized_symbol::init_object): Rename from init. Change all
16490 callers.
16491 (Sized_symbol::init_output_data): Likewise.
16492 (Sized_symbol::init_output_segment): Likewise.
16493 (Sized_symbol::init_constant): Likewise.
16494 (Sized_symbol::init_undefined): New function.
16495 (Symbol_table::add_undefined_symbols_from_command_line): New
16496 function.
16497 (Symbol_table::do_add_undefined_symbols_from_command_line): New
16498 function.
16499 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
16500 (Symbol::output_section): Likewise.
16501 (Symbol::set_output_section): Likewise.
16502 (Symbol_table::sized_finalize_symbol): Likewise.
16503 (Symbol_table::sized_write_globals): Likewise.
16504 * resolve.cc (Symbol_table::should_override): Likewise.
16505 (Symbol::override_base_with_special): Likewise.
16506
8bdcdf2c
ILT
16507 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
16508 symbol, change it to have default visibility.
16509 * testsuite/protected_1.cc: New file.
16510 * testsuite/protected_2.cc: New file.
16511 * testsuite/protected_3.cc: New file.
16512 * testsuite/protected_main_1.cc: New file.
16513 * testsuite/protected_main_2.cc: New file.
16514 * testsuite/protected_main_3.cc: New file.
16515 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
16516 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
16517 (protected_1_LDFLAGS, protected_1_LDADD): Define.
16518 (protected_1.so): New target.
16519 (protected_1_pic.o, protected_2_pic.o): New targets.
16520 (protected_3_pic.o): New target.
16521 (check_PROGRAMS): Add protected_2.
16522 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
16523 (protected_2_LDFLAGS, protected_2_LDADD): Define.
16524 * testsuite/Makefile.in: Rebuild.
16525
2b706932
ILT
16526 * options.h (DEFINE_var): Add set_user_set_##varname__.
16527 (DEFINE_bool_alias): New macro.
16528 (class General_options): Define -Bstatic using DEFINE_bool_alias
16529 rather than DEFINE_special. Add --undefined as an alias for -z
16530 defs.
16531 * options.cc (General_options::parse_Bstatic): Remove.
16532
d82a5bcc
ILT
16533 * options.h (class General_options): Add --fatal-warnings.
16534 * main.cc (main): Implement --fatal-warnings.
16535 * errors.h (Errors::warning_count): New function.
16536
f1f70eae
ILT
16537 * options.h (class General_options): Add -Bsymbolic-functions.
16538 * symtab.h (Symbol::is_preemptible): Check for
16539 -Bsymbolic-functions.
16540
8825ac63
ILT
165412008-05-05 Ian Lance Taylor <iant@google.com>
16542
d98bc257
ILT
16543 * options.h (DEFINE_bool): For DASH_Z, create the negative option
16544 as noVARNAME rather than no-VARNAME.
16545 (class General_options): Add option -z combreloc.
16546 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
16547 get_address.
16548 (Output_reloc::sort_before) [SHT_REL]: New function.
16549 (Output_reloc::sort_before) [SHT_RELA]: New function.
16550 (class Output_data_reloc_base): Add sort_relocs_ field. Define
16551 Sort_relocs_comparison.
16552 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
16553 parameter. Change all callers.
16554 (Output_data_reloc::Output_data_reloc) [both versions]: Add
16555 sort_relocs parameter. Change all callers.
16556 * output.cc (Output_reloc::get_address): New function, broken out
16557 of write_rel.
16558 (Output_reloc::write_rel): Call it.
16559 (Output_reloc::compare): New function.
16560 (Output_data_reloc_base::do_write): Optionally sort relocs.
16561
60b2b4e7
ILT
16562 * configure.ac: If targ_extra_obj is set, link it in.
16563 * configure.tgt: Initialize all variables.
16564 (x86_64*): Set targ_extra_obj and targ_extra_size.
16565 * configure: Rebuild.
16566
8825ac63
ILT
16567 * object.cc (Sized_relobj::include_section_group): Adjust section
16568 indexes read from group data. Build vector to pass to
16569 layout_group.
16570 * layout.cc (Layout::layout_group): Add flags and shndxes
16571 parameters. Remove contents parameter. Change caller. Update
16572 explicit instantiations.
16573 * layout.h (class Layout): Update layout_group declaration.
16574 * output.cc (Output_data_group::Output_data_group): Add flags and
16575 input_shndxes parameters. Remove contents parameter. Change
16576 caller.
16577 (Output_data_group::do_write): Change input_sections_ to
16578 input_shndxes_.
16579 * output.h (class Output_data_group): Update constructor
16580 declaration. Rename input_sections_ to input_shndxes_.
16581 * testsuite/many_sections_test.cc: Add template.
16582
e94cf127
CC
165832008-04-30 Cary Coutant <ccoutant@google.com>
16584
4418b2d5
CC
16585 * target-reloc.h (relocate_section): Fix dead-pointer bug.
16586
e94cf127
CC
16587 * layout.cc (Layout::include_section): Refactored check for debug
16588 info section.
16589 (Layout::add_comdat): Add new parameters. Change type
16590 of signature parameter. Add object and shndx to signatures table.
16591 (Layout::find_kept_object): New function.
16592 * layout.h: Include <cstring>.
16593 (Layout::is_debug_info_section): New function.
16594 (Layout::add_comdat): Add new parameters.
16595 (Layout::find_kept_object): New function.
16596 (Layout::Kept_section): New struct.
16597 (Layout::Signatures): Change type of map range.
16598 * object.cc (Relobj::output_section_address): New function.
16599 (Sized_relobj::include_section_group): Add new parameters. Change
16600 calls to Layout::add_comdat. Change to build table of kept comdat
16601 groups and table mapping discarded sections to kept sections.
16602 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
16603 (Sized_relobj::do_layout): Change calls to include_section_group and
16604 include_linkonce_section.
16605 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
16606 value to zero when section is discarded.
16607 (Sized_relobj::map_to_kept_section): New function.
16608 * object.h (Relobj::output_section_address): New function.
16609 (Relobj::Comdat_group): New type.
16610 (Relobj::find_comdat_group): New function.
16611 (Relobj::Comdat_group_table): New type.
16612 (Relobj::Kept_comdat_section): New type.
16613 (Relobj::Kept_comdat_section_table): New type.
16614 (Relobj::add_comdat_group): New function.
16615 (Relobj::set_kept_comdat_section): New function.
16616 (Relobj::get_kept_comdat_section): New function.
16617 (Relobj::comdat_groups_): New field.
16618 (Relobj::kept_comdat_sections_): New field.
16619 (Symbol_value::input_value): Update comment.
16620 (Sized_relobj::map_to_kept_section) New function.
16621 (Sized_relobj::include_linkonce_section): Add new parameter.
16622 * target-reloc.h (Comdat_behavior): New type.
16623 (get_comdat_behavior): New function.
16624 (relocate_section): Add code to map a discarded section to the
16625 corresponding kept section when applying a relocation.
16626
e4e5049b
CS
166272008-04-30 Craig Silverstein <csilvers@google.com>
16628
16629 * dwarf_reader.cc (next_generation_count): New static var.
16630 (Addr2line_cache_entry): New struct.
16631 (addr2line_cache): New static var.
16632 (Dwarf_line_info::one_addr2line): Added caching.
16633 (Dwarf_line_info::clear_addr2line_cache): New function.
16634 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
16635 cache-size parameter.
16636 (Dwarf_line_info::one_addr2line_cache): New function.
16637 * symtab.cc (Symbol_table::detect_odr_violations): Pass
16638 new cache-size argument to one_addr2line(), and clear cache.
16639
d09e9154
CC
166402008-04-28 Cary Coutant <ccoutant@google.com>
16641
16642 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
16643 R_386_PC8 relocations.
16644
7ef73768
ILT
166452008-04-23 Ian Lance Taylor <iant@google.com>
16646
55438702
ILT
16647 * object.cc (Sized_relobj::include_section_group): Check for
16648 invalid section group.
16649
c165fb93
ILT
16650 * object.cc (make_elf_object): Correct test for 64-bit ELF file
16651 header size.
16652
7ef73768
ILT
16653 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
16654 than read for file header.
16655 * archive.cc (Archive::include_member): Likewise.
16656
6194aaab
L
166572008-04-23 Paolo Bonzini <bonzini@gnu.org>
16658
16659 * aclocal.m4: Regenerate.
16660 * configure: Regenerate.
16661
d491d34e
ILT
166622008-04-19 Ian Lance Taylor <iant@google.com>
16663
5ea2bac6
ILT
16664 * version.cc (version_string): Bump to 1.6.
16665
7bc3e21a
ILT
16666 * testsuite/Makefile.am (many_sections_r_test): New target.
16667 (many_sections_r_test_SOURCES): Remove.
16668 (many_sections_r_test_DEPENDENCIES): Remove.
16669 (many_sections_r_test_LDFLAGS): Remove.
16670 (many_sections_r_test_LDADD): Remove.
16671
7fcd3aa9
ILT
16672 * object.cc (Sized_relobj::do_add_symbols): Always pass
16673 local_symbol_count_ to add_from_relobj.
16674
4c94d6ae
ILT
16675 * testsuite/Makefile.am (many_sections_check.h): Only check one in
16676 every thousand variables.
16677 * testsuite/Makefile.in: Rebuild.
16678
d491d34e
ILT
16679 * object.cc (Xindex::initialize_symtab_xindex): New function.
16680 (Xindex::read_symtab_xindex): New function.
16681 (Xindex::sym_xindex_to_shndx): New function.
16682 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
16683 available.
16684 (Sized_relobj::do_initialize_xindex): New function.
16685 (Sized_relobj::do_read_symbols): Adjust section links.
16686 (Sized_relobj::symbol_section_and_value): Add is_ordinary
16687 parameter. Change all callers.
16688 (Sized_relobj::include_section_group): Adjust section links and
16689 symbol section indexes.
16690 (Sized_relobj::do_layout): Adjust section links.
16691 (Sized_relobj::do_count_local_symbols): Adjust section links and
16692 symbol section indexes.
16693 (Sized_relobj::do_finalize_local_symbols): Distinguish between
16694 ordinary and special symbols.
16695 (Sized_relobj::write_local_symbols): Add symtab_xindex and
16696 dynsym_xindex parameters. Change all callers. Adjust section
16697 links. Use SHN_XINDEX when needed.
16698 (Sized_relobj::get_symbol_location_info): Adjust section links.
16699 Don't get fooled by special symbols.
16700 * object.h (class Xindex): Define.
16701 (class Object): Add xindex_ parameter. Declare virtual functoin
16702 do_initialize_xindex.
16703 (Object::adjust_sym_shndx): New function.
16704 (Object::set_xindex): New protected function.
16705 (class Symbol_value): Add is_ordinary_shndx_ field.
16706 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
16707 (Symbol_value::value): Assert ordinary section.
16708 (Symbol_value::initialize_input_to_output_map): Likewise.
16709 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
16710 Change all callers.
16711 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
16712 all callers.
16713 (class Sized_relobj): Update declarations.
16714 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
16715 parameter. Change all callers.
16716 (Sized_relobj::adjust_shndx): New function.
16717 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
16718 field.
16719 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
16720 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
16721 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
16722 (Sized_dynobj::read_dynsym_section): Adjust section links.
16723 (Sized_dynobj::read_dynamic): Likewise.
16724 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
16725 section links.
16726 (Sized_dynobj::do_initialize_xindex): New function.
16727 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
16728 do_initialize_xindex.
16729 (Sized_dynobj::adjust_shndx): New function.
16730 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
16731 dynsym_xindex_ fields.
16732 (Layout::finalize): Add a call to set_section_indexes before
16733 creating the symtab sections.
16734 (Layout::set_section_indexes): Don't do anything if the section
16735 already has a section index.
16736 (Layout::create_symtab_sections): Add shnum parameter. Change
16737 caller. Create .symtab_shndx section if needed.
16738 (Layout::create_shdrs): Add shstrtab_section parameter. Change
16739 caller.
16740 (Layout::allocated_output_section_count): New function.
16741 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
16742 needed.
16743 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
16744 fields. Update declarations.
16745 (Layout::symtab_xindex): New function.
16746 (Layout::dynsym_xindex): New function.
16747 (class Write_symbols_task): Add layout_ field.
16748 (Write_symbols_task::Write_symbols_task): Add layout parameter.
16749 Change caller.
16750 * output.cc (Output_section_headers::Output_section_headers): Add
16751 shstrtab_section parameter. Change all callers.
16752 (Output_section_headers::do_sized_write): Store overflow values
16753 for section count and section string table section index in
16754 section header zero.
16755 (Output_file_header::do_sized_write): Check for overflow of
16756 section count and section string table section index.
16757 (Output_symtab_xindex::do_write): New function.
16758 (Output_symtab_xindex::endian_do_write): New function.
16759 * output.h (class Output_section_headers): Add shstrtab_section_.
16760 Update declarations.
16761 (class Output_symtab_xindex): Define.
16762 (Output_section::has_out_shndx): New function.
16763 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
16764 field.
16765 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
16766 Change all callers.
16767 (Sized_symbol::init): Likewise.
16768 (Symbol::output_section): Check for ordinary symbol.
16769 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
16770 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
16771 callers.
16772 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
16773 Change all callers. Simplify handling of symbols from sections
16774 not included in the link.
16775 (Symbol_table::add_from_dynobj): Handle ordinary symbol
16776 distinction.
16777 (Weak_alias_sorter::operator()): Assert that symbols are
16778 ordinary.
16779 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
16780 distinction.
16781 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
16782 parameters. Change all callers.
16783 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
16784 symbol distinction. Use SHN_XINDEX when needed.
16785 (Symbol_table::write_section_symbol): Add symtab_xindex
16786 parameter. Change all callers.
16787 (Symbol_table::sized_write_section_symbol): Likewise. Use
16788 SHN_XINDEX when needed.
16789 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
16790 declarations.
16791 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
16792 (Symbol::is_defined): Check is_ordinary.
16793 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
16794 (Symbol::is_absolute, Symbol::is_common): Likewise.
16795 (class Sized_symbol): Update declarations.
16796 (class Symbol_table): Update declarations.
16797 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
16798 parameters. Change all callers.
16799 (Sized_symbol::override): Likewise.
16800 (Symbol_table::override): Likewise.
16801 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
16802 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
16803 is_ordinary, and orig_st_shndx parameters. Change all callers.
16804 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
16805 to be in an ordinary section.
16806 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
16807 object and is_ordinary parameters. Change all callers.
16808 (Sized_dwarf_line_info::read_relocs): Add object parameter.
16809 Change all callers. Don't add undefined or non-ordinary symbols
16810 to reloc_map_.
16811 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
16812 Change all callers.
16813 * dwarf_reader.h (class Sized_dwarf_line_info): Update
16814 declarations.
16815 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
16816 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
16817 (Sized_relobj::relocate_sections): Likewise.
16818 * target-reloc.h (scan_relocs): Adjust section symbol index.
16819 (scan_relocatable_relocs): Likewise.
16820 * i386.cc (Scan::local): Check for ordinary symbols.
16821 * sparc.cc (Scan::local): Likewise.
16822 * x86_64.cc (Scan::local): Likewise.
16823 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
16824 to symbol_section_and_value.
16825 * testsuite/many_sections_test.cc: New file.
16826 * testsuite/Makefile.am (BUILT_SOURCES): Define.
16827 (check_PROGRAMS): Add many_sections_test.
16828 (many_sections_test_SOURCES): Define.
16829 (many_sections_test_DEPENDENCIES): Define.
16830 (many_sections_test_LDFLAGS): Define.
16831 (BUILT_SOURCES): Add many_sections_define.h.
16832 (many_sections_define.h): New target.
16833 (BUILT_SOURCES): Add many_sections_check.h.
16834 (many_sections_check.h): New target.
16835 (check_PROGRAMS): Add many_sections_r_test.
16836 (many_sections_r_test_SOURCES): Define.
16837 (many_sections_r_test_DEPENDENCIES): Define.
16838 (many_sections_r_test_LDFLAGS): Define.
16839 (many_sections_r_test_LDADD): Define.
16840 (many_sections_r_test.o): New target.
16841 * testsuite/Makefile.in: Rebuild.
16842
c5818ff1
CC
168432008-04-17 Cary Coutant <ccoutant@google.com>
16844
16845 * errors.cc (Errors::info): New function.
16846 (gold_info): New function.
16847 * errors.h (Errors::info): New function.
16848 * gold.h (gold_info): New function.
16849 * object.cc (Input_objects::add_object): Print trace output.
16850 * options.cc (options::parse_set): New function.
16851 (General_options::parse_wrap): Deleted.
16852 (General_options::General_options): Deleted initializer.
16853 * options.h (options::String_set): New typedef.
16854 (options::parse_set): New function.
16855 (DEFINE_set): New macro.
16856 (General_options::wrap): Changed to use DEFINE_set. Changed
16857 callers of any_wrap_symbols and is_wrap_symbol.
16858 (General_options::trace, General_options::trace_symbol):
16859 New options.
16860 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
16861 (General_options::wrap_symbols_): Deleted.
16862 * symtab.cc (Symbol_table::add_from_object): Print trace output.
16863
b5be4a7c
DM
168642008-04-17 David S. Miller <davem@davemloft.net>
16865
16866 * options.cc (General_options::parse_V): New function.
16867 * options.h: Add entries for -V and -Qy.
16868
155a0dd7
ILT
168692008-04-17 Ian Lance Taylor <iant@google.com>
16870
16871 * common.cc (Symbol_table::allocate_commons): Remove options
16872 parameter. Change caller.
16873 (Symbol_table::do_allocate_commons): Remove options parameter.
16874 Change caller. Just call do_allocate_commons_list twice.
16875 (Symbol_table::do_allocate_commons_list): New function, broken out
16876 of do_allocate_commons.
16877 * common.h (class Allocate_commons_task): Remove options_ field.
16878 Update constructor.
16879 * symtab.cc (Symbol_table::Symbol_table): Initialize
16880 tls_commons_.
16881 (Symbol_table::add_from_object): Put TLS common symbols on
16882 tls_commons_ list.
16883 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
16884 which are IN_OUTPUT_DATA.
16885 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
16886 allocate_commons and do_allocate_commons declarations. Declare
16887 do_allocate_commons_list.
16888 * gold.cc (queue_middle_tasks): Update creation of
16889 Allocate_commons_task to not pass options.
16890 * testsuite/Makefile.am (INCLUDES): Add -I.. .
16891 (TLS_TEST_C_FLAGS): New variable.
16892 (tls_test_c_pic.o): New target.
16893 (tls_test_shared.so): Link in tls_test_c_pic.o.
16894 (tls_test_c_pic_ie.o): New target.
16895 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
16896 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
16897 (tls_test_c.o): New target.
16898 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
16899 (tls_pic_test_LDADD): Likewise.
16900 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
16901 (tls_shared_gd_to_ie_test_LDADD): Likewise.
16902 (tls_test_c_gnu2.o): New target.
16903 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
16904 tls_test_c_gnu2.o.
16905 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
16906 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
16907 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
16908 * testsuite/tls_test.cc: Include "config.h".
16909 (t_last): Call t11_last.
16910 * testsuite/tls_test.h (t11, t11_last): Declare.
16911 * testsuite/tls_test_c.c: New file.
16912 * testsuite/tls_test_main.cc (thread_routine): Call t11.
16913 * configure.ac: Check for OpenMP support.
16914 * configure, config.in, Makefile.in: Rebuild.
16915 * testsuite/Makefile.in: Rebuild.
16916
edfbb029
CC
169172008-04-16 Cary Coutant <ccoutant@google.com>
16918
16919 * i386.cc (Target_i386::define_tls_base_symbol): New function.
16920 (Target_i386::tls_base_symbol_defined_): New field.
16921 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
16922 (Target_i386::Scan::global): Likewise.
16923 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
16924 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
16925 (Target_x86_64::tls_base_symbol_defined_): New field.
16926 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
16927 (Target_x86_64::Scan::global): Likewise.
16928
f3c69fca
CC
169292008-04-16 Cary Coutant <ccoutant@google.com>
16930
16931 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
16932 (Symbol::needs_plt_entry): Allow weak undefined symbols.
16933 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
16934 building shared libraries.
16935 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
16936 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
16937 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
16938 * testsuite/Makefile.in: Rebuild.
16939 * testsuite/weak_undef.h: New file.
16940 * testsuite/weak_undef_file1.cc: Add extra test cases.
16941 * testsuite/weak_undef_file2.cc: Likewise.
16942 * testsuite/weak_undef_test.cc: Likewise.
16943
7c414435
DM
169442008-04-16 David S. Miller <davem@davemloft.net>
16945
32b769e1
DM
16946 * sparc.cc (Target_sparc::Scan): Change from struct to class.
16947 Add issued_non_pic_error_ field. Declare check_non_pic.
16948 (Target_sparc::Scan::check_non_pic): New function.
16949 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
16950 (Target_sparc::Scan::global): Likewise.
16951
11936fb1
DM
16952 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
16953 * configure: Rebuild.
16954
7c414435
DM
16955 * options.h (DEFINE_enable): New macro.
16956 (new_dtags): New enable option.
16957 (initfirst, interpose, loadfltr, nodefaultlib,
16958 nodelete, nodlopen, nodump): New -z options.
16959 * layout.cc (Layout:finish_dynamic_section): If new
16960 dtags enabled, emit DT_RUNPATH. Also, emit a
16961 DT_FLAGS_1 containing any specified -z flags.
16962
85c7bf8b
ILT
169632008-04-16 Ian Lance Taylor <iant@google.com>
16964
12c0daef
ILT
16965 * copy-relocs.cc: New file.
16966 * copy-relocs.h: New file.
16967 * reloc.cc: Remove Copy_relocs code.
16968 * reloc.h: Likewise.
16969 * reloc-types.h (struct Reloc_types) [both versions]: Add
16970 get_reloc_addend_noerror.
16971 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
16972 variants of add_global which take an addend which must be zero.
16973 * i386.cc: Include "copy-relocs.h".
16974 (class Target_i386): Change type of copy_relocs_ to variable,
16975 update initializer.
16976 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
16977 Change all callers.
16978 (Target_i386::do_finalize_sections): Change handling of
16979 copy_relocs_.
16980 * sparc.cc: Include "copy-relocs.h".
16981 (class Target_sparc): Change type of copy_relocs_ to variable,
16982 update initializer.
16983 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
16984 Change all callers.
16985 (Target_sparc::do_finalize_sections): Change handling of
16986 copy_relocs_.
16987 * x86_64.cc: Include "copy-relocs.h".
16988 (class Target_x86_64): Change type of copy_relocs_ to variable,
16989 update initializer.
16990 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
16991 class. Change all callers.
16992 (Target_x86_64::do_finalize_sections): Change handling of
16993 copy_relocs_.
16994 * Makefile.am (CCFILES): Add copy-relocs.cc.
16995 (HFILES): Add copy-relocs.h.
16996
4f4995b6
ILT
16997 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
16998
85c7bf8b
ILT
16999 * testsuite/script_test_4.sh: Permit leading zeroes.
17000
4f2a9edd
ILT
170012008-04-15 Ian Lance Taylor <iant@google.com>
17002
e6188289
ILT
17003 * script-sections.cc (Script_sections::create_segments): Use
17004 header_size_adjustment even when there is enough room for the
17005 headers.
17006 * testsuite/script_test_4.sh: New file.
17007 * testsuite/script_test_4.t: New file.
17008 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
17009 (check_DATA): Add script_test_4.stdout.
17010 (MOSTLYCLEANFILES): Likewise.
17011 (script_test_4): New target.
17012 (script_test_4.stdout): New target.
17013 * testsuite/Makefile.in: Rebuild.
17014
4f2a9edd
ILT
17015 * sparc.cc: Add definitions for Output_data_plt_sparc class
17016 constants.
17017
f5314dd5
DM
170182008-04-14 David S. Miller <davem@davemloft.net>
17019
17020 * sparc.cc: New file.
17021 * Makefile.am (TARGETSOURCES): Add sparc.cc
17022 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
17023 * configure.tgt: Document targ_extra_size and
17024 targ_extra_big_endian. Add entries for sparc-* and
17025 sparc64-*.
17026 * configure.ac: Handle targ_extra_size and
17027 targ_extra_big_endian.
17028 * Makefile.in: Rebuild.
17029 * configure: Likewise.
17030 * po/POTFILES.in: Likewise.
17031 * po/gold.pot: Likewise.
17032
154e0e9a
ILT
170332008-04-14 Ian Lance Taylor <iant@google.com>
17034
17035 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
17036 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
17037 in the name/type/flags to section mapping. Don't call
17038 allocate_output_section.
17039 (Layout::choose_output_section): Change parameter from adjust_name
17040 to is_input_section. Don't permit input sections after sections
17041 are attached to segments. Don't call allocate_output_section.
17042 (Layout::layout_eh_frame): Call update_flags_for_input_section,
17043 not write_enable_output_section.
17044 (Layout::make_output_section): Don't push to
17045 unattached_section_list_ nor call attach_to_segment. Call
17046 attach_section_to_segment if sections are attached.
17047 (Layout::attach_sections_to_segments): New function.
17048 (Layout::attach_section_to_segment): New function.
17049 (Layout::attach_allocated_section_to_segment): Rename from
17050 attach_to_segment. Remove flags parameter.
17051 (Layout::allocate_output_section): Remove function.
17052 (Layout::write_enable_output_section): Remove function.
17053 * layout.h (class Layout): Update for above changes. Add new
17054 field sections_are_attached_.
17055 * output.h (Output_section::update_flags_for_input_section): New
17056 function.
17057 * output.cc (Output_section::add_input_section): Call
17058 update_flags_for_input_section.
17059 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
17060
009a67a2
CC
170612008-04-11 Cary Coutant <ccoutant@google.com>
17062
17063 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
17064 thought unnecessary.
17065 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
17066
759b1a24
ILT
170672008-04-11 Ian Lance Taylor <iant@google.com>
17068
17069 * output.h (class Output_section_data): Remove inline definition
17070 of set_addralign.
17071 * output.cc (Output_section_data::set_addralign): New function.
17072
c2b45e22
CC
170732008-04-11 Cary Coutant <ccoutant@google.com>
17074
17075 Add support for TLS descriptors for i386 and x86_64.
17076 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
17077 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
17078 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
17079 GOT_TYPE_TLS_DESC.
17080 (Target_i386::got_mod_index_entry): Remove unnecessary code.
17081 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
17082 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
17083 relocations.
17084 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
17085 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
17086 Fix problem with initial-exec relocations.
17087 (Target_i386::Relocate::relocate_tls): Likewise.
17088 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
17089 relaxation.
17090 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
17091 support for section-plus-offset dynamic table entries.
17092 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
17093 (Output_data_dynamic::Dynamic_entry): Add support for
17094 section-plus-offset dynamic table entries.
17095 (Output_data_dynamic::Classification): Likewise.
17096 (Output_data_dynamic::classification_): Renamed offset_.
17097 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
17098 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
17099 (Target_x86_64::make_plt_section): New function.
17100 (Target_x86_64::reserve_tlsdesc_entries): New function.
17101 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
17102 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
17103 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
17104 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
17105 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
17106 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
17107 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
17108 add extra PLT entry for TLS descriptors.
17109 (Output_data_plt_x86_64::got_): New field.
17110 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
17111 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
17112 fields.
17113 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
17114 descriptors.
17115 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
17116 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
17117 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
17118 R_386_TLS_DESC_CALL relocations.
17119 (Target_x86_64::Scan::global): Likewise.
17120 (Target_x86_64::do_finalize_sections): Add dynamic table entries
17121 for TLS descriptors.
17122 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
17123 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
17124 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
17125 GD-to-IE relaxation.
17126 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
17127 and TLS_DESCRIPTORS.
17128 * Makefile.in: Rebuild.
17129 * configure: Rebuild.
17130 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
17131 (tls_test_shared2.so): New target.
17132 (tls_shared_gd_to_ie_test_SOURCES): New variable.
17133 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
17134 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
17135 (tls_shared_gd_to_ie_test_LDADD): New variable.
17136 (tls_shared_gnu2_gd_to_ie_test): New target.
17137 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
17138 New targets.
17139 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
17140 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
17141 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
17142 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
17143 (tls_shared_gnu2_test): New target.
17144 (tls_test_gnu2_shared.so): New target.
17145 (tls_shared_gnu2_test_SOURCES): New variable.
17146 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
17147 (tls_shared_gnu2_test_LDFLAGS): New variable.
17148 (tls_shared_gnu2_test_LDADD): New variable.
17149 * testsuite/Makefile.in: Rebuild.
17150 * testsuite/Makefile.
17151
83bfb6b7
ILT
171522008-04-11 Ian Lance Taylor <iant@google.com>
17153
17154 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
17155 justsyms.t.
17156 * testsuite/Makefile.in: Rebuild.
17157
17158 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
17159 long.
17160 * testsuite/script_test_2.cc (main): Adjust test.
17161
706e1f5e
ILT
171622008-04-11 David S. Miller <davem@davemloft.net>
17163 Ian Lance Taylor <iant@google.com>
17164
17165 * options.h (General_options): Add entries for '-Y' and
17166 '-relax'.
17167 * options.cc (General_options:finalize): If -Y was used, add those
17168 entries to the library path instead of the default "/lib" and
17169 "/usr/lib".
17170
7c98e6bb
DM
171712008-04-11 David S. Miller <davem@davemloft.net>
17172
17173 * testsuite/justsyms.t: Start at 0x100.
17174 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
17175 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
17176 long.
17177 * testsuite/script_test_2.cc: Adjust string and section length
17178 checks.
7c98e6bb 17179
99a37bfd
ILT
171802008-04-09 Ian Lance Taylor <iant@google.com>
17181
2cefc357
ILT
17182 PR gold/5996
17183 * script-sections.cc (Sections_element::allocate_to_segment): Add
17184 orphan parameter.
17185 (Output_section_definition::allocate_to_segment): Likewise.
17186 (Orphan_output_section::allocate_to_segment): Likewise.
17187 (Script_sections::attach_sections_using_phdrs_clause): Don't
17188 propagate non-PT_LOAD segments to orphan sections.
17189 * testsuite/Makefile.am (script_test_3.stdout): Generate using
17190 readelf rather than objdump.
17191 * testsuite/script_test_3.sh: Adjust accordingly. Test that
17192 .interp section and PT_INTERP segment are the same size.
17193 * testsuite/Makefile.in: Rebuild.
17194
99a37bfd
ILT
17195 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
17196 aliases for symbols defined in the same object.
17197 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
17198 (weak_alias_test_SOURCES): New variable.
17199 (weak_alias_test_DEPENDENCIES): New variable.
17200 (weak_alias_test_LDFLAGS): New variable.
17201 (weak_alias_test_LDADD): New variable.
17202 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
17203 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
17204 (weak_alias_test_3.o): New target.
17205 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
17206 * testsuite/weak_alias_test_main.cc: New file.
17207 * testsuite/weak_alias_test_1.cc: New file.
17208 * testsuite/weak_alias_test_2.cc: New file.
17209 * testsuite/weak_alias_test_3.cc: New file.
17210
780e49c5
ILT
172112008-04-08 Ian Lance Taylor <iant@google.com>
17212
cdb0b8f5
ILT
17213 * options.h (class General_options): Add --noinhibit-exec option.
17214 * main.cc (main): Check --noinhibit-exec.
17215
0864d551
ILT
17216 * options.h (class General_options): Define --wrap as a special
17217 option. Add wrap_symbols_ field.
17218 (General_options::any_wrap_symbols): New function.
17219 (General_options::is_wrap_symbol): New function.
17220 * options.cc (General_options::parse_wrap): New function.
17221 (General_options::General_options): Initialize wrap_symbols_.
17222 * symtab.cc (Symbol_table::wrap_symbol): New function.
17223 (Symbol_table::add_from_object): Handle --wrap.
17224 * symtab.h (class Symbol_table): Declare wrap_symbol.
17225 * target.h (Target::wrap_char): New function.
17226 (Target::Target_info): Add wrap_char field.
17227 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
17228 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
17229 * testsuite/testfile.cc (Target_test::test_target_info):
17230 Likewise.
17231
789aa6de
ILT
17232 * errors.cc (Errors::undefined_symbol): Mention symbol version if
17233 there is one.
17234
2c38906f
ILT
17235 * layout.h (class Layout): Add added_eh_frame_data_ field.
17236 * layout.cc (Layout::Layout): Initialize new field.
17237 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
17238 output section until we find a section we merged successfully.
17239 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
17240 that the size be non-zero.
17241
780e49c5
ILT
17242 * merge.cc (Object_merge_map::get_output_offset): Remove inline
17243 qualifier.
17244
7fcd0256
ILT
172452008-04-08 Craig Silverstein <csilvers@google.com>
17246
17247 * configure.ac: Export new conditional variable HAVE_ZLIB.
17248 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
17249 on HAVE_ZLIB.
17250 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
17251 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17252
6835af53
ILT
172532008-04-07 Ian Lance Taylor <iant@google.com>
17254
e24f324c
ILT
17255 * version.cc (version_string): Set to "1.5".
17256
a036edd8
ILT
17257 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
17258 Add issued_non_pic_error_ field. Declare check_non_pic.
17259 (Target_x86_64::Scan::check_non_pic): New function.
17260 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
17261 (Target_x86_64::Scan::global): Likewise.
17262
624f8810
ILT
17263 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
17264 addend parameter. Change caller. Handle merge sections.
17265 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
17266 Address to Addend. Don't add in the result of
17267 local_section_offset, pass down the addend and use the returned
17268 value.
17269 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
17270 Update declarations of local_section_offset and symbol_value.
17271 * testsuite/two_file_test_1.cc (t18): New function.
17272 * testsuite/two_file_test_2.cc (f18): New function.
17273 * testsuite/two_file_test_main.cc (main): Call t18.
17274 * testsuite/two_file_test.h (t18, f18): Declare.
17275
6835af53
ILT
17276 * configure.ac: Don't test for objdump, c++filt, or readelf.
17277 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
17278 conditionals.
17279 (TEST_READELF): New variable.
17280 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
17281 (check_PROGRAMS): Add two_file_strip_test.
17282 (two_file_strip_test): New target.
17283 (check_PROGRAMS): Add two_file_same_shared_strip_test.
17284 (two_file_same_shared_strip_test_SOURCES): New variable.
17285 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
17286 (two_file_same_shared_strip_test_LDFLAGS): New variable.
17287 (two_file_same_shared_strip_test_LDADD): New variable.
17288 (two_file_shared_strip.so): New target.
17289 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
17290 (ver_test_5.syms, ver_test_7.syms): Likewise.
17291 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
17292 (strip_test_3.stdout): Use TEST_OBJDUMP.
17293 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17294
86925eef
CC
172952008-04-04 Cary Coutant <ccoutant@google.com>
17296
17297 * symtab.h (Symbol::is_weak_undefined): New function.
17298 (Symbol::is_strong_undefined): New function.
17299 (Symbol::is_absolute): New function.
17300 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
17301 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
17302 absolute symbols.
17303 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
17304 (weak_undef_test): New target.
17305 * testsuite/Makefile.in: Rebuild.
17306 * testsuite/weak_undef_file1.cc: New file.
17307 * testsuite/weak_undef_file2.cc: New file.
17308 * testsuite/weak_undef_test.cc: New file.
17309
126f3ece
ILT
173102008-04-03 Craig Silverstein <csilvers@google.com>
17311
17312 * compressed_output.h (class Output_compressed_section): Use
17313 unsigned buffer.
17314 * compressed_output.cc (zlib_compress): Use unsigned buffers,
17315 add zlib header.
17316 (zlib_compressed_suffix): Removed.
17317 (Output_compressed_section::set_final_data_size): Use unsigned
17318 buffers.
17319 * testsuite/Makefile.am (flagstest_compress_debug_sections):
17320 Fix linker invocation.
17321 (flagstest_o_specialfile_and_compress_debug_sections):
17322 Likewise.
17323 * testsuite/Makefile.in: Regenerated.
17324
deae2a14
DM
173252008-04-02 David S. Miller <davem@davemloft.net>
17326
17327 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
17328 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
17329
70752818
ILT
173302008-04-02 Craig Silverstein <csilvers@google.com>
17331
17332 * TODO: New file.
17333
39d0cb0e
ILT
173342008-04-02 Ian Lance Taylor <iant@google.com>
17335
17336 * fileread.cc (File_read::find_view): Add byteshift and vshifted
17337 parameters. Update for new key type to views_. Change all
17338 callers.
17339 (File_read::read): Adjust for byteshift in returned view.
17340 (File_read::add_view): New function, broken out of
17341 find_and_make_view.
17342 (File_read::make_view): New function, broken out of
17343 find_and_make_view.
17344 (File_read::find_or_make_view): Add offset and aligned
17345 parameters. Rewrite accordingly. Change all callers.
17346 (File_read::get_view): Add offset and aligned parameters. Adjust
17347 for byteshift in return value.
17348 (File_read::get_lasting_view): Likewise.
17349 * fileread.h (class File_read): Update declarations.
17350 (class File_read::View): Add byteshift_ field. Add byteshift to
17351 constructor. Add byteshift method.
17352 * archive.h (Archive::clear_uncached_views): New function.
17353 (Archive::get_view): Add aligned parameter. Change all callers.
17354 * object.h (Object::get_view): Add aligned parameter. Change all
17355 callers.
17356 (Object::get_lasting_view): Likewise.
17357
17358 * fileread.cc (File_read::release): Don't call clear_views if
17359 there are multiple objects.
17360 * fileread.h (File_read::clear_uncached_views): New function.
17361 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
17362 on the archive.
17363
a1207466
CC
173642008-03-31 Cary Coutant <ccoutant@google.com>
17365
17366 Add thin archive support.
17367 * archive.cc (Archive::armagt): New const.
17368 (Archive::setup): Remove task parameter and calls to unlock.
17369 (Archive::unlock_nested_archives): New function.
17370 (Archive::read_header): Add nested_off parameter. Change
17371 all callers.
17372 (Archive::interpret_header): Likewise.
17373 (Archive::include_all_members): Change to handle thin
17374 archives.
17375 (Archive::include_member): Likewise.
17376 * archive.h (Archive::Archive): Add new parameters and
17377 initializers.
17378 (Archive::armagt): New const.
17379 (Archive::setup): Remove task parameter.
17380 (Archive::unlock_nested_archives): New function.
17381 (Archive::read_header): Add nested_off parameter.
17382 (Archive::interpret_header): Likewise.
17383 (Archive::Nested_archive_table): New typedef.
17384 (Archive::is_thin_archive_): New field.
17385 (Archive::nested_archives_): New field.
17386 (Archive::options_): New field.
17387 (Archive::dirpath_): New field.
17388 (Archive::task_): New field.
17389 * readsyms.cc (Read_symbols::do_read_symbols): Add check
17390 for thin archives. Pass additional parameters to
17391 Archive::Archive. Unlock the archive file after calling
17392 Archive::setup.
cd536b21 17393
479f6503
ILT
173942008-03-29 Ian Lance Taylor <iant@google.com>
17395
686c8caf
ILT
17396 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
17397 version symbol to be local.
17398 * testsuite/ver_test_4.sh: New file.
17399 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
17400 (check_DATA): Add ver_test_4.syms.
17401 (ver_test_4.syms): New target.
17402 * testsuite/Makefile.in: Rebuild.
17403
ab794b6b
ILT
17404 * output.cc
17405 (Output_section::Input_section_sort_entry::has_priority): New
17406 function.
17407 (Output_section::Input_section_sort_entry::match_file_name): New
17408 function.
17409 (Output_section::Input_section_sort_entry::match_section_name):
17410 Remove.
17411 (Output_section::Input_section_sort_entry::match_section_name_prefix):
17412 Remove.
17413 (Output_section::Input_section_sort_entry::match_section_file):
17414 Remove.
17415 (Output_section::Input_section_sort_compare::operator()): Rewrite
17416 using new Input_section_sort_entry functions. Sort crtbegin and
17417 crtend first. Sort sections with no priority before sections with
17418 a priority.
17419 * testsuite/initpri1.c (d3): Check j != 4.
17420 (cd5): New constructor/destructor function.
17421 (main): Check j != 2.
17422
479f6503
ILT
17423 * symtab.cc (Symbol_table::add_from_object): If we don't use the
17424 new symbol when resolving, don't call set_is_default.
17425 * testsuite/ver_test_7.cc: New file.
17426 * testsuite/ver_test_7.sh: New file.
17427 * testsuite/Makefile.am (ver_test_7.so): New target.
17428 (ver_test_7.o): New target.
17429 (check_SCRIPTS): Add ver_test_7.sh.
17430 (check_DATA): Add ver_test_7.syms.
17431 (ver_test_7.syms): New target.
17432
2fd32231
ILT
174332008-03-28 Ian Lance Taylor <iant@google.com>
17434
17435 * layout.cc (Layout::layout): If we see an input section with a
17436 name that needs sorting, set the must_sort flag for the output
17437 section.
17438 (Layout::make_output_section): If the name of the output section
17439 indicates that it might require sorting, set the may_sort flag.
17440 * output.h (Output_section::may_sort_attached_input_sections): New
17441 function.
17442 (Output_section::set_may_sort_attached_input_sections): New
17443 function.
17444 (Output_section::must_sort_attached_input_sections): New
17445 function.
17446 (Output_section::set_must_sort_attached_input_sections): New
17447 function.
17448 (class Output_section): Declare Input_section_sort_entry. Define
17449 Input_section_sort_compare. Declare
17450 sort_attached_input_sections. Add new fields:
17451 may_sort_attached_input_sections_,
17452 must_sort_attached_input_sections_,
17453 attached_input_sections_are_sorted_.
17454 * output.cc (Output_section::Output_section): Initialize new
17455 fields.
17456 (Output_section::add_input_section): Add an entry to
17457 input_sections_ if may_sort or must_sort are true.
17458 (Output_section::set_final_data_size): Call
17459 sort_attached_input_sections if necessary.
17460 (Output_section::Input_section_sort_entry): Define new class.
17461 (Output_section::Input_section_sort_compare::operator()): New
17462 function.
17463 (Output_section::sort_attached_input_sections): New function.
17464 * configure.ac: Check whether the compiler supports constructor
17465 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
17466 * testsuite/initpri1.c: New file.
17467 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
17468 CONSTRUCTOR_PRIORITY.
17469 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
17470 (initpri1_LDFLAGS): New variable.
17471 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17472
18e6b24e
ILT
174732008-03-27 Ian Lance Taylor <iant@google.com>
17474
49bdd526
ILT
17475 * common.cc (Sort_commons::operator): Correct sorting algorithm.
17476 * testsuite/common_test_1.c: New file.
17477 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
17478 (common_test_1_SOURCES): New variable.
17479 (common_test_1_DEPENDENCIES): New variable.
17480 (common_test_1_LDFLAGS): New variable.
17481
18e6b24e
ILT
17482 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
17483 and commons_ correctly when NAME/VERSION does not override
17484 NAME/NULL.
17485 * testsuite/ver_test_6.c: New file.
17486 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
17487 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
17488 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
17489
04bf7072
ILT
174902008-03-26 Ian Lance Taylor <iant@google.com>
17491
5871526f
ILT
17492 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
17493 of an undefined symbol from a version script.
17494 * testsuite/Makefile.am (ver_test_5.so): New target.
17495 (ver_test_5.o): New target.
17496 (check_SCRIPTS): Add ver_test_5.sh.
17497 (check_DATA): Add ver_test_5.syms.
17498 (ver_test_5.syms): New target.
17499 * testsuite/ver_test_5.cc: New file.
17500 * testsuite/ver_test_5.script: New file.
17501 * testsuite/ver_test_5.sh: New file.
17502 * Makefile.in, testsuite/Makefile.in: Rebuild.
17503
04bf7072
ILT
17504 PR gold/5986
17505 Fix problems building gold with gcc 4.3.0.
17506 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
17507 (gold_error_at_location, gold_warning_at_location): Use it.
17508 * configure.ac: Check whether we can compile and use a template
17509 function with a printf attribute.
17510 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
17511 when jumping over bytes.
17512 * object.cc: Instantiate Object::read_section_data.
17513 * debug.h: Include <cstring>
17514 * dwarf_reader.cc: Include <algorithm>
17515 * main.cc: Include <cstring>.
17516 * options.cc: Include <cstring>.
17517 * output.cc: Include <cstring>.
17518 * script.cc: Include <cstring>.
17519 * script.h: Include <string>.
17520 * symtab.cc: Include <cstring> and <algorithm>.
17521 * target-select.cc: Include <cstring>.
17522 * version.cc: Include <string>.
17523 * testsuite/testmain.cc: Include <cstdlib>.
17524 * configure, config.in: Rebuild.
17525
874c5b28
ILT
175262008-03-25 Ian Lance Taylor <iant@google.com>
17527
819d6c3a
ILT
17528 * options.cc: Include "../bfd/bfdver.h".
17529 (options::help): Print bug reporting address.
17530
f4b2c6f5
ILT
17531 * version.cc (print_version): Adjust output for current value of
17532 BFD_VERSION_STRING.
17533
17534 * NEWS: New file.
17535
e96caa79
ILT
17536 * options.cc (options::help): Print list of supported targets.
17537 * target-select.h: Include <vector>.
17538 (class Target_selector): Make machine_, size_, and is_big_endian_
17539 fields const. Add bfd_name_ and instantiated_target_ fields.
17540 (Target_selector::Target_selector): Add bfd_name parameter.
17541 (Target_selector::recognize): Make non-virtual, call
17542 do_recognize.
17543 (Target_selector::recognize_by_name): Make non-virtual, call
17544 do_recognize_by_name.
17545 (Target_selector::supported_names): New function.
17546 (Target_selector::bfd_name): New function.
17547 (Target_selector::do_instantiate_target): New pure virtual
17548 function.
17549 (Target_selector::do_recognize): New virtual function.
17550 (Target_selector::do_recognize_by_name): New virtual function.
17551 (Target_selector::instantiate_target): New private function.
17552 (supported_target_names): Declare.
17553 * target-select.cc (Target_selector::Target_selector): Update for
17554 new parameter and fields.
17555 (select_target_by_name): Check that the name matches before
17556 calling recognize_by_name.
17557 (supported_target_names): New function.
17558 * i386.cc (class Target_selector_i386): Update Target_selector
17559 constructor call. Remove recognize and recognize_by_name. Add
17560 do_instantiate_target.
17561 * x86_64.cc (class Target_selector_x86_64): Likewise.
17562 * testsuite/testfile.cc (class Target_selector_test): Update for
17563 changes to Target_selector.
17564
874c5b28
ILT
17565 * README: Rewrite, with some notes on unsupported features.
17566
0a65a3a7
CC
175672008-03-24 Cary Coutant <ccoutant@google.com>
17568
17569 * i386.cc (Target_i386::Got_type): New enum declaration.
17570 (Target_i386::Scan::local): Updated callers of Output_data_got
17571 member functions.
17572 (Target_i386::Scan::global): Likewise.
17573 (Target_i386::Relocate::relocate): Likewise.
17574 (Target_i386::Relocate::relocate_tls): Likewise.
17575 * object.h (Got_offset_list): New class.
17576 (Sized_relobj::local_has_got_offset): Added got_type parameter.
17577 (Sized_relobj::local_got_offset): Likewise.
17578 (Sized_relobj::set_local_got_offset): Likewise.
17579 (Sized_relobj::local_has_tls_got_offset): Removed.
17580 (Sized_relobj::local_tls_got_offset): Removed.
17581 (Sized_relobj::set_local_tls_got_offset): Removed.
17582 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
17583 * output.cc (Output_data_got::add_global): Added got_type parameter.
17584 (Output_data_got::add_global_with_rel): Likewise.
17585 (Output_data_got::add_global_with_rela): Likewise.
17586 (Output_data_got::add_global_pair_with_rel): New function.
17587 (Output_data_got::add_global_pair_with_rela): New function.
17588 (Output_data_got::add_local): Added got_type parameter.
17589 (Output_data_got::add_local_with_rel): Likewise.
17590 (Output_data_got::add_local_with_rela): Likewise.
17591 (Output_data_got::add_local_pair_with_rel): New function.
17592 (Output_data_got::add_local_pair_with_rela): New function.
17593 (Output_data_got::add_global_tls): Removed.
17594 (Output_data_got::add_global_tls_with_rel): Removed.
17595 (Output_data_got::add_global_tls_with_rela): Removed.
17596 (Output_data_got::add_local_tls): Removed.
17597 (Output_data_got::add_local_tls_with_rel): Removed.
17598 (Output_data_got::add_local_tls_with_rela): Removed.
17599 * output.h (Output_data_got::add_global): Added got_type parameter.
17600 (Output_data_got::add_global_with_rel): Likewise.
17601 (Output_data_got::add_global_with_rela): Likewise.
17602 (Output_data_got::add_global_pair_with_rel): New function.
17603 (Output_data_got::add_global_pair_with_rela): New function.
17604 (Output_data_got::add_local): Added got_type parameter.
17605 (Output_data_got::add_local_with_rel): Likewise.
17606 (Output_data_got::add_local_with_rela): Likewise.
17607 (Output_data_got::add_local_pair_with_rel): New function.
17608 (Output_data_got::add_local_pair_with_rela): New function.
17609 (Output_data_got::add_global_tls): Removed.
17610 (Output_data_got::add_global_tls_with_rel): Removed.
17611 (Output_data_got::add_global_tls_with_rela): Removed.
17612 (Output_data_got::add_local_tls): Removed.
17613 (Output_data_got::add_local_tls_with_rel): Removed.
17614 (Output_data_got::add_local_tls_with_rela): Removed.
17615 * resolve.cc (Symbol::override_base_with_special): Removed
17616 reference to has_got_offset_ field.
17617 * symtab.cc (Symbol::init_fields): Replaced initialization
17618 of got_offset_ with got_offsets_. Removed initialization
17619 of has_got_offset_
53fcba31 17620 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
17621 (Symbol::got_offset): Likewise.
17622 (Symbol::set_got_offset): Likewise.
17623 (Symbol::has_tls_got_offset): Removed.
17624 (Symbol::tls_got_offset): Removed.
17625 (Symbol::set_tls_got_offset): Removed.
17626 (Symbol::got_offset_): Removed.
17627 (Symbol::tls_mod_got_offset_): Removed.
17628 (Symbol::tls_pair_got_offset_): Removed.
17629 (Symbol::got_offsets_): New field.
17630 (Symbol::has_got_offset): Removed.
17631 (Symbol::has_tls_mod_got_offset): Removed.
17632 (Symbol::has_tls_pair_got_offset): Removed.
17633 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
17634 (Target_x86_64::Scan::local): Updated callers of Output_data_got
17635 member functions.
17636 (Target_x86_64::Scan::global): Likewise.
17637 (Target_x86_64::Relocate::relocate): Likewise.
17638 (Target_x86_64::Relocate::relocate_tls): Likewise.
17639
bd52eafb
BE
176402008-03-25 Ben Elliston <bje@au.ibm.com>
17641
17642 * yyscript.y: Fix spelling error in comment.
17643
8b105e34
ILT
176442008-03-24 Ian Lance Taylor <iant@google.com>
17645
8ed814a9
ILT
17646 * options.h (class General_options): Define build_id option.
17647 * layout.h (class Layout): Declare write_build_id, create_note,
17648 create_build_id. Add build_id_note_ member.
17649 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
17650 "libiberty.h", "md5.h", "sha1.h".
17651 (Layout::Layout): Initialize eh_frame_data_,
17652 eh_frame_hdr_section_, and build_id_note_.
17653 (Layout::finalize): Call create_build_id.
17654 (Layout::create_note): New function, broken out of
17655 Layout::create_gold_note.
17656 (Layout::create_gold_note): Call create_note.
17657 (Layout::create_build_id): New function.
17658 (Layout::write_build_id): New function.
17659 (Close_task_runner::run): Call write_build_id.
17660
8b105e34
ILT
17661 * x86_64.cc: Correct license to GPLv3.
17662
086a1841
ILT
176632008-03-23 Ian Lance Taylor <iant@google.com>
17664
17665 * options.cc: Include "demangle.h".
17666 (parse_optional_string): New function.
17667 (parse_long_option): Handle takes_optional_argument.
17668 (parse_short_option): Update dash_z initializer. Handle
17669 takes_optional_argument.
17670 (General_options::General_options): Initialize do_demangle_.
17671 (General_options::finalize): Set do_demangle_. Handle demangling
17672 style.
17673 * options.h (parse_optional_string): Declare.
17674 (struct One_option): Add optional_arg field. Update constructor.
17675 Update call constructor calls. Add takes_optional_argument
17676 function.
17677 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
17678 (DEFINE_optional_string): Define.
17679 (General_options::demangle): Change from DEFINE_bool to
17680 DEFINE_optional_string.
17681 (General_options::no_demangle): New function.
17682 (General_options::do_demangle): New function.
17683 (General_options::set_do_demangle): New function.
17684 (General_options::execstack_status_): Move definition to end of
17685 class definition.
17686 (General_options::static_): Likewise.
17687 (General_options::do_demangle_): New field.
17688 * object.cc (big_endian>::get_symbol_location_info): Call
17689 Options::do_demangle, not Options::demangle.
17690 * symtab.cc (demangle): Likewise.
17691
cbb93e63
ILT
176922008-03-22 Ian Lance Taylor <iant@google.com>
17693
17694 * gold.h: Include <cstddef> and <sys/types.h>
17695 * options.h: Include <cstring>.
17696
ec531623
ILT
176972008-03-21 Ian Lance Taylor <iant@google.com>
17698
17699 * Added source code to GNU binutils.
752937aa 17700\f
b90efa5b 17701Copyright (C) 2008-2015 Free Software Foundation, Inc.
752937aa
NC
17702
17703Copying and distribution of this file, with or without modification,
17704are permitted in any medium without royalty provided the copyright
17705notice and this notice are preserved.
17706
17707Local Variables:
17708mode: change-log
17709left-margin: 8
17710fill-column: 74
17711version-control: never
17712End:
This page took 1.119075 seconds and 4 git commands to generate.