Fix internal error in gold when script uses section address in assignment.
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
1757d35c
CC
12015-08-25 Cary Coutant <ccoutant@gmail.com>
2
3 PR gold/14746
4 * expression.cc (Expression::Expression_eval_info): Add
5 is_valid_pointer field.
6 (Expression::eval_maybe_dot): Add is_valid_pointer parameter.
7 Adjust all callers.
8 (Addr_expression::value_from_output_section): Check whether address
9 is valid.
10 * script.cc (Symbol_assignment::set_if_absolute): Defer assignment
11 if evaluation failed due to address that is not yet valid.
12 * script.h: (Expression::eval_maybe_dot): Add is_valid_pointer
13 parameter.
14
3ac0a36c
CC
152015-08-25 Cary Coutant <ccoutant@gmail.com>
16
17 PR gold/18866
18 PR gold/18703
19 * symtab.cc (Symbol_table): Reorder conditions to avoid internal error.
20
9215b98b
AM
212015-08-20 Alan Modra <amodra@gmail.com>
22
23 PR gold/18846
24 * target-reloc.h (relocate_relocs <RELOC_ADJUST_FOR_SECTION_RELA>):
25 Subtract os->address() from addend.
26 * powerpc.cc (relocate_relocs): Likewise.
27
40fc1451
SD
282015-08-12 Simon Dardis <simon.dardis@imgtec.com>
29
30 * mips.cc (plt0_entry_o32, plt0_entry_n32, plt0_entry_n64,
31 lazy_stub_normal_1, lazy_stub_normal_1_n64,
32 lazy_stub_normal_2, lazy_stub_normal_2_n64, lazy_stub_big,
33 lazy_stub_big_n64, lazy_stub_micromips32_normal_1_n64,
34 lazy_stub_micromips32_normal_2_n64, lazy_stub_micromips32_big,
35 lazy_stub_micromips32_big_n64): Update to use 'or' for move instead
36 of 'addu/daddu'.
37
37a42ee9
L
382015-07-27 H.J. Lu <hongjiu.lu@intel.com>
39
40 * configure: Regenerated.
41
ab3b14b0
DK
422015-07-26 Doug Kwan <dougkwan@google.com>
43
44 * testsuite/arm_unaligned_reloc.{s,sh}: Make test less sensitive to
45 disassembler output format.
46
cdb06167
HS
472015-07-23 Ian Coolidge <icoolidge@google.com>
48 Plumb --pic-veneer option for gold.
49
50 * arm.cc (Reloc_stub::stub_type_for_reloc): Plumb to stub
51 generation.
52 * options.h (General_options): Add --pic-veneer option.
53
5b2af7dd
L
542015-07-22 H.J. Lu <hongjiu.lu@intel.com>
55
56 PR gold/18663
57 * testsuite/Makefile.am (script_test_1_SOURCES): Set to
58 script_test_1a.cc script_test_1b.cc.
59 (script_test_11_r.o): Replace script_test_11.o with
60 script_test_11a.o script_test_11b.o.
61 (script_test_11.o): Removed.
62 (script_test_11a.o): New.
63 (script_test_11b.o): Likewise.
64 * testsuite/Makefile.in: Regenerated.
65 * testsuite/script_test_1.h: New file.
66 * testsuite/script_test_1b.cc: Likewise.
67 * testsuite/script_test_11.h: Likewise.
68 * testsuite/script_test_11b.c: Likewise.
69 * testsuite/script_test_1.cc: Renamed to ...
70 * testsuite/script_test_1a.cc: This.
71 Include "script_test_1.h".
72 (main): Call check_int and check_ptr.
73 * testsuite/script_test_11.c: Renamed to ...
74 * testsuite/script_test_11a.c: This.
75 Include "script_test_11.h".
76 (main): Call ptr_equal.
77
cd78ea77
L
782015-07-22 H.J. Lu <hongjiu.lu@intel.com>
79
80 PR gold/18628
81 * testsuite/ifuncdep2.c (global): Change protected to hidden.
82 * testsuite/ifuncmod1.c (global): Likewise.
83 * testsuite/ifuncmod5.c (global): Likewise.
84
f945ba50
AM
852015-07-22 Alan Modra <amodra@gmail.com>
86
87 * aarch64.cc (try_fix_erratum_843419_optimized): Warning fix.
88
5417c94d
CC
892015-07-21 Cary Coutant <ccoutant@gmail.com>
90
91 PR gold/18548
92 * symtab.cc (Symbol_table::do_define_in_output_data): Check for
93 forced local symbol even when oldsym != NULL.
94 (Symbol_table::do_define_in_output_segment): Likewise.
95 (Symbol_table::do_define_as_constant): Likewise.
96
cb5cf5e2
CC
972015-07-21 Cary Coutant <ccoutant@gmail.com>
98
b8c6c5ef 99 PR gold/18698
cb5cf5e2
CC
100 * archive.cc (Library_base::should_include_member): Don't use entry
101 point for relocatable links, or if target is not yet valid.
102 * parameters.cc (Parameters::entry): Check target_valid().
103
0ef3814f
HS
1042015-07-20 Han Shen <shenhan@google.com>
105
106 Optimize erratum 843419 fix.
107
108 * aarch64.cc (AArch64_insn_utilities::is_adr): New method.
109 (AArch64_insn_utilities::aarch64_adr_encode_imm): New method.
110 (AArch64_insn_utilities::aarch64_adrp_decode_imm): New method.
111 (E843419_stub): New sub-class of Erratum_stub.
112 (AArch64_relobj::try_fix_erratum_843419_optimized): New method.
113 (AArch64_relobj::section_needs_reloc_stub_scanning): Try optimized fix.
114 (AArch64_relobj::create_erratum_stub): Add 1 argument.
115 (Target_aarch64::scan_erratum_843419_span): Pass in adrp insn offset.
116
2bca0377
HS
1172015-07-20 Han Shen <shenhan@google.com>
118
119 Fix arm elf header flags wrt hardfp bit.
120
121 * arm.cc (Target_arm::do_adjust_elf_header): Set flags into view.
122
f54f5e31
L
1232015-07-20 H.J. Lu <hongjiu.lu@intel.com>
124
125 PR gold/18689
126 * layout.cc (Layout::layout): Clear the SHF_COMPRESSED flag bit
127 from input group section for relocatable link.
128 * testsuite/Makefile.am (check_SCRIPTS): Add pr18689.sh.
129 (check_DATA): Add pr18689.stdout.
130 (MOSTLYCLEANFILES): Add pr18689a.o pr18689b.o.
131 (pr18689.stdout): New rule.
132 (pr18689a.o): Likewise.
133 (pr18689b.o): Likewise.
134 (pr18689.o): Likewise.
135 * testsuite/pr18689.c: New file.
136 * testsuite/pr18689.sh: Likewise.
137 * testsuite/Makefile.in: Regenerated.
138
c20ceeb2
YW
1392015-07-20 Yiran Wang <yiran@google.com>
140 Cary Coutant <ccoutant@gmail.com>
141
142 PR gold/15574
143 * resolve.cc (Symbol_table): Remove warning about references
144 from shared objects to hidden symbols.
145 * testsuite/Makefile.am (hidden_test): Add hidden_test.syms.
146 * testsuite/Makefile.in: Regenerate.
147 * testsuite/hidden_test.sh: Check dynamic symbol table; update
148 expected error messages.
149
19a7fe52
L
1502015-07-14 H.J. Lu <hongjiu.lu@intel.com>
151
152 * compressed_output.cc (Output_compressed_section::set_final_data_size):
153 Make --compress-debug-sections=zlib the same as
154 --compress-debug-sections=zlib-gabi.
155 * testsuite/Makefile.am (flagstest_compress_debug_sections.check):
156 Expect ".debug_.*" with the SHF_COMPRESSED bit, instead of
157 ".zdebug_".
158 * testsuite/Makefile.in: Regenerated.
159
fb8b9dbc
L
1602015-07-12 H.J. Lu <hongjiu.lu@intel.com>
161
162 PR gold/18322
163 * compressed_output.cc (zlib_compress): Add argument for
164 compression header size. Set header size to compression header
165 size if it isn't 0. Don't write out the zlib header here.
166 (Output_compressed_section::set_final_data_size): Support
167 zlib-gnu and zlib-gabi compressions. Pass compression header
168 size to zlib_compress and write out compression header. Set
169 the SHF_COMPRESSED bit for zlib-gabi compression. Otherwise
170 clear the SHF_COMPRESSED bit
171 * options.h (compress_debug_sections): Add zlib-gnu and
172 zlib-gabi.
173 * output.h (Output_section::set_flags): New.
174 * testsuite/Makefile.am (check_PROGRAMS): Add
175 flagstest_compress_debug_sections_none,
176 flagstest_compress_debug_sections_gnu and
177 flagstest_compress_debug_sections_gabi.
178 (check_DATA): Add flagstest_compress_debug_sections_none.stdout.
179 flagstest_compress_debug_sections.stdout,
180 flagstest_compress_debug_sections.cmp,
181 flagstest_compress_debug_sections.check,
182 flagstest_compress_debug_sections_gnu.stdout,
183 flagstest_compress_debug_sections_gnu.cmp,
184 flagstest_compress_debug_sections_gnu.check,
185 flagstest_compress_debug_sections_gabi.stdout,
186 flagstest_compress_debug_sections_gabi.cmp and
187 flagstest_compress_debug_sections_gabi.check.
188 (flagstest_compress_debug_sections_none): New.
189 (flagstest_compress_debug_sections_none.stdout): Likewise.
190 (flagstest_compress_debug_sections.stdout): Likewise.
191 (flagstest_compress_debug_sections.check): Likewise.
192 (flagstest_compress_debug_sections.cmp): Likewise.
193 (flagstest_compress_debug_sections_gnu): Likewise.
194 (flagstest_compress_debug_sections_gnu.stdout): Likewise.
195 (flagstest_compress_debug_sections_gnu.check): Likewise.
196 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
197 (flagstest_compress_debug_sections_gabi): Likewise.
198 (flagstest_compress_debug_sections_gabi.stdout): Likewise.
199 (flagstest_compress_debug_sections_gnu.check): Likewise.
200 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
201 * testsuite/Makefile.in: Regenerated.
202
48058663
L
2032015-07-12 H.J. Lu <hongjiu.lu@intel.com>
204
205 PR gold/18321
206 * compressed_output.h (decompress_input_section): Add arguments
207 for ELF class, big endian and sh_flags.
208 * compressed_output.cc (decompress_input_section): Likewise.
209 Support the SHF_COMPRESSED section.
210 * dynobj.h (Dynobj): Add elfsize and is_big_endian member
211 functions.
212 * plugin.h (Pluginobj): Likewise.
213 * layout.cc (Layout::get_output_section_flags): Also clear the
214 SHF_COMPRESSED bit.
215 * object.h (Compressed_section_info): Add flag to store sh_flags.
216 (Object): Add pure virtual elfsize and is_big_endian member
217 functions.
218 * object.cc (need_decompressed_section): Don't skip the ".zdebug"
219 prefix here.
220 (build_compressed_section_map): Check SHF_COMPRESSED for
221 uncompressed size. Store sh_flags in Compressed_section_info.
222 Pass size, big_endian and sh_flags to decompress_input_section.
223 Skip the ".debug"/".zdebug" prefix when passing section name to
224 need_decompressed_section.
225 (Sized_relobj_file<size, big_endian>::do_find_special_section):
226 Don't check ".zdebug_*" sections.
227 (Object::decompressed_section_contents): Pass ELF class, big
228 endian and sh_flags to decompress_input_section.
229 * reloc.cc (Sized_relobj_file<size, big_endian>::write_sections):
230 Likewise.
231 * testsuite/Makefile.am (check_DATA): Add
232 debug_msg_cdebug_gabi.err and gdb_index_test_2_gabi.stdout.
233 (MOSTLYCLEANFILES): Add debug_msg_cdebug_gabi.err and
234 gdb_index_test_2_gabi.stdout.
235 (debug_msg_cdebug_gabi.o): New.
236 (odr_violation1_cdebug_gabi.o): Likewise.
237 (odr_violation2_cdebug_gabi.o): Likewise.
238 (debug_msg_cdebug_gabi.err): Likewise.
239 (check_SCRIPTS): Add gdb_index_test_2_gabi.sh.
240 (gdb_index_test_cdebug_gabi.o): Likewise.
241 (gdb_index_test_2_gabi): Likewise.
242 (gdb_index_test_2_gabi.stdout): Likewise.
243 * testsuite/gdb_index_test_2_gabi.sh: New file.
244 * testsuite/Makefile.in: Regenerated.
245
73854cdd
HS
2462015-07-09 Han Shen <shenhan@google.com>
247
248 Use "gold_info" instead of "gold_warning" for erratum fix.
249
250 * aarch64.cc (Target_aarch64::scan_erratum_843419_span): Use
251 'gold_info'.
252 (Target_aarch64::scan_erratum_835769_span): USe 'gold_info'.
253
61163dfa
HS
2542015-07-09 Han Shen <shenhan@google.com>
255
256 Drop missing symbol warning for arm/aarch64.
257
258 * aarch64.cc (AArch64_relobj::scan_errata): Drop missing symbol warning.
259 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Drop missing
260 symbol warning.
261
b91deca9
HS
2622015-07-07 Han Shen <shenhan@google.com>
263
264 Make gold aarch64 accept long form of mapping symbols.
265
266 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Make legal
267 of mapping symbols.
268
15162bef
DK
2692015-06-29 Doug Kwan <dougkwan@google.com>
270
271 * testsuite/arm_bl_out_of_range.s: Align stub table so that it appears
272 at address expected by test.
273 * testsuite/arm_cortex_a8_b.s: Ditto.
274 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
275 * testsuite/arm_cortex_a8_bl.s: Ditto.
276 * testsuite/arm_cortex_a8_blx.s: Ditto.
277 * testsuite/arm_cortex_a8_local.s: Ditto.
278 * testsuite/arm_fix_v4bx.s: Ditto.
279 * testsuite/arm_unaligned_reloc.s: Ditto.
280 * testsuite/thumb_bl_out_of_range.s: Ditto.
281 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
282 * testsuite/thumb_blx_out_of_range.s: Ditto.
b91deca9 283
56b06706
HS
2842015-06-29 Han Shen <shenhan@google.com>
285
286 Patch for erratum 843419 internal error.
287
72f4393d
L
288 * aarch64.cc (Erratum_stub::Insn_utilities): New typedef.
289 (Erratum_stub::update_erratum_insn): New method.
290 (Stub_table::relocate_stubs): Modified to place relocated insn.
291 (AArch64_relobj::fix_errata): Modified gold_assert.
56b06706 292
2f0c79aa
HS
2932015-06-12 Han Shen <shenhan@google.com>
294
295 Fix erratum 835769.
296
72f4393d
L
297 * aarch64.cc (AArch64_insn_utilities::BYTES_PER_INSN): Move
298 defintion outside class definition.
299 (AArch64_insn_utilities::AARCH64_ZR): New static constant.
300 (AArch64_insn_utilities::aarch64_op31): New member.
301 (AArch64_insn_utilities::aarch64_ra): New member.
302 (AArch64_insn_utilities::aarch64_mac): New member.
303 (AArch64_insn_utilities::aarch64_mlxl): New member.
304 (ST_E_835769): New global enum member.
305 (Stub_table::relocate_stubs): Add 835769 handler.
306 (Stub_template_repertoire::Stub_template_repertoire): Install new
307 stub type.
308 (AArch64_relobj::scan_errata): This func is renamed from
309 scan_erratum_843419.
310 (AArch64_relobj::do_count_local_symbols): Add 835769 handler.
311 (AArch64_relobj::do_relocate_sections): Add 835769 handler.
312 (AArch64_relobj::scan_sections_for_stubs): Add 835769 handler.
313 (Target_aarch64::scan_erratum_835769_span): New method.
314 (Target_aarch64::create_erratum_stub): New method.
315 (Target_aarch64::is_erratum_835769_sequence): New method.
316 (Target_aarch64::scan_erratum_843419_sequence): Move part of the
317 code into create_erratum_stub.
318 * options.h (fix_cortex_a53_835769): New option.
2f0c79aa 319
5d7908e0
CC
3202015-06-11 Cary Coutant <ccoutant@gmail.com>
321
322 * aarch64.cc (Erratum_stub::STUB_ADDR_ALIGN): Move initialization
323 outside class body.
324 (Reloc_stub::STUB_ADDR_ALIGN): Likewise.
325
dd68f8fa
CC
3262015-06-11 Cary Coutant <ccoutant@gmail.com>
327
328 PR gold/17731
329 * layout.cc (corresponding_uncompressed_section_name): New function.
330 (Layout::choose_output_section): Call it.
331 * layout.h (corresponding_uncompressed_section_name): New function.
332 * script-sections.cc (Input_section_info::set_section_name): Check
333 for compressed debug section (.zdebug style).
334
a3a0c391
JY
3352015-06-11 Jing Yu <jingyu@google.com>
336
337 * testsuite/Makefile.am: Add -O0 for script_test_12 test.
338 * testsuite/Makefile.in: Regenerate.
339
970cdef2
DI
3402015-06-11 Davide Italiano <dccitaliano@gmail.com>
341
342 * gold.h (is_cident): Correct typo.
343
a48d0c12
HS
3442015-06-10 Han Shen <shenhan@google.com>
345 Patch for erratum-843419 (2 of 2 - fix erratum occurrences).
346
347 Now fixing for 843419 is fully functional.
348
349 The first part of the erratum fix CL is here -
350 https://sourceware.org/ml/binutils/2015-04/msg00229.html
351
352 * aarch64.cc(global enum): New constants representing stub types.
353 (Stub_template): New POD struct.
354 (Stub_template_repertoire): New class.
355 (Stub_base): New class.
356 (Erratum_stub): New class.
357 (Reloc_stub): Refactored to be a subclass of Stub_base.
358 (Reloc_stub::Stub_type): Removed.
359 (Reloc_stub::offset): Moved to Stub_base.
360 (Reloc_stub::set_offset): Moved to Stub_base.
361 (Reloc_stub::destination_address): Moved to Stub_base.
362 (Reloc_stub::set_destination_address): Moved to Stub_base.
363 (Reloc_stub::reset_destination_address): Moved to Stub_base.
364 (Reloc_stub::stub_type): Renamed and moved to Stub_base.
365 (Reloc_stub::stub_size): Renamed and moved to Stub_base.
366 (Reloc_stub::stub_insns): Renamed and moved to Stub_base.
367 (Reloc_stub::write): Moved to Stub_base.
368 (Reloc_stub::invalid_offset): Moved to Stub_base.
369 (Reloc_stub::invalid_address): Moved to Stub_base.
370 (Reloc_stub::stub_type_): Renamed and moved to Stub_base.
371 (Reloc_stub::stub_insns_): Moved to Stub_base.
372 (Reloc_stub::offset_): Moved to Stub_base.
373 (Reloc_stub::destination_address_): Moved to Stub_base.
374 (Stub_table::The_aarch64_relobj): New typedef.
375 (Stub_table::The_erratum_stub): New typedef.
376 (Stub_table::The_erratum_stub_less): New typedef.
377 (Stub_table::The_erratum_stub_set): New typedef.
378 (Stub_table::The_erratum_stub_set_iter): New typedef.
379 (Stub_table::empty): Added emptiness testing for erratum stubs.
380 (Stub_table::add_erratum_stub): New method to add an erratum stub.
381 (Stub_table::find_erratum_stub): New method.
382 (Stub_table::find_erratum_stubs_for_input_section): New method.
383 (Stub_table::erratum_stub_address): New method.
384 (Stub_table::update_date_size_changed_p): Modified to handle erratum stubs.
385 (Stub_table::do_addralign): Modified to handle erratum stubs.
386 (Stub_table::erratum_stubs_): New member.
387 (Stub_table::erratum_stub_size_): New member.
388 (Stub_table::relocate_stubs): Modified to handle erratum stubs.
389 (Stub_table::do_write): Modified to handle erratum stubs.
390 (AArch64_relobj::The_erratum_stub): New typedef.
391 (AArch64_relobj::Erratum_stub_set_iter): New typedef.
392 (AArch64_relobj::fix_errata): New method.
393 (Target_aarch64::The_reloc_stub_type): Removed.
394 (Target_aarch64::The_erratum_stub): New typede.
395 (AArch64_relocate_functions::construct_b): New method.
396
1e1b2efc
NC
3972015-06-08 Nick Clifton <nickc@redhat.com>
398
399 * po/fr.po: New French Translation.
400
b8cf5075
CC
4012015-06-07 Cary Coutant <ccoutant@gmail.com>
402
403 PR gold/18288
404 * resolve.cc (symbol_to_bits): Remove type parameter; adjust all
405 callers. Don't use STT_COMMON to check for common symbols.
406 (Symbol_table::resolve): Warn if relocatable object has STT_COMMON
407 symbol that's not in a common section.
408 * symtab.h (Symbol::is_common): Don't use STT_COMMON to check for
409 common symbols.
410
bdd2d2b7
CC
4112015-06-04 Cary Coutant <ccoutant@gmail.com>
412
413 PR gold/18200
414 * Makefile.am (diststuff): Add target.
415 * Makefile.in: Regenerate.
416
cd3c333f
CC
4172015-06-04 Cary Coutant <ccoutant@gmail.com>
418
419 PR gold/17498
420 * object.cc (Sized_relobj_file::do_count_local_symbols): Discard
421 temporary locals in merge sections.
422 * options.cc (General_options::parse_discard_all): New method.
423 (General_options::parse_discard_locals): New method.
424 (General_options::parse_discard_none): New method.
425 (General_options::General_options): Initialize discard_locals_.
426 * options.h (--discard-all): Convert to special option.
427 (--discard-locals): Likewise.
428 (--discard-none): New option.
429 (General_options::discard_all): New method.
430 (General_options::discard_locals): New method.
431 (General_options::discard_sec_merge): New method.
432 (General_options::Discard_locals): New enum.
433 (General_options::discard_locals_): New data member.
434
8086551f
CC
4352015-06-03 Cary Coutant <cary@google.com>
436
437 * script-sections.cc (Script_sections::Script_sections): Initialize
438 segments_created_.
439 (Script_sections::create_note_and_tls_segments): Set flag when
440 segments are created.
441 (Script_sections::expected_segment_count): Count PT_INTERP.
442 (Script_sections::attach_sections_using_phdrs_clause): Set flag when
443 segments are created.
444 * script-sections.h (Script_sections::segments_created_): New data
445 member.
446
374082df
CC
4472015-06-03 Cary Coutant <ccoutant@gmail.com>
448
449 PR gold/15370
450 * script-sections.cc
451 (Output_section_element_input::set_section_addresses): When there
452 are several patterns with no sort spec, put all sections in the same
453 bin.
454 * testsuite/Makefile.am (script_test_12): New testcase.
455 (script_test_12i): New testcase.
456 * testsuite/Makefile.in: Regenerate.
457 * testsuite/script_test_12.t: New test linker script.
458 * testsuite/script_test_12i.t: New test linker script.
459 * testsuite/script_test_12a.c: New test source file.
460 * testsuite/script_test_12b.c: New test source file.
461
775ed62e
CC
4622015-06-02 Cary Coutant <ccoutant@gmail.com>
463
464 * nacl.h (Sniff_file): Switch parameters to get_view to get an
465 aligned view.
466
9c7fe3c5
CC
4672015-06-03 Cary Coutant <ccoutant@gmail.com>
468
72f4393d
L
469 PR gold/17819
470 * gold.cc (queue_final_tasks): When --build-id=tree, queue a
471 separate task to schedule the build id computation.
472 * layout.cc (Hash_task::Hash_task): Remove build_id_blocker,
473 add Output_file and offset.
474 (Hash_task::run): Get and release the input views.
475 (Hash_task::is_runnable): Always return NULL (always runnable).
476 (Layout::queue_build_id_tasks): Remove.
477 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
478 parameters; use them instead of class members.
479 (Build_id_task_runner::run): New function.
480 (Close_task_runner::run): Pass array_of_hashes and size_of_hashes
481 to write_build_id.
482 * layout.h (Layout::queue_build_id_tasks): Remove.
483 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
484 parameters.
485 (Layout::array_of_hashes_): Remove.
486 (Layout::size_of_array_of_hashes_): Remove.
487 (Layout::input_view_): Remove.
488 (Build_id_task_runner): New class.
489 (Close_task_runner::Close_task_runner): Add array_of_hashes and
490 size_of_hashes parameters.
491 (Close_task_runner::array_of_hashes_): New data member.
492 (Close_task_runner::size_of_hashes_): New data member.
493 * testsuite/Makefile.am
494 (flagstest_compress_debug_sections_and_build_id_tree): New test.
495 * testsuite/Makefile.in: Regenerate.
9c7fe3c5 496
400f8944
RÁE
4972015-06-01 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
498
499 * merge.cc (get_input_merge_map): Update for data structure change.
500 (get_or_make_input_merge_map): Update for data structure change.
501 * merge.h (Object_merge_map): Use a std::vector<std::pair>> instead of
502 a std::map. Remove first_shnum_, first_map_, second_shnum_, second_map_.
503
bbec1a5d
AM
5042015-05-16 Alan Modra <amodra@gmail.com>
505
506 * reloc.cc (Sized_relobj_file::find_functions): Use function_location.
507 * powerpc.cc (Target_powerpc::do_calls_non_split): New function.
508 (addi_12_1, addis_2_12, addis_12_1, cmpld_7_12_0): New constants.
509 (lis_0): Rename from lis_0_0.
510
efc6fa12
CC
5112015-04-29 Cary Coutant <cary@google.com>
512 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
513
514 * gc.h (Garbage_collection::is_section_garbage): Change Object*
515 to Relobj*.
516 (Garbage_collection::add_reference): Likewise.
517 (Garbage_collection::gc_process_relocs): Likewise. Don't push
518 object/shndx pair onto *secvec for dynamic objects. Don't follow
519 relocations pointing to dynamic objects for GC.
520 * icf.cc (Icf::find_identical_sections): Change Object* to Relobj*.
521 (Icf::unfold_section): Likewise.
522 (Icf::is_section_folded): Likewise.
523 (Icf::get_folded_section): Likewise.
524 * icf.h: (Icf::get_folded_section): Likewise.
525 (Icf::unfold_section): Likewise.
526 (Icf::is_section_folded): Likewise.
527 (Icf::section_has_function_pointers): Likewise.
528 (Icf::set_section_has_function_pointers): Likewise.
529 * object.h (Section_id): Likewise.
530 (Const_section_id): Likewise.
531 * output.cc (Output_section::update_section_layout): Likewise.
532 * output.h: (Output_section_lookup_maps::find_relaxed_input_section):
533 Likewise.
534 * plugin.cc (update_section_order): Likewise.
535 (unique_segment_for_sections): Likewise.
536 * powerpc.cc (Powerpc_relobj::add_reference): Likewise.
537 (Target_powerpc::do_gc_add_reference): Likewise.
538 (Target_powerpc::gc_process_relocs): Likewise.
539 (Target_powerpc::do_gc_add_reference): Likewise.
540 * symtab.cc (Symbol_table::is_section_folded): Likewise.
541 (Symbol_table::gc_mark_symbol): Likewise.
542 * symtab.h: (Symbol_table::is_section_folded): Likewise.
543 * target.h: (Sized_target::gc_add_reference): Likewise.
544 (Sized_target::do_gc_add_reference): Likewise.
545
f9d3ecaa
NC
5462015-04-29 Nick Clifton <nickc@redhat.com>
547
548 * po/fi.po: Updated Finnish translation.
549
faa2211d
AM
5502015-04-28 Alan Modra <amodra@gmail.com>
551
552 * powerpc.cc (Target_powerpc::do_dynsym_value): Use Address rather
553 than unsigned int for find_global_entry result temp. Compare
554 against invalid_address.
555 (Target_powerpc::do_plt_address_for_global): Likewise.
556 (Target_powerpc::Relocate::relocate): Likewise. Don't assert
557 on plt call stub existence for debug info. Do assert for plt
558 and global entry stub existence if an alloc section.
559
6ec65f28
AM
5602015-04-28 Alan Modra <amodra@gmail.com>
561
562 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't assert
563 on missing global entry stub due to bogus debug info.
564
7a2a1c79
HS
5652015-04-27 Han Shen <shenhan@google.com>
566
567 * options.h (--fix-cortex-a53-843419): Rename option.
568 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Use renamed
569 option.
570 (AArch64_relobj::scan_sections_for_stubs): Use renamed option.
571
cfbf0e3c
RÁE
5722015-04-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
573
574 PR gold/18327
575 * output.cc (Output_section::is_input_address_mapped): Assume a missing
576 entry is mapped.
577 * testsuite/Makefile.am: Add the eh_test test.
578 * testsuite/Makefile.in: Regenerate.
579 * testsuite/eh_test_a.cc: New test.
580 * testsuite/eh_test_b.cc: New test.
581
6ec65f28
AM
5822015-04-23 Sriraman Tallam <tmsriram@google.com>
583
a100d66f
ST
584 * options.h (--weak-unresolved-symbols): New option.
585 * symtab.cc (Symbol_table::sized_write_globals): Change symbol
586 binding to weak with new option.
587 * symtab.h (is_weak_undefined): Check for new option.
588 (is_strong_undefined): Check for new option.
589 * testsuite/Makefile.am (weak_unresolved_symbols_test): New test.
590 * testsuite/Makefile.in: Regenerate.
591 * testsuite/weak_unresolved_symbols_test.cc: New file.
592
4b889c30
IC
5932015-04-20 Ian Coolidge <icoolidge@google.com>
594
595 * symtab.cc (Symbol::should_add_dynsym_entry): Return true for
596 GNU_UNIQUE.
597
4277535c
RÁE
5982015-04-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
599
600 * gc.cc (Garbage_collection::do_transitive_closure): Use back and
601 push_back.
602 * gc.h (Garbage_collection): Use a std::vector instead of a std::queue.
603 * object.cc (Sized_relobj_file::do_layout): Use push_back.
604 * powerpc.cc (process_gc_mark): Use push_back.
605 (Target_powerpc::do_gc_mark_symbol): Use push_back.
606 * symtab.cc (Symbol_table::gc_mark_symbol): Use push_back.
607
7a2a1c79 6082015-04-16 Han Shen <shenhan@google.com>
5019d64a 609
6ec65f28
AM
610 * aarch64.cc (AArch64_insn_utilities): New utility class.
611 (AArch64_relobj::Mapping_symbol_position): New struct.
612 (AArch64_relobj::Mapping_symbol_info): New typedef.
613 (AArch64_relobj::do_count_local_symbols): New function overriding
614 parent's implementation.
615 (AArch64_relobj::mapping_symbol_info_): New member
616 (AArch64_relobj::scan_erratum_843419): New method.
617 (Target_aarch64::scan_erratum_843419_span): New method.
618 (Target_aarch64::is_erratum_843419_sequence): New method.
619 * options.h (fix_cortex_a53): New option.
5019d64a 620
a6a17750
CC
6212015-04-09 Cary Coutant <ccoutant@google.com>
622
623 * symtab.cc (Symbol::final_value_is_known): Check for TLS symbol
624 in a PIE link.
625 * testsuite/Makefile.am (tls_pie_test.sh): New test.
626 * testsuite/Makefile.in: Regenerate.
627 * testsuite/tls_pie_test.sh: New.
628
437ddf0c
CC
6292015-04-09 Cary Coutant <ccoutant@google.com>
630
631 * debug.h (DEBUG_LOCATION): New.
632 (DEBUG_ALL): Include DEBUG_LOCATION.
633 (debug_string_to_enum): Add DEBUG_LOCATION.
634 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Fix debug
635 output to print correct context.
636 (Sized_dwarf_line_info::do_addr2line): Add debug output. Return
637 up to 4 more locations at the beginning of the function.
638 * symtab.cc (Symbol_table::detect_odr_violations): Get canonical
639 result before sorting list of line numbers.
640 * testsuite/debug_msg.sh: Allow range of line numbers for
641 canonical results on optimized code.
642
24491327
HS
6432015-04-07 HC Yen <hc.yen@mediatek.com>
644
645 Add AArch32 support for gold linker.
646 gold/
647 * arm.cc: Add V8 arch combine table.
648
7fa5525f
RÁE
6492015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
650
651 * aarch64.cc (do_reloc_addend): Fix signature to match the parent one.
652
5368dcf2
RÁE
6532015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
654
655 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a call
656 to find by using the return value of insert.
657
9dbb4b02
RÁE
6582015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
659
660 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a copy
661 constructor call.
662
1fa29f10
IT
6632015-04-06 Ilya Tocar <ilya.tocar@intel.com>
664
665 PR gold/17641
666 * x86_64.cc (Target_x86_64::can_convert_mov_to_lea): New.
667 (Target_x86_64::Scan::local): Don't create GOT entry, when we
668 can convert mov to lea.
669 (Target_x86_64::Scan::global): Ditto.
670 (Target_x86_64::Relocate::relocate): Convert mov foo@GOTPCREL(%rip),
671 %reg to lea foo(%rip), %reg if possible.
672 * testsuite/Makefile.am (x86_64_mov_to_lea): New test.
673 * testsuite/x86_64_mov_to_lea1.s: New.
674 * testsuite/x86_64_mov_to_lea2.s: Ditto.
675 * testsuite/x86_64_mov_to_lea3.s: Ditto.
676 * testsuite/x86_64_mov_to_lea4.s: Ditto.
677 * testsuite/x86_64_mov_to_lea.sh: Ditto.
678
39f3de7c
L
6792015-04-02 H.J. Lu <hongjiu.lu@intel.com>
680
681 * configure: Regenerated.
682
c4fc4724
IT
6832015-04-01 Ilya Tocar <ilya.tocar@intel.com>
684
685 PR gold/17640
686 * i386.cc (Target_i386::can_convert_mov_to_lea): New.
687 (Target_i386::Scan::local): Don't create GOT entry, when we
688 can convert GOT to GOTOFF.
689 (Target_i386::Scan::global): Ditto.
690 (Target_i386::Relocate::relocate): Convert mov foo@GOT(%reg), %reg to
691 lea foo@GOTOFF(%reg), %reg if possible.
692 * testsuite/Makefile.am (i386_mov_to_lea): New test.
693 * testsuite/i386_mov_to_lea1.s: New.
694 * testsuite/i386_mov_to_lea2.s: Ditto.
695 * testsuite/i386_mov_to_lea3.s: Ditto.
696 * testsuite/i386_mov_to_lea4.s: Ditto.
697 * testsuite/i386_mov_to_lea5.s: Ditto.
698 * testsuite/i386_mov_to_lea.sh: Ditto.
699
918357b9
L
7002015-04-01 H.J. Lu <hongjiu.lu@intel.com>
701
702 * Makefile.am (ZLIB): New.
703 (ZLIBINC): Likewise.
704 (AM_CFLAGS): Add $(ZLIBINC).
705 (AM_CXXFLAGS): Likewise.
706 (ldadd_varldadd_var): Add $(ZLIB).
707 (incremental_dump_LDADD): Likewise.
708 (dwp_LDADD): Likewise.
709 * compressed_output.cc: Don't check HAVE_ZLIB_H to include
710 <zlib.h>.
711 (zlib_compress): Don't check HAVE_ZLIB_H.
712 (zlib_decompress): Likewise.
713 * options.h (compress_debug_sections): Likewise.
714 * configure.ac (AM_CONDITIONAL): Removed.
715 * testsuite/Makefile.am (ZLIB): New.
716 (LDADD): Add $(ZLIB).
717 Don't check HAVE_ZLIB.
718 * Makefile.in: Regenerated.
719 * config.in: Likewise.
720 * configure: Likewise.
721 * testsuite/Makefile.in: Likewise.
722
6b0ad2eb
JY
7232015-03-30 Jing Yu <jingyu@google.com>
724
725 * aarch64-reloc.def: New TLSLD_ADD_DTPREL_HI12,
726 TLSLD_ADD_DTPREL_LO12_NC.
727 * aarch64.cc (Target_aarch64::define_tls_base_symbol): Always let
728 _TLS_MODULE_BASE_ point to the start of tls segment.
729 (Target_aarch64::optimize_tls_reloc): Add cases for
730 R_AARCH64_TLSLD_ADD_DTPREL_HI12 and
731 R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
732 (Target_aarch64::Scan::local): Likewise.
733 (Target_aarch64::Scan::global): Likewise.
734 (Target_aarch64::Relocate::relocate): Likewise.
735 (Target_aarch64::Relocate::relocate_tls): Likewise. And remove
736 subtracting tls segment size from symbol value for TLSLD_*_DTPREL
737 relocations.
738
0916f9e7
RÁE
7392015-03-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
740
741 * merge.cc (Object_merge_map::add_mapping): call
742 Object_merge_map::Input_merge_map::add_mapping.
743 (Object_merge_map::Input_merge_map::add_mapping): New.
744 (Output_merge_data::do_add_input_section): Call
745 get_or_make_input_merge_map before a loop.
746 (Output_merge_string<Char_type>::finalize_merged_data): Call
747 get_or_make_input_merge_map before a loop.
748 * merge.h (Object_merge_map): Make Input_merge_map public.
749 * object.cc (Relobj::add_merge_mapping): Use get_or_create_merge_map.
750 (Relobj::get_or_create_merge_map): New.
751 * object.h (Relobj::get_or_create_merge_map): New.
752
282c9750
AM
7532015-03-24 Alan Modra <amodra@gmail.com>
754
755 PR 18147
756 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't report
757 relocation errors for branches to strong undefined symbols.
758
67f95b96
RÁE
7592015-03-23 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
760
761 * merge.cc (Object_merge_map::get_input_merge_map): Make it const.
762 (Object_merge_map::is_merge_section_for): Remove.
763 (Object_merge_map::find_merge_section): New.
764 * merge.h (Object_merge_map::is_merge_section_for): Remove.
765 (Object_merge_map::find_merge_section): New.
766 (Object_merge_map::get_input_merge_map): Add a const version.
767 * object.cc (Relobj::is_merge_section_for): Remove.
768 (Relobj::find_merge_section): New.
769 * object.h (Relobj::is_merge_section_for): Remove.
770 (Relobj::find_merge_section): New.
771 * output.cc
772 (Output_section::Input_section::is_merge_section_for): Remove.
773 (Output_section::add_merge_input_section): Don't call
774 add_merge_input_section.
775 (Output_section::find_merge_section): Return const. Use
776 object->find_merge_section.
777 (Output_section::build_lookup_maps): Don't build a map for
778 merge sections.
779 (Output_section::is_input_address_mapped): Return false if
780 section is not found.
781 (Output_section::find_starting_output_address): Use
782 find_merge_section instead of is_merge_section_for.
783 (Output_section::add_script_input_section): Don't build a map for
784 merge sections.
785 * output.h (Output_section_lookup_maps::merge_sections_by_id_): Remove.
786 (Output_section_lookup_maps::find_merge_section): Remove.
787 (Output_section_lookup_maps::add_merge_input_section) Remove.
788 (Output_section::find_merge_section): Return const.
789
152f7024
CC
7902015-03-22 Cary Coutant <cary@google.com>
791
792 PR gold/18106
793 * i386.cc (Target_i386::Relocate::tls_gd_to_ie): Fix support for
794 non-SIB form of lea, with nop after the call.
795
bccffdfd
CC
7962015-03-21 Cary Coutant <cary@google.com>
797
798 PR gold/14217
799 * output.cc (Output_segment::is_first_section_relro): Don't ignore
800 .tdata section.
801 (Output_segment::set_section_addresses): Don't align size of relro
802 segment for .tbss.
803
1c582fe7
CC
8042015-03-21 Cary Coutant <cary@google.com>
805
806 PR gold/18010
807 * stringpool.cc (Stringpool_template): Don't optimize if section
808 alignment is greater than sizeof(char).
809
410da591
CC
8102015-03-21 Cary Coutant <cary@google.com>
811
812 PR gold/18048
813 * script-c.h (script_include_directive): Add first_token parameter.
814 * script.cc (script_include_directive): Add first_token parameter, and
815 pass it to read_script_file.
816 * yyscript.y (PARSING_SECTIONS_BLOCK, PARSING_SECTION_CMDS)
817 (PARSING_MEMORY_DEF): New tokens.
818 (top): Add new productions for INCLUDE files.
819 (file_cmd): Replace file_or_sections_cmd with copy of its productions.
820 Pass PARSING_LINKER_SCRIPT to script_include_directive.
821 (section_block_cmd): Likewise; pass PARSING_SECTIONS_BLOCK.
822 (section_cmd): Pass PARSING_SECTION_CMDS.
823 (file_or_sections_cmd): Remove.
824 (memory_def): Pass PARSING_MEMORY_DEF.
825 * testsuite/Makefile.am (memory_test_2): New test.
826 * testsuite/Makefile.in: Regenerate.
827 * testsuite/memory_test_inc.t: New script file.
828 * testsuite/memory_test_inc_1.t.src: New script file.
829 * testsuite/memory_test_inc_2.t.src: New script file.
830 * testsuite/memory_test_inc_3.t.src: New script file.
831
0d5bbdb0
CC
8322015-03-21 Cary Coutant <cary@google.com>
833
834 * dwp.cc (Sized_relobj_dwo::do_section_contents): Delete.
835 (Sized_relobj_dwo::setup): Build compressed section map.
836 (Sized_relobj_dwo::do_decompressed_section_contents): Delete.
837 * dynobj.cc (Sized_dynobj::base_read_symbols): Build compressed
838 section map.
839 * object.cc (Sized_relobj_file::Sized_relobj_file): Remove
840 compressed_sections_ field.
841 (build_compressed_section_map): Take Object instead of
842 Sized_relobj_file parameter; add decompress_if_needed parameter.
843 (Sized_relobj_file::do_find_special_sections): Store compressed
844 section map in parent Object.
845 (Sized_relobj_file::do_decompressed_section_contents): Move
846 implementation to Object::decompressed_section_contents.
847 (Sized_relobj_file::do_discard_decompressed_sections): Move
848 implementation to Object::discard_decompressed_sections.
849 * object.h (build_compressed_section_map): Declare.
850 (Object::Object): Add compressed_sections_ field.
851 (Object::section_is_compressed): Move implementation here.
852 (Object::decompressed_section_contents): De-virtualize.
853 (Object::discard_decompressed_sections): De-virtualize.
854 (Object::do_section_is_compressed): Delete.
855 (Object::do_decompressed_section_contents): Delete.
856 (Object::set_compressed_sections): New method.
857 (Object::compressed_sections): New method.
858 (Object::compressed_sections_): New data member.
859 (Compressed_section_info, Compressed_section_map): Move to top of file.
860 (Sized_relobj_file::do_section_is_compressed): Delete.
861 (Sized_relobj_file::do_decompressed_section_contents): Delete.
862 (Sized_relobj_file::do_discard_decompressed_sections): Delete.
863 (Sized_relobj_file::compressed_sections_): Move to Object class.
864
bd9e0d46
CC
8652015-03-21 Cary Coutant <ccoutant@google.com>
866
867 PR gold/18152
868 * gold.cc (queue_middle_tasks): Finalize .eh_frame after laying out
869 deferred objects.
870
943c8b43
CC
8712015-03-11 Cary Coutant <ccoutant@google.com>
872
873 * options.cc (General_options::finalize): Don't allow -z relro
874 with incremental linking.
875 * testsuite/Makefile.am (incremental_test): Add -z norelro.
876 (incremental_test_2): Likewise.
877 (incremental_test_3): Likewise.
878 (incremental_test_4): Likewise.
879 (incremental_test_5): Likewise.
880 (incremental_test_6): Likewise.
881 (incremental_copy_test): Likewise.
882 (incremental_common_test_1): Likewise.
883 (incremental_comdat_test_1): Likewise.
884 * testsuite/Makefile.in: Regenerate.
885
e1663197
CC
8862015-03-09 Cary Coutant <ccoutant@google.com>
887
888 PR gold/14675
889 * ehframe.cc (Eh_frame::add_ehframe_input_section): Change return type;
890 return enum indicating whether .eh_frame section is empty, optimizable,
891 unrecognized, or an end marker. Adjust explicit instantiations.
892 * ehframe.h (Eh_frame::Eh_frame_section_disposition): New enum type.
893 (Eh_frame::add_ehframe_input_section): Change return type.
894 * gold.cc (queue_middle_tasks): Call Layout::finalize_eh_frame_section.
895 * layout.cc (Layout::layout_eh_frame): Don't add optimized sections
896 to the .eh_frame output section until we see the end marker.
897 (Layout::finalize_eh_frame_section): New.
898 * layout.h: (Layout::finalize_eh_frame_section): New.
899
beb8418f
L
9002015-03-05 H.J. Lu <hongjiu.lu@intel.com>
901
902 * output.cc (Relobj::initialize_input_to_output_map<size>):
903 Remove typename on elfcpp::Elf_types<size>::Elf_Addr.
904
48c73428
CC
9052015-03-04 Cary Coutant <ccoutant@google.com>
906
907 * parameters.cc (Parameters::set_target_once): Call
908 Target::select_as_default_target just once from here...
909 (set_parameters_target): ...instead of from here.
910
9112015-03-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
dbe40a88
RÁE
912
913 * ehframe.cc (Cie::set_output_offset): Pass in and use a
914 Output_section_data instead of a Merge_map.
915 (Eh_frame::Eh_frame): Don't initialize merge_map_.
916 (Eh_frame::read_cie): Use add_merge_mapping instead of
917 Merge_map::add_mapping.
918 (Eh_frame::read_fde): Ditto.
919 (Eh_frame::set_final_data_size): Use this instead of this->merge_map_.
920 (Eh_frame::do_output_offset): Use merge_output_offset istead of
921 merge_map_->get_output_offset.
922 (Eh_frame::do_is_merge_section_for): Delete.
923 * ehframe.h (Fde::add_mapping): Pass in and use a Output_section_data
924 instead of a Merge_map.
925 (Cie::set_output_offset): Pass in a Output_section_data instead of a
926 Merge_map.
927 (Eh_frame::do_is_merge_section_for): Delete.
928 (Eh_frame::merge_map_): Delete.
929 * merge.cc (Object_merge_map::get_or_make_input_merge_map): Pass in
930 and use a Output_section_data instead of a Merge_map.
931 (Object_merge_map::add_mapping): Ditto.
932 (Object_merge_map::get_output_offset): Remove the merge_map argument.
933 (Object_merge_map::is_merge_section_for): Pass in and use a
934 Output_section_data instead of a Merge_map.
935 (Merge_map): Delete.
936 (Output_merge_base::do_output_offset): Use merge_output_offset instead
937 of merge_map_.get_output_offset.
938 (Output_merge_base::do_is_merge_section_for): Delete.
939 (Output_merge_data::do_add_input_section): Use
940 object->add_merge_mapping instead of add_mapping.
941 (Output_merge_string<Char_type>::finalize_merged_data): Ditto.
942 * merge.h (Merge_map): Delete forward declaration.
943 (Object_merge_map::add_mapping): Pass in and use a Output_section_data
944 instead of a Merge_map.
945 (Object_merge_map::get_output_offset): Remove the merge_map argument.
946 (Object_merge_map::is_merge_section_for): Pass in and use a
947 Output_section_data instead of a Merge_map.
948 (Input_merge_map::Object_merge_map::merge_map): Replace with
949 output_data.
950 (Object_merge_map::get_or_make_input_merge_map): Pass in and use a
951 Output_section_data instead of a Merge_map.
952 (Merge_map): Delete.
953 (Output_merge_base::Output_merge_base): Don't initialize merge_map_.
954 (Output_merge_base::do_is_merge_section_for): Delete.
955 (Output_merge_base::add_mapping): Delete.
956 (Output_merge_base::merge_map_): Delete.
957 * object.cc (Relobj::initialize_input_to_output_map): New.
958 (Relobj::initialize_input_to_output_map): New.
959 (Relobj::merge_output_offset): New.
960 (Relobj::is_merge_section_for): New.
961 (Relobj::initialize_input_to_output_map): Instantiate for 32 and 64
962 bits.
963 * object.h (Relobj::merge_map): Delete.
964 (initialize_input_to_output_map): New.
965 (set_merge_map): Delete.
966 (add_merge_mapping): New.
967 (merge_output_offset): New.
968 (is_merge_section_for): New.
969 * output.cc (Output_section::Input_section::is_merge_section_for):
970 Use object->is_merge_section_for.
971 * output.h (Output_section_data::is_merge_section_for): Delete.
972 (Output_section_data::do_is_merge_section_for): Delete.
973 * reloc.cc (Merged_symbol_value<size>::initialize_input_to_output_map):
974 Use object->initialize_input_to_output_map.
975 (Merged_symbol_value<size>::value_from_output_section): Use
976 object->merge_output_offset.
977
48c73428 9782015-03-02 Peter Collingbourne <pcc@google.com>
72f4393d 979 Cary Coutant <ccoutant@google.com>
2c7b626c
CC
980
981 * output.cc (Output_section::add_merge_input_section): Do not
982 attempt to merge sections with an entsize of 0.
983
48c73428 9842015-03-02 Khem Raj <raj.khem@gmail.com>
5b07cd84
CC
985
986 * attributes.h (class Output_attributes_section_data ): Add
987 do_print_to_mapfile function.
988
ec86f434
AM
9892015-02-24 Alan Modra <amodra@gmail.com>
990
991 PR 18010
992 * powerpc.cc (Powerpc_relocate_functions::addr16_ds): Always
993 complain if value is not a multiple of four.
994 (Target_powerpc::Relocate::relocate): Correct handling of
995 R_POWERPC_GOT_TPREL16 and R_POWERPC_GOT_TPREL16_LO for ppc64.
996
be66981e
L
9972015-02-21 H.J. Lu <hongjiu.lu@intel.com>
998
999 * configure.ac (default_size): Set to 32 for x32.
1000 * configure: Regenerated.
1001
e3ee8ed4
AM
10022015-02-18 Alan Modra <amodra@gmail.com>
1003
1004 PR 17954
1005 * powerpc.cc (Global_symbol_visitor_opd::operator()): Set default
1006 visibility.
1007
3a935c6c
RÁE
10082015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1009
1010 * gc.h (Garbage_collection::add_reference): Don't use find.
1011
e0a1e121
RÁE
10122015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1013
1014 * object.cc (write_local_symbols): avoid std::vector copy.
1015
45a4fb1a
RÁE
10162015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1017
1018 * merge.cc (get_output_offset): Use upper_bound instead of lower_bound.
1019
2d9afefe
MW
10202015-02-09 Mark Wielaard <mjw@redhat.com>
1021
1022 * gdb-index.cc (Gdb_index_info_reader::visit_top_die): Recognize
1023 DW_LANG_Fortran03 and DW_LANG_Fortran08.
1024
e9c1bdad
CC
10252015-02-16 Cary Coutant <ccoutant@google.com>
1026
1027 PR gold/13577
1028 PR gold/16992
1029 * layout.cc (Layout::finish_dynamic_section): Don't set DT_SYMBOLIC or
1030 DF_SYMBOLIC if --dynamic-list option is used.
1031 * options.cc (General_options::finalize): --dynamic-list is not
1032 mutually exclusive with -Bsymbolic.
1033 * symtab.h (Symbol::is_preemptible): Don't exclude dynamic symbols not
1034 listed in --dynamic-list.
1035 * testsuite/Makefile.am (dynamic_list_lib2.so): Add
1036 -Bsymbolic-functions.
1037 * testsuite/Makefile.in: Regenerate.
1038
0ed4b0bf
CC
10392015-02-16 Cary Coutant <ccoutant@google.com>
1040
1041 PR gold/17971
1042 * incremental.cc: Remove redundant include of "output.h".
1043
1a920511
JY
10442015-02-12 Jing Yu <jingyu@google.com>
1045
1046 * aarch64-reloc.def (TLSLE_MOVW_TPREL_G2, TLSLE_MOVW_TPREL_G1,
1047 TLSLE_MOVW_TPREL_G1_NC, TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC,):
1048 New relocation.
1049 * aarch64.cc (Target_aarch64::Scan::local): Add cases for new
1050 TLSLE_MOVW_* relocations.
1051 (Target_aarch64::Scan::global): Likewise.
1052 (Target_aarch64::Relocate::relocate): Likewise.
1053 (Target_aarch64::Relocate::relocate_tls): Add cases and handlings
1054 for new TLSLE_MOVW_* relocations.
1055
07f107f3
WN
10562015-02-11 Will Newton <will.newton@linaro.org>
1057
1058 PR gold/13321
1059 * arm.cc (Target_arm::make_plt_section): Create an ARM
1060 state mapping symbol at the start of the PLT.
1061
e051a5b5
L
10622015-02-09 H.J. Lu <hongjiu.lu@intel.com>
1063
1064 * testsuite/Makefile.am (two_file_shared_2_pic_1_test_DEPENDENCIES):
1065 Replace two_file_shared_2.so with two_file_shared_1.so.
1066 * testsuite/Makefile.in: Regenerated.
1067
dddcc5b9
AM
10682015-02-09 Alan Modra <amodra@gmail.com>
1069
1070 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add libweak_undef_2.a,
1071 plugin_test_thin.a and defsym_test.
1072 * testsuite/Makefile.in: Regenerate.
1073
b39b8b9d
RÁE
10742015-02-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1075
1076 * merge.cc (do_add_input_section): Combine loop epilogue into main loop
1077 body.
1078
b66d1c52
CC
10792015-02-04 Peter Collingbourne <pcc@google.com>
1080
1081 * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve
1082 forwarding symbols when computing symbol resolution info for plugins.
1083 * plugin.h (Plugin_manager::symtab): New method.
1084 (Pluginobj::get_symbol_resolution_info): Add symtab parameter.
1085
23081de0
CC
10862015-02-03 Cary Coutant <ccoutant@google.com>
1087 Peter Collingbourne <pcc@google.com>
1088
1089 PR gold/15660
1090 * archive.cc (Thin_archive_object_unlocker): New class.
1091 (Archive::include_member): Unlock external members of thin archives.
1092 * testsuite/Makefile.am (plugin_test_1): Rename .syms files.
1093 (plugin_test_2): Likewise.
1094 (plugin_test_3): Likewise.
1095 (plugin_test_4): Likewise.
1096 (plugin_test_5): Likewise.
1097 (plugin_test_6): Likewise.
1098 (plugin_test_7): Likewise.
1099 (plugin_test_8): Likewise.
1100 (plugin_test_9): Likewise.
1101 (plugin_test_10): Likewise.
1102 (plugin_test_11): New test case.
1103 * testsuite/Makefile.in: Regenerate.
1104 * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms
1105 file to decide whether to claim file.
1106 (all_symbols_read_hook): Likewise.
1107 * testsuite/plugin_test_1.sh: Adjust expected output.
1108 * testsuite/plugin_test_2.sh: Likewise.
1109 * testsuite/plugin_test_3.sh: Likewise.
1110 * testsuite/plugin_test_6.sh: Likewise.
1111 * testsuite/plugin_test_tls.sh: Likewise.
1112 * testsuite/plugin_test_11.sh: New testcase.
1113
11142015-02-03 Cary Coutant <ccoutant@google.com>
1115
1116 * descriptors.cc (Descriptors::open): Set artificially-low limit for
1117 file descriptors when debugging enabled. Add debug output.
1118 (Descriptors::release): Add debug output.
1119 (Descriptors::close_some_descriptor): Likewise.
1120 (Descriptors::close_all): Likewise.
1121 * fileread.cc (File_read::lock): Likewise.
1122 (File_read::unlock): Likewise.
1123
24dd5808
CC
11242015-02-02 Cary Coutant <ccoutant@google.com>
1125
1126 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
1127 executable output file.
1128
fa89cc82
HS
11292015-01-22 Han Shen <shenhan@google.com>
1130
1131 * arm.cc (Target_arm::Target_arm): Add initialization for new members.
1132 (Target_arm::do_plt_address_for_global): New method.
1133 (Target_arm::do_plt_address_for_local): New method.
1134 (Target_arm::rel_irelative_section): New method.
1135 (Target_arm::make_data_plt): Add more parameters for plt ctor.
1136 (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
1137 (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
1138 (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
1139 (Target_arm::Scan::check_non_pic): Add ifunc support.
1140 (Target_arm::Scan::local): Add ifunc support.
1141 (Target_arm::Scan::global): Add ifunc support.
1142 (Target_arm::make_plt_section): New method.
1143 (Target_arm::make_plt_entry): Change to call to make_plt_section.
1144 (Target_arm::make_local_ifunc_plt_entry): New method.
1145 (Target_arm::got_irelative_): New member.
1146 (Target_arm::rel_irelative_): New member.
1147 (Target_arm::got_section): Add creation for got_irelative_.
1148 (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
1149 (Target_arm::Relocate::relocate): Properly set local ifunc address.
1150 (Target_arm::do_dynsym_value): Properly set global ifunc address.
1151 (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
1152 (Output_data_plt_arm::IRelative_data): New type.
1153 (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
1154 (Output_data_plt_arm::add_entry): Add more parameters.
1155 (Output_data_plt_arm::add_relocation): New method.
1156 (Output_data_plt_arm::add_local_ifunc_entry): New method.
1157 (Output_data_plt_arm::rel_irelative): New method.
1158 (Output_data_plt_arm::entry_count): Modified.
1159 (Output_data_plt_arm::address_for_global): New method.
1160 (Output_data_plt_arm::address_for_local): New method.
23081de0 1161gold/
fa89cc82
HS
1162 (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
1163 (Output_data_plt_arm::insert_irelative_data): New method.
1164 (Output_data_plt_arm::irelative_rel_): New member.
1165 (Output_data_plt_arm::got_): New member.
1166 (Output_data_plt_arm::got_irelative_): New member.
1167 (Output_data_plt_arm::irelative_count_): New member.
1168 (Output_data_plt_arm::IRelative_data_vec): New typedef.
1169 (Output_data_plt_arm::irelative_data_vec_): New member.
1170 (Output_data_plt_arm::do_write): Write out irelative entries.
1171 (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
1172 more parameters to ctor.
1173 (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
1174 more parameters to ctor.
1175 * output.h (Output_data_reloc::add_local_relative): New method.
1176 * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
1177
0f81d3f0
AM
11782015-01-29 Alan Modra <amodra@gmail.com>
1179
1180 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
1181 and GOT_TLSGD to LE optimization.
1182
65d92137
CC
11832015-01-28 Cary Coutant <ccoutant@google.com>
1184
1185 * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
1186 for undef TLS symbols.
1187 (Target_x86_64::Relocate::relocate_tls): Likewise.
1188 (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
1189
5485698a
CC
11902015-01-25 Cary Coutant <ccoutant@google.com>
1191
1192 * output.cc (Output_segment::set_section_addresses): Fix calculation
1193 of size of relro segment.
1194
b01a4b04
AM
11952015-01-22 Alan Modra <amodra@gmail.com>
1196
1197 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
1198 condition for need of ifunc plt entry.
1199 (Target_powerpc::Scan::global <got relocs>): Likewise.
1200
3d0064a9
CC
12012015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1202
1203 * mips.cc (reloc_high): Add r_sym.
1204 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
1205 reloc_high constructor.
1206 (Mips_relocate_functions::relgot16_local): Likewise.
1207 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
1208 r_type to decide whether LO16 matches HI16.
1209 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
1210 rello16 and relgot16_local.
1211
a5cd8f05
CC
12122015-01-09 Cary Coutant <ccoutant@google.com>
1213
1214 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
1215 unless alignment is larger than page size.
1216
4fc1b9d4
L
12172015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1218 Cary Coutant <ccoutant@google.com>
1219
1220 PR gold/17729
1221 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
1222 (DEFAULT_TARGET_X32): Set for x32.
1223 * x86_64.cc (cmp_insn_32): New.
1224 (lea_r10_insn_32): Likewise.
1225 (lea_r11_insn_32): Likewise.
1226 (cmp_insn_64): Likewise.
1227 (lea_r10_insn_64): Likewise.
1228 (lea_r11_insn_64): Likewise.
1229 (Target_x86_64<size>::do_calls_non_split): Handle x32.
1230 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
1231 (check_DATA): Add split_x32 files.
1232 (split_x32_[1234n].o): New targets.
1233 (split_x32_[124]): New targets.
1234 (split_x32_[1234r].stdout): New targets.
1235 * testsuite/split_x32.sh: New file.
1236 * testsuite/split_x32_1.s: Likewise.
1237 * testsuite/split_x32_2.s: Likewise.
1238 * testsuite/split_x32_3.s: Likewise.
1239 * testsuite/split_x32_4.s: Likewise.
1240 * testsuite/split_x32_n.s: Likewise.
1241 * configure: Regenerated.
1242 * testsuite/Makefile.in: Likewise.
1243
e749cab8
L
12442015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1245
1246 PR gold/17809
1247 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
1248 x32.
1249
af759df0
AM
12502015-01-02 Alan Modra <amodra@gmail.com>
1251
1252 * version.cc (print_version): Just print current year.
1253 * dwp.cc (print_version): Likewise.
1254
b90efa5b
AM
12552015-01-01 Alan Modra <amodra@gmail.com>
1256
1257 Update year range in copyright notice of all files.
1258
f12d1e8a
AM
12592014-12-25 Alan Modra <amodra@gmail.com>
1260
1261 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
1262 new enums.
1263 (Target_arm::merge_object_attributes, ): Likewise.
1264
5c294fee
TG
12652014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
1266
1267 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
1268 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
1269 AEABI_VFP_args_vfp to check that.
1270 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
1271 value and replace hardcoded values by enum values.
1272
e30880c2
CC
12732014-12-22 Cary Coutant <ccoutant@google.com>
1274
1275 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
1276
bd040da1
L
12772014-12-20 H.J. Lu <hongjiu.lu@intel.com>
1278
1279 PR gold/14608
1280 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
1281 to "return i * i * 3;".
1282
e02a4046
CC
12832014-12-16 Cary Coutant <ccoutant@google.com>
1284
1285 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
1286 (Mapfile::print_output_data): Use current_data_size() to avoid
1287 assert for sections requiring postprocessing; if address is not valid,
1288 print 0.
1289 (Mapfile::print_output_section): Use current_data_size(); print note
1290 that addresses and sizes are before compression.
1291
add6016b
L
12922014-12-14 H.J. Lu <hongjiu.lu@intel.com>
1293
1294 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1295 Cast current_group_size to unsigned long when reporting error.
1296
0bf32ea9
JY
12972014-12-10 Jing Yu <jingyu@google.com>
1298
1299 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
1300 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
1301 Update error message.
1302 (Target_aarch64::do_relax): Use absolute value of option
1303 stub_group_size. Replace local variable with class member
1304 stub_group_size_.
1305
cbcb23fa
AM
13062014-12-04 Alan Modra <amodra@gmail.com>
1307
1308 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
1309 addend of PLTREL24 reloc when not generating a plt stub. Make
1310 max_branch_offset an "Address".
fbad6518 1311 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
cbcb23fa
AM
1312 (Target_powerpc::Relocate::relocate): Likewise.
1313
1611bc4a
AM
13142014-12-04 Alan Modra <amodra@gmail.com>
1315
1316 PR 17670
1317 * symtab.cc (Symbol::set_undefined): Remove assertion.
1318 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1319 on symbols defined in discarded sections, instead return false.
1320 Rearrange params, update all callers.
1321 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
1322 branches to syms in discarded sections.
1323 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
1324 undefined and flag as discarded.
1325 (Target_powerpc::Relocate::relocate): Localize variable.
1326
4759c34e
L
13272014-12-03 H.J. Lu <hongjiu.lu@intel.com>
1328
1329 PR gold/17675
1330 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
1331 * testsuite/Makefile.in: Regenerated.
1332
1f98a074
AM
13332014-12-03 Alan Modra <amodra@gmail.com>
1334
1335 PR 17566
1336 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
1337 when adding dynamic relocations against section symbols.
1338
fb257835
DI
13392014-12-01 Dimitry Ivanov <dimitry@google.com>
1340
1341 * layout.cc (Layout::finish_dynamic_section): When '-z global'
1342 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
1343 * options.h (General_options): New -z option (global).
1344
d8e60314
CC
13452014-12-01 Cary Coutant <ccoutant@google.com>
1346
1347 PR gold/17578
1348 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
1349 is given.
1350 (Layout::create_executable_stack_info): Warn when -z noexecstack is
1351 given but some inputs require executable stack.
1352
982bbd97
CC
13532014-11-26 Cary Coutant <ccoutant@google.com>
1354
1355 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
1356 .debug_str_offsets; strip .debug_gnu_pubnames and
1357 .debug_gnu_pubtypes.
1358 (lines_only_debug_sections): Strip all four new sections.
1359
bb779192
HS
13602014-11-26 Jing Yu <jingyu@google.com>
1361
1362 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
1363 register to be x0 when to relax TLSDESC_LD64_LO12.
1364
a3e60ddb
AM
13652014-11-26 Alan Modra <amodra@gmail.com>
1366
1367 * powerpc.cc (struct Stub_table_owner): New.
1368 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
1369 unsigned int vector. Update all references.
1370 (powerpc_relobj::set_stub_table): Take an unsigned int param
1371 rather than a Stub_table. Update callers.
1372 (Powerpc_relobj::clear_stub_table): New function.
1373 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
1374 stub_group_size_ vars.
1375 (Target_powerpc::new_stub_table): Delete.
1376 (max_branch_delta): New function, extracted from..
1377 (Target_powerpc::Relocate::relocate): ..here..
1378 (Target_powerpc::Branch_info::make_stub): ..and here. Return
1379 status on whether stub created successfully.
1380 (Stub_control::Stub_control): Add "no_size_errors" param. Move
1381 default sizing to..
1382 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
1383 reduce on relax failure.
1384 (Target_powerpc::group_sections): Add "no_size_errors" param.
1385 Use stub_group_size_. Set up group info in a temp vector,
1386 before building Stub_table vector. Account for input sections
1387 possibly already converted to relaxed sections.
1388 (Stub_table::init): Delete. Merge into..
1389 (Stub_table::Stub_table): ..here.
1390 (Stub_table::can_reach_stub): New function.
1391 (Stub_table::add_plt_call_entry): Add "from" parameter and
1392 return true iff stub could be reached.
1393 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
1394 param too.
1395 (Stub_table::clear_stubs): Add "all" param.
1396
a20605cf
AM
13972014-11-26 Alan Modra <amodra@gmail.com>
1398
1399 * powerpc.cc (Stub_control::set_output_and_owner): New function.
1400 (Target_powerpc::group_sections): Use it.
1401
43b64deb
CC
14022014-11-25 Cary Coutant <ccoutant@google.com>
1403
1404 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
1405 (Binary_to_elf::write_symbol): Add st_size parameter.
1406 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
1407
c924eb67
CC
14082014-11-25 Cary Coutant <ccoutant@google.com>
1409
1410 PR gold/17639
1411 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
1412 (Sized_relobj_file::do_layout): Handle deferred sections properly
1413 during GC pass 1. Don't add reloc sections to deferred list twice.
1414 * object.h (Sized_relobj_file::is_deferred_layout): New function.
1415 (Sized_relobj_file::is_deferred_layout_): New data member.
1416
9d585188
L
14172014-11-21 H.J. Lu <hongjiu.lu@intel.com>
1418
1419 PR gold/17619
1420 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
1421 Check PC-relative offset overflow in PLT entry.
1422
3ffaac20
AM
14232014-11-21 Alan Modra <amodra@gmail.com>
1424
1425 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
1426 for undefined weaks.
1427
0cfb0717
AM
14282014-11-20 Alan Modra <amodra@gmail.com>
1429
1430 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
1431 from --stub-group-size parameter divided by 1024.
1432 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
1433 template parameter. Update all uses.
1434 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
1435 has_stub_value. Set for long branches. Don't report overflow for
1436 branch to undefined weak symbols. Print info message on
1437 overflowing branch to stub.
1438
f9dffbf0
AM
14392014-11-20 Alan Modra <amodra@gmail.com>
1440
1441 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
1442
e88ba8d5
L
14432014-11-13 H.J. Lu <hongjiu.lu@intel.com>
1444
1445 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
1446 entry for R_X86_64_GOTPLT64.
1447 (Target_x86_64<size>::Relocate::relocate): Update comments for
1448 R_X86_64_GOTPLT64.
1449
d37ffe25
ED
14502014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
1451
1452 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
1453 * plugin.h: add lock definition
1454
9726c3c1
HS
14552014-10-29 Han Shen <shenhan@google.com>
1456 Jing Yu <jingyu@google.com>
1457
1458 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
1459 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1460 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
1461 Symbol::TLS_REF.
1462 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
1463 method.
1464 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
1465 (Target_aarch64::tls_ld_to_le): New method.
1466 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
1467 for 64bit targets.
1468 (Output_data_plt_aarch64::irelative_rel_): New data member.
1469 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
1470 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
1471 (Output_data_plt_aarch64::add_relocation): New method.
1472 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
1473 offset. Add got_irelative size to got size.
1474 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
1475 type string with the new typename.
1476 (AArch64_relocate_functions::update_adr): Replace parameter x with
1477 immed.
1478 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
1479 (AArch64_relocate_functions::reloc_common): New method.
1480 (AArch64_relocate_funcsions::rela_general): Extract common part out
1481 into reloc_common method.
1482 (AArch64_relocate_functions::rela_general): Likewise.
1483 (AArch64_relocate_functions::pcrela_general): Likewise.
1484 (AArch64_relocate_functions::adr): New method.
1485 (AArch64_relocate_functions::adrp): Calculate immed before calling
1486 update_adr.
1487 (AArch64_relocate_functions::adrp): Likewise.
1488 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
1489 comparing x to 0. Calculate immed from ~x when x < 0.
1490 (Target_aarch64::optimize_tls_reloc): Add new cases for
1491 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1492 TLSLD_MOVW_DTPREL_G0_NC.
1493 (Target_aarch64::possible_function_pointer_reloc): Implement this
1494 method.
1495 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
1496 comment.
1497 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
1498 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1499 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1500 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
1501 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1502 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1503 (Target_aarch64::make_plt_entry): Call add_entry with two more
1504 parameters.
1505 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1506 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
1507 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1508 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1509 (Target_aarch64::Relocate::relocate_tls): Add cases for
1510 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1511 TLSLD_MOVW_DTPREL_G0_NC.
1512 * testsuite/icf_safe_so_test.cc: Correct test comment.
1513 * testsuite/icf_safe_test.sh: Add AArch64 arch.
1514
80272b8c
AM
15152014-10-22 Alan Modra <amodra@gmail.com>
1516
1517 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
1518 thread_starter.
1519
998a69f4
AS
15202014-10-18 Andreas Schwab <schwab@linux-m68k.org>
1521
1522 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
1523
aed56ec5
CC
15242014-10-17 Cary Coutant <ccoutant@google.com>
1525
1526 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1527 Add "typename" keyword.
1528
bb779192 15292014-10-15 Han Shen <shenhan@google.com>
72f4393d 1530 Jing Yu <jingyu@google.com>
83a01957
HS
1531
1532 Patch for gold aarch64 backend to support relaxation.
1533 * aarch64-reloc.def: Change format.
1534 * aarch64.cc (class Reloc_stub): New class.
1535 (class Stub_table): New class.
1536 (class AArch64_relobj): New class.
1537 (class AArch64_input_section): New class.
1538 (class AArch64_output_section): New class.
1539 (Target_aarch64::new_stub_table): New method.
1540 (Target_aarch64::new_aarch64_input_section): New method.
1541 (Target_aarch64::find_aarch64_input_section): New method.
1542 (Target_aarch64::scan_section_for_stubs): New method.
1543 (Target_aarch64::scan_reloc_section_for_stubs): New method.
1544 (Target_aarch64::relocate_stub): New method.
1545 (Target_aarch64::current_target): New method.
1546 (Target_aarch64::do_make_elf_object): New method.
1547 (Target_aarch64::do_may_relax): New method.
1548 (Target_aarch64::do_relax): New method.
1549 (Target_aarch64::group_sections): New method.
1550 (Target_aarch64::scan_reloc_for_stub): New method.
1551 (Target_aarch64::do_make_output_section): New method.
1552 (Target_aarch64::stub_tables_): New data member.
1553 (Target_aarch64::aarch64_input_section_map_): New data member.
1554 (AArch64_relocate_functions::maybe_apply_stub): New method.
1555
db4c9594
CC
15562014-09-30 Cary Coutant <ccoutant@google.com>
1557
1558 PR gold/17432
1559 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
1560
cd6da036
KC
15612014-09-30 Kito Cheng <kito@0xlab.org>
1562
1563 PR gold/13597
1564 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
1565 hash table before sysv-style hash table.
1566
5f772412
ST
15672014-09-29 Sriraman Tallam <tmsriram@google.com>
1568
1569 * options.h (--pic-executable): Add negative to alias to -no-pie.
1570
5efeedf6
CC
15712014-09-26 Cary Coutant <ccoutant@google.com>
1572
1573 PR gold/16773
1574 * object.cc (Sized_relobj_file): Compute value of section symbols
1575 for TLS sections the same as TLS symbols.
1576
1707f183
CC
15772014-09-25 Cary Coutant <ccoutant@google.com>
1578
1579 PR gold/17432
1580 * resolve.cc (Symbol_table::resolve): Override common placeholder
1581 symbols, but adjust sizes.
1582 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
1583 symbols to common lists.
1584
00cac886
AM
15852014-09-24 Alan Modra <amodra@gmail.com>
1586
1587 * po/POTFILES.in: Regenerate.
1588
635aa30e 15892014-09-23 Taiju Tsuiki <tzik@google.com>
72f4393d 1590 Cary Coutant <ccoutant@google.com>
635aa30e 1591
71b9b91b 1592 PR gold/14860
635aa30e
CC
1593 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
1594 on input_sections_blocker.
1595 * layout.cc (Write_sections_task::locks): Unblock
1596 input_sections_blocker_.
1597 * layout.h (Write_sections_task::Write_sections_task): Add
1598 input_sections_blocker.
1599 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
1600 to DEPENDENCIES.
1601 * testsuite/Makefile.in: Regenerate.
1602
c0c71592
RÁE
16032014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1604
1605 * testsuite/Makefile.am (plugin_test_10): New test.
1606 * testsuite/Makefile.in: Regenerate
1607 * testsuite/plugin_common_test_2.c (c1): Align to 8.
1608 * testsuite/plugin_test_10.sh: New file.
1609
6168c2a1
RÁE
16102014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1611
1612 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
1613 * resolve.cc (Symbol_table::resolve): Don't override common symbols
1614 during the replacement phase.
1615
3a531937
JY
16162014-09-17 Han Shen <shenhan@google.com>
1617 Jing Yu <jingyu@google.com>
1618
1619 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
1620 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
1621 * aarch64.cc (Target_aarch64): Add data members
1622 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
1623 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
1624 constructor.
1625 (Target_aarch64::do_reloc_symbol_index): New method.
1626 (Target_aarch64::do_reloc_addend): New method.
1627 (Target_aarch64::add_tlsdesc_info): New method.
1628 (Target_aarch64::do_dynsym_value): New method.
1629 (Target_aarch64::do_make_data_plt): Add new parameters: got,
1630 got_irelative. Pass them to Output_data_plt_aarch64_standard.
1631 (Target_aarch64::make_data_plt): Add new parameters: got,
1632 got_irelative. Pass them to do_make_data_plt.
1633 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
1634 (Target_aarch64::Relocate:tls_gd_to_le): New method.
1635 (Target_aarch64::Relocate:tls_ie_to_le): New method.
1636 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
1637 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
1638 (Target_aarch64::got_tlsdesc_section): New method.
1639 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1640 (Target_aarch64::define_tls_base_symbol): New method.
1641 (Target_aarch64::reserve_tlsdesc_entries): New method.
1642 (Target_aarch64::got_mod_index_entry): New method.
1643 (Target_aarch64::rela_tlsdesc_section): New method.
1644 (Target_aarch64::rela_irelative_section): New method.
1645 (Target_aarch64::Tlsdesc_info): New struct.
1646 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
1647 relocations and tlsdesc relocations.
1648 (Target_aarch64::optimize_tls_reloc): Implement method.
1649 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
1650 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
1651 in constructor.
1652 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
1653 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
1654 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
1655 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
1656 (Output_data_plt_aarch64::rela_tlsdesc): New method.
1657 (Output_data_plt_aarch64::rela_irelative): New method.
1658 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
1659 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
1660 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
1661 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
1662 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
1663 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
1664 (Output_data_plt_aarch64_standard): New member variables:
1665 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
1666 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
1667 New parameter: got, got_irelative.
1668 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
1669 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
1670 (Output_data_plt_aarch64::do_write): Replace got_address with
1671 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
1672 (AArch64_relocate_functions::update_movnz): New method.
1673 (AArch64_relocate_functions): Correct format.
1674 (AArch64_relocate_functions::movnz): New method.
1675 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
1676 before the switch. Add new cases to switch.
00cac886 1677 Check ie_to_le relaxation on tlsie relocations. Add code handling
3a531937
JY
1678 tlsgd tlsdesc cases.
1679 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
1680 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
1681 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
1682 Call reloc_name_in_error_message to print unsupported reloc.
1683 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
1684 make_data_plt.
1685 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
1686 relocs. Fill in some more dynamic tags.
1687 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
1688 Skip call tls_get_addr when tlsgd is relaxed.
1689 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
1690 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
1691 tlsdesc->ie relaxation.
1692
62661c93
SS
16932014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1694
1695 * mips.cc (Target_mips_nacl): New class.
1696 (Target_selector_mips_nacl): New class.
1697 (target_selector_mips32): Rename from target_selector_mips32be and use
1698 Target_selector_mips_nacl instead of Target_selector_mips.
1699 (target_selector_mips32el): Rename from target_selector_mips32 and use
1700 Target_selector_mips_nacl instead of Target_selector_mips.
1701 (target_selector_mips64): Rename from target_selector_mips64be and use
1702 Target_selector_mips_nacl instead of Target_selector_mips.
1703 (target_selector_mips64el): Rename from target_selector_mips64 and use
1704 Target_selector_mips_nacl instead of Target_selector_mips.
1705 (Target_mips::mips_info): Add const attribute.
1706
54674d38
CC
17072014-09-02 Cary Coutant <ccoutant@google.com>
1708
1709 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
1710 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
1711 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
1712 (Sized_incr_dynobj::do_section_name): Likewise.
1713 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
1714 (Sized_incr_dynobj::do_section_name): Likewise.
1715 * object.h (Object::section_name): Likewise.
1716 (Object::do_section_name): Likewise.
1717 (Sized_relobj_file::do_section_name): Likewise.
1718 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
1719 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
1720
9860cbcf
CC
17212014-09-02 Cary Coutant <ccoutant@google.com>
1722
1723 PR gold/17005
1724 * ehframe.cc (Fde::write): Add output_offset parameter.
1725 (Cie::write): Likewise.
1726 (Eh_frame::set_final_data_size): Account for offset within output
1727 section.
1728 (Eh_frame::do_sized_write): Likewise.
1729 * ehframe.h (Fde::write): Add output_offset parameter.
1730 (Cie::write): Likewise.
1731 * output.cc (Output_section::Input_section_sort_entry): Remove
1732 section_has_name_; add output_section_name parameter. Use
1733 output section name for non-input sections.
1734 (Output_section::Input_section_sort_entry::section_has_name): Remove.
1735 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
1736 (Output_section::Input_section_sort_compare): Remove logic for
1737 sections without names.
1738 (Output_section::Input_section_sort_init_fini_compare): Likewise.
1739 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
1740 Likewise.
1741 (Output_section::Input_section_sort_section_name_compare): Likewise.
1742
8e33481e
HS
17432014-08-29 Han Shen <shenhan@google.com>
1744 Jing Yu <jingyu@google.com>
1745
1746 * aarch64-reloc-property.cc
1747 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
1748 reference reloc property in the table.
1749 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
1750 3 other entries.
1751 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
1752 2 new overloaded methods.
1753 (Output_data_got_aarch64::do_write): Add code to write out
1754 static relocs.
1755 (class Output_data_got_aarch64::Static_reloc): New class to wrap
1756 static relocs.
1757 (Output_data_got_aarch64::static_relocs): New vector to
1758 hold static relocs.
1759 (Target_aarch64::TCB_SIZE): New const static memeber.
1760 (Target_aarch64::tcb_size): New method.
1761 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
1762 (Target_aarch64::Relocate::relocate_tls): New method.
1763 (Target_aarch64::Scan::local): Add code handling new reloc types.
1764 (Target_aarch64::Scan::global): Add code handling new reloc types.
1765
81233653
ST
17662014-08-13 Sriraman Tallam <tmsriram@google.com>
1767
1768 * options.h (-no-pie): Add option.
1769
9363c7c3
JY
17702014-08-08 Jing Yu <jingyu@google.com>
1771 Han Shen <shenhan@google.com>
1772
1773 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
1774 (DEFFILES): add aarch64-reloc.def.
1775 (TARGETSOURCES): Add aarch64-reloc-property.cc.
1776 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
1777 * Makefile.in: Regenerate.
1778 * aarch64-reloc-property.cc: New file.
1779 * aarch64-reloc-property.h: New file.
1780 * aarch64-reloc.def: New file.
1781 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
1782 with tab to make the format consistent.
1783 (Output_data_got_aarch64::symbol_table_): New method.
1784 (Target_aarch64::do_plt_address_for_global): New method.
1785 (Target_aarch64::do_plt_address_for_local): New method.
1786 (Target_aarch64::do_select_as_default_target): New method.
1787 (Target_aarch64::do_make_data_plt): New method.
1788 (Target_aarch64::make_data_plt): New method.
1789 (Output_data_plt_aarch64::has_irelative_section): New method.
1790 (Output_data_plt_aarch64::address_for_global): New method.
1791 (Output_data_plt_aarch64::address_for_local): New method.
1792 (Output_data_plt_aarch64::irelative_rel_): New parameter.
1793 (Output_data_plt_aarch64::add_entry): Implement contents.
1794 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
1795 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
1796 the got_pov entry to plt0.
1797 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
1798 Implement contents.
1799 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
1800 (AArch64_howto): New struct.
1801 (aarch64_howto[]): New static const array.
1802 (AArch64_relocate_functions): New class.
1803 (Target_aarch64::Scan::get_reference_flags): Remove method.
1804 (Target_aarch64::Scan::local): Implement to support a few relocations.
1805 (Target_aarch64::Scan::global): Implement to support a few relocations.
1806 (Target_aarch64::make_plt_section): Implement contents.
1807 (Target_aarch64::make_plt_entry): Implement contents.
1808 (Target_aarch64::do_finalize_sections): Implement contents.
1809 (Target_aarch64::Relocate::relocate): Implement a few relocations.
1810 (Target_aarch64::relocate_section): Implement contents.
1811
ad9fe6c1
AM
18122014-08-06 Alan Modra <amodra@gmail.com>
1813
1814 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
1815
7cd4e5b7
AM
18162014-08-06 Alan Modra <amodra@gmail.com>
1817
1818 PR 13227
1819 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
1820
5ad9b0a7
ST
18212014-07-21 Sriraman Tallam <tmsriram@google.com>
1822
1823 * object.cc (Relobj::is_section_name_included): Add
7c16d96e 1824 ".rodata.nptl_version" to not garbage collect this section.
5ad9b0a7 1825
e051745c
CC
18262014-07-08 Cary Coutant <ccoutant@google.com>
1827
1828 * expression.cc (struct Expression::Expression_eval_info): Add
1829 new fields type_pointer, vis_pointer, and nonvis_pointer.
1830 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
1831 nonvis_pointer parameters. Adjust all calls.
1832 (Symbol_expression::value): Update type, visibility, and nonvis bits
1833 in caller.
1834 * script.cc (Symbol_assignment::sized_finalize): Update type,
1835 visibility, and remaining st_other bits for new symbol.
1836 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
1837 vis_pointer, and nonvis_pointer parameters.
1838 * symtab.h (Symbol::set_type): New method.
1839
1840 * testsuite/Makefile.am (defsym_test): New test.
1841 * testsuite/Makefile.in: Regenerate.
1842 * testsuite/defsym_test.c: New file.
1843 * testsuite/defsym_test.sh: New file.
1844
f35c4853
CC
18452014-07-08 Cary Coutant <ccoutant@google.com>
1846
1847 PR gold/15639
1848 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
1849 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
1850 (Sized_dynobj::base_read_symbols): ...new method.
1851 * object.h (Sized_relobj_file::base_read_symbols): New method.
1852 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
1853 (Sized_relobj_file::base_read_symbols): ...new method.
1854 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
1855 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
1856 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
1857
2900af2d
AM
18582014-07-04 Alan Modra <amodra@gmail.com>
1859
1860 * po/POTFILES.in: Regenerate.
1861
053a4d68
JY
18622014-07-02 Jing Yu <jingyu@google.com>
1863
1864 * aarch64.cc: New file
1865 * Makefile.am (TARGETSOURCES): Add aarch64.cc
1866 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
1867 * Makefile.in: Regenerate.
1868 * configure.tgt: Add entries for aarch64*.
1869 * configure.ac: Likewise.
1870 * configure: Likewise.
1871
7b549045
AM
18722014-06-27 Alan Modra <amodra@gmail.com>
1873
1874 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
1875
cb818dbf
CC
18762014-06-24 Cary Coutant <ccoutant@google.com>
1877
1878 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
1879 sections.
1880 (Dwo_file::sized_read_unit_index): Likewise.
1881
9810d34d
SS
18822014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1883
1884 * mips.cc: New file.
1885 * Makefile.am (TARGETSOURCES): Add mips.cc
1886 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
1887 * configure.tgt: Add entries for mips*.
1888 * configure.ac: Likewise.
1889 * Makefile.in: Regenerate.
1890 * configure: Likewise.
1891
9baa787b
CC
18922014-06-09 Cary Coutant <ccoutant@google.com>
1893
1894 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
1895 unit_length is within section bounds.
1896
8f89af0a
CC
18972014-06-09 Cary Coutant <ccoutant@google.com>
1898
1899 PR gold/16980
1900 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
1901 map.
1902
a47622ac
AM
19032014-06-07 Alan Modra <amodra@gmail.com>
1904
1905 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
1906
4320c691
CC
19072014-06-06 Cary Coutant <ccoutant@google.com>
1908
1909 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
1910 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
1911 (Dwarf_pubnames_table::read_header): Likewise.
1912 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
1913 .debug_gnu_pubtypes.
1914
270c9937
JB
19152014-06-05 Joel Brobecker <brobecker@adacore.com>
1916
1917 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
1918 * Makefile.in, configure: Regenerate.
1919
397998fc
AM
19202014-06-03 Alan Modra <amodra@gmail.com>
1921
1922 * powerpc.cc (addis_12_2): Define.
1923 (Stub_table::do_write): Support fusion on ELFv2 stubs.
1924
61f5c66f
AM
19252014-06-03 Alan Modra <amodra@gmail.com>
1926
1927 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
1928 st_other output.
1929
f6971787
AM
19302014-06-02 Alan Modra <amodra@gmail.com>
1931
1932 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
1933 Only ignore relocs on ELFv1.
1934 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
1935
f6fb8322
CC
19362014-05-30 Cary Coutant <ccoutant@google.com>
1937
1938 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
1939 * testsuite/Makefile.in: Regenerate.
1940 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
1941
c23dd342
L
19422014-05-27 H.J. Lu <hongjiu.lu@intel.com>
1943
1944 PR gold/16945
1945 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
1946 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
1947
5fe7ffdc
AM
19482014-05-15 Alan Modra <amodra@gmail.com>
1949
1950 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
1951 Compare FDE contents with DW_CFA_nop rather than 0.
1952
a82bef93
ST
19532014-05-13 Sriraman Tallam <tmsriram@google.com>
1954
1955 * symtab.h (may_need_copy_reloc): Remove check for position independent
1956 code.
1957 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
1958 position independence before pc absolute may_need_copy_reloc call.
1959 Add check for executable output befor pc relative may_need_copy_reloc
1960 call.
1961 * i386.cc: Ditto.
1962 * arm.cc: Ditto.
1963 * sparc.cc: Ditto.
1964 * tilegx.cc: Ditto.
1965 * powerpc.cc: Add check for no position independence before
1966 may_need_copy_reloc calls.
1967 * testsuite/pie_copyrelocs_test.cc: New file.
1968 * testsuite/pie_copyrelocs_shared_test.cc: New file.
1969 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 1970 * Makefile.in: Regenerate.
a82bef93 1971
53c66605
ML
19722014-05-08 Martin Liška <mliska@suse.cz>
1973
1974 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
1975
57b2284c
CC
19762014-05-06 Cary Coutant <ccoutant@google.com>
1977
1978 PR gold/16900
1979 * i386.cc (Output_data_got_plt_i386): New class.
1980 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
1981 parameter. Change all callers.
1982 (Output_data_plt_i386::layout_): Remove.
1983 (Output_data_plt_i386::got_plt_): Change type.
1984 (Target_i386::got_plt_): Change type. Change all references.
1985 (Target_i386::got_section): Create instance of new class.
1986 (Output_data_got_plt_i386::do_write): New function.
1987 * x86_64.cc (Output_data_got_plt_x86_64): New class.
1988 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
1989 parameter. Change all callers.
1990 (Output_data_plt_x86_64::layout_): Remove.
1991 (Output_data_plt_x86_64::got_plt_): Change type.
1992 (Target_x86_64::got_plt_): Change type. Change all references.
1993 (Target_x86_64::got_section): Create instance of new class.
1994 (Output_data_got_plt_x86_64::do_write): New function.
1995 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
1996 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
1997 class.
1998
6b97515d 19992014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 2000
6b97515d
CC
2001 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
2002 if we have pubnames/pubtypes.
2003
d1bddd3c
CC
20042014-05-02 Cary Coutant <ccoutant@google.com>
2005
5fe7ffdc
AM
2006 * defstd.cc (in_segment): Define __ehdr_start here...
2007 * layout.cc (Layout::finalize): ...Instead of here. Set the
2008 output segment when known.
2009 * resolve.cc (Symbol::override_base_with_special): Remember
2010 the original binding.
2011 * symtab.cc (Symbol::set_output_segment): New function.
2012 (Symbol::set_undefined): New function.
2013 * symtab.h (Symbol::is_weak_undefined): Check original undef
2014 binding.
2015 (Symbol::is_strong_undefined): New function.
2016 (Symbol::set_output_segment): New function.
2017 (Symbol::set_undefined): New function.
2018 * target-reloc.h (is_strong_undefined): Remove.
2019 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
2020 Check for hidden undefs.
2021 (relocate_section): Call Symbol::is_strong_undefined.
2022
2023 * testsuite/Makefile.am (ehdr_start_test_1)
2024 (ehdr_start_test_2, ehdr_start_test_3)
2025 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
2026 * testsuite/Makefile.in: Regenerate.
2027 * testsuite/ehdr_start_def.cc: New source file.
2028 * testsuite/ehdr_start_test.cc: New source file.
2029 * testsuite/ehdr_start_test.t: New linker script.
2030 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 2031
7849f6d8
CC
20322014-04-23 Cary Coutant <ccoutant@google.com>
2033
bf2cc635 2034 PR gold/16870
7849f6d8
CC
2035 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
2036
99fd8cff
CC
20372014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2038
2039 * layout.cc (Layout::include_section): Allow a target to decide
2040 whether to include a section.
2041 * target.h (Target::should_include_section): New function.
2042 (Target::do_should_include_section): New function.
2043
91f43acd
CC
20442014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2045
2046 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
2047 inline into ...
2048 (Copy_relocs::emit): ... here.
2049 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
2050 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
2051 (Copy_reloc_entry::entries_): Change from private to protected.
2052
c4eb27e1
ST
20532014-04-02 Sriraman Tallam <tmsriram@google.com>
2054
2055 * icf.cc (get_section_contents): Replace copies of reloc
2056 vectors with const references.
2057
ae447ddd
CC
20582014-04-02 Cary Coutant <ccoutant@google.com>
2059
2060 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
2061 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
2062 * configure: Regenerate.
2063 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
2064 -fno-use-linker-plugin.
2065 (LINK1, CXXLINK1): Add it to the link command.
2066 * testsuite/Makefile.in: Regenerate.
2067
fa47fa92
AM
20682014-03-12 Alan Modra <amodra@gmail.com>
2069
2070 * Makefile.in: Regenerate.
2071
9b12c500
CC
20722014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2073
2074 * symtab.h (Symbol::set_nonvis): New function.
2075
beacaa96
CC
20762014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2077
2078 * symtab.cc (Sized_symbol<32>::init_output_data):
2079 Instantiate the template.
2080 (Sized_symbol<64>::init_output_data): Likewise.
2081
800d9823
CC
20822014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2083
2084 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
2085 adjust dynamic symbol value.
2086 * target.h (Target::adjust_dyn_symbol): New function.
2087 (Target::do_adjust_dyn_symbol): New function.
2088
918fc1f8 20892014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 2090
918fc1f8
CC
2091 * output.cc (Output_data_dynamic::Dynamic_entry::write):
2092 Get the value of DYNAMIC_CUSTOM dynamic entry.
2093 * output.h (Output_data_dynamic::add_custom): New function.
2094 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
2095 dynamic entry.
2096 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
2097 * target.h (Target::dynamic_tag_custom_value): New function.
2098 (Target::do_dynamic_tag_custom_value): New function.
2099
98ff9231
CC
21002014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2101
2102 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
2103 dynsym indexes.
2104 * target.h (Target::has_custom_set_dynsym_indexes): New function.
2105 (Target::do_has_custom_set_dynsym_indexes): New function.
2106 (Target::set_dynsym_indexes): New function.
2107 (Target::do_set_dynsym_indexes): New function.
2108
b80eed39
AM
21092014-03-07 Alan Modra <amodra@gmail.com>
2110
2111 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
2112 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
2113 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
2114 (Powerpc_relocate_functions::has_overflow_bitfield,
2115 overflowed): Use the above.
2116 (Target_powerpc::Relocate::relocate): Correct overflow checking
2117 for a number of relocations. Modify overflow test for 16-bit
2118 fields in instructions to signed/unsigned according to whether
2119 the field takes a signed or unsigned value.
2120
4b95cf5c
AM
21212014-03-05 Alan Modra <amodra@gmail.com>
2122
2123 Update copyright years.
2124
45965137
AM
21252014-03-05 Alan Modra <amodra@gmail.com>
2126
2127 * powerpc.cc (Target_powerpc::Scan::local, global): Support
2128 R_PPC64_ADDR64_LOCAL.
2129 (Target_powerpc::Relocate::relocate): Likewise.
2130
2c80b753
AM
21312014-03-03 Alan Modra <amodra@gmail.com>
2132
2133 * dwp.cc (print_version): Update copyright year to current.
2134
c1c69e83
AM
21352014-02-10 Alan Modra <amodra@gmail.com>
2136
2137 * po/gold.pot: Regenerate.
2138
dd0c4e70
CC
21392014-02-06 Cary Coutant <ccoutant@google.com>
2140
2141 Fix problem where -u is ignored when a weak undef is seen.
2142
2143 * archive.cc (Library_base::should_include_member): Reorder
2144 code to check for -u option if a weak undef has already been seen.
2145 * testsuite/Makefile.am (weak_undef_test_2): New test case.
2146 * testsuite/Makefile.in: Regenerate.
2147 * testsuite/weak_undef_file3.cc: New file.
2148 * testsuite/weak_undef_file4.cc: New file.
2149 * testsuite/weak_undef_test_2.cc: New file.
2150
1a221d3d
CC
21512014-02-05 Cary Coutant <ccoutant@google.com>
2152
2153 Fix issues with gold undefined symbol diagnostics.
2154
2155 PR binutils/15435
2156 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
2157 check to here.
2158 * target-reloc.h (is_strong_undefined): New function.
2159 (relocate_section): Move undef vtable symbol check from here.
2160 Check for is_strong_undefined.
2161
e889f0a4 21622014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 2163
e889f0a4
CC
2164 Fix problems with the --dynamic-list option.
2165
2166 PR gold/13577
2167 * options.cc (General_options::parse_dynamic_list):
2168 Set have_dynamic_list_.
2169 (General_options::General_options): Initialize have_dynamic_list_.
2170 (General_options::finalize): Turn off -Bsymbolic and
2171 -Bsymbolic-functions if --dynamic-list provided.
2172 * options.h (General_options::have_dynamic_list): New function.
2173 (General_options::have_dynamic_list_): New data member.
2174 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
2175 correctly.
5fe7ffdc 2176
e889f0a4
CC
2177 PR gold/16530
2178 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
2179 in --dynamic-list, mark it.
5fe7ffdc 2180
e889f0a4
CC
2181 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
2182 (dynamic_list_2): New test case.
2183 * testsuite/Makefile.in: Regenerate.
2184 * testsuite/dynamic_list_2.cc: New file.
2185 * testsuite/dynamic_list_2.t: New file.
2186 * testsuite/dynamic_list_lib1.cc: New file.
2187 * testsuite/dynamic_list_lib2.cc: New file.
2188 * testsuite/gc_dynamic_list_test.c: New file.
2189 * testsuite/gc_dynamic_list_test.sh: New file.
2190 * testsuite/gc_dynamic_list_test.t: New file.
2191
ec673e64
CC
21922014-01-28 Cary Coutant <ccoutant@google.com>
2193
2194 Add .gdb_index version 7 support.
2195
2196 * gold/dwarf_reader.cc: include <utility> (for make_pair).
2197 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
2198 debug sections.
2199 (Dwarf_ranges_table::read_ranges_table): Likewise.
2200 (Dwarf_pubnames_table::read_section): Check for GNU-style
2201 sections, and for compressed debug sections.
2202 (Dwarf_pubnames_table::read_header): Compute end address of table.
2203 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
2204 for end of list by offset, not by offset == 0.
2205 (Dwarf_info_reader::do_read_string_table): Check for compressed
2206 debug sections.
2207 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2208 Initialize new data members.
2209 (Dwarf_pubnames_table::next_name): return flag_byte.
2210 (Dwarf_pubnames_table::end_of_table_): New data member.
2211 (Dwarf_pubnames_table::is_gnu_style_): New data member.
2212 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
2213 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
2214 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
2215 read skeleton type unit DIEs.
2216 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
2217 (Gdb_index::do_write): Write flag_byte.
2218 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
2219 (Gdb_index::Cu_vector): Store flags along with cu indexes.
2220 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
2221 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
2222
221fd5d5
L
22232014-01-08 H.J. Lu <hongjiu.lu@intel.com>
2224
2225 * version.cc (print_version): Update copyright year to 2014.
2226
6c09fb0b
ILT
22272013-12-19 Dimitry Andric <dimitry@andric.com>
2228
2229 * stringpool.cc (Stringpool_template::reserve): Add
2230 HAVE_UNORDERED_MAP case.
2231 * stringpool.cc (Stringpool_template::print_stats): Likewise.
2232
8356f2d0
CC
22332013-12-18 Cary Coutant <ccoutant@google.com>
2234
2235 * configure.ac: Check for <unordered_set> and <unordered_map>.
2236 * config.in: Regenerate.
2237 * configure: Regenerate.
2238 * system.h: Use <unordered_set> and <unordered_map> if available.
2239
f2c7d7ee
RM
22402013-12-10 Roland McGrath <mcgrathr@google.com>
2241
2242 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
2243 with $(INSTALL_PROGRAM_ENV).
2244 * Makefile.in: Regenerate.
2245
6632e8cc
CC
22462013-11-22 Cary Coutant <ccoutant@google.com>
2247
2248 * configure.ac: Add check for which library is needed for
2249 dlopen.
2250 * configure: Regenerate.
2251
0c075858
CC
22522013-11-22 Cary Coutant <ccoutant@google.com>
2253
2254 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
2255 assembler.
2256 * testsuite/Makefile.in: Regenerate.
2257
f49fe902
L
22582013-11-17 H.J. Lu <hongjiu.lu@intel.com>
2259
2260 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
2261 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
2262 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
2263 (Target_x86_64<size>::Scan::local): Likewise.
2264 (Target_x86_64<size>::Scan::global): Likewise.
2265 (Target_x86_64<size>::Relocate::relocate): Likewise.
2266 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
2267 Likewise.
2268 (Target_x86_64<size>::Scan::check_non_pic(): Handle
2269 R_X86_64_PC32_BND.
2270
2271 * testsuite/Makefile.am (check_PROGRAMS): Add
2272 exception_x86_64_bnd_test.
2273 (exception_x86_64_bnd_test_SOURCES): New macro.
2274 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
2275 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
2276 (exception_x86_64_bnd_test_LDADD): Likewise.
2277 (exception_x86_64_bnd_1.o): New rule.
2278 (exception_x86_64_bnd_2.o): Likewise.
2279 * testsuite/Makefile.in: Regenerated.
2280
9055360d
AM
22812013-11-15 Alan Modra <amodra@gmail.com>
2282
2283 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
2284 accessor.
2285 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
2286 Only call ppc64_local_entry_offset for 64-bit. Restrict
2287 symval_for_branch lookup to ELFv1.
2288 (Stub_table::add_plt_call_entry): Use unsigned int off.
2289 (Output_data_glink::Address, invalid_address): New.
2290 (Output_data_glink::add_eh_frame): Move out of line. Add
2291 support for ELFv2.
2292 (Output_data_glink::add_global_entry, find_global_entry,
2293 global_entry_address): New functions.
2294 (Output_data_glink::global_entry_stubs_, end_branch_table_,
2295 ge_size): New variables.
2296 (Output_data_glink::set_final_data_size): Add global entry
2297 stub sizing.
2298 (Output_data_glink::do_write): Write global entry stubs.
2299 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
2300 parameter. Return true for ELFv2. Adjust callers.
2301 (Target_powerpc::Scan::local, global): Restrict opd lookup to
2302 ELFv1. Similarly for ifunc and dynamic relocation processing
2303 specific to ELFv1. Recognize that symbols are defined on
2304 their plt entries for ELFv2.
2305 (Target_powerpc::symval_for_branch): Assert if called for
2306 ELFv2 or ppc32.
2307 (Target_powerpc::Relocate::relocate): Use global entry plt
2308 stub for symbol value if such exists on ELFv2.
2309 (Target_powerpc::Relocate::relocate): Don't call
2310 symval_for_branch when ELFv2. Do adjust for local entry
2311 offset when ELFv2.
2312 (Target_powerpc::do_dynsym_value): Set symbols to global entry
2313 plt stub for ELFv2.
2314 (Target_powerpc::do_plt_address_for_global): Similarly.
2315
cafdd569
CC
23162013-11-14 Cary Coutant <ccoutant@google.com>
2317
2318 Revert patch -- this did not fix the problem, and there is
2319 no race there.
2320
2321 2013-11-14 Cary Coutant <ccoutant@google.com>
2322
2323 PR gold/14860
2324 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2325 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2326 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2327 updating fde_offsets_.
2328 (Eh_frame_hdr::lock_): New data member.
2329
94e49e16
CC
23302013-11-14 Cary Coutant <ccoutant@google.com>
2331
2332 * dwp.cc (Dwo_file_entry): New type.
2333 (File_list): Use Dwo_file_entry.
2334 (Dwo_file::verify): New function.
2335 (Dwo_file::verify_dwo_list): New function.
2336 (Dwo_file::sized_verify_dwo_list): New function.
2337 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
2338 list.
2339 (Dwp_options): New enum type.
2340 (dwp_options): Add --verify-only.
2341 (usage): Likewise.
2342 (main): Likewise.
2343 * dwp.h (gold_info): Add declaration.
2344
7cdd7d57
CC
23452013-11-14 Cary Coutant <ccoutant@google.com>
2346
2347 PR gold/14860
2348 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2349 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2350 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2351 updating fde_offsets_.
2352 (Eh_frame_hdr::lock_): New data member.
2353
1d946cb3
CC
23542013-11-06 Cary Coutant <ccoutant@google.com>
2355
2356 PR gold/15758
2357 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
2358 before reloc sections.
2359
4f65b40e
AM
23602013-11-04 Alan Modra <amodra@gmail.com>
2361
2362 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
2363 (Symbol::needs_dynamic_reloc): Test new flag.
2364 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
2365 (Target_powerpc::Scan::get_reference_flags): Add target param.
2366 Return FUNC_DESC_ABI for 64-bit ELFv1.
2367 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
2368 call.
2369 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
2370 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
2371
908794a9
CC
23722013-10-31 Cary Coutant <ccoutant@google.com>
2373
2374 Restore support for dwp v2 DWARF package file format.
2375
2376 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2377 tu_length parameter. Adjust all callers.
2378 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2379 * dwp.cc: Include dwarf.h.
2380 (Section_bounds): New struct type.
2381 (Unit_set): New struct type.
2382 (Dwo_file::Dwo_file): Initialize new data member.
2383 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2384 Combine and rename to...
2385 (Dwo_file::read_unit_index): ...this.
2386 (Dwo_file::sized_read_compunit_index)
2387 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2388 (Dwo_file::sized_read_unit_index): ...this.
2389 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2390 parameters; add section_id parameter.
2391 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2392 (Dwo_file::add_unit_set): ...this.
2393 (Dwo_file::shndx_map_): Remove.
2394 (Dwo_file::sect_offsets_): New data member.
2395 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2396 (Dwp_output_file::add_section): Rename to...
2397 (Dwp_output_file::add_contribution): ...this.
2398 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2399 (Dwp_output_file::add_tu_set): Likewise.
2400 (Dwp_output_file::Contribution): New type.
2401 (Dwp_output_file::Section::contributions): New data member.
2402 (Dwp_output_file::Cu_or_tu_set): Remove.
2403 (Dwp_output_file::Section::Section): New ctor.
2404 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2405 (Dwp_output_file::Dwp_index::Section_table): New type.
2406 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2407 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2408 parameter.
2409 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2410 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2411 (Dwp_output_file::Dwp_index::section_table): New member function.
2412 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2413 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2414 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2415 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2416 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2417 (Dwp_output_file::Dwp_index::section_table_): New data member.
2418 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2419 (Dwp_output_file::add_output_section): New member function.
2420 (Dwp_output_file::write_new_section): New member function.
2421 (Dwp_output_file::write_contributions): New member function.
2422 (Dwp_output_file::section_id_map_): New data member.
2423 (class Dwo_id_info_reader): Remove.
2424 (class Unit_reader): New class.
2425 (get_dwarf_section_name): New function.
2426 (Dwo_file::read_executable): Adjust initializations of class data.
2427 (Dwo_file::read): Add support for v2 package file format.
2428 (Dwo_file::read_unit_index): Likewise.
2429 (Dwo_file::sized_read_unit_index): Likewise.
2430 (Dwo_file::copy_section): Likewise.
2431 (Dwo_file::add_unit_set): Likewise.
2432 (Dwp_output_file::add_output_section): Likewise.
2433 (Dwp_output_file::add_contribution): Likewise.
2434 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2435 for empty slot.
2436 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2437 file format.
2438 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2439 slot.
2440 (Dwp_output_file::initialize): Remove unused function.
2441 (Dwp_output_file::finalize): Add support for v2 package file format.
2442 (Dwp_output_file::write_index): Likewise.
2443 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2444 function prototype.
2445
2500c017
CC
24462013-10-31 Cary Coutant <ccoutant@google.com>
2447
2448 * configure.ac: Fix check for -fmerge-constants.
2449 * configure.ac: Regenerate.
2450
dd0845d7
RM
24512013-10-30 Roland McGrath <mcgrathr@google.com>
2452
2453 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
2454 Correct 9-byte nop sequence to match what the assembler generates.
2455
b4f7960d
AM
24562013-10-30 Alan Modra <amodra@gmail.com>
2457
2458 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
2459 ppc64_local_entry_offset, ppc64_local_entry_offset,
2460 do_read_symbols): New functions.
2461 (Powerpc_relobj::e_flags_, st_other_): New vars.
2462 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
2463 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
2464 (Powerpc_relobj::e_flags_): New var.
2465 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
2466 and adjust for ELFv2.
2467 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
2468 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
2469 (Powerpc_dynobj::do_find_special_sections): Likewise.
2470 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
2471 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
2472 to ELFv2 local entry.
2473 (Target_powerpc::do_relax): No thread safe barriers needed for
2474 ELFv2.
2475 (Output_data_plt_powerpc::initial_plt_entry_size_,
2476 plt_entry_size): Delete. Replace all uses with
2477 first_plt_entry_offset() and plt_entry_size().
2478 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
2479 reserved_size parm. Update callers.
2480 (Output_data_plt_powerpc::entry_count): Update.
2481 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
2482 and use Target_powerpc::first_plt_entry_offset().
2483 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
2484 rename to plt_entry_size.
2485 (Output_data_plt_powerpc::add_ifunc_entry,
2486 add_local_ifunc_entry): Adjust reloc for ELFv2.
2487 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
2488 (glink_eh_frame_fde_64v2): New.
2489 (Stub_table::plt_call_size): Support ELFv2 sizing.
2490 (Output_data_glink::add_eh_frame): Use the new FDE.
2491 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
2492 (Stub_table::do_write): Write ELFv2 stubs and glink.
2493 (Target_powerpc::Relocate::relocate): Replaces nop after call
2494 with ld 2,24(1) and adjust local offset destination for ELFv2.
2495
f9c6b907
AM
24962013-10-30 Alan Modra <amodra@gmail.com>
2497
2498 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
2499 (Target_powerpc::Scan::global, local): Likewise.
2500 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
2501 on all ppc64 @h and @ha relocs.
2502
e84fe78f
AM
25032013-10-14 Alan Modra <amodra@gmail.com>
2504
2505 * output.h (Output_data_got::add_constant): Tidy.
2506 (Output_data_got::add_constant_pair): New function.
2507 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
2508 methods used so as to first call reserve_ent().
2509
679e4abf
RM
25102013-10-11 Roland McGrath <mcgrathr@google.com>
2511
44dcb735
RM
2512 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
2513 add_got_entry and add_got_entry_pair.
2514
13323c49
RM
2515 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
2516 (HAVE_PUBNAMES): Likewise.
2517 * configure: Regenerate.
2518
1496b446
RM
2519 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
2520 * testsuite/Makefile.in: Regenerate.
2521
cc84c10b
RM
2522 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
2523 Remove const from declaration.
2524 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
2525 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
2526 * output.h (Output_file_header): Remove const from member target_
2527 and corresponding constructor argument.
2528 * output.cc (Output_file_header::Output_file_header): Update prototype.
2529 (Output_file_header::do_sized_write): Use this->target_ in place
2530 of parameters()->target().
2531
52f66a2c
RM
2532 * testsuite/undef_symbol.cc (Foo::get_a): New method.
2533
2b64b551
RM
2534 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
2535 * configure: Regenerate.
2536 * Makefile.in: Regenerate.
2537 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
2538 * testsuite/merge_string_literals_2.c: Likewise.
2539 * testsuite/Makefile.am
2540 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
2541 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
2542 literal -fmerge-constants.
2543 * testsuite/Makefile.in: Regenerate.
2544
43819297
RM
2545 * i386.cc (Target_i386): Remove unused member dynbss_.
2546 * arm.cc (Target_arm): Likewise.
2547 * powerpc.cc (Target_powerpc): Likewise.
2548 * sparc.cc (Target_sparc): Likewise.
2549 * tilegx.cc (Target_tilegx): Likewise.
2550 * x86_64.cc (Target_x86_64): Likewise.
2551 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
2552 type_signature_, type_offset_.
2553 * plugin.h (Plugin_hook): Remove unused member layout_.
2554 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
2555 mapfile_.
2556 (Read_member): Remove unused members input_objects_, symtab_,
2557 mapfile_, layout_.
2558 (Check_library): Remove unused member symtab_.
2559 * archive.h (Lib_group): Remove unused member lib_.
2560 * archive.cc (Lib_group::Lib_group): Update initializer.
2561 * incremental.h (Incremental_binary): Remove unused member target_.
2562 (Incremental_script_entry): Removed unused member script_.
2563 * layout.h (Write_symbols_task): Remove unused member input_objects_.
2564 * icf.h (Icf): Remove unused member num_tracked_relocs.
2565
39d9ead7
RM
2566 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
2567 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
2568 its only use.
2569 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
2570
679e4abf
RM
2571 * archive.h: Use struct rather than class for forward declaration
2572 of Read_symbols_data.
2573
54de2ea6
CC
25742013-10-07 Cary Coutant <ccoutant@google.com>
2575
2576 PR gold/16010
2577 * testsuite/Makefile.am (icf_test): Fix dependencies.
2578 (icf_safe_test): Likewise.
2579 (icf_safe_so_test): Likewise.
2580 (large_symbol_alignment): Add empty _LDADD rule.
2581 * testsuite/Makefile.in: Regenerate.
2582
b14016f0
L
25832013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
2584
2585 PR gold/15927
2586 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
2587 relocation for R_X86_64_32 on x32.
2588
eb426534
RM
25892013-08-27 Roland McGrath <mcgrathr@google.com>
2590
2591 * output.cc (Output_segment::set_section_addresses): Take new
2592 Target* argument. If target->isolate_execinstr() and the segment
2593 is executable and starts at a target->abi_pagesize() boundary,
2594 pad its end out to a target->abi_pagesize() boundary with code fill.
2595 * output.h (Output_segment::set_section_addresses): Update decl.
2596 * layout.h (Layout::check_output_data_for_reset_values): Take new
2597 argument RELAX_OUTPUTS.
2598 (Layout): New member relax_output_list_.
2599 (Layout::add_relax_output): New method.
2600 * layout.cc (Layout::Layout): Update constructor.
2601 (Layout::reset_relax_output): New method.
2602 (Layout::clean_up_after_relaxation): Call it.
2603 (Layout::prepare_for_relaxation): Update caller.
2604 (Layout::set_segment_offsets): Update callers of set_section_addresses.
2605 Call reset_relax_output before re-processing segments for
2606 isolate_execinstr case.
2607 (Layout::write_data): Handle relax_output_list_.
2608 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
2609 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
2610
9aff4b7a
NC
26112013-08-23 Yuri Chornoivan <yurchor@ukr.net>
2612
2613 PR binutils/15834
2614 * object.h: Fix typos.
2615
93f8221c
RM
26162013-08-16 Roland McGrath <mcgrathr@google.com>
2617
2618 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
2619 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
2620
e44c3715
CC
26212013-08-07 Cary Coutant <ccoutant@google.com>
2622
2623 Revert support for v2 DWP files:
2624
2625 2013-03-01 Cary Coutant <ccoutant@google.com>
2626
2627 Add dwp support for v2 DWARF package file format.
2628 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2629 tu_length parameter. Adjust all callers.
2630 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2631 * dwp.cc: Include dwarf.h.
2632 (Section_bounds): New struct type.
2633 (Unit_set): New struct type.
2634 (Dwo_file::Dwo_file): Initialize new data member.
2635 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2636 Combine and rename to...
2637 (Dwo_file::read_unit_index): ...this.
2638 (Dwo_file::sized_read_compunit_index)
2639 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2640 (Dwo_file::sized_read_unit_index): ...this.
2641 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2642 parameters; add section_id parameter.
2643 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2644 (Dwo_file::add_unit_set): ...this.
2645 (Dwo_file::shndx_map_): Remove.
2646 (Dwo_file::sect_offsets_): New data member.
2647 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2648 (Dwp_output_file::add_section): Rename to...
2649 (Dwp_output_file::add_contribution): ...this.
2650 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2651 (Dwp_output_file::add_tu_set): Likewise.
2652 (Dwp_output_file::Contribution): New type.
2653 (Dwp_output_file::Section::contributions): New data member.
2654 (Dwp_output_file::Cu_or_tu_set): Remove.
2655 (Dwp_output_file::Section::Section): New ctor.
2656 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2657 (Dwp_output_file::Dwp_index::Section_table): New type.
2658 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2659 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2660 parameter.
2661 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2662 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2663 (Dwp_output_file::Dwp_index::section_table): New member function.
2664 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2665 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2666 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2667 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2668 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2669 (Dwp_output_file::Dwp_index::section_table_): New data member.
2670 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2671 (Dwp_output_file::add_output_section): New member function.
2672 (Dwp_output_file::write_new_section): New member function.
2673 (Dwp_output_file::write_contributions): New member function.
2674 (Dwp_output_file::section_id_map_): New data member.
2675 (class Dwo_id_info_reader): Remove.
2676 (class Unit_reader): New class.
2677 (get_dwarf_section_name): New function.
2678 (Dwo_file::read_executable): Adjust initializations of class data.
2679 (Dwo_file::read): Add support for v2 package file format.
2680 (Dwo_file::read_unit_index): Likewise.
2681 (Dwo_file::sized_read_unit_index): Likewise.
2682 (Dwo_file::copy_section): Likewise.
2683 (Dwo_file::add_unit_set): Likewise.
2684 (Dwp_output_file::add_output_section): Likewise.
2685 (Dwp_output_file::add_contribution): Likewise.
2686 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2687 for empty slot.
2688 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2689 file format.
2690 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2691 slot.
2692 (Dwp_output_file::initialize): Remove unused function.
2693 (Dwp_output_file::finalize): Add support for v2 package file format.
2694 (Dwp_output_file::write_index): Likewise.
2695 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2696 function prototype.
2697
c6905c28
CC
26982013-07-31 Cary Coutant <ccoutant@google.com>
2699
2700 * object.cc (Sized_relobj::do_output_section_address): New function.
2701 (Sized_relobj): Instantiate explicitly.
2702 * object.h (Object::output_section_address): New function.
2703 (Object::do_output_section_address): New function.
2704 (Sized_relobj::do_output_section_address): New function.
2705 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
2706
27072013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 2708 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
2709
2710 * parameters.cc (Parameters::entry): Return target-specific entry
2711 symbol name.
2712 * target.h (Target::entry_symbol_name): New function.
2713 (Target_info::entry_symbol_name): New data member.
2714
2715 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
2716 * i386.cc (Target_i386::i386_info): Likewise.
2717 (Target_i386_nacl::i386_nacl_info): Likewise.
2718 * sparc.cc (Target_sparc::sparc_info): Likewise.
2719 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
2720 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
2721 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
2722 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
2723
234d4ab8
SA
27242013-07-22 Sterling Augustine <saugustine@google.com>
2725
2726 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
2727 Convert parameter shndx to local variable. Add parameters symtab
2728 and symtab_size. Scan over section names. Find relocation
2729 section corresponding to current section. Create and initialize
2730 reloc_mapper_ and reloc_type_.
2731 (Dwarf_pubnames_table::read_header): Add assertion. Change
2732 unit_length to off_t. Initialize member unit_length_. Fill in field
2733 cu_offset_.
2734 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2735 Initialize new fields unit_length_ and cu_offset_.
2736 (Dwarf_pubnames_table::read_section): Update prototype.
2737 (Dwarf_pubnames_table::cu_offset): New member function.
2738 (Dwarf_pubnames_table::subsection_size): Likewise.
2739 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
2740 New fields.
2741 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
2742 member functions public.
2743 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
2744 Update comment. Rework logic. Move repeated parts to...
2745 (Gdb_index_info_reader::read_pubtable): ...here. New function.
2746 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
2747 pubtypes_table_, and stmt_list_offset.
2748 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2749 Gdb_index::find_pubtype_offset,
2750 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
2751 (Gdb_index::pubnames_read): Update prototype and rework logic.
2752 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
2753 Forward declare.
2754 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2755 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
2756 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
2757 Gdb_index::map_pubtable_to_dies):
2758 Declare functions.
2759 (Gdb_index::pubnames_read): Update declaration.
2760 (Gdb_index::Pubname_offset_map): New type.
2761 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
2762 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
2763 Gdb_index::stmt_list_offset): Declare.
2764 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
2765 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
2766 Gdb_index::pubtypes_offset_): Remove.
2767
a3ed37d8
RM
27682013-07-19 Roland McGrath <mcgrathr@google.com>
2769
2770 * options.h (General_options): Add -Trodata-segment option.
2771 * parameters.cc (Parameters::check_rodata_segment): New function.
2772 (Parameters::set_target_once): Call it.
2773 * parameters.h (Parameters): Declare it (private member function).
2774 * layout.cc (load_seg_unusable_for_headers): New function, broken
2775 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
2776 then validate rodata segment rather than text segment.
2777 (relaxation_loop_body): Call that.
2778 (is_text_segment): New function. Don't admit a non-executable
2779 segment if TARGET->isolate_execinstr().
2780 (set_segment_offsets): Call it. Honor -Trodata-segment option.
2781
eb5b4ded
CC
27822013-07-15 Shawn Landden <shawnlandden@gmail.com>
2783
2784 PR gold/15070
2785 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
2786 * nacl.h (Sniff_file::View::View): Request aligned view.
2787
4d5effb9
CC
27882013-07-11 Cary Coutant <ccoutant@google.com>
2789
2790 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
2791 correct BRLT entry size.
2792
ba8ca3e7
AM
27932013-07-03 Alan Modra <amodra@gmail.com>
2794
2795 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
2796 comment.
2797
267257d2
CC
27982013-07-01 Cary Coutant <ccoutant@google.com>
2799
2800 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
2801 reloc_type_.
2802 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
2803 (Dwarf_ranges_table::lookup_reloc): New function.
2804 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
2805 reloc_type_.
2806 (Dwarf_ranges_table::lookup_reloc): New function.
2807 (Dwarf_ranges_table::reloc_type_): New data member.
2808
06f30c9d
CC
28092013-06-27 Jing Yu <jingyu@google.com>
2810
2811 PR gold/15662
2812 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
2813 function.
2814 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
2815 (Target_powerpc::do_relax): Call the above.
2816
a2d7bf59
AM
28172013-06-27 Cary Coutant <ccoutant@google.com>
2818
2819 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
2820 on garbage collected .opd section.
2821
28222013-06-27 Alan Modra <amodra@gmail.com>
2823
2824 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
2825 is non-zero.
2826 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
2827 (Target_powerpc::do_function_location): Likewise for loc->shndx.
2828
32364e50
CC
28292013-06-14 Cary Coutant <ccoutant@google.com>
2830
2831 * resolve.cc (Symbol::override_base): Don't override st_type
2832 from plugin placeholder symbols.
2833 (Symbol_table::resolve): Likewise.
2834 (Symbol_table::should_override): Don't complain about TLS mismatch
2835 if the TO symbol is a plugin placeholder.
2836 * testsuite/Makefile.am (plugin_test_tls): New test.
2837 * testsuite/Makefile.in: Regenerate.
2838 * testsuite/plugin_test_tls.sh: New test script.
2839 * testsuite/two_file_test_2_tls.cc: New test source.
2840 * testsuite/two_file_test_tls.cc: New test source.
2841
7fb47cc9
CC
28422013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
2843
2844 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
2845 the maximum segment alignment is larger than the page size.
2846 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
2847 correctly aligns the symbols with large alignemnt.
2848 * testsuite/Makefile.in: Regenerate.
2849 * testsuite/large_symbol_alignment.cc: New file.
2850
6934001a
CC
28512013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
2852 Sriraman Tallam <tmsriram@google.com>
2853
2854 * options.h (sort_section): New option.
2855 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
2856 Rename from Input_section_sort_section_name_special_ordering_compare.
2857 (Input_section_sort_section_name_compare): New struct.
2858 * output.cc (Output_section::Input_section_sort_section_name_compare::
2859 operator()): New function.
2860 (Output_section::sort_attached_input_sections): Use new sort function
2861 for .text if --sort-section=name is specified.
2862 * layout.cc (Layout::make_output_section):
2863 Add sorting by name when --sort-section=name is specified.
2864 * testsuite/Makefile.am (text_section_grouping): Test option
2865 --sort-section=name.
2866 * testsuite/Makefile.in: Regenerate.
2867 * testsuite/section_sorting_name.cc: New file.
2868 * testsuite/section_sorting_name.sh: New file.
2869
93acabad
CC
28702013-05-21 Cary Coutant <ccoutant@google.com>
2871
2872 * symtab.h (Symbol::is_cxx_vtable): New function.
2873 * target-reloc.h (relocate_section): Check for vtable symbol.
2874 * testsuite/Makefile.am (missing_key_func.sh): New test case.
2875 * testsuite/Makefile.in: Regenerate.
2876 * testsuite/missing_key_func.cc: New test source.
2877 * testsuite/missing_key_func.sh: New test script.
2878
60e8b3fc
CC
28792013-05-21 Cary Coutant <ccoutant@google.com>
2880
2b64b551
RM
2881 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
2882 type of enclosing symbol.
2883 (Relocate_info::location): Check symbol type when describing symbol.
2884 * object.h (Symbol_location_info): Remove unused line_number;
2885 add enclosing_symbol_type.
2886 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 2887
9df9de2c
CC
28882013-05-13 Cary Coutant <ccoutant@google.com>
2889
2b64b551
RM
2890 * configure.ac: Export DEFAULT_TARGET.
2891 * configure: Regenerate.
2892 * Makefile.in: Regenerate.
2893 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
2894 * testsuite/Makefile.in: Regenerate.
2895 * testsuite/debug_msg.sh: Delete duplicate tests.
2896 Don't check undef_int error message match for powerpc where the
2897 source file and line number aren't available.
9df9de2c 2898
bbc5ae17
RM
28992013-05-10 Roland McGrath <mcgrathr@google.com>
2900
2901 * options.h (General_options): Add --rosegment-gap option.
2902 * options.cc (finalize): --rosegment-gap implies --rosegment.
2903 * layout.cc (set_segment_offsets): Let user option override
2904 target->rosegment_gap().
2905
0c6e6c39
RM
29062013-05-10 Roland McGrath <mcgrathr@google.com>
2907
2908 * options.h (General_options): Remove leading space from help
2909 messages for -nostdlib and --rosegment.
2910
cde7cb01
MR
29112013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
2912
2913 PR ld/15365
2914 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
2915
f31ae5b8
AM
29162013-05-03 Alan Modra <amodra@gmail.com>
2917
2918 * merge.cc (Output_merge_string::do_add_input_section): Correct
2919 scan for number of strings. Rename vars to avoid shadowing.
2920 Include missing terminator in input_size_.
2921
d3a7cd45
L
29222013-05-01 H.J. Lu <hongjiu.lu@intel.com>
2923
2924 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
2925 Restore empty string handling.
2926
6ad3daba
CC
29272013-05-01 Cary Coutant <ccoutant@google.com>
2928
2929 * stringpool.cc (Stringpool_template::new_key_offset): Fix
2930 uninitialized warning.
2931
e31908b6
CC
29322013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
2933
2934 * output.cc (Output_section::add_merge_input_section): Allow
2935 to merge sections if the alignment is more than character size.
2936 * merge.h (Output_merge_string::Output_merge_string): Remove
2937 assert.
2938 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
2939 only not-null strings. Check the alignment of strings.
2940 * stringpool.h
2941 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
2942 alignment as the argument.
2943 (Stringpool_template<Stringpool_char>::addralign_): New class member.
2944 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
2945 Align non-zero length strings according to the addralign_.
2946 (Stringpool_template<Stringpool_char>::set_string_offsets):
2947 Updating offsets according to the given alignment.
2948 * testsuite/Makefile.am (text_section_grouping): Test if string
2949 literals are getting merged.
2950 * testsuite/Makefile.in: Regenerate.
2951 * testsuite/merge_string_literals_1.c: New file.
2952 * testsuite/merge_string_literals_2.c: Ditto.
2953 * testsuite/merge_string_literals.sh: Ditto.
2954
0e804863
ILT
29552013-04-26 Ian Lance Taylor <iant@google.com>
2956
2957 * target-reloc.h (relocate_section): If the reloc offset is out of
2958 range, pass VIEW as NULL to relocate.relocate.
2959 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
2960 * i386.cc (Target_i386::Relocate::relocate): Likewise.
2961 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
2962 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
2963 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
2964 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
2965
e7c5ea40
CC
29662013-04-26 Geoff Pike <gpike@chromium.org>
2967
2968 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
2969 * layout.cc (Hash_task): New class.
2970 (Layout::queue_build_id_tasks): New function.
2971 (Layout::write_build_id): Handle single-thread portion of build ID
2972 computation. (In some cases, all of it is single-threaded.) Replace
2973 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
2974 functionality in fewer lines of code.
2975 * layout.h (Layout::queue_build_id_tasks): New function declaration.
2976 * options.h (General_options): make "--build-id" default to tree
2977 rather than sha1. Add two new options related to --build-id=tree:
2978 --build-id-chunk-size-for-treehash and
2979 --build-id-min-file-size-for-treehash.
2980 * Makefile.am: add testing of --build-id=tree and related new options
2981 (these tests will be invoked by "make check").
2982 * Makefile.in: Regenerate.
2983
49926cd0
AM
29842013-04-25 Alan Modra <amodra@gmail.com>
2985
2986 * configure.tgt: Add powerpcle and powerpc64le.
2987
a4034750
AM
29882013-04-22 Alan Modra <amodra@gmail.com>
2989
2990 PR gold/15355
2991 * layout.cc (Layout::segment_precedes): Allow more than one
2992 segment with the same type and flags.
2993
e79c84aa
CC
29942013-04-15 Cary Coutant <ccoutant@google.com>
2995
2996 * layout.cc (Layout::set_relocatable_section_offsets): Don't
2997 allocate space in file for BSS sections.
2998
2199fbe7
CC
29992013-04-15 Cary Coutant <ccoutant@google.com>
3000
3001 * script-sections.cc (Orphan_output_section): Reset address
3002 to zero after each orphaned section for relocatable links.
3003
502e8a84
CC
30042013-04-15 Cary Coutant <ccoutant@google.com>
3005
a4034750
AM
3006 * symtab.cc (Symbol_table::sized_write_globals): Subtract
3007 section starting address for relocatable link.
3008 * testsuite/Makefile.am (script_test_11): New test.
3009 * testsuite/Makefile.in: Regenerate.
3010 * testsuite/script_test_11.c: New source file.
3011 * testsuite/script_test_11.t: New linker script.
502e8a84 3012
0cfdc767
AM
30132013-04-13 Alan Modra <amodra@gmail.com>
3014
3015 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
3016 owner when sections are not adjacent and exceed group size.
3017 (Target_powerpc::group_sections): Handle corner case.
3018 (Target_powerpc::Branch_info::make_stub): Handle case where
3019 stub table doesn't exist due to branches in non-exec sections.
3020 (Target_powerpc::Relocate::relocate): Likewise.
3021
6830ee24
AM
30222013-04-11 Alan Modra <amodra@gmail.com>
3023
3024 PR gold/15354
3025 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
3026 .branch_lt to match bfd ld. Adjust comments throughout file.
3027
54a3d865
ILT
30282013-04-04 Ian Lance Taylor <iant@google.com>
3029
3030 GCC PR c++/56840
3031 * object.cc (do_layout_deferred_sections): Handle .eh_frame
3032 sections before checking whether they are included in the link.
3033
9993ba11
ST
30342013-03-29 Sriraman Tallam <tmsriram@google.com>
3035
3036 * archive.cc (Archive::get_elf_object_for_member): Create the elf
3037 object before calling the plugin claim_file handler. Pass the elf
3038 object of the archive to the plugin. Delete the elf object if the
3039 plugin claims the file.
3040
ebacd51e
AM
30412013-03-21 Alan Modra <amodra@gmail.com>
3042
3043 * layout.cc (Layout::set_segment_offsets): Accept writable .text
3044 segment when omagic.
3045
117be58f
AM
30462013-03-21 Alan Modra <amodra@gmail.com>
3047
3048 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
3049 comparison warning.
3050 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
3051 uninitialized" warning.
3052
32e2b61d
AM
30532013-03-20 Alan Modra <amodra@gmail.com>
3054
3055 * symtab.h (Symbol::clear_version): New function.
3056 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
3057 is_needed by weak references. Clear version for symbols defined
3058 in as-needed objects that are not needed.
3059
b3ccdeb5
AM
30602013-03-15 Alan Modra <amodra@gmail.com>
3061
3062 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
3063 static and public. Add report_err param. Return false for data refs.
3064 (Target_powerpc::rela_dyn_section): New overloaded function.
3065 (Target_powerpc::plt_, iplt_): Elucidate.
3066 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
3067 (Output_data_plt_powerpc::do_write): Don't write .iplt.
3068 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
3069 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
3070 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
3071 push_branch and make_plt_entry for ifunc syms when
3072 reloc_needs_plt_for_ifunc.
3073 (Target_powerpc::Relocate::relocate): Don't use plt entry value
3074 for ifunc unless reloc_needs_plt_for_ifunc.
3075
ad3d8a2f
AM
30762013-03-15 Alan Modra <amodra@gmail.com>
3077
3078 * gc.h (gc_process_relocs): Don't look through function descriptors.
3079 * icf.cc (get_section_contents): Do so here instead.
3080
4d9aa155
AM
30812013-03-13 Alan Modra <amodra@gmail.com>
3082
3083 * powerpc.cc (is_branch_reloc): Forward declare.
3084 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
3085 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
3086 false for 64-bit, true for 32-bit non-branch relocs.
3087 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
3088 * testsuite/Makefile.am (icf_test): Use linker map file instead of
3089 nm output.
3090 (icf_safe_test): Generate linker map file as well as nm output.
3091 (icf_safe_so_test): Likewise.
3092 * testsuite/Makefile.in: Regenerate.
3093 * testsuite/icf_test.sh: Parse linker map file to determine
3094 section folding.
3095 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
3096 * testsuite/icf_safe_so_test.sh: Likewise.
3097 (X86_32_or_ARM_specific_safe_fold): Merge into..
3098 (arch_specific_safe_fold): ..this.
3099 (X86_64_specific_safe_fold): Delete unused function.
3100
57420c20
AM
31012013-03-12 Alan Modra <amodra@gmail.com>
3102
3103 * gc.h (gc_process_relocs): Look through function descriptors
3104 to determine shndx, symvalue and addend used by ICF. Tidy
3105 variable duplication.
3106
dc3714f3
AM
31072013-03-11 Alan Modra <amodra@gmail.com>
3108
3109 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
3110 * layout.cc (Layout_task_runner::run): ..to here.
3111 * symtab.h (struct Symbol_location): Extract from..
3112 (class Symbol_table): ..here.
3113 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
3114 * target.h (class Target): Add function_location and
3115 do_function_location functions.
3116 (class Sized_target): Add do_function_location.
3117 * object.h (class Sized_relobj_file): Move find_shdr..
3118 (class Object): ..to here.
3119 * object.cc: Likewise. Update to suit. Instantiate.
3120 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
3121 * powerpc.cc (class Powerpc_dynobj): New.
3122 (Target_powerpc::do_function_location): New function.
3123 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
3124 (Powerpc_dynobj::do_read_symbols): New function.
3125 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
3126
956b03bb
ILT
31272013-03-08 Ian Lance Taylor <iant@google.com>
3128
3129 * options.cc (General_options::string_to_object_format): Accept
3130 "default".
3131
4bead2d5
AM
31322013-03-08 Alan Modra <amodra@gmail.com>
3133
3134 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
3135 pointer to Post_fde.
3136 (struct Post_fde): Move definition to here..
3137 * ehframe.cc (struct Post_fde): ..from here.
3138 (Cie::write): Don't alloc Post_fde.
3139 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
3140
02e60bf7
AM
31412013-03-07 Alan Modra <amodra@gmail.com>
3142
3143 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
3144 relocation referencing .LC0.
3145 * testsuite/discard_locals_test.sh: Remove FIXMEs.
3146
8343f03a
AM
31472013-03-07 Alan Modra <amodra@gmail.com>
3148
3149 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
3150 always_inline. Add assembly for powerpc to avoid GOT.
3151
3366d57c
AM
31522013-03-07 Alan Modra <amodra@gmail.com>
3153
3154 * testsuite/script_test_10.sh: Don't test .bss section
3155 header number.
3156
6c77229c
AM
31572013-03-06 Alan Modra <amodra@gmail.com>
3158
3159 * powerpc.cc (class Powerpc_relobj): Move some member functions.
3160 (Target_powerpc::symval_for_branch): Add symtab param. Update
3161 all callers. Handle folded sections.
3162 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
3163 to Powerpc_relobj.
3164 (Global_symbol_visitor_opd::operator()): Likewise.
3165
a39e4af6
AM
31662013-03-04 Alan Modra <amodra@gmail.com>
3167
3168 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
3169 * testsuite/Makefile.in: Regenerate.
3170
d5834edb
CC
31712013-03-01 Cary Coutant <ccoutant@google.com>
3172
3173 Add dwp support for v2 DWARF package file format.
3174 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
3175 tu_length parameter. Adjust all callers.
3176 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
3177 * dwp.cc: Include dwarf.h.
3178 (Section_bounds): New struct type.
3179 (Unit_set): New struct type.
3180 (Dwo_file::Dwo_file): Initialize new data member.
3181 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
3182 Combine and rename to...
3183 (Dwo_file::read_unit_index): ...this.
3184 (Dwo_file::sized_read_compunit_index)
3185 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
3186 (Dwo_file::sized_read_unit_index): ...this.
3187 (Dwo_file::copy_section): Remove section_name, is_str_offsets
3188 parameters; add section_id parameter.
3189 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
3190 (Dwo_file::add_unit_set): ...this.
3191 (Dwo_file::shndx_map_): Remove.
3192 (Dwo_file::sect_offsets_): New data member.
3193 (Dwp_output_file::Dwp_output_file): Initialize new data members.
3194 (Dwp_output_file::add_section): Rename to...
3195 (Dwp_output_file::add_contribution): ...this.
3196 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
3197 (Dwp_output_file::add_tu_set): Likewise.
3198 (Dwp_output_file::Contribution): New type.
3199 (Dwp_output_file::Section::contributions): New data member.
3200 (Dwp_output_file::Cu_or_tu_set): Remove.
3201 (Dwp_output_file::Section::Section): New ctor.
3202 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
3203 (Dwp_output_file::Dwp_index::Section_table): New type.
3204 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
3205 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
3206 parameter.
3207 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
3208 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
3209 (Dwp_output_file::Dwp_index::section_table): New member function.
3210 (Dwp_output_file::Dwp_index::section_table_end): New member function.
3211 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
3212 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
3213 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
3214 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
3215 (Dwp_output_file::Dwp_index::section_table_): New data member.
3216 (Dwp_output_file::Dwp_index::section_mask_): New data member.
3217 (Dwp_output_file::add_output_section): New member function.
3218 (Dwp_output_file::write_new_section): New member function.
3219 (Dwp_output_file::write_contributions): New member function.
3220 (Dwp_output_file::section_id_map_): New data member.
3221 (class Dwo_id_info_reader): Remove.
3222 (class Unit_reader): New class.
3223 (get_dwarf_section_name): New function.
3224 (Dwo_file::read_executable): Adjust initializations of class data.
3225 (Dwo_file::read): Add support for v2 package file format.
3226 (Dwo_file::read_unit_index): Likewise.
3227 (Dwo_file::sized_read_unit_index): Likewise.
3228 (Dwo_file::copy_section): Likewise.
3229 (Dwo_file::add_unit_set): Likewise.
3230 (Dwp_output_file::add_output_section): Likewise.
3231 (Dwp_output_file::add_contribution): Likewise.
3232 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
3233 for empty slot.
3234 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
3235 file format.
3236 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
3237 slot.
3238 (Dwp_output_file::initialize): Remove unused function.
3239 (Dwp_output_file::finalize): Add support for v2 package file format.
3240 (Dwp_output_file::write_index): Likewise.
3241 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
3242 function prototype.
3243
a68a081d
CC
32442013-03-01 Cary Coutant <ccoutant@google.com>
3245
3246 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
3247 function into class definition in header file.
3248 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
3249 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
3250 New function.
3251 (Dwarf_info_reader::check_buffer): Move here from .cc file.
3252
9d5781f8
AM
32532013-02-28 Alan Modra <amodra@gmail.com>
3254
3255 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
3256 * target.cc (Target::do_plt_fde_location): New function.
3257 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
3258 accessor function, and constructor param.
3259 (struct Post_fde, Post_fdes): Declare.
3260 (Cie::write): Add post_fdes param.
3261 * ehframe.cc (Fde::write): Use plt_fde_location.
3262 (struct Post_fde): Define.
3263 (Cie::write): Stash FDEs added post merge mapping.
3264 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
3265 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
3266 (Eh_frame::do_sized_write): Arrange to write post map FDES after
3267 other FDEs.
3268 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
3269 (Target_powerpc::has_glink): New function.
3270 (Target_powerpc::do_relax): Add eh_frame info for stubs.
3271 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
3272 glink_eh_frame_fde_32, default_fde): New data.
3273 (Stub_table::eh_frame_added_): New var.
3274 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
3275 Make const.
3276 (Stub_table::add_eh_frame): New function.
3277 (Output_data_glink::add_eh_frame): New function.
3278 (Target_powerpc::make_glink_section): Call add_eh_frame.
3279
214383dd
ILT
32802013-02-15 Ian Lance Taylor <iant@google.com>
3281
3282 * options.h (DEFINE_uint64_alias): Define.
3283 (class General_options): Add -Ttext-segment as an alias for
3284 -Ttext.
3285
91c2b899
AM
32862013-02-15 Alan Modra <amodra@gmail.com>
3287
3288 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
3289 (Stub_table::do_write): ..here, two places.
3290 (Stub_table::plt_call_size): Use it here too.
3291
20e2a8aa
ILT
32922013-02-11 Ian Lance Taylor <iant@google.com>
3293
3294 * descriptors.cc (Descriptors::close_all): New function.
3295 * descriptors.h (class Descriptors): Declare close_all.
3296 (close_all_descriptors): New inline function.
3297 * plugin.cc: Include "descriptors.h".
3298 (Plugin_manager::cleanup): Call close_all_descriptors.
3299
8952bc69
AM
33002013-02-06 Alan Modra <amodra@gmail.com>
3301
3302 * README: Update coding style link.
3303
29bd8b6b
CC
33042013-01-28 Cary Coutant <ccoutant@google.com>
3305
a4034750
AM
3306 * dwp.cc (File_list): New typedef.
3307 (Dwo_name_info_reader): New class.
3308 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
3309 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
3310 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
3311 (Dwo_file::read_executable): New function.
3312 (Dwo_file::read): Move common setup code to ...
3313 (Dwo_file::make_object): ... here.
3314 (dwp_options): Add --exec/-e.
3315 (usage): Likewise.
3316 (main): Likewise.
29bd8b6b 3317
c6ac678d
ST
33182013-01-24 Sriraman Tallam <tmsriram@google.com>
3319
3320 * layout.cc (Layout::layout): Check for option text_reorder.
3321 (Layout::make_output_section): Ditto.
3322 * options.h (text_reorder): New option.
3323 * output.cc (Input_section_sort_compare): Remove special ordering
3324 of section names.
3325 (Output_section::
3326 Input_section_sort_section_name_special_ordering_compare::
3327 operator()): New function.
3328 (Output_section::sort_attached_input_sections): Use new sort function
3329 for .text.
3330 * output.h (Input_section_sort_section_name_special_ordering_compare):
3331 New struct.
3332 * testsuite/Makefile.am (text_section_grouping): Test option
3333 --no-text-reorder
3334 * testsuite/Makefile.in: Regenerate.
3335 * testsuite/text_section_grouping.sh: Check order of functions without
3336 default text reordering.
3337
50701cc1
MF
33382013-01-18 Mike Frysinger <vapier@gentoo.org>
3339
3340 * options.h (General_options): Change default to true for new_dtags.
3341
b1b00fcc
MF
33422013-01-18 Mike Frysinger <vapier@gentoo.org>
3343
3344 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
3345 when enable_new_dtags is false. Only add DT_RUNPATH when
3346 enable_new_dtags is true.
3347
ec5b8187
AM
33482013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
3349
3350 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
3351 used in declaration and definition consistent.
3352 (Target_powerpc::symval_for_branch): Ditto.
3353
a880d4c4
ST
33542013-01-16 Sriraman Tallam <tmsriram@google.com>
3355
3356 * testsuite/plugin_final_layout.cc: Fix comment.
3357
7c381248
ST
33582013-01-16 Sriraman Tallam <tmsriram@google.com>
3359
3360 * layout.cc (Layout::layout): Do not do default sorting for
3361 text sections when section ordering is specified.
3362 (make_output_section): Ditto.
3363 * testsuite/plugin_final_layout.cc: Name the function sections
3364 to catch reordering issues.
3365
e2458743
AM
33662013-01-15 Alan Modra <amodra@gmail.com>
3367
3368 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
3369 plt-thread-safe.
3370
431ed302
AM
33712013-01-15 Alan Modra <amodra@gmail.com>
3372
3373 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
3374 * testsuite/Makefile.in: Regenerate.
3375
0ec6429b
AM
33762013-01-14 Alan Modra <amodra@gmail.com>
3377
3378 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
3379 * testsuite/Makefile.in: Regenerate.
3380
0bf402d5
ILT
33812013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
3382
36af3926 3383 PR bfd/14430
0bf402d5
ILT
3384 Fix mingw gold build with plugins enabled
3385 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
3386 * configure.ac: Export DLOPEN_LIBS and add headers check.
3387 * plugin.cc: Handle non-dlfcn case.
3388 * Makefile.in: Regenerate.
3389 * config.in: Regenerate.
3390 * configure: Regenerate.
3391 * testsuite/Makefile.in: Regenerate.
3392
9e9143bc
ST
33932013-01-09 Sriraman Tallam <tmsriram@google.com>
3394
3395 * output.h (sort_attached_input_sections): Change to be public.
3396 * script-sections.cc
3397 (Output_section_definition::set_section_addresses): Sort
3398 attached input sections according to section order before linker
3399 script assigns section addresses.
3400 (Orphan_output_section::set_section_addresses): Sort
3401 attached input sections according to section order before linker
3402 script assigns section addresses.
3403 * Makefile.am (final_layout.sh): Use a simple linker script to
3404 check if section ordering still works.
3405 * Makefile.in: Regenerate.
3406
679af368
ILT
34072013-01-09 Ben Cheng <bccheng@google.com>
3408
3409 * arm.cc (Target_arm::attributes_accept_div): New function.
3410 (Target_arm::attributes_forbid_div): New function.
3411 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
3412 attribute using the same new functions as what bfd/elf32_arm.c
3413 does.
3414
3136a00e
CC
34152013-01-07 Cary Coutant <ccoutant@google.com>
3416
3417 PR gold/14993
3418 * output.cc (Output_section::add_input_section): For incremental
3419 updates, don't track input sections that are allocated from patch
3420 space.
3421
f2a6224b
L
34222013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3423 Ian Lance Taylor <iant@google.com>
3424
3425 PR gold/14897
3426 * configure.ac (--enable-ld): Removed.
3427 (install_as_default): Set to yes only for --enable-gold=default
3428 or --disable-ld.
3429 * configure: Regenerated.
3430
4f46f626
L
34312013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3432
3433 * options.h (General_options): Add -fuse-ld= for GCC linker
3434 option compatibility.
3435
26e4ef59
CC
34362013-01-04 Cary Coutant <ccoutant@google.com>
3437
3438 * configure.ac: Fix typo restoring CXXFLAGS.
3439 * configure: Regenerate.
3440
3d587466
CC
34412013-01-04 Cary Coutant <ccoutant@google.com>
3442
4f46f626
L
3443 * testsuite/Makefile.am (CXXLINK_S): New macro.
3444 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
3445 * testsuite/Makefile.in: Regenerate.
3d587466 3446
44db6695
L
34472013-01-02 H.J. Lu <hongjiu.lu@intel.com>
3448
3449 * version.cc (print_version): Update copyright year to 2013.
3450
edcac0c1
ILT
34512012-12-20 Ian Lance Taylor <iant@google.com>
3452
3453 * layout.cc (Layout::special_ordering_of_input_section): New
3454 function.
3455 (Layout::layout): If input section requires special ordering, must
3456 sort input sections.
3457 (Layout::make_output_section): May sort .text input sections.
3458 (Layout::is_section_name_prefix_grouped): Remove.
3459 * layout.h (class Layout): Declare
3460 special_ordering_of_input_section. Don't declare
3461 is_section_name_prefix_grouped.
3462 * output.cc (Output_section::add_input_section): Revert last
3463 change.
3464 (Output_section::Input_section_sort::match_file_name): Don't crash
3465 if called on output section data.
3466 (Output_section::Input_section_sort_compare): Sort based on
3467 special ordering.
3468 (Output_section::Input_section_sort_section_order_index_compare):
3469 Revert last patch.
3470 (Output_section::sort_attached_input_sections): Likewise.
3471
28f2a4ac
ST
34722012-12-18 Sriraman Tallam <tmsriram@google.com>
3473
edcac0c1 3474 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
3475 * layout.h (Layout::is_section_name_prefix_grouped): New function.
3476 * output.cc (Output_section::add_input_section): Check if section
3477 name contains special prefix. Keep input sections to sort such
3478 sections.
3479 (Output_section::Input_section_sort_section_order_index_compare
3480 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
3481 (Output_section::sort_attached_input_sections): Add condition to
3482 Input_section_entry constructor call.
28f2a4ac
ST
3483 * testsuite/Makefile.am (text_section_grouping): New test.
3484 * testsuite/Makefile.in: Regenerate.
3485 * testsuite/text_section_grouping.cc: New file.
3486 * testsuite/text_section_grouping.sh: New file.
3487
5bf135a7
NC
34882012-12-17 Nick Clifton <nickc@redhat.com>
3489
3490 * Makefile.am: Add copyright notice.
3491 * NEWS: Likewise.
3492 * README: Likewise.
3493 * configure.ac: Likewise.
3494 * ftruncate.c: Likewise.
3495 * Makefile.in: Regenerate.
3496
59965708
CC
34972012-12-14 Cary Coutant <ccoutant@google.com>
3498
a4034750
AM
3499 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
3500 --no-as-needed flag.
3501 (exception_separate_shared_12_test): Likewise.
3502 (incremental_copy_test): Likewise.
3503 * testsuite/Makefile.in: Regenerate.
59965708 3504
2a77e2ab
CC
35052012-12-14 Cary Coutant <ccoutant@google.com>
3506
3507 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
3508 (Dwp_output_file::Dwp_index::enter_set): Add assert.
3509
e3deeb9c
AM
35102012-12-12 Alan Modra <amodra@gmail.com>
3511
3512 * powerpc.cc (class Track_tls): New.
3513 (class Relocate, class Scan): Inherit Track_tls.
3514 (Target_powerpc::Scan::local, global): Track tls optimization
3515 and avoid creating plt entry for __tls_get_addr if all uses
3516 are optimized away.
3517 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
3518
d8f5a274
AM
35192012-12-12 Alan Modra <amodra@gmail.com>
3520
3521 * options.h (General_options): Add --toc-sort/--no-toc-sort.
3522 Replace no_toc_optimize with toc_optimize.
3523 * output.h (Output_section::input_sections): Provide non-const variant.
3524 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
3525 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
3526 accessors.
3527 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
3528 (class Sort_toc_sections): New.
3529 (Target_powerpc::do_finalize_sections): Sort toc sections.
3530 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
3531
4c8a1de1
RM
35322012-12-10 Roland McGrath <mcgrathr@google.com>
3533
3534 * testsuite/binary_unittest.cc (read_all): New function.
3535 (Sized_binary_test): Use it instead of ::read.
3536 * fileread.cc (do_read): Don't assume pread always reads the whole
3537 amount in a single call.
3538
edc27beb
AM
35392012-12-10 Alan Modra <amodra@gmail.com>
3540
3541 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
3542 Set EM_PPC64 or EM_PPC here.
3543 (Target_selector_powerpc::do_recognize): Delete.
3544
906b9150
AM
35452012-12-10 Alan Modra <amodra@gmail.com>
3546
3547 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
3548 stub_table_.
3549 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
3550
418c15ae
RM
35512012-12-07 Roland McGrath <mcgrathr@google.com>
3552
3553 * testsuite/binary_unittest.cc (Sized_binary_test):
3554 Use open_descriptor rather than ::open.
3555
decdd3bc
AM
35562012-12-07 Alan Modra <amodra@gmail.com>
3557
3558 * powerpc.cc (Stub_table::do_write): Delete redundant Address
3559 typedef and invalid_address constant.
3560 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
3561 instantiate constants.
3562
db399005
ILT
35632012-12-06 Roland McGrath <mcgrathr@google.com>
3564
3565 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
3566 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
3567 * aclocal.m4: Regenerate.
3568 * configure: Regenerate.
3569 * Makefile.in: Regenerate.
3570 * testsuite/Makefile.in: Regenerate.
3571
aba6bc71
AM
35722012-12-07 Alan Modra <amodra@gmail.com>
3573
3574 * options.h (General_options): Add no_toc_optimize.
3575 * powerpc.cc (ok_lo_toc_insn): New function.
3576 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
3577
9e69ed50
AM
35782012-12-06 Alan Modra <amodra@gmail.com>
3579
3580 * options.h (General_options): Add plt_align, plt_static_chain,
3581 plt_thread_safe. Update stub_group_size help text.
3582 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
3583 for new plt_thread_safe_ var.
3584 (use_plt_offset): Correct comments.
3585 (Target_powerpc::do_relax): Look for thread creation symbols to
3586 determine default plt_thread_safe value. Clear plt call stubs
3587 as well as branch stubs each iteration.
3588 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
3589 insn constants.
3590 (l, hi, ha, write_insn): Move earlier.
3591 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
3592 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
3593 plt stubs too.
3594 (Stub_table::update_size): Adjust.
3595 (Stub_table::prev_size, set_prev_size): Delete.
3596 (Stub_table::stub_align): Let --plt-align affect result.
3597 (Stub_table::plt_call_size): Calculate sizes for various stubs.
3598 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
3599 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
3600 (Stub_table::do_write): Support more stub variants.
3601
f43ba157
AM
36022012-12-04 Alan Modra <amodra@gmail.com>
3603
3604 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
3605 (Target_powerpc::do_define_standard_symbols): New function.
3606
34171bc5
AM
36072012-12-03 Alan Modra <amodra@gmail.com>
3608
3609 * output.h: Formatting, whitespace.
3610
dc9589e9 36112012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
3612
3613 * layout.h (Layout::get_executable_sections): Declare.
3614 * layout.cc (Layout::get_executable_sections): New function.
3615 * arm.cc (Target_arm::group_sections): Use it.
3616 (Arm_output_section::group_sections): Delete now redundant test.
3617 * output.cc (Output_reloc::Output_reloc): Add is_relative.
3618 param to handle relative relocs.
3619 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
3620 (Output_data_reloc::add_absolute): Adjust.
3621 (Output_data_reloc::add_relative): New function.
3622 (Output_data::reset_data_size): New function.
3623 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
3624 (Output_section::set_addralign): New function.
3625 (Output_section::checkpoint_set_addralign): New function.
3626 (Output_section::clear_section_offsets_need_adjustment): New function.
3627 (Output_section::input_sections): Make public.
3628 * powerpc.cc (class Output_data_brlt_powerpc): New.
3629 (class Stub_table, class Stub_control): New.
3630 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
3631 stub_table_, set_stub_table, stub_table): New vectors and accessor
3632 functions.
3633 (Target_powerpc::do_may_relax, do_relax, push_branch,
3634 new_stub_table, stub_tables, brlt_section, group_sections,
3635 add_branch_lookup_table, find_branch_lookup_table,
3636 write_branch_lookup_table, make_brlt_section): New functions.
3637 (Target_powerpc::struct Sort_sections, class Branch_info): New.
3638 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
3639 branch_info_): New vars.
3640 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
3641 make call stubs here.
3642 (Output_data_glink): Remove all call stub handling from this class.
3643 (Target_powerpc::Scan::local, global): Save interesting branch
3644 relocs and relocs for ifunc. Adjust calls to plt entry functions.
3645 (Target_powerpc::do_finalize_sections): Only make reg save/restore
3646 functions on final link.
3647 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
3648 Handle long branch destinations too.
3649 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
3650 do_plt_address_for_local): Adjust lookup of plt call stubs.
3651
627b30b7
AM
36522012-11-30 Alan Modra <amodra@gmail.com>
3653
3654 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
3655 relocs against protected symbols when building 32-bit shared libs.
3656
40b469d7
AM
36572012-11-30 Alan Modra <amodra@gmail.com>
3658
3659 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
3660 param. Call got_section() to make .got. Update all callers
3661 and their callers and so on.
3662
bb66a627
AM
36632012-11-30 Alan Modra <amodra@gmail.com>
3664
3665 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
3666 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
3667 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
3668 value if it already exists.
3669
d2cf1c6c
L
36702012-11-19 H.J. Lu <hongjiu.lu@intel.com>
3671
3672 PR gold/14858
3673 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
3674
edccdf7c
RM
36752012-11-14 Roland McGrath <mcgrathr@google.com>
3676
3677 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
3678 than bfc instruction for data sandboxing.
3679
6febeb74
AM
36802012-11-08 Alan Modra <amodra@gmail.com>
3681
3682 * po/POTFILES.in: Regenerate.
3683
0a6f1bf2
AM
36842012-11-05 Alan Modra <amodra@gmail.com>
3685
3686 * configure.ac: Apply 2012-09-10 change to config.in here.
3687 * configure: Regenerate.
3688
26a4e9cb
AM
36892012-11-05 Alan Modra <amodra@gmail.com>
3690
3691 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
3692 (struct Opd_ent): Use "Address" rather than "Offset".
3693 (Output_data_got_powerpc::got_base_offset): Return Valtype.
3694 (Target_powerpc::got_section): Make public.
3695 (Target_powerpc::scan_relocs): Move code setting symbols..
3696 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
3697 Create _SDA_BASE_ only when referenced.
3698
cc928013
RM
36992012-11-02 Roland McGrath <mcgrathr@google.com>
3700
3701 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
3702 from last change.
3703
50ed5eb1
RM
37042012-11-01 Roland McGrath <mcgrathr@google.com>
3705
62fe925a
RM
3706 * target.h (Sized_target::relocate_relocs): Use Elf_Off
3707 for offset_in_output_section parameter.
3708 (Sized_target::relocate_special_relocatable): Likewise.
3709 * arm.cc (Target_arm::relocate_relocs): Likewise.
3710 (Target_arm::relocate_special_relocatable): Likewise.
3711 * i386.cc (Target_i386::relocate_relocs): Likewise.
3712 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
3713 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
3714 * target-reloc.h (relocate_relocs): Likewise.
3715 * testsuite/testfile.cc (Target_test): Likewise.
3716 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
3717 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
3718
3719 * system.h: Move inclusion of <clocale> to after <libintl.h> in
3720 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
3721
3722 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
3723 parameter, which is unused in the [!F_SETFD] case.
3724
50ed5eb1
RM
3725 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
3726 SYMNDX to off_t before comparing it to this->data_size().
3727 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
3728 * incremental.cc (Output_section_incremental_inputs::do_write):
3729 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
3730
2cadc0bf
RM
3731 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
3732
3bfcb652
NC
37332012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
3734
3735 * gold.cc (Target_arm::do_adjust_elf_header): Add the
3736 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
3737 in EABI_VER5.
3738
c1a8d56e
CC
37392012-10-29 Cary Coutant <ccoutant@google.com>
3740
3741 * dwp.cc (usage): Add file and exit status parameters;
3742 add --help and --version options.
3743 (print_version): New function.
3744 (main): Add --help and --version options.
3745
b2490a7b
L
37462012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3747
3748 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
3749 final_layout_sequence.txt.
3750 * testsuite/Makefile.in: Regenerated.
3751
aa543512
L
37522012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3753
3754 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
3755 COMPILE generated by automake.
3756 (LINK1): Likewise.
3757 (CXXCOMPILE1): Likewise.
3758 (CXXLINK1): Likewise.
3759 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
3760 (LINK): Likewise.
3761 (CXXCOMPILE): Likewise.
3762 (CXXLINK): Likewise.
3763 * testsuite/Makefile.in: Regenerated.
3764
d361fafb
L
37652012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3766
3767 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
3768 on bad fwrite return.
3769
598c7410
L
37702012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3771
3772 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
3773 on val.
3774
35c813e2
CC
37752012-10-23 Cary Coutant <ccoutant@google.com>
3776
3777 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
3778 * testsuite/Makefile.in: Regenerate.
3779 * testsuite/dwp_test.h: New source file.
3780 * testsuite/dwp_test_1.cc: New source file.
3781 * testsuite/dwp_test_1.s: New source file.
3782 * testsuite/dwp_test_1.sh: New source file.
3783 * testsuite/dwp_test_1b.cc: New source file.
3784 * testsuite/dwp_test_1b.s: New source file.
3785 * testsuite/dwp_test_2.cc: New source file.
3786 * testsuite/dwp_test_2.s: New source file.
3787 * testsuite/dwp_test_2.sh: New source file.
3788 * testsuite/dwp_test_main.cc: New source file.
3789 * testsuite/dwp_test_main.s: New source file.
3790
77429909
CC
37912012-10-23 Cary Coutant <ccoutant@google.com>
3792
3793 * dwp.h: New header file.
3794 * dwp.cc: New source file.
3795 * gold.h: Move shared declarations to system.h.
3796 * system.h: New header file.
3797 * Makefile.am: Add dwp.
3798 * Makefile.in: Regenerate.
3799
ed5d6712
CC
38002012-10-23 Cary Coutant <ccoutant@google.com>
3801
3802 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
3803 Dwarf_info_reader::read_from_pointer.
3804 (Dwarf_pubnames_table::read_header): Likewise.
3805 (Dwarf_pubnames_table::next_name): Likewise.
3806 (Dwarf_die::read_attributes): Likewise.
3807 (Dwarf_die::skip_attributes): Likewise.
3808 (Dwarf_info_reader::read_from_pointer): New function template.
3809 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
3810 (Dwarf_pubnames_table): Likewise.
3811 (Dwarf_info_reader::read_from_pointer): New function template.
3812 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
3813 Dwarf_pubnames_table ctor.
3814
8787852d
CC
38152012-10-23 Cary Coutant <ccoutant@google.com>
3816
3817 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
3818 abbrev_shndx.
3819 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
3820 abbrev_shndx_.
3821 (Dwarf_info_reader::set_abbrev_shndx): New method.
3822 (Dwarf_info_reader::abbrev_shndx_): New data member.
3823
9fc236f3
CC
38242012-10-23 Cary Coutant <ccoutant@google.com>
3825
3826 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
3827 from object, not parameters.
3828 (Dwarf_info_reader::parse): Likewise.
3829 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
3830 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
3831 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
3832 methods.
3833
effe8365
CC
38342012-10-23 Cary Coutant <ccoutant@google.com>
3835
3836 * fileread.cc (Input_file::Input_file): New constructor.
3837 * fileread.h (class Input_file): Add new constructor.
3838
1698990d
AM
38392012-10-18 Alan Modra <amodra@gmail.com>
3840
3841 PR gold/14727
3842 * object.cc (Relobj::is_section_name_included): Also match
3843 .sdata personality section.
3844
168a4726
AM
38452012-10-18 Alan Modra <amodra@gmail.com>
3846
3847 * target-reloc.h (class Default_comdat_behavior): New, package up..
3848 (get_comdat_behaviour): ..this.
3849 (relocate_section): Add Relocate_comdat_behavior template arg,
3850 adjust code to suit.
3851 * arm.cc (Target_arm::relocate_section): Adjust to suit.
3852 (Target_arm::scan_reloc_section): Likewise.
3853 * i386.cc (Target_i386::relocate_section): Likewise.
3854 * sparc.cc (Target_sparc::relocate_section): Likewise.
3855 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
3856 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
3857 * powerpc.cc (class Relocate_comdat_behavior): New.
3858 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
3859 gold::relocate_section with new template arg.
3860
acc276d8
AM
38612012-10-18 Alan Modra <amodra@gmail.com>
3862
3863 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
3864 dynamic relocs for GOT_TPREL got entries, without symbol if
3865 resolving locally.
3866 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
3867 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
3868 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
3869
e10f9870
AM
38702012-10-17 Alan Modra <amodra@gmail.com>
3871
3872 PR gold/14726
3873 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
3874
ae034989
ST
38752012-10-16 Sriraman Tallam <tmsriram@google.com>
3876
3877 * layout.cc (Layout::include_section): Keep sections marked
3878 SHF_EXCLUDE when doing relocatable links.
3879
f3a0ed29
AM
38802012-10-16 Alan Modra <amodra@gmail.com>
3881
3882 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
3883 (Target_powerpc::do_finalize_sections): Call it.
3884 (Output_data_save_res): New class and supporting functions.
3885 (Target_powerpc::symval_for_branch): Only look up .opd entry for
3886 normal symbols defined in object files.
3887
c6de8ed4
AM
38882012-10-12 Alan Modra <amodra@gmail.com>
3889
3890 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
3891 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
3892 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
3893 section if scan_opd_relocs not yet called.
3894 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
3895
03e25981
AM
38962012-10-12 Alan Modra <amodra@gmail.com>
3897
3898 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
3899 add_local_ifunc_entry): Revert last change.
3900 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
3901
c9824451
AM
39022012-10-05 Alan Modra <amodra@gmail.com>
3903
3904 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
3905 do_plt_address_for_global): New functions.
3906 (Output_data_got_powerpc::do_write): Don't segfault when linking
3907 statically.
3908 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
3909 add_local_ifunc_entry): Return true on adding entry..
3910 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
3911 glink->add_entry call. Remove unused symtab param. Adjust calls.
3912 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
3913 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
3914 set up symbols here.
3915 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
3916 syms here. Do so even when no .iplt. Don't segfault when linking
3917 statically.
3918 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
3919 new variants without reloc param.
3920 (Glink_sym_ent::Glink_sym_ent): Likewise.
3921 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
3922 reloc when refs will resolve to plt call stub.
3923 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
3924 R_PPC_PLTREL24 to resolve locally.
3925 (Target_powerpc::Scan::global): Correct ifunc handling.
3926 (Target_powerpc::Relocate::relocate): Correct local sym glink
3927 lookup. Don't destroy "value" when we have a plt call stub,
3928 and when checking plt call validity.
3929 (Target_powerpc::do_dynsym_value): Simplify.
3930
19fec8c1
AM
39312012-10-05 Alan Modra <amodra@gmail.com>
3932
3933 * i386.cc (Output_data_plt_i386::address_for_global,
3934 address_for_local): Add plt offset to returned value. Adjust uses.
3935 * sparc.cc (Output_data_plt_sparc::address_for_global,
3936 address_for_local): Likewise.
3937 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
3938 address_for_local): Likewise.
3939 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
3940 address_for_local): Likewise.
3941 * target.h (Target::plt_address_for_global, plt_address_for_local):
3942 Update comment.
3943 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
3944 (Output_data_got::Got_entry::write): Nor here.
3945 * output.h: Comment fix.
3946
e867b647
WL
39472012-10-02 Jiong Wang <jiwang@tilera.com>
3948
3949 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
3950 global_offset_table_ value for larget got.
3951 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
3952
e5d5f5ed
AM
39532012-09-29 Alan Modra <amodra@gmail.com>
3954
3955 * powerpc.cc (Target_powerpc::iplt_): New output section.
3956 (Target_powerpc::iplt_section, make_iplt_section,
3957 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
3958 (Target_powerpc::make_plt_entry): Handle ifunc syms.
3959 Target_powerpc::plt_entry_count): Count iplt entries too.
3960 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
3961 reloc section in constructor. New params.
3962 (Target_powerpc::make_plt_section): Create reloc section here instead.
3963 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
3964 functions.
3965 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
3966 (Output_data_glink::add_entry, find_entry): New functions to
3967 deal with local syms.
3968 (Glink_sym_ent): Add support for local syms.
3969 (Output_data_glink::do_write): Handle ifunc plt entries.
3970 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
3971 (Target_powerpc::Scan::local, global): Handle ifunc syms.
3972 (Target_powerpc::Relocate::relocate): Likewise.
3973 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
3974
ec4dbad3
AM
39752012-09-25 Alan Modra <amodra@gmail.com>
3976
3977 * object.h (Sized_relobj_file::adjust_local_symbol,
3978 do_adjust_local_symbol): New functions.
3979 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
3980 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
3981 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
3982 and irregular opd entry spacing.
3983 (Powerpc_relobj::do_read_relocs): Add opd size checks.
3984 (Global_symbol_visitor_opd): New functor.
3985 (Target_powerpc::do_finalize_sections): Omit global symbols defined
3986 on deleted opd entries.
3987
5c0b3823
WL
39882012-09-15 Jiong Wang <jiwang@tilera.com>
3989
3990 * tilegx.cc: New file.
3991 * Makefile.am (TARGETSOURCES): Add tilegx.cc
3992 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
3993 * configure.tgt: Add entries for tilegx*.
3994 * configure.ac: Likewise.
3995 * Makefile.in: Rebuild.
3996 * configure: Likewise.
3997 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
3998 tilegx.
3999
bfdfa4cd
AM
40002012-09-13 Alan Modra <amodra@gmail.com>
4001
4002 * target-reloc.h (scan_relocs): Call scan.local for relocs
4003 against symbols in discarded sections. Pass is_discarded
4004 param.
4005 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
4006 Add is_discarded param.
4007 * powerpc (Target_powerpc::Scan::local): Likewise. Use
4008 is_discarded to flag opd entry as discarded. Don't emit dyn
4009 relocs on such entries.
4010 (Target_powerpc::Scan::global): Similarly detect and handle
4011 such opd entries.
4012 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
4013 opd_ent_. Update all uses.
4014 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
4015 (Target_powerpc::relocate_section): Zero out discarded opd
4016 entry relocs.
4017
d77a0555
ILT
40182012-09-12 Ian Lance Taylor <iant@google.com>
4019
4020 PR gold/14570
4021 * output.cc: Rename Output_data_got template parameter from size
4022 to got_size for all functions. Compile all variants of
4023 Output_data_got.
4024 (Output_data_got::Got_entry::write): Correct use of size for
4025 symbol value. Use local_is_tls rather than casting to
4026 Sized_relobj_file.
4027 * object.h (class Object): Add local_is_tls and do_local_is_tls.
4028 (class Sized_relobj_file): Add do_local_is_tls.
4029 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
4030
815a1205
AM
40312012-09-11 Alan Modra <amodra@gmail.com>
4032
4033 PR gold/14566
4034 * layout.cc (Layout::set_segment_offsets): When using
4035 common-page-size alignment, ensure we are on a new max-page-size
4036 page.
4037 * output.cc (Output_segment::set_section_addresses): Use
4038 abi_pagesize, not common_pagesize for relro boundary.
4039 (Output_segment::set_offset): Likewise.
4040
bd73a62d
AM
40412012-09-11 Alan Modra <amodra@gmail.com>
4042
4043 * output.h (Output_data_got::add_global_tls, add_local_tls,
4044 add_local_tls_pair): New functions.
4045 (Output_data_got::add_local_pair_with_rel): Remove second
4046 reloc param. Expand comment.
4047 (Output_data_got::Got_entry): Rename use_plt_offset_ to
4048 use_plt_or_tls_offset_, similarly for constructor param.
4049 (Output_data_got::Got_entry::write): Add got_index param.
4050 * output.cc (Output_data_got::add_global_tls, add_local_tls,
4051 add_local_tls_pair): New functions.
4052 (Output_data_got::Got_entry::write): Handle tls symbols
4053 with use_plt_or_tls_offset_ set specially.
4054 (Output_data_got::add_local_pair_with_rel): Only one reloc.
4055 (Output_data_got::do_write): Replace iterator with index, pass
4056 index to entry write function.
4057 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
4058 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
4059 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
4060 call.
4061 * i386.cc (Target_i386::Scan::local): Likewise.
4062 * sparc.cc (Target_sparc::Scan::local): Likewise.
4063 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
4064 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
4065 do_tls_offset_for_global): New functions.
4066 (Target_powerpc::Scan::local): Correct TLS relocations and got
4067 entry values.
4068 (Target_powerpc::Scan::global): Don't emit unnecessary
4069 dynamic relocations on TLS GOT entries.
4070
00716ab1
AM
40712012-09-10 Matthias Klose <doko@ubuntu.com>
4072
4073 * config.in: Disable sanity check for kfreebsd.
4074
c891b3f9
SA
40752012-09-10 Sterling Augustine <saugustine@google.com>
4076
4077 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
4078 (Gdb_index::pubtypes_read): New parameter.
4079 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
4080 to calls.
4081 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
4082 pubtypes_object_.
4083
e81fea4d
AM
40842012-09-09 Alan Modra <amodra@gmail.com>
4085
4086 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
4087 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
4088 * gc.h (gc_process_relocs): Call target gc_add_reference.
4089 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
4090 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
4091 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
4092 unnecessary cast.
4093 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
4094 to cater for when we don't need code offset. Update use.
4095 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
4096 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
4097 set_opd_valid): New functions.
4098 (Target_powerpc::do_gc_add_reference): New function.
4099 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
4100 stashed refs.
4101 (Target_powerpc::do_gc_mark_symbol): New function.
4102
d2d60eef
CC
41032012-09-06 Cary Coutant <ccoutant@google.com>
4104
4105 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
4106 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
4107 (Dwarf_die::skip_attributes): Likewise.
4108 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
4109 * testsuite/gdb_index_test.cc (inline_func_1): New function.
4110 (main): Call it.
4111 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
4112
32ed4573
L
41132012-09-05 H.J. Lu <hongjiu.lu@intel.com>
4114
4115 * testsuite/script_test_3.t: Add .got.plt output section
4116 statement.
4117 * testsuite/script_test_4.t: Likewise.
4118
f4baf0d4
AM
41192012-09-05 Alan Modra <amodra@gmail.com>
4120
4121 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
4122 update all uses and lose "enum" when using type.
4123
864a1b56
AM
41242012-09-05 Alan Modra <amodra@gmail.com>
4125
4126 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
4127 * configure: Regenerate.
4128 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
4129 (plugin_final_layout.stdout): Likewise.
4130 (memory_test): Set page sizes to 0x1000.
4131 * testsuite/Makefile.in: Regenerate.
4132 * testsuite/discard_locals_test.sh: Add FIXME comment.
4133 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
4134 * testsuite/pr14265.t: Add .got output section statement.
4135 * testsuite/script_test_2.t: Likewise.
4136 * testsuite/script_test_3.t: Likewise.
4137 * testsuite/script_test_4.t: Likewise.
4138 * testsuite/script_test_5.t: Likewise.
4139 * testsuite/script_test_6.t: Likewise.
4140 * testsuite/script_test_7.t: Likewise.
4141 * testsuite/script_test_9.t: Likewise.
4142
3ea0a085
AM
41432012-09-05 Alan Modra <amodra@gmail.com>
4144
4145 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
4146 (Powerpc_relocate_functions::Status): New typedef.
4147 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4148 (Target_powerpc::Scan::local): Handle REL64.
4149 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
4150 for REL32 and REL64.
4151 (Target_powerpc::symval_for_branch): New function, extracted from..
4152 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
4153 checks. Report overflow errors.
4154
7404fe1b
AM
41552012-09-05 Alan Modra <amodra@gmail.com>
4156
4157 * object.h (Sized_relobj_file::emit_relocs): Delete.
4158 (Sized_relobj_file::emit_relocs_reltype): Delete.
4159 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
4160 relocate_relocs for --emit-relocs.
4161 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
4162 * output.h: Update comment.
4163 (Output_segment::first_section): New function.
4164 (Output_segment::first_section_load_address): Use first_section.
4165 * output.cc (Output_segment::first_section): New function extracted..
4166 (Output_segment::first_section_load_address): ..from here. Delete.
4167 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
4168 * target.h (Sized_target::relocate_for_relocatable): Likewise.
4169 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
4170 adjust call to target.h function.
4171 * i386.cc (Target_i386): Likewise.
4172 * sparc.cc (Target_sparc): Likewise.
4173 * x86_64.cc (Target_x86_64): Likewise.
4174 * powerpc.cc (Target_powerpc): Likewise.
4175 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
4176 first tls section has section symbol for optimised local dynamic
4177 output relocs.
4178 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
4179 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
4180 optimised tls code.
4181 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
4182 Rename to relocate_relocs. Update error message.
4183
957564c9
AS
41842012-09-04 Andreas Schwab <schwab@linux-m68k.org>
4185
4186 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
4187 --just-symbols.
4188
dd93cd0a
AM
41892012-08-31 Alan Modra <amodra@gmail.com>
4190
4191 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
4192 (Powerpc_relobj::toc_base_offset): New stub function.
4193 (Target_powerpc): Add tp_offset, dtp_offset. Rename
4194 got_mod_index_offset to tlsld_got_offset. Update all refs.
4195 (Target_powerpc::Relocate::enum skip_tls): New.
4196 (Target_powerpc::call_tls_get_addr_): New var.
4197 (Target_powerpc::is_branch_reloc): Move to file scope.
4198 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
4199 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
4200 New functions.
4201 (Target_powerpc::enum Got_type): Delete old values, add new ones.
4202 (powerpc_info): Correct common_pagesize for ppc64.
4203 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
4204 (Powerpc_relocate_functions): Add overflow check enums and functions.
4205 Add non-shift version of rela, rela_ua. Delete all rel public
4206 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
4207 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
4208 addr16_ha3, addr14 functions.
4209 (Output_data_got_powerpc::add_constant_pair): New function.
4210 (Output_data_got_powerpc::got_base_offset): Likewise.
4211 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
4212 (instruction constants): Sort, add some more.
4213 (Output_data_glink::do_write): Add and use Address typedef. Use
4214 object->toc_base_offset() stub for 64-bit.
4215 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
4216 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4217 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
4218 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
4219 Always treat .opd relocs as against locally defined symbol.
4220 Correct condition for RELATIVE relocs.
4221 (Target_powerpc::do_finalize_sections): Test for NULL sections.
4222 (Target_powerpc::Relocate::relocate): Use plt call stub as value
4223 for 32-bit syms with a plt entry. Correct ppc64 toc base
4224 calculations. Handle TLS relocs, and more. Add overflow
4225 checking and adjust for Powerpc_relocate_functions changes.
4226 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
4227 Reinstate --emit-relocs code with FIXME.
4228
a1373b60
AM
42292012-08-30 Alan Modra <amodra@gmail.com>
4230
4231 * layout.cc (Layout::set_segment_offsets): Set p_align to
4232 abi_pagesize, not common_pagesize.
4233 (Layout::relaxation_loop_body): Similarly use abi_pagesize
4234 to determine whether file header can go in segment.
4235
703d02da
AM
42362012-08-30 Alan Modra <amodra@gmail.com>
4237
4238 * output.h (Output_reloc::Output_reloc <output section>): Add
4239 is_relative param. Adjust calls.
4240 (Output_reloc::add_output_section_relative): New functions.
4241 * output.cc (Output_reloc::Output_reloc <output section>): Handle
4242 is_relative.
4243 (Output_reloc::symbol_value): Handle SECTION_CODE.
4244
16164a6b
ST
42452012-08-24 Sriraman Tallam <tmsriram@google.com>
4246
4247 * gold.cc (queue_middle_tasks): Call layout again when unique
4248 segments for sections is desired.
4249 * layout.cc (Layout::Layout): Initialize new members.
4250 (Layout::get_output_section_flags): New function.
4251 (Layout::choose_output_section): Call get_output_section_flags.
4252 (Layout::layout): Make output section for mapping to a unique segment.
4253 (Layout::insert_section_segment_map): New function.
4254 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 4255 output sections marked so.
16164a6b
ST
4256 (Layout::segment_precedes): Check for unique segments when sorting.
4257 * layout.h (Layout::Unique_segment_info): New struct.
4258 (Layout::Section_segment_map): New typedef.
4259 (Layout::insert_section_segment_map): New function.
4260 (Layout::get_output_section_flags): New function.
4261 (Layout::is_unique_segment_for_sections_specified): New function.
4262 (Layout::set_unique_segment_for_sections_specified): New function.
4263 (Layout::unique_segment_for_sections_specified_): New member.
4264 (Layout::section_segment_map_): New member.
4265 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
4266 Rename is_gc_pass_one to is_pass_one.
4267 Rename is_gc_pass_two to is_pass_two.
4268 Rename is_gc_or_icf to is_two_pass.
4269 Check for which pass based on whether symbols data is present.
4270 Make it two pass when unique segments for sections is desired.
4271 * output.cc (Output_section::Output_section): Initialize new
4272 members.
4273 * output.h (Output_section::is_unique_segment): New function.
4274 (Output_section::set_is_unique_segment): New function.
4275 (Output_section::is_unique_segment_): New member.
4276 (Output_section::extra_segment_flags): New function.
4277 (Output_section::set_extra_segment_flags): New function.
4278 (Output_section::extra_segment_flags_): New member.
4279 (Output_section::segment_alignment): New function.
4280 (Output_section::set_segment_alignment): New function.
4281 (Output_section::segment_alignment_): New member.
4282 (Output_segment::Output_segment): Initialize is_unique_segment_.
4283 (Output_segment::is_unique_segment): New function.
4284 (Output_segment::set_is_unique_segment): New function.
4285 (Output_segment::is_unique_segment_): New member.
4286 * plugin.cc (allow_unique_segment_for_sections): New function.
4287 (unique_segment_for_sections): New function.
4288 (Plugin::load): Add new functions to transfer vector.
4289 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
4290 * Makefile.in: Regenerate.
4291 * testsuite/plugin_final_layout.sh: Check if unique segment
4292 functionality works.
4293 * testsuite/plugin_section_order.c (onload): Check if new interfaces
4294 are available.
4295 (allow_unique_segment_for_sections): New global.
4296 (unique_segment_for_sections): New global.
4297 (claim_file_hook): Call allow_unique_segment_for_sections.
4298 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 4299
1e2bee4f
CC
43002012-08-22 Cary Coutant <ccoutant@google.com>
4301
4302 * layout.cc (Layout::include_section): Don't assert on GROUP
4303 sections with --emit-relocs.
4304
1d5dfe78
CC
43052012-08-21 Cary Coutant <ccoutant@google.com>
4306
4307 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
4308 if --export-dynamic-symbol names an undef symbol.
4309
c9269dff
AM
43102012-08-18 Alan Modra <amodra@gmail.com>
4311
4312 * powerpc.cc: Formatting and white space.
4313 (Powerpc_relobj): Rename got2_section_ to special_.
4314 Add opd_ent_shndx_ and opd_ent_off_ vectors.
4315 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
4316 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
4317 (Target_powerpc): Add Address typedef and invalid_address. Use
4318 throughout.
4319 (Target_powerpc::is_branch_reloc): New function.
4320 (Powerpc_relocate_functions): Add Address typedef, use throughout.
4321 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
4322 for dst_mask, value and addend.
4323 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
4324 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
4325 (Output_data_glink::do_write): Correct toc base. Don't try to use
4326 uint16_t for 24-bit offset. Use get_output_section_offset and
4327 check return.
4328 (Target_powerpc::Scan::local): Handle more relocs.
4329 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
4330 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
4331 Plug in toc restoring insn after plt calls. Translate branches
4332 to function descriptor symbols to corresponding entry point.
4333 (Target_powerpc::relocate_for_relocatable): Check return from
4334 get_output_section_offset.
4335 * symtab.h: Comment typo.
4336
b1759dce
ILT
43372012-08-14 Ian Lance Taylor <iant@google.com>
4338
4339 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
4340 unsupported_relocal_local to call unsupported_reloc_global.
4341
b9b2ae8b
NC
43422012-08-14 Nick Clifton <nickc@redhat.com>
4343
4344 PR ld/14265
4345 * script-sections.cc (Sections_element::output_section_name): Add
4346 keep return parameter.
4347 (Output_section_element::match_name): Add keep return parameter.
4348 Return the value of the keep_ member.
4349 * script-sections.h (class Output_section): Update
4350 output_section_name prototype.
4351 * layout.cc (Layout::keep_input_section): New public member
4352 function.
4353 (Layout::choose_output_section): Pass keep parameter to
4354 output_section_name.
4355 * layout.h (class Layout): Add keep_input_section.
4356 * object.cc (Sized_relobj_file::do_layout): Check for kept input
4357 sections.
4358 * testsuite/Makefile.am: Add a test.
4359 * testsuite/Makefile.in: Regenerate.
4360 * testsuite/pr14265.c: Source file for the test.
4361 * testsuite/pr14265.t: Linker script for the test.
4362 * testsuite/pr14265.sh: Shell script for the test.
4363
921b5322
AM
43642012-08-14 Alan Modra <amodra@gmail.com>
4365
4366 * target.h (Target::output_section_name): New function.
4367 (Target::do_output_section_name): New function.
4368 * layout.cc (Layout::choose_output_section): Call the above.
4369 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
4370
6ce78956
AM
43712012-08-14 Alan Modra <amodra@gmail.com>
4372
4373 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
4374 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
4375 for replace_constant call.
4376 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
4377 (Output_data_glink::do_print_to_mapfile): New function.
4378 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
4379 (Target_powerpc::Relocate::relocate): Likewise.
4380
d1a8cabd
AM
43812012-08-14 Alan Modra <amodra@gmail.com>
4382
4383 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
4384 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
4385 (Output_data_glink::add_entry,find_entry): Remove shndx param.
4386 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
4387 all references to shndx_. Handle special case for R_PPC_PLTREL24
4388 here.
4389 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
4390 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
4391 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
4392 here.
4393 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
4394 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
4395
d83ce4e3
AM
43962012-08-12 Alan Modra <amodra@gmail.com>
4397
4398 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
4399 (glink insn constants): Use uint32_t.
4400 (Output_data_glink::add_entry): Use insert, not [] operator.
4401
cf43a2fe
AM
44022012-08-11 Alan Modra <amodra@gmail.com>
4403
4404 * object.h (Sized_relobj_file::find_shdr): New function.
4405 (Sized_relobj_file::find_special_sections): New function.
4406 * object.cc (Sized_relobj_file::find_shdr): New function.
4407 (Sized_relobj_file::find_eh_frame): Use find_shdr.
4408 (Sized_relobj_file::find_special_sections): New function, split out..
4409 (Sized_relobj_file::do_read_symbols): ..from here.
4410 * output.h (Output_data_got::replace_constant): New function.
4411 (Output_data_got::num_entries): New function.
4412 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
4413 (Output_data_got::got_offset): Protected rather than private.
4414 (Output_data_got::replace_got_entry): New function.
4415 * output.cc (Output_data_got::replace_got_entry): New function.
4416 * powerpc.cc (class Powerpc_relobj): New.
4417 (class Powerpc_relocate_functions): Delete all psymval variants or
4418 convert to value,addend type. Delete pcrela, pcrela_unaligned.
4419 Implement _ha functions using corresponding _hi function.
4420 (Powerpc_relobj::find_special_sections): New function.
4421 (Target_powerpc::do_make_elf_object): New function.
4422 (class Output_data_got_powerpc): New.
4423 (class Output_data_glink): New.
4424 (class Powerpc_scan_relocatable_reloc): New.
4425 Many more changes througout file.
4426
3c892704
NC
44272012-08-09 Nick Clifton <nickc@redhat.com>
4428
4429 * po/vi.po: Updated Vietnamese translation.
4430
82435b3b
ILT
44312012-08-07 Ian Lance Taylor <iant@google.com>
4432
4433 * layout.cc (Layout::add_target_dynamic_tags): If
4434 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
4435 plt_rel.
4436
a6dc81d2
NC
44372012-07-30 Nick Clifton <nickc@redhat.com>
4438
4439 * po/gold.pot: Updated template.
4440 * po/es.po: Updated Spanish translation.
4441
f1415016
CC
44422012-07-18 Cary Coutant <ccoutant@google.com>
4443
4444 PR gold/14344
4445 * configure.ac: Add check for -gpubnames support.
4446 * configure: Regenerate.
4447 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
4448 support; force -gno-pubnames.
4449 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
4450 support.
4451 (gdb_index_test_4): New test.
4452 * testsuite/Makefile.in: Regenerate.
4453 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
4454 * testsuite/gdb_index_test_2.sh: Likewise.
4455 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
4456 * testsuite/gdb_index_test_4.sh: New script.
4457 * testsuite/gdb_index_test_comm.sh: New script with common code;
4458 don't look for space after colon.
4459
b7fd7c37
ST
44602012-07-16 Sriraman Tallam <tmsriram@google.com>
4461
4462 * gold.cc (queue_middle_tasks): Update function order only after
4463 deferred objects due to plugins are processed.
4464
1f3212db
ILT
44652012-07-11 Ian Lance Taylor <iant@google.com>
4466
4467 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
4468 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
4469 (Target_arm::scan_reloc_for_stub): Likewise.
4470 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
4471 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
4472 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
4473 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
4474 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
4475
81c82a68
ILT
44762012-07-10 Dodji Seketeli <dodji@redhat.com>
4477 Ian Lance Taylor <iant@google.com>
4478
4479 PR gold/14309
4480 * configure.ac: Test whether std::tr1::hash<off_t> works.
4481 * gold.h: Add a specialization for std::tr1::hash<off_t> if
4482 needed.
4483 * output.h (class Output_fill): Add virtual destructor.
4484 * configure, config.in: Rebuild.
4485
eabc84f4
RM
44862012-06-22 Roland McGrath <mcgrathr@google.com>
4487
4488 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
4489
370e30b6
RÁE
44902012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
4491
4492 * plugin.cc (Plugin::load): Handle position independent executables.
4493
fb1b895d
CC
44942012-06-06 Cary Coutant <ccoutant@google.com>
4495
4496 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
4497 add .debug_macro.
4498 (lines_only_debug_sections): Likewise.
4499 (gdb_fast_lookup_sections): New static array.
4500 (is_gdb_debug_section): Rename formal parameter.
4501 (is_lines_only_debug_section): Likewise.
4502 (is_gdb_fast_lookup_section): New function.
4503 (Layout::include_section): Check for ".zdebug_" prefix; pass
4504 section name suffix to is_gdb_debug_section, et al.; check for
4505 fast-lookup sections when building .gdb_index.
4506 * options.h (--strip-debug-gdb): Update GDB version number.
4507
7c0640fa
CC
45082012-06-06 Cary Coutant <ccoutant@google.com>
4509
4510 * configure.ac: Add check for fallocate.
4511 * configure: Regenerate.
4512 * config.in: Regenerate.
4513
4514 * options.h (class General_options): Add --mmap-output-file and
4515 --posix-fallocate options.
4516 * output.cc: (posix_fallocate): Remove; replace with...
4517 (gold_fallocate): New function.
4518 (Output_file::map_no_anonymous): Call gold_fallocate.
4519 (Output_file::map): Check --mmap-output-file option.
4520
2a49eb69
DK
45212012-06-05 Jing Yu <jingyu@google.com>
4522
4523 * gold.h (textdomain): Add do {} to empty while(0).
4524 (bindtextdomain): Likewise.
4525
fad072ac
CC
45262012-06-04 Cary Coutant <ccoutant@google.com>
4527
4528 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
4529 has_dynsym_index.
4530
8cc69fb6
ST
45312012-05-25 Sriraman Tallam <tmsriram@google.com>
4532
4533 * symtab.cc (Symbol_table::define_special_symbol):
4534 Initialize *poldsym to prevent uninitialized variable errors.
4535
1be75daa
CC
45362012-05-23 Cary Coutant <ccoutant@google.com>
4537
4538 * layout.cc (Layout::section_name_mapping): Add rules to handle
4539 exact match on .data.rel.ro.local or .data.rel.ro.
4540 (Layout::output_section_name): Check for exact matches.
4541
9b689de0
CC
45422012-05-23 Cary Coutant <ccoutant@google.com>
4543
4544 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
4545 more carefully.
4546
b24fdbf5
CC
45472012-05-22 Cary Coutant <ccoutant@google.com>
4548
4549 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
4550 object before exporting symbol.
4551
e550e1a2
L
45522012-05-21 H.J. Lu <hongjiu.lu@intel.com>
4553
4554 * testsuite/tls_test.cc: Include "config.h" first.
4555 * testsuite/tls_test_c.c: Likewise.
4556
df7b86aa
NC
45572012-05-17 Daniel Richard G. <skunk@iskunk.org>
4558 Nick Clifton <nickc@redhat.com>
4559
4560 PR 14072
4561 * configure.in: Add check that sysdep.h has been included before
4562 any system header files.
4563 * configure: Regenerate.
4564 * config.in: Regenerate.
4565
1007b503
CC
45662012-05-14 Cary Coutant <ccoutant@google.com>
4567
4568 * layout.cc (Layout::make_output_section): Mark .tdata section
4569 as RELRO.
4570 * testsuite/relro_test.cc: Add a TLS variable.
4571
fd885f3a
L
45722012-05-10 H.J. Lu <hongjiu.lu@intel.com>
4573
4574 PR gold/14091
4575 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
4576 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
4577 R_X86_64_64.
4578
80f5885c
CC
45792012-05-08 Cary Coutant <ccoutant@google.com>
4580
4581 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
4582 (lines_only_debug_sections): Likewise.
4583
2e702c99
RM
45842012-05-02 Roland McGrath <mcgrathr@google.com>
4585
4586 * nacl.cc: New file.
4587 * nacl.h: New file.
4588 * Makefile.am (CCFILES, HFILES): Add them.
4589 * Makefile.in: Regenerate.
4590 * i386.cc (Output_data_plt_i386_nacl): New class.
4591 (Output_data_plt_i386_nacl_exec): New class.
4592 (Output_data_plt_i386_nacl_dyn): New class.
4593 (Target_i386_nacl): New class.
4594 (Target_selector_i386_nacl): New class.
4595 (target_selector_i386): Use it instead of Target_selector_i386.
4596 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
4597 (Target_x86_64_nacl): New class.
4598 (Target_selector_x86_64_nacl): New class.
4599 (target_selector_x86_64, target_selector_x32): Use it instead of
4600 Target_selector_x86_64.
4601 * arm.cc (Output_data_plt_arm_nacl): New class.
4602 (Target_arm_nacl): New class.
4603 (Target_selector_arm_nacl): New class.
4604 (target_selector_arm, target_selector_armbe): Use it instead of
4605 Target_selector_arm.
4606
4607 * target-select.cc (select_target): Take new Input_file* and off_t
4608 arguments, pass them on to recognize method of selector.
4609 * object.cc (make_elf_sized_object): Update caller.
4610 * parameters.cc (parameters_force_valid_target): Likewise.
4611 * incremental.cc (make_sized_incremental_binary): Likewise.
4612 * target-select.h: Update decl.
4613 (Target_selector::recognize): Take new Input_file* argument,
4614 pass it on to do_recognize.
4615 (Target_selector::do_recognize): Take new Input_file* argument.
4616 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
4617 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
4618 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
4619 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
4620
4621 * target.h (Target::Target_info): New members isolate_execinstr
4622 and rosegment_gap.
4623 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
4624 * arm.cc (Target_arm::arm_info): Update initializer.
4625 * i386.cc (Target_i386::i386_info): Likewise.
4626 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
4627 * sparc.cc (Target_sparc::sparc_info): Likewise.
4628 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
4629 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
4630 * layout.cc (Layout::attach_allocated_section_to_segment):
4631 Take new const Target* argument. If target->isolate_execinstr(), act
4632 like --rosegment.
4633 (Layout::find_first_load_seg): Take new const Target* argument;
4634 if target->isolate_execinstr(), reject PF_X segments.
4635 (Layout::relaxation_loop_body): Update caller.
4636 (Layout::set_segment_offsets): If target->isolate_execinstr(),
4637 reset file offset to zero when we hit LOAD_SEG, and then do a second
4638 loop over the segments before LOAD_SEG to reassign offsets after
4639 addresses have been determined. Handle target->rosegment_gap().
4640 (Layout::attach_section_to_segment): Take new const Target* argument;
4641 pass it to attach_allocated_section_to_segment.
4642 (Layout::make_output_section): Update caller.
4643 (Layout::attach_sections_to_segments): Take new const Target* argument;
4644 pass it to attach_section_to_segment.
4645 * gold.cc (queue_middle_tasks): Update caller.
4646 * layout.h (Layout): Update method decls with new arguments.
4647
4648 * arm.cc (Target_arm::Target_arm): Take optional argument for the
4649 Target_info pointer to use.
4650 (Target_arm::do_make_data_plt): New virtual method.
4651 (Target_arm::make_data_plt): New method that calls it.
4652 (Target_arm::make_plt_entry): Use it.
4653 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
4654 for the section alignment.
4655 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
4656 method.
4657 (Output_data_plt_arm::first_plt_entry_offset): Call it.
4658 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
4659 method.
4660 (Output_data_plt_arm::get_plt_entry_size): Call it.
4661 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
4662 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
4663 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
4664 method.
4665 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
4666 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
4667 method instead of sizeof(plt_entry).
4668 (Output_data_plt_arm::add_entry): Likewise.
4669 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
4670 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
4671 than static method.
4672 (Target_arm::plt_entry_size): Likewise.
4673 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
4674 Move to ...
4675 (Output_data_plt_arm_standard): ... here, new class.
4676 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
4677 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
4678 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
4679
4680 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
4681 Take additional argument for the PLT entry size.
4682 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
4683 Use get_plt_entry_size method rather than plt_entry_size variable.
4684 (Output_data_plt_x86_64::reserve_slot): Likewise.
4685 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
4686 (Output_data_plt_x86_64::add_entry): Likewise.
4687 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
4688 (Output_data_plt_x86_64::address_for_global): Likewise.
4689 (Output_data_plt_x86_64::address_for_local): Likewise.
4690 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4691 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
4692 Make method non-static.
4693 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
4694 method.
4695 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
4696 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
4697 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
4698 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
4699 virtual method.
4700 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
4701 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
4702 virtual method.
4703 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
4704 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
4705 virtual method.
4706 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
4707 (Output_data_plt_x86_64::plt_entry_size)
4708 (Output_data_plt_x86_64::first_plt_entry)
4709 (Output_data_plt_x86_64::plt_entry)
4710 (Output_data_plt_x86_64::tlsdesc_plt_entry)
4711 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
4712 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
4713 (Output_data_plt_x86_64_standard): ... here, new class.
4714 (Target_x86_64::Target_x86_64): Take optional argument for the
4715 Target_info pointer to use.
4716 (Target_x86_64::do_make_data_plt): New virtual method.
4717 (Target_x86_64::make_data_plt): New method to call it.
4718 (Target_x86_64::init_got_plt_for_update): Use that.
4719 Call this->plt_->add_eh_frame method here.
4720 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
4721 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
4722 rather than static method.
4723 (Target_x86_64::plt_entry_size): Likewise.
4724 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
4725 rather than plt_entry_size variable. Move guts of PLT filling to...
4726 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
4727 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
4728 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
4729
4730 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
4731 additional argument for the section alignment.
4732 Don't do add_eh_frame_for_plt here.
4733 (Output_data_plt_i386::first_plt_entry_offset): Make the method
4734 non-static. Use get_plt_entry_size method rather than plt_entry_size
4735 variable.
4736 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
4737 method.
4738 (Output_data_plt_i386::get_plt_entry_size): Call it.
4739 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
4740 (Output_data_plt_i386::add_eh_frame): New method to call it.
4741 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
4742 method.
4743 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
4744 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
4745 method.
4746 (Output_data_plt_i386::fill_plt_entry): New method to call it.
4747 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
4748 method instead of plt_entry_size.
4749 (Output_data_plt_i386::plt_entry_size)
4750 (Output_data_plt_i386::plt_eh_frame_fde_size)
4751 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
4752 (Output_data_plt_i386_standard): ... here, new class.
4753 (Output_data_plt_i386_exec): New class.
4754 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
4755 (Output_data_plt_i386_exec::first_plt_entry): ... here.
4756 (Output_data_plt_i386::exec_plt_entry): Move to ...
4757 (Output_data_plt_i386_exec::plt_entry): ... here.
4758 (Output_data_plt_i386_dyn): New class.
4759 (Output_data_plt_i386::first_plt_entry): Move to ...
4760 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
4761 (Output_data_plt_i386::dyn_plt_entry): Move to ...
4762 (Output_data_plt_i386_dyn::plt_entry): ... here.
4763 (Target_i386::Target_i386): Take optional argument for the Target_info
4764 pointer to use.
4765 (Target_i386::do_make_data_plt): New virtual method.
4766 (Target_i386::make_data_plt): New method to call it.
4767 (Target_i386::make_plt_section): Use that.
4768 Call this->plt_->add_eh_frame method here.
4769 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
4770 rather than plt_entry_size variable.
4771 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
4772 (Output_data_plt_i386::address_for_local): Likewise.
4773 (Output_data_plt_i386::do_write): Likewise.
4774 Move guts of PLT filling to...
4775 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
4776 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
4777 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
4778 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
4779
b9b9f2ee
CC
47802012-05-01 Cary Coutant <ccoutant@google.com>
4781
4782 * dwarf_reader.cc (Dwarf_die::read_attributes)
4783 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
4784 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
4785 * reduced_debug_output.cc
4786 (Output_reduced_debug_info_section::get_die_end): Remove
4787 DW_FORM_GNU_ref_index. Add default case.
4788
57923f48
MW
47892012-04-26 Mark Wielaard <mjw@redhat.com>
4790
4791 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
4792 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
4793 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
4794 DW_AT_high_pc as offset from DW_AT_low_pc.
4795
4796 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
4797 * testsuite/Makefile.in: Regenerate.
4798 * testsuite/gdb_index_test_3.c: New test source file.
4799 * testsuite/gdb_index_test_3.sh: New test source file.
4800
2c54b4f4
ILT
48012012-04-25 Ian Lance Taylor <iant@google.com>
4802
4803 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
4804 pointer.
4805 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
4806 as a class, not a struct.
4807 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
4808 (Target_arm::apply_cortex_a8_workaround): Likewise.
4809 * gc.h: Declare Reloc_types as a struct, not a class.
4810 * object.h: Declare Symbols_data as a struct.
4811 * reloc.h: Declare Read_relocs_data as a struct.
4812 * target.h: Declare Relocate_info as a struct.
4813
a5a5f7a3
DM
48142012-04-24 David S. Miller <davem@davemloft.net>
4815
4816 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
4817 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
4818 and R_SPARC_WPLT30.
4819
f038d496
CC
48202012-04-24 Cary Coutant <ccoutant@google.com>
4821
4822 * incremental-dump.cc (find_input_containing_global): Replace
4823 magic number with symbolic constant.
4824 (dump_incremental_inputs): Update version number.
4825 * incremental.cc (Output_section_incremental_inputs): Update version
4826 number; import symbolic constants from Incremental_inputs_reader.
4827 (Incremental_inputs::create_data_sections): Align relocations
4828 section correctly for 64-bit targets.
4829 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
4830 constants; add padding.
4831 (Output_section_incremental_inputs::write_header): Add assert for
4832 header_size.
4833 (Output_section_incremental_inputs::write_input_files): Add assert
4834 for input_entry_size.
4835 (Output_section_incremental_inputs::write_info_blocks): Add padding;
4836 add assert for object_info_size, input_section_entry_size,
4837 global_sym_entry_size.
4838 * incremental.h (Incremental_inputs_reader): Add symbolic constants
4839 for data structure sizes; use them.
4840 (Incremental_input_entry_reader): Import symbolic constants from
4841 Incremental_inputs_reader; use them.
4842
a4d85145
DM
48432012-04-23 David S. Miller <davem@davemloft.net>
4844
4845 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
4846 and elf_flags_set_.
4847 (Target_sparc::Target_sparc): Initialize new fields.
4848 (Target_sparc::do_make_elf_object): New function.
4849 (Target_sparc::do_adjust_elf_header): New function.
4850
1d509098
CC
48512012-04-23 Cary Coutant <ccoutant@google.com>
4852
4853 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
4854 CU range table of gdb index.
4855
7ebeff7f
DM
48562012-04-20 David S. Miller <davem@davemloft.net>
4857
4858 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
4859 instead of false.
4860
13cf9988
DM
48612012-04-16 David S. Miller <davem@davemloft.net>
4862
2a1079e8
DM
4863 * sparc.cc (Target_sparc::got_address): New function.
4864 (Sparc_relocate_functions::gdop_hix22): New function.
4865 (Sparc_relocate_functions::gdop_lox10): New function.
4866 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
4867 relocs.
4868 (Target_sparc::Scan::local): Likewise if the global symbol is not
4869 preemptible and is not IFUNC.
4870 (Target_sparc::Relocate::relocate): Perform GOTDATA code
4871 transformations for local and non-preemptible non-IFUNC global
4872 symbols.
4873
0bc964fc
DM
4874 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
4875 writing out 64-bit part of ranges.
4876
661d7a80
DM
4877 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
4878 -fpic and -fpie respectively.
4879 * Makefile.in: Regenerate.
4880
8c2bf391
DM
4881 * sparc.cc (class Target_sparc): Add rela_ifunc_.
4882 (Target_sparc::Target_sparc): Initialize new field.
4883 (Target_sparc::do_plt_section_for_global): New function.
4884 (Target_sparc::do_plt_section_for_local): New function.
4885 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
4886 (Target_sparc::make_plt_section): New function, broken out of
4887 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
4888 (Target_sparc::make_plt_entry): Call make_plt_section.
4889 (Target_sparc::make_local_ifunc_plt_entry): New function.
4890 (Target_sparc::rela_ifunc_section): New function.
4891 (Target_sparc::plt_section): Remove const.
4892 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
4893 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
4894 and ifunc_count_ fields.
4895 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
4896 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
4897 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
4898 (Output_data_plt_sparc::rela_ifunc): New function.
4899 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
4900 (Output_data_plt_sparc::has_ifunc_section): New function.
4901 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
4902 (Output_data_plt_sparc::address_for_global): New function.
4903 (Output_data_plt_sparc::address_for_local): New function.
4904 (Output_data_plt_sparc::plt_index_to_offset): New function.
4905 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
4906 and entry_count.
4907 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
4908 entry_count.
4909 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
4910 R_SPARC_JMP_IREL to switch.
4911 (Target_sparc::Scan::check_non_pic): Likewise.
4912 (Target_sparc::Scan::local): Handle IFUNC symbols.
4913 (Target_sparc::Scan::local): Likewise.
4914 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
4915 and plt_address_for_local.
4916 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
4917 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
4918
13cf9988
DM
4919 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
4920 (class Output_data_reloc): Adjust calls to Output_reloc_type.
4921 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
4922 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
4923 global relocs too.
4924 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
4925 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
4926 calls.
4927 * sparc.cc (Target_sparc::Scan::global): Likewise.
4928 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4929
31821be0
CC
49302012-04-16 Cary Coutant <ccoutant@google.com>
4931
4932 * archive.cc (Library_base::should_include_member): Check for
4933 --export-dynamic-symbol.
4934 * options.h (class General_options): Add --export-dynamic-symbol.
4935 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
4936 --export-dynamic-symbol.
4937 (Symbol_table::gc_mark_undef_symbols): Likewise.
4938 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
4939
2615994e
DM
49402012-04-12 David S. Miller <davem@davemloft.net>
4941
4942 * sparc.cc (Reloc::wdisp10): New relocation method.
4943 (Reloc::h34): Likewise.
4944 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
4945 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
4946 R_SPARC_WDISP10.
4947 (Target_sparc::Scan::local): Likewise.
4948 (Target_sparc::Scan::global): Likewise.
4949 (Target_sparc::Relocate::relocate): Likewise.
4950
6782735d
CC
49512012-04-09 Cary Coutant <ccoutant@google.com>
4952
4953 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
4954 low_pc == 0.
4955
8c7a0b00
ILT
49562012-04-06 Ian Lance Taylor <iant@google.com>
4957
4958 * timer.cc: #include <unistd.h>.
4959
58797674
RM
49602012-04-06 Roland McGrath <mcgrathr@google.com>
4961
4962 * configure.in (AC_CHECK_HEADERS): Add locale.h.
4963 * config.in: Regenerate.
4964 * configure: Regenerate.
4965
44350750
NC
49662012-04-05 Nick Clifton <nickc@redhat.com>
4967
4968 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
4969 (AM_LC_MESSAGES): Add.
4970 * aclocal.m4: Regenerate.
4971 * config.in: Regenerate.
4972 * configure: Regenerate.
4973
c1027032
CC
49742012-03-21 Cary Coutant <ccoutant@google.com>
4975
4976 * Makefile.am: Add gdb-index.cc, gdb-index.h.
4977 * Makefile.in: Regenerate.
4978 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
4979 (Sized_elf_reloc_mapper::symbol_section): New function.
4980 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
4981 (make_elf_reloc_mapper): New function.
4982 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
4983 (Dwarf_abbrev_table::do_read_abbrevs): New function.
4984 (Dwarf_abbrev_table::do_get_abbrev): New function.
4985 (Dwarf_ranges_table::read_ranges_table): New function.
4986 (Dwarf_ranges_table::read_range_list): New function.
4987 (Dwarf_pubnames_table::read_section): New function.
4988 (Dwarf_pubnames_table::read_header): New function.
4989 (Dwarf_pubnames_table::next_name): New function.
4990 (Dwarf_die::Dwarf_die): New function.
4991 (Dwarf_die::read_attributes): New function.
4992 (Dwarf_die::skip_attributes): New function.
4993 (Dwarf_die::set_name): New function.
4994 (Dwarf_die::set_linkage_name): New function.
4995 (Dwarf_die::attribute): New function.
4996 (Dwarf_die::string_attribute): New function.
4997 (Dwarf_die::int_attribute): New function.
4998 (Dwarf_die::uint_attribute): New function.
4999 (Dwarf_die::ref_attribute): New function.
5000 (Dwarf_die::child_offset): New function.
5001 (Dwarf_die::sibling_offset): New function.
5002 (Dwarf_info_reader::check_buffer): New function.
5003 (Dwarf_info_reader::parse): New function.
5004 (Dwarf_info_reader::do_parse): New function.
5005 (Dwarf_info_reader::do_read_string_table): New function.
5006 (Dwarf_info_reader::lookup_reloc): New function.
5007 (Dwarf_info_reader::get_string): New function.
5008 (Dwarf_info_reader::visit_compilation_unit): New function.
5009 (Dwarf_info_reader::visit_type_unit): New function.
5010 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
5011 Sized_elf_reloc_mapper.
5012 (Sized_dwarf_line_info::symbol_section): Remove function.
5013 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
5014 (Sized_dwarf_line_info::read_line_mappings): Remove object
5015 parameter, adjust callers.
5016 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
5017 * dwarf_reader.h: Include <sys/types.h>.
5018 (class Track_relocs): Remove forward declaration.
5019 (class Elf_reloc_mapper): New class.
5020 (class Sized_elf_reloc_mapper): New class.
5021 (class Dwarf_abbrev_table): New class.
5022 (class Dwarf_range_list): New class.
5023 (class Dwarf_ranges_table): New class.
5024 (class Dwarf_pubnames_table): New class.
5025 (class Dwarf_die): New class.
5026 (class Dwarf_info_reader): New class.
5027 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
5028 (Sized_dwarf_line_info::symbol_section): Remove member function.
5029 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
5030 base class.
5031 * gdb-index.cc: New source file.
5032 * gdb-index.h: New source file.
5033 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
5034 and .debug_types sections, call Layout::add_to_gdb_index.
5035 (Sized_relobj_incr::do_section_name): Implement.
5036 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
5037 return type; Implement.
5038 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
5039 return type.
5040 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
5041 parameter list and return type.
5042 (Sized_incr_dynobj::do_section_contents): Likewise.
5043 * layout.cc: Include gdb-index.h.
5044 (Layout::Layout): Initialize gdb_index_data_.
5045 (Layout::init_fixed_output_section): Check for .gdb_index section.
5046 (Layout::add_to_gdb_index): New function. Instantiate.
5047 * layout.h: Add forward declaration for class Gdb_index.
5048 (Layout::add_to_gdb_index): New member function.
5049 (Layout::gdb_index_data_): New data member.
5050 * main.cc: Include gdb-index.h.
5051 (main): Print statistics for gdb index.
5052 * object.cc (Object::section_contents): Move code into
5053 do_section_contents.
5054 (need_decompressed_section): Check for sections needed when building
5055 gdb index.
5056 (build_compressed_section_map): Likewise.
5057 (Sized_relobj_file::do_read_symbols): Need local symbols when building
5058 gdb index.
5059 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
5060 sections; call Layout::add_to_gdb_index.
5061 (Sized_relobj_file::do_decompressed_section_contents): Call
5062 do_section_contents directly.
5063 * object.h (Object::do_section_contents): Adjust parameter list and
5064 return type.
5065 (Object::do_decompressed_section_contents): Call do_section_contents
5066 directly.
5067 (Sized_relobj_file::do_section_contents): Adjust parameter list and
5068 return type.
5069 * options.h (class General_options): Add --gdb-index option.
5070 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
5071 list and return type.
5072 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
5073 * reloc.h (Track_relocs::checkpoint): New function.
5074 (Track_relocs::reset): New function.
5075
5076 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
5077 New test cases.
5078 * testsuite/Makefile.in: Regenerate.
5079 * testsuite/gdb_index_test.cc: New test source file.
5080 * testsuite/gdb_index_test_1.sh: New test source file.
5081 * testsuite/gdb_index_test_2.sh: New test source file.
5082
647f1574
DK
50832012-03-19 Doug Kwan <dougkwan@google.com>
5084
5085 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 5086 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
5087 __exidx_start and __exidx_end. Make symbol table parameter
5088 anonymous as it is not used.
5089 * gold.cc (queue_middle_tasks): Call target hook to define any
5090 target-specific symbols.
5091 * target.h (Target::define_standard_symbols): New method.
5092 (Target::do_define_standard_symbols): Same.
5093 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
5094 * testsuite/Makefile.in: Regenerate.
5095 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
5096 and __exidx_end.
5097 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
5098 relocations are generated for __exidx_start and __exidx_end.
5099
7c6109da
DK
51002012-03-16 Doug Kwan <dougkwan@google.com>
5101
5102 * testsuite/Makefile.am: Disable test initpri3b.
5103 * testsuite/Makefile.in: Regenerate.
5104
7b8957f8
DK
51052012-03-15 Doug Kwan <dougkwan@google.com>
5106
5107 * arm.cc (Target_arm::got_section): Make .got section read-only
5108 if -z now is given.
5109
14dc9ef7
ILT
51102012-03-15 Ian Lance Taylor <iant@google.com>
5111
5112 PR gold/13850
5113 * layout.cc (Layout::make_output_section): Correctly mark
5114 SHT_INIT_ARRAY, et. al., as relro.
5115
fa40b62a
DK
51162012-03-14 Doug Kwan <dougkwan@google.com>
5117
5118 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
5119 dynamic relocations for protected symbols in shared objects.
5120
fd325007
ILT
51212012-03-13 Ian Lance Taylor <iant@google.com>
5122
5123 * resolve.cc (Symbol_table::resolve): When merging common symbols,
5124 keep the larger alignment.
5125
e8dd54e1
CC
51262012-03-12 Cary Coutant <ccoutant@google.com>
5127
5128 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
5129 handling of DW_LNE_define_file.
5130
feb5f3b0
CC
51312012-03-12 Cary Coutant <ccoutant@google.com>
5132
5133 * reduced_debug_output.cc
5134 (Output_reduced_debug_info_section::get_die_end): Add new FORM
5135 codes to switch.
5136
a1fb4256
CC
51372012-02-29 Cary Coutant <ccoutant@google.com>
5138
5139 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
5140
5dd8762a
CC
51412012-02-29 Cary Coutant <ccoutant@google.com>
5142
5143 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
5144 Call Object::decompressed_section_contents.
5145 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
5146 New dtor.
5147 (Sized_dwarf_line_info::buffer_start_): New data member.
5148 * merge.cc (Output_merge_data::do_add_input_section): Call
5149 Object::decompressed_section_contents.
5150 (Output_merge_string::do_add_input_section): Likewise.
5151 * object.cc (need_decompressed_section): New function.
5152 (build_compressed_section_map): Decompress sections needed later.
5153 (Sized_relobj_file::do_decompressed_section_contents): New function.
5154 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5155 * object.h (Object::decompressed_section_contents): New function.
5156 (Object::discard_decompressed_sections): New function.
5157 (Object::do_decompressed_section_contents): New function.
5158 (Object::do_discard_decompressed_sections): New function.
5159 (Compressed_section_info): New type.
5160 (Compressed_section_map): Include decompressed section contents.
5161 (Sized_relobj_file::do_decompressed_section_contents): New function.
5162 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5163
7b5de7ee
CC
51642012-02-16 Cary Coutant <ccoutant@google.com>
5165
5166 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
5167 * testsuite/Makefile.in: Regenerate.
5168
f9fa4a63
CC
51692012-02-14 Cary Coutant <ccoutant@google.com>
5170
5171 * options.cc (General_options::finalize): Disallow -pie and -static.
5172
2c175ebc
DK
51732012-02-03 Doug Kwan <dougkwan@google.com>
5174
5175 * arm.cc (Arm_relocate_functions::abs8,
5176 Arm_relocate_functions::abs16): Use
5177 Bits::has_signed_unsigned_overflow32.
5178 (Arm_relocate_functions::thm_abs8): Correct range of
5179 overflow check.
5180 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
5181 in assertions.
5182
90cff06f
DK
51832012-02-02 Doug Kwan <dougkwan@google.com>
5184
5185 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
5186 position independent outputs, not just shared objects.
5187
63887f3d
L
51882012-01-30 H.J. Lu <hongjiu.lu@intel.com>
5189
5190 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
5191 * configure: Regenerated.
5192
bef2b434
ILT
51932012-01-27 Ian Lance Taylor <iant@google.com>
5194
5195 * reloc.h (Bits): New class with static functions, copied from
5196 namespace utils in arm.cc.
5197 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
5198 instead.
5199
c335b55d
L
52002012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5201
5202 * incremental.cc (write_info_blocks): Correct relocation offset.
5203
41194d9f
L
52042012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5205
5206 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
5207 (Relocate::tls_gd_to_le): Likewise.
5208
1bae613c
L
52092012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5210
5211 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
5212
24482ca0
L
52132012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5214
5215 * configure.ac: Check if -mcmodel=medium works.
5216 * configure: Regenerated.
5217
c2c7840a
CC
52182012-01-24 Cary Coutant <ccoutant@google.com>
5219
5220 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
5221 definition and ...
5222 (read_unsigned_LEB_128_x): ... this new function.
5223 (read_signed_LEB_128): Replaced with inline definition and ...
5224 (read_signed_LEB_128_x): ... this new function.
5225 * int_encoding.h (read_unsigned_LEB_128_x): New function.
5226 (read_unsigned_LEB_128): Add inline definition.
5227 (read_signed_LEB_128_x): New function.
5228 (read_signed_LEB_128): Add inline definition.
5229 * testsuite/Makefile.am (leb128_unittest): New unit test.
5230 * testsuite/Makefile.in: Regenerate.
5231 * testsuite/leb128_unittest.cc: New unit test.
5232
833de760 52332012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
5234
5235 PR gold/13617
5236 * i386.cc (Target_i386::do_code_fill): When using a jmp
5237 instruction, pad with nop instructions.
5238 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5239
618d6666
L
52402012-01-22 H.J. Lu <hongjiu.lu@intel.com>
5241
5242 * x86_64.cc (gc_process_relocs): Add typename on types used in
5243 template.
5244 (scan_relocs): Likewise.
5245 (relocate_section): Likewise.
5246 (apply_relocation): Likewise.
5247
3660ff06
L
52482012-01-10 H.J. Lu <hongjiu.lu@intel.com>
5249
5250 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
5251 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
5252 under x32.
5253
fc51264f
L
52542012-01-09 H.J. Lu <hongjiu.lu@intel.com>
5255
5256 * x86_64.cc: Initial support for x32.
5257
dd74ae06
CC
52582012-01-03 Cary Coutant <ccoutant@google.com>
5259
5260 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
5261 Use abstract base class for GOT.
5262 * gold/output.h (class Output_data_got_base): New abstract base class.
5263 (class Output_data_got): Derive from new base class, adjust ctors.
5264 (Output_data_got::reserve_slot): Make virtual; rename to
5265 do_reserve_slot; Adjust callers.
5266 * gold/target.h (Sized_target::init_got_plt_for_update): Return
5267 pointer to abstract base class.
5268 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
5269
83896202
ILT
52702011-12-18 Ian Lance Taylor <iant@google.com>
5271
5272 * object.h (Relobj::local_symbol_value): New function.
5273 (Relobj::local_plt_offset): New function.
5274 (Relobj::local_has_got_offset): New function.
5275 (Relobj::local_got_offset): New function.
5276 (Relobj::set_local_got_offset): New function.
5277 (Relobj::do_local_symbol_value): New pure virtual function.
5278 (Relobj::do_local_plt_offset): Likewise.
5279 (Relobj::do_local_has_got_offset): Likewise.
5280 (Relobj::do_local_got_offset): Likewise.
5281 (Relobj::do_set_local_got_offset): Likewise.
5282 (Sized_relobj::do_local_has_got_offset): Rename from
5283 local_has_got_offset.
5284 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
5285 (Sized_relobj::do_set_local_got_offset): Rename from
5286 set_local_got_offset.
5287 (Sized_relobj_file::do_local_plt_offset): Rename from
5288 local_plt_offset.
5289 (Sized_relobj_file::do_local_symbol_value): New function.
5290 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
5291 local_plt_offset.
5292 * output.cc (Output_data_got::Got_entry::write): Change object to
5293 Relobj. Use local_symbol_value.
5294 (Output_data_got::add_global_with_rel): Change rel_dyn to
5295 Output_data_reloc_generic*. Use add_global_generic.
5296 (Output_data_got::add_global_with_rela): Remove. Change all
5297 callers to use add_global_with_rel.
5298 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
5299 Output_data_reloc_generic*. Use add_global_generic.
5300 (Output_data_got::add_global_pair_with_rela): Remove. Change all
5301 callers to use add_global_pair_with_rel.
5302 (Output_data_got::add_local): Change object to Relobj*.
5303 (Output_data_got::add_local_plt): Likewise.
5304 (Output_data_got::add_local_with_rel): Change object to Relobj*,
5305 change rel_dyn to Output_data_reloc_generic*. Use
5306 add_local_generic.
5307 (Output_data_got::add_local_with_rela): Remove. Change all
5308 callers to use all_local_with_rel.
5309 (Output_data_got::add_local_pair_with_rel): Change object to
5310 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
5311 add_output_section_generic.
5312 (Output_data_got::add_local_pair_with_rela): Remove. Change all
5313 callers to use add_local_pair_with_rel.
5314 (Output_data_got::reserve_local): Change object to Relobj*.
5315 * output.h: (class Output_data_reloc_generic): Add pure virtual
5316 declarations for add_global_generic, add_local_generic,
5317 add_output_section_generic.
5318 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
5319 functions for Output_data_reloc_generic. Update declarations for
5320 changes listed in output.cc.
5321 (class Output_data_got): Change template parameter to got_size.
5322 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
5323 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
5324 function.
5325 (Sized_relobj_incr::do_local_plt_offset): New function.
5326 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
5327 add_global_generic.
5328
76677ad0
CC
53292011-12-17 Cary Coutant <ccoutant@google.com>
5330
5331 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
5332 * resolve.cc (Symbol_table::resolve): Likewise.
5333 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
5334 arrays.
5335 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5336
8b8dd8d5
ILT
53372011-12-16 Ian Lance Taylor <iant@google.com>
5338
5339 * output.h (Output_data_reloc_generic::add): Only call
5340 add_dynamic_reloc if this is a dynamic reloc section.
5341
d55525b9
L
53422011-12-15 H.J. Lu <hongjiu.lu@intel.com>
5343
5344 PR gold/13505
5345 * target-reloc.h (apply_relocation): Replace <64, false> with
5346 <size, big_endian>.
5347
ff81c7c1
NC
53482011-11-25 Nick Clifton <nickc@redhat.com>
5349
5350 * po/it.po: New Italian translation.
5351
628f39be
SA
53522011-11-17 Sterling Augustine <saugustine@google.com>
5353
5354 * script.cc (script_include_directive): Implement.
5355 (read_script_file): New local variables name and search_path. Update
5356 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
5357 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
5358 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
5359
98ef3ea4
SA
53602011-11-11 Sterling Augustine <saugustine@google.com>
5361
5362 * yyscript.y (section_cmd): Add support for INCLUDE directive.
5363 (file_or_sections_cmd): Likewise.
5364
f4a8b6d7
DK
53652011-11-11 Doug Kwan <dougkwan@google.com>
5366
5367 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
5368 if --just-symbols is given.
5369
29ab395d
DK
53702011-11-10 Doug Kwan <dougkwan@google.com>
5371
5372 PR gold/13362
5373 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
5374 when processing data relocs.
5375 * reloc.h (Relocate_functions::rel_unaligned): New method.
5376 (Relocate_functions::pcrel_unaligned): Ditto.
5377 (Relocate_functions::rel32_unaligned): Ditto.
5378 (Relocate_functions::pcrel32_unaligned): Ditto.
5379
2c339f71
DK
53802011-11-09 Doug Kwan <dougkwan@google.com>
5381
5382 PR gold/13362
5383 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
5384 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
5385 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
5386 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5387 (Relocate_functions::rel_unaligned): New.
5388 (Relocate_functions::rel32_unaligned): New.
5389 * target-reloc.h (relocate_for_relocatable): Add code to handle
5390 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5391 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
5392 arm_unaligned_reloc_r): New targets.
5393 * testsuite/Makefile.in: Regenerate.
5394 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
5395 linking.
5396
3f3cddf1
ILT
53972011-11-02 Ian Lance Taylor <iant@google.com>
5398
5399 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
5400 NATIVE_LINKER.
5401 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
5402 * options.cc (General_options::finalize): Use library search path
5403 from configure script if specified. If not native and no sysroot,
5404 only search TOOLLIBDIR.
5405 * options.h (Search_directory::Search_directory): Change name to
5406 const std::string&.
5407 (General_options::add_to_library_path_with_sysroot): Change arg to
5408 const std::string&.
5409 * configure, Makefile.in, config.in: Rebuild.
5410
a8e2273b
ILT
54112011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5412
5413 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
5414 we are working around the ARM1176 Erratum.
5415 * options.h (General_options::fix_arm1176): Add option.
5416 * testsuite/Makefile.am: Add testcases, and keep current ones
5417 working.
5418 * testsuite/Makefile.in: Regenerate.
5419 * testsuite/arm_fix_1176.s: New file.
5420 * testsuite/arm_fix_1176.sh: Likewise.
5421
cd6eab1c
ILT
54222011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5423
5424 * arm.cc (Target_arm::Target_arm): Remove initialisation of
5425 may_use_blx_.
5426 (Target_arm::may_use_blx): Remove method.
5427 (Target_arm::set_may_use_blx): Likewise.
5428 (Target_arm::may_use_v4t_interworking): New method.
5429 (Target_arm::may_use_v5t_interworking): Likewise.
5430 (Target_arm::may_use_blx_): Remove member variable.
5431 (Arm_relocate_functions::arm_branch_common): Check for v5T
5432 interworking.
5433 (Arm_relocate_functions::thumb_branch_common): Likewise.
5434 (Reloc_stub::stub_type_for_reloc): Likewise.
5435 (Target_arm::do_finalize_sections): Correct interworking checks.
5436 * testsuite/Makefile.am: Add new tests.
5437 * testsuite/Makefile.in: Regenerate.
5438 * testsuite/arm_farcall_arm_arm.s: New test.
5439 * testsuite/arm_farcall_arm_arm.sh: Likewise.
5440 * testsuite/arm_farcall_arm_thumb.s: Likewise.
5441 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
5442 * testsuite/arm_farcall_thumb_arm.s: Likewise.
5443 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
5444 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
5445 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
5446
286adcf4
CC
54472011-10-31 Cary Coutant <ccoutant@google.com>
5448
5449 PR gold/13023
5450 * expression.cc (Expression::eval_with_dot): Add
5451 is_section_dot_assignment parameter.
5452 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
5453 absolute and assigning to dot within a section.
5454 * script-sections.cc
5455 (Output_section_element_assignment::set_section_addresses): Pass
5456 dot_section to set_if_absolute.
5457 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
5458 as is_section_dot_assignment flag to eval_with_dot.
5459 (Output_section_element_dot_assignment::set_section_addresses):
5460 Likewise.
5461 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
5462 parameter. Also set value if relative to dot_section; set the
5463 symbol's output_section.
5464 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
5465 parameter. Adjust all callers.
5466 (Expression::eval_maybe_dot): Likewise.
5467 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
5468 Adjust all callers.
5469 * testsuite/script_test_2.t: Test assignment of an absolute value
5470 to dot within an output section element.
5471
9634ed06
CC
54722011-10-31 Cary Coutant <ccoutant@google.com>
5473
5474 * options.h (class General_options): Add --[no-]gnu-unique options.
5475 * symtab.cc (Symbol_table::sized_write_globals): Convert
5476 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
5477
de4101c7
CC
54782011-10-31 Cary Coutant <ccoutant@google.com>
5479
5480 PR gold/13359
5481 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
5482 unnecessary assertion.
5483 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
5484
7257cc92
ST
54852011-10-31 Sriraman Tallam <tmsriram@google.com>
5486
5487 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5488 gc_mark_symbol.
5489 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5490 gc_mark_symbol.
5491 Change to just keep the section associated with symbol.
5492 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
5493 they are externally visible and --export-dynamic is turned on.
5494 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
5495
bfc34b3f
ILT
54962011-10-19 Ian Lance Taylor <iant@google.com>
5497
5498 PR gold/13163
5499 * script-sections.cc
5500 (Output_section_element_dot_assignment::needs_output_section): New
5501 function.
5502
ea0d8c47
ILT
55032011-10-19 Ian Lance Taylor <iant@google.com>
5504
5505 PR gold/13204
5506 * layout.cc (Layout::segment_precedes): Don't assert failure if a
5507 --section-start option was seen.
5508 * options.h (General_options::any_section_start): New function.
5509
abd242a9
DM
55102011-10-18 David S. Miller <davem@davemloft.net>
5511
5512 PR binutils/13301
5513 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
5514 member to track relocation locations that have moved during TLS
5515 reloc optimizations.
5516 (Target_sparc::Relocate::Relocate): Initialize to NULL.
5517 (Target_sparc::Relocate::relocate): Adjust view down by 4
5518 bytes if it matches reloc_adjust_addr_.
5519 (Target_sparc::Relocate::relocate_tls): Always move the
5520 __tls_get_addr call delay slot instruction forward 4 bytes when
5521 performing relaxation.
5522
bab9090f
CC
55232011-10-18 Cary Coutant <ccoutant@google.com>
5524
5525 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
5526 (Output_file::map_no_anonymous): Check for non-zero
5527 return code from posix_fallocate.
5528
f7c5b166
CC
55292011-10-17 Cary Coutant <ccoutant@google.com>
5530
5531 PR gold/13245
5532 * plugin.cc (is_visible_from_outside): Check for symbols
5533 referenced from dynamic objects.
5534 * resolve.cc (Symbol_table::resolve): Don't count references
5535 from dynamic objects as references from real ELF files.
5536 * testsuite/plugin_test_2.sh: Adjust expected result.
5537
b490c0bb
CC
55382011-10-17 Cary Coutant <ccoutant@google.com>
5539
5540 * gold.cc: Include timer.h.
5541 (queue_middle_tasks): Stamp time.
5542 (queue_final_tasks): Likewise.
5543 * main.cc (main): Store timer in parameters. Print timers
5544 for each pass.
5545 * parameters.cc (Parameters::Parameters): Initialize timer_.
5546 (Parameters::set_timer): New function.
5547 (set_parameters_timer): New function.
5548 * parameters.h (Parameters::set_timer): New function.
5549 (Parameters::timer): New function.
5550 (Parameters::timer_): New data member.
5551 (set_parameters_timer): New function.
5552 * timer.cc (Timer::stamp): New function.
5553 (Timer::get_pass_time): New function.
5554 * timer.h (Timer::stamp): New function.
5555 (Timer::get_pass_time): New function.
5556 (Timer::pass_times_): New data member.
5557
f475cf7b
CC
55582011-10-17 Cary Coutant <ccoutant@google.com>
5559
5560 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
5561 task for members of lib groups.
5562
cdd7e244
CC
55632011-10-17 Cary Coutant <ccoutant@google.com>
5564
5565 PR gold/13288
4f95c8b4 5566 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
5567 (File_read::make_view): Move bounds check (replace with assert)...
5568 (File_read::find_or_make_view): ... to here.
5569
dfb45471
CC
55702011-10-12 Cary Coutant <ccoutant@google.com>
5571
4f95c8b4 5572 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
5573 ::read returns less than requested size.
5574
53bbcc1b
CC
55752011-10-10 Cary Coutant <ccoutant@google.com>
5576
4f95c8b4 5577 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
5578 Initialize defined_count_.
5579 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
5580 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
5581 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
5582 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
5583 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 5584 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
5585 member.
5586 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 5587 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
5588 Return zeroes instead of internal error.
5589
397b129b
CC
55902011-10-10 Cary Coutant <ccoutant@google.com>
5591
5592 PR gold/13249
4f95c8b4 5593 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 5594 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 5595 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
5596 (Output_reloc::type_): Adjust size of bit field.
5597 (Output_reloc::use_plt_offset_): New bit field.
5598 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
5599 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
5600 flag. Adjust all callers.
4f95c8b4 5601 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
5602 creating RELATIVE relocations.
5603
d5698657
NC
56042011-10-10 Nick Clifton <nickc@redhat.com>
5605
5606 * po/es.po: Updated Spanish translation.
5607 * po/fi.po: Updated Finnish translation.
5608
6a59a5c2
DN
56092011-10-03 Diego Novillo <dnovillo@google.com>
5610
5611 * options.cc (parse_uint): Fix dereference of RETVAL.
5612
f0558624
ST
56132011-09-29 Sriraman Tallam <tmsriram@google.com>
5614
5615 * layout.h (section_order_map_): New member.
5616 (get_section_order_map): New member function.
5617 * output.cc (Output_section::add_input_section): Check for patterns
5618 only when --section-ordering-file is specified.
5619 * gold.cc (queue_middle_tasks): Delay updating order of sections till
5620 output_sections have been formed.
5621 * layout.cc (Layout_Layout): Initialize section_order_map_.
5622 * plugin.cc (update_section_order): Store order in order_map. Do not
5623 update the order.
5624 * testsuite/Makefile.am: Add test case for plugin_final_layout.
5625 * testsuite/Makefile.in: Regenerate.
5626 * testsuite/plugin_section_order.c: New file.
5627 * testsuite/plugin_final_layout.cc: New file.
5628 * testsuite/plugin_final_layout.sh: New file.
5629
a7dac153
CC
56302011-09-29 Cary Coutant <ccoutant@google.com>
5631
4f95c8b4 5632 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 5633 Check for NULL.
4f95c8b4 5634 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
5635 symbols during incremental update.
5636 (Symbol_table::add_from_dynobj): Likewise.
5637
eebd87a5
ILT
56382011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5639 Ian Lance Taylor <iant@google.com>
5640
5641 * symtab.cc (Symbol_table::define_special_symbol): Always
5642 canonicalize version string.
5643
403a3331
CC
56442011-09-26 Cary Coutant <ccoutant@google.com>
5645
4f95c8b4
CC
5646 * gold.cc (queue_initial_tasks): Move option checks ...
5647 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
5648 some options; make others fatal.
5649
235061c2
CC
56502011-09-26 Cary Coutant <ccoutant@google.com>
5651
5652 gcc PR lto/47247
5653 * plugin.cc (get_symbols_v2): New function.
5654 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
5655 (is_referenced_from_outside): New function.
5656 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
5657 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
5658 (get_symbols): Pass version parameter.
5659 (get_symbols_v2): New function.
5660 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
5661 parameter.
5662 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
5663 (onload): Add LDPT_GET_SYMBOLS_V2.
5664 (all_symbols_read_hook): Use get_symbols_v2; check for
5665 LDPR_PREVAILING_DEF_IRONLY_EXP.
5666 * testsuite/plugin_test_3.sh: Update expected results.
5667
dc87f620
ILT
56682011-09-23 Simon Baldwin <simonb@google.com>
5669
5670 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
5671 configuration options.
5672 * configure: Regenerate.
5673 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
5674 * Makefile.in: Regenerate.
5675 * testsuite/Makefile.in: Regenerate.
5676
a8279f82
ST
56772011-09-19 Sriraman Tallam <tmsriram@google.com>
5678
5679 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
5680
0c9350c8
CC
56812011-09-19 Cary Coutant <ccoutant@google.com>
5682
5683 * incremental.cc (can_incremental_update): Fix typo in comment.
5684 * incremental.h (can_incremental_update): Likewise.
5685
aa06ae28
CC
56862011-09-18 Cary Coutant <ccoutant@google.com>
5687
5688 * incremental.cc (can_incremental_update): New function.
5689 * incremental.h (can_incremental_update): New function.
5690 * layout.cc (Layout::init_fixed_output_section): Call it.
5691 (Layout::make_output_section): Don't allow patch space in .eh_frame.
5692 * object.cc (Sized_relobj_file::do_layout): Call
5693 can_incremental_update.
5694
ebb300b2
CC
56952011-09-13 Cary Coutant <ccoutant@google.com>
5696
5697 * configure.ac: Check for glibc support for gnu_indirect_function
5698 support with static linking, setting automake conditional
5699 IFUNC_STATIC.
5700 * Makefile.in: Regenerate.
5701 * configure: Regenerate.
5702
5703 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
5704 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
5705 for IFUNC_STATIC.
5706 * testsuite/Makefile.in: Regenerate.
5707
1206d0d5
CC
57082011-09-13 Cary Coutant <ccoutant@google.com>
5709
5710 * incremental.cc (Sized_relobj_incr::do_layout): Call
5711 report_comdat_group for kept comdat sections.
5712 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
5713 * testsuite/Makefile.in: Regenerate.
5714 * testsuite/incr_comdat_test_1.cc: New source file.
5715 * testsuite/incr_comdat_test_2_v1.cc: New source file.
5716 * testsuite/incr_comdat_test_2_v2.cc: New source file.
5717 * testsuite/incr_comdat_test_2_v3.cc: New source file.
5718
40b29874
ILT
57192011-09-13 Ian Lance Taylor <iant@google.com>
5720
5721 * object.cc (Sized_relobj_file::do_layout): Remove unused local
5722 variable external_symbols_offset.
5723
1b045aac
ILT
57242011-09-12 Ian Lance Taylor <iant@google.com>
5725
5726 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
5727 triggered if object has no symbols.
5728
24c6c55a
DM
57292011-09-09 David S. Miller <davem@davemloft.net>
5730
5731 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
5732 (Output_fill_debug_line::do_write): Likewise.
5733
66570254
CC
57342011-08-29 Cary Coutant <ccoutant@google.com>
5735
5736 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
5737 casts to match formatting specs.
5738 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
5739
8ea8cd50
CC
57402011-08-26 Cary Coutant <ccoutant@google.com>
5741
5742 * layout.cc (Free_list::allocate): Provide guarantee of minimum
5743 remaining hole size when allocating.
5744 (Layout::make_output_section): Set fill methods for debug sections.
5745 * layout.h (Free_list::Free_list_node): Move from private to
5746 public.
5747 (Free_list::set_min_hole_size): New function.
5748 (Free_list::begin, Free_list::end): New functions.
5749 (Free_list::min_hole_): New data member.
5750 * output.cc: Include dwarf.h.
5751 (Output_fill_debug_info::do_minimum_hole_size): New function.
5752 (Output_fill_debug_info::do_write): New function.
5753 (Output_fill_debug_line::do_minimum_hole_size): New function.
5754 (Output_fill_debug_line::do_write): New function.
5755 (Output_section::Output_section): Initialize new data member.
5756 (Output_section::set_final_data_size): Ensure patch space is larger
5757 than minimum hole size.
5758 (Output_section::do_write): Fill holes in debug sections.
5759 * output.h (Output_fill): New class.
5760 (Output_fill_debug_info): New class.
5761 (Output_fill_debug_line): New class.
5762 (Output_section::set_free_space_fill): New function.
5763 (Output_section::free_space_fill_): New data member.
5764 * testsuite/Makefile.am (incremental_test_3): Add
5765 --incremental-patch option.
5766 (incremental_test_4): Likewise.
5767 (incremental_test_5): Likewise.
5768 (incremental_test_6): Likewise.
5769 (incremental_copy_test): Likewise.
5770 (incremental_common_test_1): Likewise.
5771 * testsuite/Makefile.in: Regenerate.
5772
7cf80422
NC
57732011-08-26 Nick Clifton <nickc@redhat.com>
5774
5775 * po/es.po: Updated Spanish translation.
5776
c3f7b0e5
CC
57772011-08-01 Cary Coutant <ccoutant@google.com>
5778
5779 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
5780 * gold/testsuite/Makefile.in: Regenerate.
5781 * gold/testsuite/justsyms_exec.c: New source file.
5782 * gold/testsuite/justsyms_lib.c: New source file.
5783
9590bf25
CC
57842011-08-01 Cary Coutant <ccoutant@google.com>
5785
5786 * layout.cc (Layout::set_segment_offsets): Don't realign text
5787 segment if -Ttext was specified.
5788 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
5789 file type.
5790 * object.h (Sized_relobj_file::e_type): New function.
5791 (Sized_relobj_file::e_type_): New data member.
5792 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
5793 base address for ET_EXEC files.
5794 * target.cc (Target::do_make_elf_object_implementation): Allow
5795 ET_EXEC files with --just-symbols option.
5796
dcd8d12e
CC
57972011-07-28 Cary Coutant <ccoutant@google.com>
5798
5799 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
5800 Add thread_number parameter.
5801 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
5802 * workqueue-threads.cc
5803 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
5804 current thread if its thread number is greater than desired thread
5805 count.
5806 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
5807 Add thread_number parameter.
5808 (Workqueue::should_cancel_thread): Likewise.
5809 (Workqueue::find_runnable_or_wait): Pass thread_number to
5810 should_cancel_thread.
5811 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
5812 parameter.
5813
804eb480
ST
58142011-07-22 Sriraman Tallam <tmsriram@google.com>
5815
5816 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
5817 only after checking if it cannot be forced local.
5818 * symtab.h (is_externally_visible): Check if the symbol is not forced
5819 local.
5820
f1ddb600
ILT
58212011-07-15 Ian Lance Taylor <iant@google.com>
5822
5823 * options.h (class General_options): Add --print-output-format.
5824 Move -EL next to -EB, for better --help output.
5825 * target-select.cc: Include <cstdio>, "options.h", and
5826 "parameters.h".
5827 (Target_selector::do_target_bfd_name): New function.
5828 (print_output_format): New function.
5829 * target-select.h (class Target_selector): Update declarations.
5830 (Target_selector::target_bfd_name): New function.
5831 (print_output_format): Declare.
5832 * main.cc: Include "target-select.h".
5833 (main): Handle --print-output-format.
5834 * gold.cc: Include "target-select.h".
5835 (queue_initial_tasks): Handle --print-output-format when there are
5836 no input files.
5837 * parameters.cc (parameters_force_valid_target): Give a better
5838 error message if -EB/-EL does not match target.
5839 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
5840 function.
5841
7d172687
ILT
58422011-07-15 Ian Lance Taylor <iant@google.com>
5843
5844 * i386.cc (class Output_data_plt_i386): Add layout_ field.
5845 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
5846 (Output_data_plt_i386::do_write): Write address of .dynamic
5847 section to first entry in .got.plt section.
5848 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
5849 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
5850 Initialize layout_.
5851 (Output_data_plt_x86_64::do_write): Write address of .dynamic
5852 section to first entry in .got.plt section.
5853 * layout.h (Layout::dynamic_section): New function.
5854
e9552f7e
ST
58552011-07-13 Sriraman Tallam <tmsriram@google.com>
5856
5857 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
5858 to claim_file call.
5859 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
5860 input_section_position_, and input_section_glob_.
5861 (read_layout_from_file): Call function section_ordering_specified.
5862 * layout.h (is_section_ordering_specified): New function.
5863 (section_ordering_specified): New function.
5864 (section_ordering_specified_): New boolean member.
5865 * main.cc(main): Call load_plugins after layout object is defined.
5866 * output.cc (Output_section::add_input_section): Use
5867 function section_ordering_specified to check if section ordering is
5868 needed.
5869 * output.cc (Output_section::add_relaxed_input_section): Use
5870 function section_ordering_specified to check if section ordering is
5871 needed.
5872 (Output_section::update_section_layout): New function.
5873 (Output_section::sort_attached_input_sections): Check if input section
5874 must be reordered.
5875 * output.h (Output_section::update_section_layout): New function.
5876 * plugin.cc (get_section_count): New function.
5877 (get_section_type): New function.
5878 (get_section_name): New function.
5879 (get_section_contents): New function.
5880 (update_section_order): New function.
58797674 5881 (allow_section_ordering): New function.
e9552f7e
ST
5882 (Plugin::load): Add the new interfaces to the transfer vector.
5883 (Plugin_manager::load_plugins): New parameter.
5884 (Plugin_manager::all_symbols_read): New parameter.
5885 (Plugin_manager::claim_file): New parameter. Save the elf object for
5886 unclaimed objects.
5887 (Plugin_manager::get_elf_object): New function.
5888 (Plugin_manager::get_view): Change to directly use the bool to check
5889 if get_view is called from claim_file_hook.
5890 * plugin.h (input_objects): New function
5891 (Plugin__manager::load_plugins): New parameter.
5892 (Plugin_manager::claim_file): New parameter.
5893 (Plugin_manager::get_elf_object): New function.
5894 (Plugin_manager::in_claim_file_handler): New function.
5895 (Plugin_manager::in_claim_file_handler_): New member.
5896 (layout): New function.
5897 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
5898 handler with an extra parameter. Make the elf object before calling
5899 claim_file handler.
5900 * testsuite/plugin_test.c (get_section_count): New function pointer.
5901 (get_section_type): New function pointer.
5902 (get_section_name): New function pointer.
5903 (get_section_contents): New function pointer.
5904 (update_section_order): New function pointer.
5905 (allow_section_ordering): New function pointer.
5906 (onload): Check if the new interfaces exist.
5907
9446efde
ILT
59082011-07-13 Ian Lance Taylor <iant@google.com>
5909
5910 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
5911 relro section.
5912 * x86_64.cc (Target_x86_64::got_section): Likewise.
5913 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
5914 (relro_now_test_SOURCES): New variable.
5915 (relro_now_test_DEPENDENCIES): New variable.
5916 (relro_now_test_LDFLAGS): New variable.
5917 (relro_now_test_LDADD): New variable.
5918 (relro_now_test.so): New target.
5919 * testsuite/Makefile.in: Rebuild.
5920
07aa62f2
ILT
59212011-07-12 Ian Lance Taylor <iant@google.com>
5922
5923 PR gold/12980
5924 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
5925 GLOB_DAT relocation rather than a RELATIVE relocation for a
5926 protected symbol when creating a shared library.
5927 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
5928 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
5929 * testsuite/protected_main_1.cc (main): Test that protected
5930 function has same address.
5931
e2153196
ILT
59322011-07-11 Ian Lance Taylor <iant@google.com>
5933
5934 PR gold/12979
5935 * options.h (class General_options): Add -Bgroup.
5936 * options.cc (General_options::finalize): If -Bgroup is set,
5937 default to --unresolved-symbols=report-all.
5938 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
5939 * target-reloc.h (issue_undefined_symbol_error): Handle
5940 --unresolved-symbols=report-all.
5941
6daf5215
ILT
59422011-07-08 Ian Lance Taylor <iant@google.com>
5943
5944 PR gold/11985
5945 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
5946 if linker script discards key sections.
5947 (Layout::create_dynamic_symtab): Likewise.
5948 (Layout::assign_local_dynsym_offsets): Likewise.
5949 (Layout::sized_create_version_sections): Likewise.
5950 (Layout::create_interp): Likewise.
5951 (Layout::finish_dynamic_section): Likewise.
5952 (Layout::set_dynamic_symbol_size): Likewise.
5953
beabb2c6
ILT
59542011-07-08 Ian Lance Taylor <iant@google.com>
5955
5956 PR gold/12386
5957 * options.h (class General_options): Add --unresolved-symbols.
5958 * target-reloc.h (issue_undefined_symbol_error): Check
5959 --unresolved-symbols. Add comments.
5960
9c16daf1
ILT
59612011-07-08 Ian Lance Taylor <iant@google.com>
5962
5963 * testsuite/odr_violation2.cc (Ordering::operator()): Make
5964 expression more complex.
5965
191f1a2d
ILT
59662011-07-08 Ian Lance Taylor <iant@google.com>
5967
5968 PR gold/11317
5969 * target-reloc.h (issue_undefined_symbol_error): New inline
5970 function, broken out of relocate_section.
5971 (relocate_section): Call issue_undefined_symbol_error.
5972 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
5973 there is no TLS segment if we are about to issue an undefined
5974 symbol error.
5975 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
5976
62855347
ILT
59772011-07-08 Ian Lance Taylor <iant@google.com>
5978
5979 PR gold/12279
5980 * resolve.cc (Symbol_table::should_override): Add fromtype
5981 parameter. Change all callers. Give error when linking together
5982 TLS and non-TLS symbol.
5983 (Symbol_table::should_override_with_special): Add fromtype
5984 parameter. Change all callers.
5985 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
5986 there is no TLS segment if we have reported some errors.
5987 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
5988
67181c72
ILT
59892011-07-08 Ian Lance Taylor <iant@google.com>
5990
5991 PR gold/12372
5992 * target.h (Target::plt_address_for_global): New function.
5993 (Target::plt_address_for_local): New function.
5994 (Target::plt_section_for_global): Remove.
5995 (Target::plt_section_for_local): Remove.
5996 (Target::do_plt_address_for_global): New virtual function.
5997 (Target::do_plt_address_for_local): New virtual function.
5998 (Target::do_plt_section_for_global): Remove.
5999 (Target::do_plt_section_for_local): Remove.
6000 (Target::register_global_plt_entry): Add Symbol_table and Layout
6001 parameters.
6002 * output.cc (Output_data_got::Got_entry::write): Use
6003 plt_address_for_global and plt_address_for_local.
6004 * layout.cc (Layout::add_target_dynamic_tags): Use size and
6005 address of output section.
6006 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
6007 got_irelative_, and irelative_count_ fields. Update
6008 declarations.
6009 (Output_data_plt_i386::has_irelative_section): New function.
6010 (Output_data_plt_i386::entry_count): Add irelative_count_.
6011 (Output_data_plt_i386::set_final_data_size): Likewise.
6012 (class Target_i386): Add got_irelative_ and rel_irelative_
6013 fields. Update declarations.
6014 (Target_i386::Target_i386): Initialize new fields.
6015 (Target_i386::do_plt_address_for_global): New function replacing
6016 do_plt_section_for_global.
6017 (Target_i386::do_plt_address_for_local): New function replacing
6018 do_plt_section_for_local.
6019 (Target_i386::got_section): Create got_irelative_.
6020 (Target_i386::rel_irelative_section): New function.
6021 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
6022 fields. Don't define __rel_iplt_{start,end}.
6023 (Output_data_plt_i386::add_entry): Add symtab and layout
6024 parameters. Change all callers. Use different PLT and GOT for
6025 IFUNC symbols.
6026 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
6027 layout parameters. Change all callers. Use different PLT and
6028 GOT.
6029 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
6030 (Output_data_plt_i386::rel_irelative): New function.
6031 (Output_data_plt_i386::address_for_global): New function.
6032 (Output_data_plt_i386::address_for_local): New function.
6033 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
6034 IRELATIVE GOT when changing IFUNC GOT entries.
6035 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
6036 reloc.
6037 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
6038 if we didn't create an IRELATIVE GOT.
6039 (Target_i386::Relocate::relocate): Use plt_address_for_global and
6040 plt_address_for_local.
6041 (Target_i386::do_dynsym_value): Use plt_address_for_global.
6042 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
6043 got_irelative_, and irelative_count_ fields. Update
6044 declarations.
6045 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
6046 Initialize new fields. Remove symtab parameter. Change all
6047 callers.
6048 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
6049 irelative_count_.
6050 (Output_data_plt_x86_64::has_irelative_section): New function.
6051 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
6052 (class Target_x86_64): Add got_irelative_ and rel_irelative_
6053 fields. Update declarations.
6054 (Target_x86_64::Target_x86_64): Initialize new fields.
6055 (Target_x86_64::do_plt_address_for_global): New function replacing
6056 do_plt_section_for_global.
6057 (Target_x86_64::do_plt_address_for_local): New function replacing
6058 do_plt_section_for_local.
6059 (Target_x86_64::got_section): Create got_irelative_.
6060 (Target_x86_64::rela_irelative_section): New function.
6061 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
6062 all callers. Don't create __rel_iplt_{start,end}.
6063 (Output_data_plt_x86_64::add_entry): Add symtab and layout
6064 parameters. Change all callers. Use different PLT and GOT for
6065 IFUNC symbols.
6066 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
6067 layout parameters. Change all callers. Use different PLT and
6068 GOT.
6069 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
6070 parameters. Change all callers. Use different PLT and GOT for
6071 IFUNC symbols.
6072 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
6073 (Output_data_plt_x86_64::rela_irelative): New function.
6074 (Output_data_plt_x86_64::address_for_global): New function.
6075 (Output_data_plt_x86_64::address_for_local): New function.
6076 (Output_data_plt_x86_64::set_final_data_size): Likewise.
6077 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
6078 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
6079 (Target_x86_64::register_global_plt_entry): Add symtab and layout
6080 parameters.
6081 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
6082 reloc.
6083 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
6084 symbols if we didn't create an IRELATIVE GOT.
6085 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
6086 plt_address_for_local.
6087 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
6088 * testsuite/ifuncvar1.c: New test file.
6089 * testsuite/ifuncvar2.c: New test file.
6090 * testsuite/ifuncvar3.c: New test file.
6091 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
6092 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
6093 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
6094 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
6095 * testsuite/Makefile.in: Rebuild.
6096
33c15b45
CC
60972011-07-07 Cary Coutant <ccoutant@google.com>
6098
6099 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
6100 (two_file_test_1_ndebug.o): Likewise.
6101 (two_file_test_1b_ndebug.o): Likewise.
6102 (two_file_test_2_ndebug.o): Likewise.
6103 (two_file_test_main_ndebug.o): Likewise.
6104 (incremental_test_2): Link with no-debug versions.
6105
f48b5fb7
CC
61062011-07-06 Cary Coutant <ccoutant@google.com>
6107
6108 * gold/incremental.cc
6109 (Output_section_incremental_inputs::write_info_blocks): Check for
6110 hidden and internal symbols.
6111
221597a5
CC
61122011-07-06 Cary Coutant <ccoutant@google.com>
6113
6114 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
6115 Check disposition for startup file.
6116 (Incremental_inputs::report_command_line): Ignore
6117 --incremental-startup-unchanged option.
6118 * options.cc (General_options::parse_incremental_startup_unchanged):
6119 New function.
6120 (General_options::General_options): Initialize new data member.
6121 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
6122 (General_options): Add --incremental-startup-unchanged option.
6123 (General_options::incremental_startup_disposition): New function.
6124 (General_options::incremental_startup_disposition_): New data member.
6125
e24719f6
CC
61262011-07-06 Cary Coutant <ccoutant@google.com>
6127
6128 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
6129 input file index to Script_info ctor.
6130 (Sized_incremental_binary::do_file_has_changed): Find the
6131 command-line argument for files named in scripts.
6132 * incremental.h (Script_info::Script_info): New ctor
6133 with input file index.
6134 (Script_info::input_file_index): New function.
6135 (Script_info::input_file_index_): New data member.
6136 (Incremental_binary::get_library): Add const.
6137 (Incremental_binary::get_script_info): Add const.
6138 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
6139 * testsuite/Makefile.am (incremental_test_5): New test case.
6140 (incremental_test_6): New test case.
6141 * testsuite/Makefile.in: Regenerate.
6142
8f7c81e8
CC
61432011-07-06 Cary Coutant <ccoutant@google.com>
6144
6145 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
6146 debug output when command lines differ.
6147
9fbd3822
CC
61482011-07-06 Cary Coutant <ccoutant@google.com>
6149
6150 * incremental.cc (Incremental_inputs::report_command_line): Ignore
6151 --incremental-patch option.
6152 * layout.cc (Free_list::allocate): Extend allocation beyond original
6153 end if enabled.
6154 (Layout::make_output_section): Mark sections that should get
6155 patch space.
6156 * options.cc (parse_percent): New function.
6157 * options.h (parse_percent): New function.
6158 (DEFINE_percent): New macro.
6159 (General_options): Add --incremental-patch option.
6160 * output.cc (Output_section::Output_section): Initialize new data
6161 members.
6162 (Output_section::add_input_section): Print section name when out
6163 of patch space.
6164 (Output_section::add_output_section_data): Likewise.
6165 (Output_section::set_final_data_size): Add patch space when
6166 doing --incremental-full.
6167 (Output_section::do_reset_address_and_file_offset): Remove patch
6168 space.
6169 (Output_segment::set_section_list_addresses): Print debug output
6170 only if --incremental-update.
6171 * output.h (Output_section::set_is_patch_space_allowed): New function.
6172 (Output_section::is_patch_space_allowed_): New data member.
6173 (Output_section::patch_space_): New data member.
6174 * parameters.cc (Parameters::incremental_full): New function.
6175 * parameters.h (Parameters::incremental_full): New function
6176 * testsuite/Makefile.am (incremental_test_2): Add test for
6177 --incremental-patch option.
6178 * testsuite/Makefile.in: Regenerate.
6179 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
6180 (t18): Remove function body.
6181
f6cccc2c
DK
61822011-07-05 Doug Kwan <dougkwan@google.com>
6183
6184 PR gold/12771
6185 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
6186 Arm_Address type for relocation result.
6187 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
6188 overflow check.
6189 (Arm_relocate_functions::abs32): Use unaligned access.
6190 (Arm_relocate_functions::rel32): Ditto.
6191 (Arm_relocate_functions::prel31): Ditto.
6192 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
6193 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
6194 static data relocations.
6195 * testsuite/Makefile.in: Regnerate.
6196 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
6197
28a13fec
ILT
61982011-07-05 Ian Lance Taylor <iant@google.com>
6199
6200 PR gold/12392
6201 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
6202 symbols if necessary.
6203 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6204
24d47b34
ILT
62052011-07-05 Ian Lance Taylor <iant@google.com>
6206
6207 PR gold/12952
6208 * resolve.cc (Symbol::override_base_with_special): Simply override
6209 version with special symbol version, ignoring previous version.
6210
41f9cbbe
ILT
62112011-07-05 Ian Lance Taylor <iant@google.com>
6212
6213 * object.cc (Sized_relobj_file::include_section_group): Add
6214 information to comment about signature location.
6215
886288f1
ILT
62162011-07-02 Ian Lance Taylor <iant@google.com>
6217
6218 PR gold/12957
6219 * options.h (class General_options): Add -f and -F.
6220 * options.cc (General_options::finalize): Fatal error if -f/-F
6221 are used without -shared.
6222 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
6223
ae3a6d4f
ILT
62242011-07-02 Ian Lance Taylor <iant@google.com>
6225
6226 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
6227
21131061
ILT
62282011-07-01 Ian Lance Taylor <iant@google.com>
6229
6230 PR gold/12525
6231 PR gold/12952
6232 * resolve.cc (Symbol::override_base_with_special): Don't override
6233 the version if the overriding symbol has a different name.
6234 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
6235 all callers. If we give an error about an undefined version,
6236 define the base version if necessary.
6237 * dynobj.h (class Versions): Update declaration.
6238 * testsuite/weak_alias_test_5.cc: New file.
6239 * testsuite/weak_alias_test.script: New file.
6240 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
6241 and versioned_alias have the right value, and call t2.
6242 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
6243 weak_alias_test_5.so.
6244 (weak_alias_test_LDADD): Likewise.
6245 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
6246 * testsuite/Makefile.in: Rebuild.
6247
611062c0
ILT
62482011-07-01 Ian Lance Taylor <iant@google.com>
6249
6250 PR gold/12525
6251 * options.h (class General_options): Support -z notext.
6252 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
6253 -Wl,-z,notext.
6254 (two_file_shared_nonpic.so): Likewise.
6255 (two_file_shared_mixed.so): Likewise.
6256 (two_file_shared_mixed_1.so): Likewise.
6257 (weak_undef_lib_nonpic.so): Likewise.
6258 (alt/weak_undef_lib_nonpic.so): Likewise.
6259 (tls_test_shared_nonpic.so): Likewise.
6260 * testsuite/Makefile.in: Rebuild.
6261
328c7c2f
ILT
62622011-07-01 Ian Lance Taylor <iant@google.com>
6263
6264 PR gold/12525
6265 * configure.ac: Test whether static linking works, setting
6266 the automake conditional HAVE_STATIC.
6267 * testsuite/Makefile.am: Disable tests using -static if
6268 HAVE_STATIC is not true.
6269 * configure, testsuite/Makefile.in: Rebuild.
6270
02d7cd44
ILT
62712011-07-01 Ian Lance Taylor <iant@google.com>
6272
6273 PR gold/12525
6274 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
6275 Assert if we see DW_EH_PE_indirect.
6276 * target.h (Target::ehframe_datarel_base): New function.
6277 (Target::do_ehframe_datarel_base): New target function.
6278 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
6279 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
6280 function.
6281
07a60597
ILT
62822011-07-01 Ian Lance Taylor <iant@google.com>
6283
6284 PR gold/12571
6285 * options.h (class General_options): Add
6286 --ld-generated-unwind-info.
6287 * ehframe.cc (Fde::write): Add address parameter. Change all
6288 callers. If associated with PLT, fill in address and size.
6289 (Cie::set_output_offset): Only add merge mapping if there is an
6290 object.
6291 (Cie::write): Add address parameter. Change all callers.
6292 (Eh_frame::add_ehframe_for_plt): New function.
6293 * ehframe.h (class Fde): Update declarations. Move shndx_ and
6294 input_offset_ fields into union u_, with new plt field.
6295 (Fde::Fde): Adjust for new union field.
6296 (Fde::Fde) [Output_data version]: New constructor.
6297 (Fde::add_mapping): Only add merge mapping if there is an object.
6298 (class Cie): Update declarations.
6299 (class Eh_frame): Declare add_ehframe_for_plt.
6300 * layout.cc (Layout::layout_eh_frame): Break out code into
6301 make_eh_frame_section, and call it.
6302 (Layout::make_eh_frame_section): New function.
6303 (Layout::add_eh_frame_for_plt): New function.
6304 * layout.h (class Layout): Update declarations.
6305 * merge.cc (Merge_map::add_mapping): Add assertion.
6306 * i386.cc: Include "dwarf.h".
6307 (class Output_data_plt_i386): Make first_plt_entry,
6308 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
6309 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6310 and plt_eh_frame_fde.
6311 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
6312 boundary. Call add_eh_frame_for_plt if appropriate.
6313 * x86_64.cc: Include "dwarf.h".
6314 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
6315 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
6316 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6317 and plt_eh_frame_fde.
6318 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
6319 appropriate.
6320
14788a3f
ILT
63212011-06-29 Ian Lance Taylor <iant@google.com>
6322
6323 PR gold/12629
6324 * object.cc (Sized_relobj_file::layout_section): Change shdr
6325 parameter to be const.
6326 (Sized_relobj_file::layout_eh_frame_section): New function, broken
6327 out of do_layout.
6328 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
6329 appropriate. Call layout_eh_frame_section.
6330 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
6331 sections.
6332 * object.h (class Sized_relobj_file): Update declarations.
6333
6c21fce1
ILT
63342011-06-29 Ian Lance Taylor <iant@google.com>
6335
37e41b03 6336 PR gold/12652
6c21fce1
ILT
6337 * script.cc (Token::integer_value): Accept trailing M/m/K/k
6338 modifier.
6339 (Lex::gather_token): Accept trailing M/m/K/k for integers.
6340
4d5e4e62
ILT
63412011-06-29 Ian Lance Taylor <iant@google.com>
6342
6343 PR gold/12675
6344 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
6345 SHT_X86_64_UNWIND.
6346 * layout.cc (Layout::layout_eh_frame): Likewise.
6347
886f533a
ILT
63482011-06-29 Ian Lance Taylor <iant@google.com>
6349
6350 PR gold/12695
6351 * layout.cc (Layout::symtab_section_shndx): New function.
6352 * layout.h (class Layout): Declare symtab_section_shndx.
6353 * output.cc (Output_section::write_header): Call it.
6354
f3ae1b28
ILT
63552011-06-29 Ian Lance Taylor <iant@google.com>
6356
6357 PR gold/12818
6358 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
6359 symbols which are not used in a relocation.
6360
aecf301f
ILT
63612011-06-28 Ian Lance Taylor <iant@google.com>
6362
6363 PR gold/12898
6364 * layout.cc (Layout::segment_precedes): Don't crash if a linker
6365 script create indistinguishable segments.
6366 (Layout::set_segment_offsets): Use stable_sort when sorting
6367 segments. Pass this to Compare_segments constructor.
6368 * layout.h (class Layout): Make segment_precedes non-static.
6369 (class Compare_segments): Change from struct to class. Add
6370 layout_ field. Add constructor.
6371 * script-sections.cc
6372 (Script_sections::attach_sections_using_phdrs_clause): Rename
6373 local orphan to is_orphan. Don't report failure to put empty
6374 section in segment. On attachment failure, report name of
6375 section, and attach to first PT_LOAD segment.
6376
03ef7571
ILT
63772011-06-28 Ian Lance Taylor <iant@google.com>
6378
6379 PR gold/12934
6380 * target-select.cc (Target_selector::Target_selector): Add
6381 emulation parameter. Change all callers.
6382 (select_target_by_bfd_name): Rename from select_target_by_name.
6383 Change all callers.
6384 (select_target_by_emulation): New function.
6385 (supported_emulation_names): New function.
6386 * target-select.h (class Target_selector): Add emulation_ field.
6387 Update declarations.
6388 (Target_selector::recognize_by_bfd_name): Rename from
6389 recognize_by_name. Change all callers.
6390 (Target_selector::supported_bfd_names): Rename from
6391 supported_names. Change all callers.
6392 (Target_selector::recognize_by_emulation): New function.
6393 (Target_selector::supported_emulations): New function.
6394 (Target_selector::emulation): New function.
6395 (Target_selector::do_recognize_by_bfd_name): Rename from
6396 do_recognize_by_name. Change all callers.
6397 (Target_selector::do_supported_bfd_names): Rename from
6398 do_supported_names. Change all callers.
6399 (Target_selector::do_recognize_by_emulation): New function.
6400 (Target_selector::do_supported_emulations): New function.
6401 (select_target_by_bfd_name): Change name in declaration.
6402 (select_target_by_emulation): Declare.
6403 (supported_emulation_names): Declare.
6404 * parameters.cc (parameters_force_valid_target): Try to find
6405 target based on emulation from -m option.
6406 * options.h (class General_options): Change doc string for -m.
6407 * options.cc (help): Print emulations.
6408 (General_options::parse_V): Likewise.
6409 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
6410 Add emulation parameter. Change all callers.
6411
200b2bb9
ILT
64122011-06-28 Ian Lance Taylor <iant@google.com>
6413
6414 * target.h (class Target): Add osabi_ field.
6415 (Target::osabi): New function.
6416 (Target::set_osabi): New function.
6417 (Target::Target): Initialize osabi_.
6418 (Target::do_adjust_elf_header): Make pure virtual.
6419 (Sized_target::do_adjust_elf_header): Declare.
6420 * target.cc (Sized_target::do_adjust_elf_header): New function.
6421 (class Sized_target): Instantiate all versions.
6422 * freebsd.h (class Target_freebsd): Remove.
6423 (Target_selector_freebsd::do_recognize): Call set_osabi on
6424 Target.
6425 (Target_selector_freebsd::do_recognize_by_name): Likewise.
6426 (Target_selector_freebsd::set_osabi): Remove.
6427 * i386.cc (class Target_i386): Inherit from Sized_target rather
6428 than Target_freebsd.
6429 * x86_64.cc (class Target_x86_64): Likewise.
6430
b3ce541e
ILT
64312011-06-28 Ian Lance Taylor <iant@google.com>
6432
6433 * target.h (Target::can_check_for_function_pointers): Rewrite.
6434 Make non-virtual.
6435 (Target::can_icf_inline_merge_sections): Likewise.
6436 (Target::section_may_have_icf_unsafe_poineters): Likewise.
6437 (Target::Target_info): Add can_icf_inline_merge_sections field.
6438 (Target::do_can_check_for_function_pointers): New virtual
6439 function.
6440 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
6441 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
6442 from can_check_for_function_pointers, move in file.
6443 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
6444 section_may_have_icf_unsafe_poineters, move in file.
6445 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
6446 * i386.cc (Target_i386::do_can_check_for_function_pointers):
6447 Rename from can_check_for_function_pointers, move in file.
6448 (Target_i386::can_icf_inline_merge_sections): Remove.
6449 (Target_i386::i386_info): Initialize
6450 can_icf_inline_merge_sections.
6451 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
6452 Initialize can_icf_inline_merge_sections.
6453 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
6454 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
6455 Rename from can_check_for_function_pointers, move in file.
6456 (Target_x86_64::can_icf_inline_merge_sections): Remove.
6457 (Target_x86_64::x86_64_info): Initialize
6458 can_icf_inline_merge_sections.
6459 * testsuite/testfile.cc (Target_test::test_target_info):
6460 Likewise.
6461 * icf.cc (get_section_contents): Correct formatting.
6462
6d1c4efb
ILT
64632011-06-27 Ian Lance Taylor <iant@google.com>
6464
6465 * symtab.cc (Symbol::versioned_name): New function.
6466 (Symbol_table::add_to_final_symtab): Use versioned_name when
6467 appropriate.
6468 (Symbol_table::sized_write_symbol): Likewise.
6469 * symtab.h (class Symbol): Declare versioned_name.
6470 * stringpool.h (class Stringpool_template): Add variant of add
6471 which takes a std::basic_string.
6472 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
6473 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
6474 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
6475 (ver_test_12.o): New target.
6476 * testsuite/Makefile.in: Rebuild.
6477
57eb9b50
DK
64782011-06-27 Doug Kwan <dougkwan@google.com>
6479
6480 * arm.cc (Arm_relocate_functions::thm_jump8,
6481 Arm_relocate_functions::thm_jump11): Use a wider signed
6482 type to compute offset.
6483 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
6484 arm_thm_jump8.
6485 * testsuite/Makefile.in: Regenerate.
6486 * testsuite/arm_branch_in_range.sh: Check test results of
6487 arm_thm_jump11 and arm_thm_jump8.
6488 * testsuite/arm_thm_jump11.s: New test source file.
6489 * testsuite/arm_thm_jump11.t: New linker script.
6490 * testsuite/arm_thm_jump8.s: New test source file.
6491 * testsuite/arm_thm_jump8.t: New linker script.
6492
487b39df
ILT
64932011-06-24 Ian Lance Taylor <iant@google.com>
6494
6495 * layout.cc: Include "object.h".
6496 (ctors_sections_in_init_array): New static variable.
6497 (Layout::is_ctors_in_init_array): New function.
6498 (Layout::layout): Add entry to ctors_sections_in_init_array if
6499 appropriate.
6500 * layout.h (class Layout): Declare is_ctors_in_init_array.
6501 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
6502 is_ctors_reverse_view is set.
6503 (Sized_relobj_file::write_sections): Add layout parameter. Change
6504 all callers. Set is_ctors_reverse_view field of View_size.
6505 (Sized_relobj_file::reverse_words): New function.
6506 * object.h (Sized_relobj_file::View_size): Add
6507 is_ctors_reverse_view field.
6508 (class Sized_relobj_file): Update declarations.
6509 * testsuite/initpri3.c: New test.
6510 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
6511 initpri3b.
6512 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
6513 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
6514 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
6515 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
6516 * testsuite/Makefile.in: Rebuild.
6517
472076e4
CC
65182011-06-24 Cary Coutant <ccoutant@google.com>
6519
6520 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
6521 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
6522 (debug_msg_cdebug.err): New targets.
6523 * testsuite/Makefile.in: Regenerate.
6524 * testsuite/debug_msg.sh: Check output of link with compressed debug.
6525 Fix checks for link with shared library.
6526
a60af0db
DK
65272011-06-24 Doug Kwan <dougkwan@google.com>
6528
6529 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
6530 skip empty text sections.
6531 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
6532
5393d741
ILT
65332011-06-22 Ian Lance Taylor <iant@google.com>
6534
6535 PR gold/12910
6536 * options.h (class General_options): Add --ctors-in-init-array.
6537 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
6538 friends as SHT_PROGBITS for merging sections.
6539 (Layout::layout): Remove special handling of .init_array and
6540 friends. Don't sort if doing relocatable link. Sort for .ctors
6541 and .dtors if ctors_in_init_array.
6542 (Layout::make_output_section): Force correct section types for
6543 .init_array and friends. Don't sort if doing relocatable link,
6544 Don't sort .ctors and .dtors if ctors_in_init_array.
6545 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
6546 (Layout::output_section_name): Add relobj parameter. Change all
6547 callers. Handle .ctors. and .dtors. in code rather than table.
6548 Handle .ctors and .dtors if ctors_in_init_array.
6549 (Layout::match_file_name): New function, moved from output.cc.
6550 * layout.h (class Layout): Update declarations.
6551 * output.cc: Include "layout.h".
6552 (Input_section_sort_entry::get_priority): New function.
6553 (Input_section_sort_entry::match_file_name): Just call
6554 Layout::match_file_name.
6555 (Output_section::Input_section_sort_init_fini_compare::operator()):
6556 Handle .ctors and .dtors. Sort by explicit priority rather than
6557 by name.
6558 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
6559 * testsuite/initpri2.c: New test.
6560 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
6561 (check_PROGRAMS): Add initpri2.
6562 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
6563 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
6564 * configure, testsuite/Makefile.in: Rebuild.
6565
e1f74f98
ILT
65662011-06-19 Ian Lance Taylor <iant@google.com>
6567
6568 PR gold/12880
6569 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
6570 .interp section to a PT_INTERP segment even if we have seen a
6571 --dynamic-linker option. Don't do it if we have seen a PHDRS
6572 clause in a linker script.
6573 (Layout::finalize): Don't create a .interp section if we've
6574 already create a PT_INTERP segment.
6575 (Layout::create_interp): Always call choose_output_section (revert
6576 patch of 2011-06-17). Don't create PT_INTERP segment.
6577 * script-sections.cc
6578 (Script_sections::create_note_and_tls_segments): Add a .interp
6579 section to a PT_INTERP segment even if we have seen a
6580 --dynamic-linker option.
6581
766f91bb
ILT
65822011-06-18 Ian Lance Taylor <iant@google.com>
6583
6584 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
6585 merely because a non-PT_LOAD segment has a dynamic reloc.
6586
0d212c3a
ILT
65872011-06-18 Ian Lance Taylor <iant@google.com>
6588
6589 * layout.cc (Layout::finish_dynamic_section): Don't create
6590 DT_FLAGS entry if not needed.
6591
911a5072
ILT
65922011-06-18 Ian Lance Taylor <iant@google.com>
6593
6594 PR gold/12745
6595 * layout.cc (Layout::layout_eh_frame): Correct handling of
6596 writable .eh_frame section.
6597
534b4e5f
ILT
65982011-06-17 Ian Lance Taylor <iant@google.com>
6599
6600 PR gold/12893
6601 * resolve.cc (Symbol_table::resolve): Don't give an error if a
6602 symbol is redefined with the exact same object and value.
6603
10b4f102
ILT
66042011-06-17 Ian Lance Taylor <iant@google.com>
6605
6606 PR gold/12880
6607 * layout.h (class Layout): Add interp_segment_ field.
6608 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
6609 (Layout::attach_allocated_section_to_segment): If making shared
6610 library, put .interp section in PT_INTERP segment.
6611 (Layout::finalize): Also call create_interp if -dynamic-linker
6612 option was used.
6613 (Layout::create_interp): Assert that there is no PT_INTERP
6614 segment. If not using a SECTIONS clause, use make_output_section.
6615 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
6616 * script-sections.cc
6617 (Script_sections::create_note_and_tls_segments): If making shared
6618 library, put .interp section in PT_INTERP segment.
6619
a29b0dad
ILT
66202011-06-17 Ian Lance Taylor <iant@google.com>
6621
e588ea8d
ILT
6622 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
6623 when making a shared library.
6624
66252011-06-17 Ian Lance Taylor <iant@google.com>
6626
6627 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
6628 parameter. Change all callers. Don't issue warning about PC32
6629 against locally defined symbol.
a29b0dad 6630
9d3b0698
ILT
66312011-06-16 Ian Lance Taylor <iant@google.com>
6632
6633 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
6634 occurs in same object.
6635
85b0f90c
AM
66362011-06-14 Alan Modra <amodra@gmail.com>
6637
6638 * po/POTFILES.in: Regenerate.
6639
a94907d9
ILT
66402011-06-09 Ian Lance Taylor <iant@google.com>
6641
6642 * script-sections.cc
6643 (Orphan_output_section::set_section_addresses): For a relocatable
6644 link set address to 0.
6645
4fb3a1c3
CC
66462011-06-09 Cary Coutant <ccoutant@google.com>
6647
6648 PR gold/12804
6649 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
6650 used with --compress-debug-sections.
6651 * gold/object.cc (Sized_relobj_file::do_layout): Report
6652 uncompressed size of compressed input sections.
6653
61220854
CC
66542011-06-08 Cary Coutant <ccoutant@google.com>
6655
6656 PR gold/12804
6657 * testsuite/two_file_test_2_v1.cc: Change initialization of
6658 v2 to keep it in .data.
6659
e6455dfb
CC
66602011-06-07 Cary Coutant <ccoutant@google.com>
6661
6662 * common.cc (Symbol_table::do_allocate_commons_list): Call
6663 gold_fallback.
6664 * errors.cc (Errors::fatal): Adjust call to gold_exit.
6665 (Errors::fallback): New function.
6666 (gold_fallback): New function.
6667 * errors.h (Errors::fallback): New function.
6668 * gold.cc (gold_exit): Change status parameter to enum; adjust
6669 all callers.
6670 (queue_initial_tasks): Call gold_fallback.
6671 * gold.h: Include cstdlib.
6672 (Exit_status): New enum type.
6673 (gold_exit): Change status parameter to enum.
6674 (gold_fallback): New function.
6675 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
6676 (Layout::create_symtab_sections): Likewise.
6677 (Layout::create_shdrs): Likewise.
6678 * main.cc (main): Adjust call to gold_exit.
6679 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
6680 (Output_data_got::add_got_entry_pair): Likewise.
6681 (Output_section::add_input_section): Likewise.
6682 (Output_section::add_output_section_data): Likewise.
6683 (Output_segment::set_section_list_addresses): Likewise.
6684 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
6685
fb0e076f
CC
66862011-06-07 Cary Coutant <ccoutant@google.com>
6687
6688 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
6689 for incremental links.
6690 * output.cc (Output_segment::set_section_list_addresses): Remove
6691 FIXME and test for TLS or BSS.
6692
a5ee4d5d
CC
66932011-06-07 Cary Coutant <ccoutant@google.com>
6694
6695 * testsuite/Makefile.am: Add incremental_copy_test,
6696 incremental_common_test_1.
6697 * testsuite/Makefile.in: Regenerate.
6698 * testsuite/common_test_1_v1.c: New source file.
6699 * testsuite/common_test_1_v2.c: New source file.
6700 * testsuite/copy_test_v1.cc: New source file.
6701
5146f448
CC
67022011-06-07 Cary Coutant <ccoutant@google.com>
6703
6704 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
6705 update, allocate common from bss section's free list.
6706 * incremental-dump.cc (dump_incremental_inputs): Print flag for
6707 linker-defined symbols.
6708 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
6709 Skip GOT and PLT entries that are no longer referenced.
6710 (Output_section_incremental_inputs::write_info_blocks): Mark
6711 linker-defined symbols.
6712 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
6713 * output.cc (Output_section::allocate): New function.
6714 * output.h (Output_section::allocate): New function.
6715 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
6716 linker-defined symbols.
6717 (Symbol::override_base_with_special): Copy is_predefined_ flag.
6718 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
6719 (Symbol::init_base_output_data): Likewise.
6720 (Symbol::init_base_output_segment): Likewise.
6721 (Symbol::init_base_constant): Likewise.
6722 (Sized_symbol::init_output_data): Likewise.
6723 (Sized_symbol::init_output_segment): Likewise.
6724 (Sized_symbol::init_constant): Likewise.
6725 (Symbol_table::do_define_in_output_data): Likewise.
6726 (Symbol_table::do_define_in_output_segment): Likewise.
6727 (Symbol_table::do_define_as_constant): Likewise.
6728 * symtab.h (Symbol::is_predefined): New function.
6729 (Symbol::init_base_output_data): Add is_predefined parameter.
6730 (Symbol::init_base_output_segment): Likewise.
6731 (Symbol::init_base_constant): Likewise.
6732 (Symbol::is_predefined_): New data member.
6733 (Sized_symbol::init_output_data): Add is_predefined parameter.
6734 (Sized_symbol::init_output_segment): Likewise.
6735 (Sized_symbol::init_constant): Likewise.
6736 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
6737
26d3c67d
CC
67382011-06-07 Cary Coutant <ccoutant@google.com>
6739
6740 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
6741 instead of emit_copy_reloc.
6742 (Copy_relocs::emit_copy_reloc): Refactor.
6743 (Copy_relocs::make_copy_reloc): New function.
6744 (Copy_relocs::add_copy_reloc): Remove.
6745 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
6746 section.
6747 (Copy_relocs::make_copy_reloc): New function.
6748 (Copy_relocs::add_copy_reloc): Remove.
6749 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
6750 unchanged input files.
6751 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
6752 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
6753 Reserve BSS space for COPY relocations.
6754 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6755 (Output_section_incremental_inputs::write_info_blocks): Record
6756 whether a symbol is copied from a shared object.
6757 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
6758 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
6759 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
6760 (Incremental_input_entry_reader::get_output_symbol_index): Add
6761 is_copy parameter.
6762 (Incremental_binary::emit_copy_relocs): New function.
6763 (Incremental_binary::do_emit_copy_relocs): New function.
6764 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6765 new data member.
6766 (Sized_incremental_binary::add_copy_reloc): New function.
6767 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6768 (Sized_incremental_binary::Copy_reloc): New struct.
6769 (Sized_incremental_binary::Copy_relocs): New typedef.
6770 (Sized_incremental_binary::copy_relocs_): New data member.
6771 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
6772 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
6773 * target.h (Sized_target::emit_copy_reloc): New function.
6774 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
6775
7cdb37d9
CC
67762011-06-02 Cary Coutant <ccoutant@google.com>
6777
6778 PR gold/12163
6779 * gold/archive.cc (Archive::Archive): Initialize new data member.
6780 (Archive::include_all_members): Return if archive has already been
6781 included.
6782 * gold/archive.h (Archive::include_all_members_): New data member.
6783
cc643b88
NC
67842011-06-02 Nick Clifton <nickc@redhat.com>
6785
6786 * dynobj.h: Fix spelling mistake in comment.
6787 * output.cc: Likewise.
6788
f62a3ca7 67892011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 6790 Asier Llano
f62a3ca7
DK
6791
6792 PR gold/12826
cc643b88 6793 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
6794 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
6795 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
6796 redundant arm_exidx_test.so.
6797 * testsuite/Makefile.in: Regenerate.
6798 (check_SCRIPTS): Add pr12826.sh
6799 (check_DATA): Add pr12826.stdout
6800 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
6801 * testsuite/pr12826.sh: New file.
6802 * testsuite/pr12826_1.s: Ditto.
6803 * testsuite/pr12826_1.s: Ditto.
6804
8dbe1edc
ILT
68052011-05-30 Ian Lance Taylor <iant@google.com>
6806
6807 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
6808 sections.
6809
c49875be
ILT
68102011-05-29 Ian Lance Taylor <iant@google.com>
6811
6812 PR gold/12804
6813 * testsuite/Makefile.am: Use different file name for two_file_test
6814 temporary file for each incremental test.
6815 * testsuite/Makefile.in: Rebuild.
6816
69d53f7a
ILT
68172011-05-29 Ian Lance Taylor <iant@google.com>
6818
6819 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
6820 binary input file is empty.
6821
41d0ab5f
ILT
68222011-05-27 Ian Lance Taylor <iant@google.com>
6823
6824 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
6825 (ver_test_9.so): Likewise.
6826 * testsuite/Makefile.in: Rebuild.
6827
89d8a36b
CC
68282011-05-26 Cary Coutant <ccoutant@google.com>
6829
6830 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
6831 * incremental.cc (Incremental_inputs::report_input_section): Fix
6832 comment, indentation.
6833 (Incremental_inputs::report_comdat_group): New function.
6834 (Output_section_incremental_inputs::set_final_data_size): Adjust size
6835 of data for incremental input file entry.
6836 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
6837 group count, COMDAT group signatures.
6838 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
6839 an unchanged input file.
6840 * incremental.h (Incremental_object_entry::Incremental_object_entry):
6841 Initialize new data member.
6842 (Incremental_object_entry::add_comdat_group): New function.
6843 (Incremental_object_entry::get_comdat_group_count): New function.
6844 (Incremental_object_entry::get_comdat_signature_key): New function.
6845 (Incremental_object_entry::groups_): New data member.
6846 (Incremental_inputs::report_comdat_group): New function.
6847 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
6848 data for incremental input file entry.
6849 (Incremental_input_entry_reader::get_comdat_group_count): New function.
6850 (Incremental_input_entry_reader::get_input_section): Adjust size of
6851 data for incremental input file entry.
6852 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
6853 (Incremental_input_entry_reader::get_comdat_group_signature): New
6854 function.
6855 * object.cc (Sized_relobj::include_section_group): Report kept
6856 COMDAT groups for incremental links.
6857
1706a06f
ILT
68582011-05-24 David Meyer <pdox@google.com>
6859
6860 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
6861 with name parameter. Add found_name parameter.
6862 * fileread.cc (Input_file::find_file): Adjust code accordingly.
6863 * dirsearch.h (class Dirsearch): Update declaration.
6864
a10ae760
ILT
68652011-05-24 Ian Lance Taylor <iant@google.com>
6866
6867 * archive.cc (Library_base::should_include_member): Pull in object
6868 from archive if it defines the entry symbol.
6869 * parameters.cc (Parameters::entry): New function.
6870 * parameters.h (class Parameters): Declare entry.
6871 * output.h (class Output_file_header): Remove entry_ field.
6872 * output.cc (Output_file_header::Output_file_header): Remove entry
6873 parameter. Change all callers.
6874 (Output_file_header::entry): Use parameters->entry.
6875 * gold.cc (queue_middle_tasks): Likewise.
6876 * plugin.cc (Plugin_hook::run): Likewise.
6877
aa92d6ed
CC
68782011-05-24 Cary Coutant <ccoutant@google.com>
6879
6880 * gold.cc (queue_initial_tasks): Pass incremental base filename
6881 to Output_file::open_base_file; don't print error message.
6882 * incremental-dump.cc (main): Adjust call to
6883 Output_file::open_for_modification.
6884 * incremental-dump.cc (main): Likewise.
6885 * incremental.cc (Incremental_inputs::report_command_line):
6886 Ignore --incremental-base option when comparing command lines.
6887 Ignore parameter when given as separate argument.
6888 * options.h (class General_options): Add --incremental-base.
6889 * output.cc (Output_file::Output_file):
6890 (Output_file::open_base_file): Add base_name and writable parameters;
6891 read base file into new file; print error message here.
6892 (Output_file::map_no_anonymous): Add writable parameter; adjust all
6893 callers.
6894 * output.h (Output_file::open_for_modification): Rename to...
6895 (Output_file::open_base_file): ...this; add base_name and
6896 writable parameters; adjust all callers.
6897 (Output_file::map_no_anonymous): Add writable parameter; adjust all
6898 callers.
6899 * testsuite/Makefile.am (incremental_test_4): Test
6900 --incremental-base.
6901 * testsuite/Makefile.in: Regenerate.
6902
2eedd706
CC
69032011-05-24 Cary Coutant <ccoutant@google.com>
6904
6905 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
6906 incremental_test_4.
6907 * testsuite/Makefile.in: Regenerate.
6908 * testsuite/two_file_test_1_v1.cc: New test source file.
6909 * testsuite/two_file_test_1b_v1.cc: New test source file.
6910 * testsuite/two_file_test_2_v1.cc: New test source file.
6911
0f1c85a6
CC
69122011-05-24 Cary Coutant <ccoutant@google.com>
6913
6914 * dynobj.h (Dynobj::do_dynobj): New function.
6915 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
6916 flag and soname for shared objects.
6917 * incremental.cc (Incremental_inputs::report_object): Make
6918 either Incremental_object_entry or Incremental_dynobj_entry; add
6919 soname to string table.
6920 (Incremental_inputs::report_input_section): Add assertion.
6921 (Output_section_incremental_inputs::set_final_data_size): Adjust
6922 type of input file entry for shared libraries; adjust size of
6923 shared library info entry.
6924 (Output_section_incremental_inputs::write_input_files): Write
6925 as_needed flag for shared libraries.
6926 (Output_section_incremental_inputs::write_info_blocks): Adjust type
6927 of input file entry for shared libraries; write soname.
6928 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
6929 soname from incremental info.
6930 * incremental.h (enum Incremental_input_flags): Add
6931 INCREMENTAL_INPUT_AS_NEEDED.
6932 (Incremental_input_entry::Incremental_input_entry): Initialize new
6933 data member.
6934 (Incremental_input_entry::set_as_needed): New function.
6935 (Incremental_input_entry::as_needed): New function.
6936 (Incremental_input_entry::do_dynobj_entry): New function.
6937 (Incremental_input_entry::as_needed_): New data member.
6938 (Incremental_object_entry::Incremental_object_entry): Don't check
6939 for shared library.
6940 (Incremental_object_entry::do_type): Likewise.
6941 (class Incremental_dynobj_entry): New class.
6942 (Incremental_input_entry_reader::as_needed): New function.
6943 (Incremental_input_entry_reader::get_soname): New function.
6944 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
6945 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
6946 size of shared library info entry.
58797674 6947 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
6948 incremental link when adding DT_NEEDED entries.
6949 * object.h (Object::Object): Initialize new data member.
6950 (Object::dynobj): New function.
6951 (Object::set_as_needed): New function.
6952 (Object::as_needed): New function.
6953 (Object::do_dynobj): New function.
6954 (Object::as_needed_): New data member.
6955
6fa2a40b
CC
69562011-05-24 Cary Coutant <ccoutant@google.com>
6957
6958 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
6959 info; adjust display of GOT entries.
6960 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
6961 vector of input objects; remove file_status_.
6962 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
6963 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
6964 got_plt reader; call target hooks to reserve GOT entries.
6965 (Output_section_incremental_inputs::set_final_data_size): Adjust size
6966 of input file info header and GOT info entry.
6967 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
6968 relocation info.
6969 (Got_plt_view_info::got_descriptor): Remove.
6970 (Got_plt_view_info::sym_index): New data member.
6971 (Got_plt_view_info::input_index): New data member.
6972 (Local_got_offset_visitor::visit): Write input file index.
6973 (Global_got_offset_visitor::visit): Write 0 for input file index.
6974 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
6975 with sym_index and input_index.
6976 (Output_section_incremental_inputs::write_got_plt): Adjust size of
6977 incremental info GOT entry; replace got_descriptor with input_index.
6978 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
6979 map from input file index to object.
6980 (Sized_relobj_incr::do_layout): Replace direct data member reference
6981 with accessor function.
6982 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
6983 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
6984 Adjust size of input file info header.
6985 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
6986 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
6987 (Incremental_input_entry_reader::get_input_section): Adjust size of
6988 input file info header.
6989 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
6990 of incremental info GOT entry.
6991 (Incremental_got_plt_reader::get_got_desc): Remove.
6992 (Incremental_got_plt_reader::get_got_symndx): New function.
6993 (Incremental_got_plt_reader::get_got_input_index): New function.
6994 (Sized_incremental_binary::Sized_incremental_binary): Remove
6995 file_status_; add input_objects_.
6996 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
6997 (Sized_incremental_binary::set_file_is_unchanged): Remove.
6998 (Sized_incremental_binary::file_is_unchanged): Remove.
6999 (Sized_incremental_binary::set_input_object): New function.
7000 (Sized_incremental_binary::input_object): New function.
7001 (Sized_incremental_binary::file_status_): Remove.
7002 (Sized_incremental_binary::input_objects_): New data member.
7003 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
7004 references.
7005 (Sized_relobj_incr::invalid_address): Move to base class.
7006 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
7007 class.
7008 (Sized_relobj_incr::do_output_section_offset): Likewise.
7009 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
7010 (Sized_relobj_incr::section_offsets_): Likewise.
7011 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
7012 function.
7013 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
7014 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
7015 with accessor function.
7016 (Sized_relobj_file::do_layout): Likewise.
7017 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
7018 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
7019 (Sized_relobj_file::compute_final_local_value): Replace refs to
7020 section_offsets_ with accessor function.
7021 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
7022 * object.h (Relobj::Relobj): Initialize new data members.
7023 (Relobj::add_dyn_reloc): New function.
7024 (Relobj::first_dyn_reloc): New function.
7025 (Relobj::dyn_reloc_count): New function.
7026 (Relobj::first_dyn_reloc_): New data member.
7027 (Relobj::dyn_reloc_count_): New data member.
7028 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
7029 references.
7030 (Sized_relobj::Address): New typedef.
7031 (Sized_relobj::invalid_address): Move here from child class.
7032 (Sized_relobj::Sized_relobj): Initialize new data members.
7033 (Sized_relobj::sized_relobj): New function.
7034 (Sized_relobj::is_output_section_offset_invalid): Move here from
7035 child class.
7036 (Sized_relobj::get_output_section_offset): Likewise.
7037 (Sized_relobj::local_has_got_offset): Likewise.
7038 (Sized_relobj::local_got_offset): Likewise.
7039 (Sized_relobj::set_local_got_offset): Likewise.
7040 (Sized_relobj::do_for_all_local_got_entries): Likewise.
7041 (Sized_relobj::clear_got_offsets): New function.
7042 (Sized_relobj::section_offsets): Move here from child class.
7043 (Sized_relobj::do_output_section_offset): Likewise.
7044 (Sized_relobj::do_set_section_offset): Likewise.
7045 (Sized_relobj::Local_got_offsets): Likewise.
7046 (Sized_relobj::local_got_offsets_): Likewise.
7047 (Sized_relobj::section_offsets_): Likewise.
7048 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
7049 references.
7050 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
7051 class.
7052 (Sized_relobj_file::sized_relobj): New function
7053 (Sized_relobj_file::local_has_got_offset): Move to base class.
7054 (Sized_relobj_file::local_got_offset): Likewise.
7055 (Sized_relobj_file::set_local_got_offset): Likewise.
7056 (Sized_relobj_file::get_output_section_offset): Likewise.
7057 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
7058 (Sized_relobj_file::do_output_section_offset): Likewise.
7059 (Sized_relobj_file::do_set_section_offset): Likewise.
7060 (Sized_relobj_file::Local_got_offsets): Likewise.
7061 (Sized_relobj_file::local_got_offsets_): Likewise.
7062 (Sized_relobj_file::section_offsets_): Likewise.
7063 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
7064 (all constructors).
7065 (set_needs_dynsym_index): Convert relobj to derived class pointer.
7066 (Output_reloc::get_symbol_index): Likewise.
7067 (Output_reloc::local_section_offset): Likewise.
7068 (Output_reloc::get_address): Likewise.
7069 (Output_reloc::symbol_value): Likewise.
7070 (Output_data_got::reserve_slot): Move to class definition.
7071 (Output_data_got::reserve_local): New function.
7072 (Output_data_got::reserve_slot_for_global): Remove.
7073 (Output_data_got::reserve_global): New function.
7074 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
7075 (all constructors, two instantiations).
7076 (Output_reloc::get_relobj): New function (two instantiations).
7077 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
7078 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
7079 (Output_data_reloc::add_global): Adjust type of relobj.
7080 (Output_data_reloc::add_global_relative): Likewise.
7081 (Output_data_reloc::add_symbolless_global_addend): Likewise.
7082 (Output_data_reloc::add_local): Likewise.
7083 (Output_data_reloc::add_local_relative): Likewise.
7084 (Output_data_reloc::add_symbolless_local_addend): Likewise.
7085 (Output_data_reloc::add_local_section): Likewise.
7086 (Output_data_reloc::add_output_section): Likewise.
7087 (Output_data_reloc::add_absolute): Likewise.
7088 (Output_data_reloc::add_target_specific): Likewise.
7089 (Output_data_got::reserve_slot): Move definition here.
7090 (Output_data_got::reserve_local): New function.
7091 (Output_data_got::reserve_global): New function.
7092 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
7093 section_offsets_ with accessor function.
7094 (Sized_relobj_file::write_sections): Likewise.
7095 (Sized_relobj_file::do_relocate_sections): Likewise.
7096 * target.h (Sized_target::reserve_local_got_entry): New function.
7097 (Sized_target::reserve_global_got_entry): New function.
7098 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
7099 (Target_x86_64::reserve_global_got_entry): New function.
7100 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
7101
4829d394
CC
71022011-05-23 Cary Coutant <ccoutant@google.com>
7103
7104 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
7105 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
7106 bit when checking got_type.
7107 * incremental.cc (Sized_incremental_binary::setup_readers):
7108 Store symbol table and string table locations; initialize bit vector
7109 of file status flags.
7110 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
7111 unchanged files.
7112 (Sized_incremental_binary::do_process_got_plt): New function.
7113 (Sized_incremental_binary::get_symtab_view): Use stored locations.
7114 (Output_section_incremental_inputs::set_final_data_size): Record
7115 file index for each input file.
7116 (Output_section_incremental_inputs::write_got_plt): Store file index
7117 instead of input entry offset for each GOT entry.
7118 * incremental.h
7119 (Incremental_input_entry::Incremental_input_entry): Initialize new
7120 data member.
7121 (Incremental_input_entry::set_offset): Store file index.
7122 (Incremental_input_entry::get_file_index): New function.
7123 (Incremental_input_entry::file_index_): New data member.
7124 (Incremental_binary::process_got_plt): New function.
7125 (Incremental_binary::do_process_got_plt): New function.
7126 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7127 data members.
7128 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
7129 (Sized_incremental_binary::set_file_is_unchanged): New function.
7130 (Sized_incremental_binary::file_is_unchanged): New function.
7131 (Sized_incremental_binary::do_process_got_plt): New function.
7132 (Sized_incremental_binary::file_status_): New data member.
7133 (Sized_incremental_binary::main_symtab_loc_): New data member.
7134 (Sized_incremental_binary::main_strtab_loc_): New data member.
7135 * output.cc (Output_data_got::Got_entry::write): Add case
7136 RESERVED_CODE.
7137 (Output_data_got::add_global): Call add_got_entry.
7138 (Output_data_got::add_global_plt): Likewise.
7139 (Output_data_got::add_global_with_rel): Likewise.
7140 (Output_data_got::add_global_with_rela): Likewise.
7141 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
7142 (Output_data_got::add_global_pair_with_rela): Likewise.
7143 (Output_data_got::add_local): Call add_got_entry.
7144 (Output_data_got::add_local_plt): Likewise.
7145 (Output_data_got::add_local_with_rel): Likewise.
7146 (Output_data_got::add_local_with_rela): Likewise.
7147 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
7148 (Output_data_got::add_local_pair_with_rela): Likewise.
7149 (Output_data_got::reserve_slot): New function.
7150 (Output_data_got::reserve_slot_for_global): New function.
7151 (Output_data_got::add_got_entry): New function.
7152 (Output_data_got::add_got_entry_pair): New function.
7153 (Output_section::add_output_section_data): Edit FIXME.
7154 * output.h
7155 (Output_section_data_build::Output_section_data_build): New
7156 constructor with size parameter.
7157 (Output_data_space::Output_data_space): Likewise.
7158 (Output_data_got::Output_data_got): Initialize new data member; new
7159 constructor with size parameter.
7160 (Output_data_got::add_constant): Call add_got_entry.
7161 (Output_data_got::reserve_slot): New function.
7162 (Output_data_got::reserve_slot_for_global): New function.
7163 (class Output_data_got::Got_entry): Add RESERVED_CODE.
7164 (Output_data_got::add_got_entry): New function.
7165 (Output_data_got::add_got_entry_pair): New function.
7166 (Output_data_got::free_list_): New data member.
7167 * target.h (Sized_target::init_got_plt_for_update): New function.
7168 (Sized_target::register_global_plt_entry): New function.
7169 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
7170 Initialize new data member; call init; add constructor with PLT count.
7171 (Output_data_plt_x86_64::init): New function.
7172 (Output_data_plt_x86_64::add_relocation): New function.
7173 (Output_data_plt_x86_64::reserve_slot): New function.
7174 (Output_data_plt_x86_64::free_list_): New data member.
7175 (Target_x86_64::init_got_plt_for_update): New function.
7176 (Target_x86_64::register_global_plt_entry): New function.
7177 (Output_data_plt_x86_64::add_entry): Allocate from free list for
7178 incremental updates.
7179 (Output_data_plt_x86_64::add_relocation): New function.
7180 * testsuite/object_unittest.cc (Object_test): Set default options.
7181
ec69d6da
ILT
71822011-05-16 Ian Lance Taylor <iant@google.com>
7183
7184 * options.h (class General_options): Make -i a synonym for -r.
7185
732e31de
ILT
71862011-05-16 Ian Lance Taylor <iant@google.com>
7187
7188 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
7189
403676b5
CC
71902011-05-10 Cary Coutant <ccoutant@google.com>
7191
7192 * object.cc (Sized_relobj::do_count_local_symbols): Check for
7193 strip_all (-s).
7194
5b7b7d6e
ILT
71952011-05-06 Ian Lance Taylor <iant@google.com>
7196
7197 * layout.cc (Layout::layout): If the output section flags change,
7198 update the ordering.
7199
f0f9babf
CC
72002011-04-25 Cary Coutant <ccoutant@google.com>
7201
7202 * incremental-dump.cc (dump_incremental_inputs): Print local
7203 symbol info for each input file.
7204 * incremental.cc
7205 (Output_section_incremental_inputs::set_final_data_size): Add local
7206 symbol info to input file entries in incremental info.
7207 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7208 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
7209 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
7210 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
7211 implementation.
7212 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
7213 (Sized_incr_relobj::do_relocate): Write the local symbols.
7214 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
7215 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
7216 Adjust size of input file header.
7217 (Incremental_inputs_reader::get_local_symbol_offset): New function.
7218 (Incremental_inputs_reader::get_local_symbol_count): New function.
7219 (Incremental_inputs_reader::get_input_section): Adjust size of input
7220 file header.
7221 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
7222 (Sized_incr_relobj::This): New typedef.
7223 (Sized_incr_relobj::sym_size): New const data member.
7224 (Sized_incr_relobj::Local_symbol): New struct.
7225 (Sized_incr_relobj::do_output_local_symbol_count): New function.
7226 (Sized_incr_relobj::do_local_symbol_offset): New function.
7227 (Sized_incr_relobj::local_symbol_count_): New data member.
7228 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
7229 (Sized_incr_relobj::local_symbol_index_): New data member.
7230 (Sized_incr_relobj::local_symbol_offset_): New data member.
7231 (Sized_incr_relobj::local_dynsym_offset_): New data member.
7232 (Sized_incr_relobj::local_symbols_): New data member.
7233 * object.h (Relobj::output_local_symbol_count): New function.
7234 (Relobj::local_symbol_offset): New function.
7235 (Relobj::do_output_local_symbol_count): New function.
7236 (Relobj::do_local_symbol_offset): New function.
7237 (Sized_relobj::do_output_local_symbol_count): New function.
7238 (Sized_relobj::do_local_symbol_offset): New function.
7239
d0a9ace3
ILT
72402011-04-22 Vladimir Simonov <sv@sw.ru>
7241
7242 * descriptors.cc (set_close_on_exec): New function.
7243 (Descriptors::open): Use set_close_on_exec.
7244 * output.cc (S_ISLNK): Define if not defined.
7245
94a3fc8b
CC
72462011-04-22 Cary Coutant <ccoutant@google.com>
7247
7248 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
7249 global symbol map.
7250 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7251 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
7252 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
7253 relocations.
7254 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
7255 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
7256 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
7257 * incremental.h
7258 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
7259 function.
7260 (Incremental_binary::apply_incremental_relocs): New function.
7261 (Incremental_binary::do_apply_incremental_relocs): New function.
7262 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7263 data member.
7264 (Sized_incremental_binary::add_global_symbol): New function.
7265 (Sized_incremental_binary::global_symbol): New function.
7266 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7267 (Sized_incremental_binary::symbol_map_): New data member.
7268 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
7269 * target.h (Sized_target::apply_relocation): New function.
7270 * target-reloc.h (apply_relocation): New function.
7271 * x86_64.cc (Target_x86_64::apply_relocation): New function.
7272
c87e4302
DK
72732011-04-22 Doug Kwan <dougkwan@google.com>
7274
7275 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
7276 flag of a SHT_ARM_EXIDX section.
2e702c99 7277 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
7278 * testsuite/Makefile.in: Regenerate.
7279 * testsuite/arm_exidx_test.s: New file.
7280 * testsuite/arm_exidx_test.sh: Same.
7281
e7782cf6
CC
72822011-04-20 Cary Coutant <ccoutant@google.com>
7283
7284 PR gold/12689
7285 * archive.h (Incremental_archive_entry::Archive_member):
7286 Initialize arg_serial_ (second constructor).
7287
308ecdc7
ILT
72882011-04-17 Ian Lance Taylor <iant@google.com>
7289
7290 * object.cc (Relocate_info::location): Simplify location string.
7291 * errors.cc (Errors::error_at_location): Don't print program
7292 name.
7293 (Errors::warning_at_location): Likewise.
7294 (Errors::undefined_symbol): Likewise.
7295 * testsuite/debug_msg.sh: Update accordingly.
7296
bec5b579
CC
72972011-04-14 Cary Coutant <ccoutant@google.com>
7298
7299 * gold/layout.cc (Layout::symtab_section_offset): New function.
7300 * gold/layout.h (Layout::symtab_section_offset): New function.
7301 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
7302
88597d34
ILT
73032011-04-12 Ian Lance Taylor <iant@google.com>
7304
7305 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
7306 with MREMAP_MAYMOVE.
7307 * output.h (class Output_file): Add map_is_allocated_ field.
7308 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
7309 not available, provide stubs. If mremap is not available, #define
7310 it to gold_mremap.
7311 (MREMAP_MAYMOVE): Define if not defined.
7312 (Output_file::Output_file): Initialize map_is_allocated_.
7313 (Output_file::resize): Check map_is_allocated_.
7314 (Output_file::map_anonymous): If mmap fails, use malloc.
7315 (Output_file::unmap): Don't do anything for an anonymous map.
7316 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
7317 is not available, provide stubs.
7318 (File_read::View::~View): Use free rather than delete[].
7319 (File_read::make_view): Use malloc rather than new[]. If mmap
7320 fails, use malloc.
7321 (File_read::find_or_make_view): Use malloc rather than new[].
7322 * gold.h: Remove HAVE_REMAP code.
7323 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
7324 exists. Rename mremap to gold_mremap. If mmap is not available
7325 don't do anything.
7326 * configure, config.in: Rebuild.
7327
11e361bc
ILT
73282011-04-11 Ian Lance Taylor <iant@google.com>
7329
7330 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
7331 initialize local variable v.
7332
cdc29364
CC
73332011-04-11 Cary Coutant <ccoutant@google.com>
7334
7335 * archive.cc (Archive::include_member): Adjust call to
7336 report_object.
7337 (Add_archive_symbols::run): Track argument serial numbers.
7338 (Lib_group::include_member): Likewise.
7339 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
7340 * archive.h (Incremental_archive_entry::Archive_member):
7341 Initialize arg_serial_.
7342 (Archive_member::arg_serial_): New data member.
7343 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
7344 (Sized_dynobj::do_add_symbols): Track symbols when doing an
7345 incremental link.
7346 (Sized_dynobj::do_for_all_local_got_entries): New function.
7347 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
7348 function.
7349 * fileread.cc (get_mtime): New function.
7350 * fileread.h (get_mtime): New function.
7351 * gold.cc (queue_initial_tasks): Check for incremental update.
7352 (process_incremental_input): New function.
7353 (queue_middle_tasks): Don't force valid target for incremental
7354 update.
7355 * incremental-dump.cc (find_input_containing_global): Adjust
7356 size of symbol info entry.
7357 (dump_incremental_inputs): Dump argument serial number and
7358 in_system_directory flag; bias shndx by 1; print symbol names
7359 when dumping per-file symbol lists; use new symbol info readers.
7360 * incremental.cc
7361 (Output_section_incremental_inputs:update_data_size): New function.
7362 (Sized_incremental_binary::setup_readers): Setup input readers
7363 for each input file; build maps for files added from libraries
7364 and scripts.
7365 (Sized_incremental_binary::check_input_args): New function.
7366 (Sized_incremental_binary::do_check_inputs): Build map of argument
7367 serial numbers to input arguments.
7368 (Sized_incremental_binary::do_file_has_changed): Rename
7369 do_file_is_unchanged to this; compare file modification times.
7370 (Sized_incremental_binary::do_init_layout): New function.
7371 (Sized_incremental_binary::do_reserve_layout): New function.
7372 (Sized_incremental_binary::do_get_input_reader): Remove.
7373 (Sized_incremental_binary::get_symtab_view): New function.
7374 (Incremental_checker::can_incrementally_link_output_file): Remove.
7375 (Incremental_inputs::report_command_line): Exclude --debug options.
7376 (Incremental_inputs::report_archive_begin): Add parameter; track
7377 argument serial numbers; don't put input file entry for archive
7378 before archive members.
7379 (Incremental_inputs::report_archive_end): Put input file entry
7380 for archive after archive members.
7381 (Incremental_inputs::report_object): Add parameter; track argument
7382 serial numbers and in_system_directory flag.
7383 (Incremental_inputs::report_script): Add parameter; track argument
7384 serial numbers.
7385 (Output_section_incremental_inputs::set_final_data_size): Adjust
7386 size of symbol info entry; check for forwarding symbols.
7387 (Output_section_incremental_inputs::write_input_files): Write
7388 in_system_directory flag and argument serial number.
7389 (Output_section_incremental_inputs::write_info_blocks): Map section
7390 indices between incremental info and original input file; store
7391 input section index for each symbol.
7392 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
7393 change operator() to visit().
7394 (class Global_got_offset_visitor): Likewise.
7395 (class Global_symbol_visitor_got_plt):
7396 (Output_section_incremental_inputs::write_got_plt): Use new visitor
7397 classes.
7398 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
7399 (Sized_incr_relobj::do_read_symbols): New function.
7400 (Sized_incr_relobj::do_layout): New function.
7401 (Sized_incr_relobj::do_layout_deferred_sections): New function.
7402 (Sized_incr_relobj::do_add_symbols): New function.
7403 (Sized_incr_relobj::do_should_include_member): New function.
7404 (Sized_incr_relobj::do_for_all_global_symbols): New function.
7405 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
7406 (Sized_incr_relobj::do_section_size): New function.
7407 (Sized_incr_relobj::do_section_name): New function.
7408 (Sized_incr_relobj::do_section_contents): New function.
7409 (Sized_incr_relobj::do_section_flags): New function.
7410 (Sized_incr_relobj::do_section_entsize): New function.
7411 (Sized_incr_relobj::do_section_address): New function.
7412 (Sized_incr_relobj::do_section_type): New function.
7413 (Sized_incr_relobj::do_section_link): New function.
7414 (Sized_incr_relobj::do_section_info): New function.
7415 (Sized_incr_relobj::do_section_addralign): New function.
7416 (Sized_incr_relobj::do_initialize_xindex): New function.
7417 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
7418 (Sized_incr_relobj::do_read_relocs): New function.
7419 (Sized_incr_relobj::do_gc_process_relocs): New function.
7420 (Sized_incr_relobj::do_scan_relocs): New function.
7421 (Sized_incr_relobj::do_count_local_symbols): New function.
7422 (Sized_incr_relobj::do_finalize_local_symbols): New function.
7423 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
7424 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
7425 (Sized_incr_relobj::do_relocate): New function.
7426 (Sized_incr_relobj::do_set_section_offset): New function.
7427 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
7428 (Sized_incr_dynobj::do_read_symbols): New function.
7429 (Sized_incr_dynobj::do_layout): New function.
7430 (Sized_incr_dynobj::do_add_symbols): New function.
7431 (Sized_incr_dynobj::do_should_include_member): New function.
7432 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
7433 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
7434 (Sized_incr_dynobj::do_section_size): New function.
7435 (Sized_incr_dynobj::do_section_name): New function.
7436 (Sized_incr_dynobj::do_section_contents): New function.
7437 (Sized_incr_dynobj::do_section_flags): New function.
7438 (Sized_incr_dynobj::do_section_entsize): New function.
7439 (Sized_incr_dynobj::do_section_address): New function.
7440 (Sized_incr_dynobj::do_section_type): New function.
7441 (Sized_incr_dynobj::do_section_link): New function.
7442 (Sized_incr_dynobj::do_section_info): New function.
7443 (Sized_incr_dynobj::do_section_addralign): New function.
7444 (Sized_incr_dynobj::do_initialize_xindex): New function.
7445 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
7446 (make_sized_incremental_object): New function.
7447 (Incremental_library::copy_unused_symbols): New function.
7448 (Incremental_library::do_for_all_unused_symbols): New function.
7449 * incremental.h (enum Incremental_input_flags): New type.
7450 (class Incremental_checker): Remove.
7451 (Incremental_input_entry::Incremental_input_entry): Add argument
7452 serial number.
7453 (Incremental_input_entry::arg_serial): New function.
7454 (Incremental_input_entry::set_is_in_system_directory): New function.
7455 (Incremental_input_entry::is_in_system_directory): New function.
7456 (Incremental_input_entry::arg_serial_): New data member.
7457 (Incremental_input_entry::is_in_system_directory_): New data member.
7458 (class Script_info): Move here from script.h.
7459 (Script_info::Script_info): Add filename parameter.
7460 (Script_info::filename): New function.
7461 (Script_info::filename_): New data member.
7462 (Incremental_script_entry::Incremental_script_entry): Add argument
7463 serial number.
7464 (Incremental_object_entry::Incremental_object_entry): Likewise.
7465 (Incremental_object_entry::add_input_section): Build list of input
7466 sections with map to original shndx.
7467 (Incremental_object_entry::get_input_section_index): New function.
7468 (Incremental_object_entry::shndx_): New data member.
7469 (Incremental_object_entry::name_key_): Rename; adjust all refs.
7470 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
7471 (Incremental_archive_entry::Incremental_archive_entry): Add argument
7472 serial number.
7473 (Incremental_inputs::report_archive_begin): Likewise.
7474 (Incremental_inputs::report_object): Likewise.
7475 (Incremental_inputs::report_script): Likewise.
7476 (class Incremental_global_symbol_reader): New class.
7477 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
7478 and store flags and input file type.
7479 (Incremental_input_entry_reader::arg_serial): New function.
7480 (Incremental_input_entry_reader::type): Extract type from flags.
7481 (Incremental_input_entry_reader::is_in_system_directory): New function.
7482 (Incremental_input_entry_reader::get_input_section_count): Call
7483 accessor function for type.
7484 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
7485 function for type; adjust size of global symbol entry.
7486 (Incremental_input_entry_reader::get_global_symbol_count): Call
7487 accessor function for type.
7488 (Incremental_input_entry_reader::get_object_count): Likewise.
7489 (Incremental_input_entry_reader::get_object_offset): Likewise.
7490 (Incremental_input_entry_reader::get_member_count): Likewise.
7491 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
7492 (Incremental_input_entry_reader::get_member_offset): Likewise.
7493 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
7494 (Incremental_input_entry_reader::Global_symbol_info): Remove.
7495 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
7496 (Incremental_input_entry_reader::get_global_symbol_reader): New
7497 function.
7498 (Incremental_input_entry_reader::get_output_symbol_index): New
7499 function.
7500 (Incremental_input_entry_reader::type_): Remove.
7501 (Incremental_input_entry_reader::flags_): New data member.
7502 (Incremental_inputs_reader::input_file_offset): New function.
7503 (Incremental_inputs_reader::input_file_index): New function.
7504 (Incremental_inputs_reader::input_file): Call input_file_offset.
7505 (Incremental_inputs_reader::input_file_at_offset): New function.
7506 (Incremental_relocs_reader::get_r_type): Reformat.
7507 (Incremental_relocs_reader::get_r_shndx): Reformat.
7508 (Incremental_relocs_reader::get_r_offset): Reformat.
7509 (Incremental_relocs_reader::data): New function.
7510 (Incremental_binary::Incremental_binary): Initialize new data members.
7511 (Incremental_binary::check_inputs): Add cmdline parameter.
7512 (Incremental_binary::file_is_unchanged): Remove.
7513 (Input_reader::arg_serial): New function.
7514 (Input_reader::get_unused_symbol_count): New function.
7515 (Input_reader::get_unused_symbol): New function.
7516 (Input_reader::do_arg_serial): New function.
7517 (Input_reader::do_get_unused_symbol_count): New function.
7518 (Input_reader::do_get_unused_symbol): New function.
7519 (Incremental_binary::input_file_count): New function.
7520 (Incremental_binary::get_input_reader): Change signature to use
7521 index instead of filename.
7522 (Incremental_binary::file_has_changed): New function.
7523 (Incremental_binary::get_input_argument): New function.
7524 (Incremental_binary::get_library): New function.
7525 (Incremental_binary::get_script_info): New function.
7526 (Incremental_binary::init_layout): New function.
7527 (Incremental_binary::reserve_layout): New function.
7528 (Incremental_binary::output_file): New function.
7529 (Incremental_binary::do_check_inputs): New function.
7530 (Incremental_binary::do_file_is_unchanged): Remove.
7531 (Incremental_binary::do_file_has_changed): New function.
7532 (Incremental_binary::do_init_layout): New function.
7533 (Incremental_binary::do_reserve_layout): New function.
7534 (Incremental_binary::do_input_file_count): New function.
7535 (Incremental_binary::do_get_input_reader): Change signature.
7536 (Incremental_binary::input_args_map_): New data member.
7537 (Incremental_binary::library_map_): New data member.
7538 (Incremental_binary::script_map_): New data member.
7539 (Sized_incremental_binary::Sized_incremental_binary): Initialize
7540 new data members.
7541 (Sized_incremental_binary::output_section): New function.
7542 (Sized_incremental_binary::inputs_reader): Add const.
7543 (Sized_incremental_binary::symtab_reader): Add const.
7544 (Sized_incremental_binary::relocs_reader): Add const.
7545 (Sized_incremental_binary::got_plt_reader): Add const.
7546 (Sized_incremental_binary::get_symtab_view): New function.
7547 (Sized_incremental_binary::Inputs_reader): New typedef.
7548 (Sized_incremental_binary::Input_entry_reader): New typedef.
7549 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
7550 (Sized_incremental_binary::do_file_is_unchanged): Remove.
7551 (Sized_incremental_binary::do_file_has_changed): New function.
7552 (Sized_incremental_binary::do_init_layout): New function.
7553 (Sized_incremental_binary::do_reserve_layout): New function.
7554 (Sized_input_reader::Inputs_reader): Remove.
7555 (Sized_input_reader::Input_entry_reader): Remove.
7556 (Sized_input_reader::do_arg_serial): New function.
7557 (Sized_input_reader::do_get_unused_symbol_count): New function.
7558 (Sized_input_reader::do_get_unused_symbol): New function.
7559 (Sized_incremental_binary::do_input_file_count): New function.
7560 (Sized_incremental_binary::do_get_input_reader): Change signature;
7561 use index instead of filename.
7562 (Sized_incremental_binary::section_map_): New data member.
7563 (Sized_incremental_binary::input_entry_readers_): New data member.
7564 (class Sized_incr_relobj): New class.
7565 (class Sized_incr_dynobj): New class.
7566 (make_sized_incremental_object): New function.
7567 (class Incremental_library): New class.
7568 * layout.cc (Free_list::num_lists): New static data member.
7569 (Free_list::num_nodes): New static data member.
7570 (Free_list::num_removes): New static data member.
7571 (Free_list::num_remove_visits): New static data member.
7572 (Free_list::num_allocates): New static data member.
7573 (Free_list::num_allocate_visits): New static data member.
7574 (Free_list::init): New function.
7575 (Free_list::remove): New function.
7576 (Free_list::allocate): New function.
7577 (Free_list::dump): New function.
7578 (Free_list::print_stats): New function.
7579 (Layout_task_runner::run): Resize output file for incremental updates.
7580 (Layout::Layout): Initialize new data members.
7581 (Layout::set_incremental_base): New function.
7582 (Layout::init_fixed_output_section): New function.
7583 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
7584 incremental updates.
7585 (Layout::create_gold_note): Do not create gold note section for
7586 incremental updates.
7587 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
7588 for incremental updates.
7589 (Layout::set_section_offsets): For incremental updates, allocate space
7590 from free list.
7591 (Layout::create_symtab_sections): Layout with offsets relative to
7592 start of section; for incremental updates, allocate space from free
7593 list.
7594 (Layout::create_shdrs): For incremental updates, allocate space from
7595 free list.
7596 (Layout::finish_dynamic_section): For incremental updates, do not
7597 check --as-needed (fixed in subsequent patch).
7598 * layout.h (class Free_list): New class.
7599 (Layout::set_incremental_base): New function.
7600 (Layout::incremental_base): New function.
7601 (Layout::init_fixed_output_section): New function.
7602 (Layout::allocate): New function.
7603 (Layout::incremental_base_): New data member.
7604 (Layout::free_list_): New data member.
7605 * main.cc (main): Print Free_list statistics.
7606 * object.cc (Relobj::finalize_incremental_relocs): Add
7607 clear_counts parameter; clear counts only when clear_counts is set.
7608 (Sized_relobj::Sized_relobj): Initialize new base class.
7609 (Sized_relobj::do_layout): Don't report special sections.
7610 (Sized_relobj::do_for_all_local_got_entries): New function.
7611 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
7612 symtab_off to all symbol table offsets.
7613 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
7614 * object.h (class Got_offset_list): Move to top of file.
7615 (Object::Object): Allow case where input_file == NULL.
7616 (Object::~Object): Likewise.
7617 (Object::input_file): Assert that input_file != NULL.
7618 (Object::lock): Allow case where input_file == NULL.
7619 (Object::unlock): Likewise.
7620 (Object::is_locked): Likewise.
7621 (Object::token): Likewise.
7622 (Object::release): Likewise.
7623 (Object::is_incremental): New function.
7624 (Object::get_mtime): New function.
7625 (Object::for_all_local_got_entries): New function.
7626 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
7627 (Object::set_is_in_system_directory): New function.
7628 (Object::is_in_system_directory): New function.
7629 (Object::do_is_incremental): New function.
7630 (Object::do_get_mtime): New function.
7631 (Object::do_for_all_local_got_entries): New function.
7632 (Object::is_in_system_directory_): New data member.
7633 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
7634 (class Sized_relobj_base): New class.
7635 (class Sized_relobj): Derive from Sized_relobj_base.
7636 (class Sized_relobj::Symbols): Redeclare from base class.
7637 (class Sized_relobj::local_got_offset_list): Remove.
7638 (class Sized_relobj::Output_sections): Redeclare from base class.
7639 (class Sized_relobj::do_for_all_local_got_entries): New function.
7640 (class Sized_relobj::write_local_symbols): Add offset parameter.
7641 (class Sized_relobj::local_symbol_offset_): Update comment.
7642 (class Sized_relobj::local_dynsym_offset_): Update comment.
7643 * options.cc (Input_arguments::add_file): Remove const.
7644 * options.h (Input_file_argument::Input_file_argument):
7645 Initialize arg_serial_ (all constructors).
7646 (Input_file_argument::set_arg_serial): New function.
7647 (Input_file_argument::arg_serial): New function.
7648 (Input_file_argument::arg_serial_): New data member.
7649 (Input_arguments::Input_arguments): Initialize file_count_.
7650 (Input_arguments::add_file): Remove const.
7651 (Input_arguments::number_of_input_files): New function.
7652 (Input_arguments::file_count_): New data member.
7653 (Command_line::number_of_input_files): Call
7654 Input_arguments::number_of_input_files.
7655 * output.cc (Output_segment_headers::Output_segment_headers):
7656 Set current size.
7657 (Output_section::Input_section::current_data_size): New function.
7658 (Output_section::Output_section): Initialize new data members.
7659 (Output_section::add_input_section): Don't do merge sections for
7660 an incremental link; allocate space from free list for an
7661 incremental update.
7662 (Output_section::add_output_section_data): Allocate space from
7663 free list for an incremental update.
7664 (Output_section::update_data_size): New function.
7665 (Output_section::set_fixed_layout): New function.
7666 (Output_section::reserve): New function.
7667 (Output_segment::set_section_addresses): Remove const.
7668 (Output_segment::set_section_list_addresses): Remove const; allocate
7669 space from free list for an incremental update.
7670 (Output_segment::set_offset): Adjust size of RELRO segment for an
7671 incremental update.
7672 * output.h (Output_data::current_data_size): Move here from
7673 child classes.
7674 (Output_data::pre_finalize_data_size): New function.
7675 (Output_data::update_data_size): New function.
7676 (Output_section_headers::update_data_size): new function.
7677 (Output_section_data_build::current_data_size): Move to Output_data.
7678 (Output_data_strtab::update_data_size): New function.
7679 (Output_section::current_data_size): Move to Output_data.
7680 (Output_section::set_fixed_layout): New function.
7681 (Output_section::has_fixed_layout): New function.
7682 (Output_section::reserve): New function.
7683 (Output_section::update_data_size): New function.
7684 (Output_section::has_fixed_layout_): New data member.
7685 (Output_section::free_list_): New data member.
7686 (Output_segment::set_section_addresses): Remove const.
7687 (Output_segment::set_section_list_addresses): Remove const.
7688 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
7689 New function.
7690 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
7691 New function.
7692 * readsyms.cc (Read_symbols::do_read_symbols): Add library
7693 parameter when calling Add_symbols constructor; store argument
7694 serial number for members of a lib group.
7695 (Add_symbols::locks): Allow case where token == NULL.
7696 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
7697 (Read_member::~Read_member): New function.
7698 (Read_member::is_runnable): New function.
7699 (Read_member::locks): New function.
7700 (Read_member::run): New function.
7701 (Check_script::~Check_script): New function.
7702 (Check_script::is_runnable): New function.
7703 (Check_script::locks): New function.
7704 (Check_script::run): New function.
7705 (Check_library::~Check_library): New function.
7706 (Check_library::is_runnable): New function.
7707 (Check_library::locks): New function.
7708 (Check_library::run): New function.
7709 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
7710 (Add_symbols::library_): New data member.
7711 (class Read_member): New class.
7712 (class Check_script): New class.
7713 (class Check_library): New class.
7714 * reloc.cc (Read_relocs::is_runnable): Allow case where
7715 token == NULL.
7716 (Read_relocs::locks): Likewise.
7717 (Scan_relocs::locks): Likewise.
7718 (Relocate_task::locks): Likewise.
7719 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
7720 to clear counters.
7721 (Sized_relobj::incremental_relocs_scan): Fix comment.
7722 (Sized_relobj::do_relocate): Pass output file offset to
7723 write_local_symbols.
7724 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
7725 from class declaration.
7726 * script.cc (read_input_script): Allocate Script_info; pass
7727 argument serial number to report_script.
7728 * script.h (class Script_info): Move to incremental.h.
7729 * symtab.cc (Symbol_table::add_from_incrobj): New function.
7730 * symtab.h (Symbol_table::add_from_incrobj): New function.
7731 (Symbol_table::set_file_offset): New function.
7732
b961d0d7
CC
77332011-04-05 Cary Coutant <ccoutant@google.com>
7734
7735 * incremental-dump.cc (dump_incremental_inputs): Change signature
7736 to take a Sized_incremental_binary; change caller. Use readers
7737 in Sized_incremental_binary.
7738 * incremental.cc
7739 (Sized_incremental_binary::find_incremental_inputs_sections):
7740 Rename do_find_incremental_inputs_sections to this.
7741 (Sized_incremental_binary::setup_readers): New function.
7742 (Sized_incremental_binary::do_check_inputs): Check
7743 has_incremental_info_ flag; move setup code to setup_readers;
7744 use input readers.
7745 (Sized_incremental_binary::do_file_is_unchanged): New function.
7746 (Sized_incremental_binary::do_get_input_reader): New function.
7747 * incremental.h (class Incremental_binary): Move to end of file.
7748 (Incremental_binary::file_is_unchanged): New function.
7749 (Incremental_binary::do_file_is_unchanged): New function.
7750 (Incremental_binary::Input_reader): New class.
7751 (Incremental_binary::get_input_reader): New function.
7752 (class Sized_incremental_binary): Move to end of file.
7753 (Sized_incremental_binary::Sized_incremental_binary): Setup the
7754 input section reader classes.
7755 (Sized_incremental_binary::has_incremental_info): New function.
7756 (Sized_incremental_binary::inputs_reader): New function.
7757 (Sized_incremental_binary::symtab_reader): New function.
7758 (Sized_incremental_binary::relocs_reader): New function.
7759 (Sized_incremental_binary::got_plt_reader): New function.
7760 (Sized_incremental_binary::do_file_is_unchanged): New function.
7761 (Sized_incremental_binary::Sized_input_reader): New class.
7762 (Sized_incremental_binary::get_input_reader): New function.
7763 (Sized_incremental_binary::find_incremental_inputs_sections):
7764 Rename do_find_incremental_inputs_sections to this.
7765 (Sized_incremental_binary::setup_readers): New function.
7766 (Sized_incremental_binary::has_incremental_info_): New data member.
7767 (Sized_incremental_binary::inputs_reader_): New data member.
7768 (Sized_incremental_binary::symtab_reader_): New data member.
7769 (Sized_incremental_binary::relocs_reader_): New data member.
7770 (Sized_incremental_binary::got_plt_reader_): New data member.
7771 (Sized_incremental_binary::current_input_file_): New data member.
7772
a869183f
PP
77732011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
7774
7775 PR gold/12640
7776 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
7777 violation.
7778
77792011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
7780
7781 * archive.cc (Archive::include_member): Adjust call to report_object.
7782 (Add_archive_symbols::run): Add script_info to call to
7783 report_archive_begin.
7784 (Lib_group::include_member): Adjust call to report_object.
7785 (Add_lib_group_symbols::run): Adjust call to report_object.
7786 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
7787 blocks. Add object count for script input files.
7788 * incremental.cc (Incremental_inputs::report_archive_begin): Add
7789 script_info parameter; change all callers.
7790 (Incremental_inputs::report_object): Add script_info parameter;
7791 change all callers.
7792 (Incremental_inputs::report_script): Store backpointer to
7793 incremental info entry.
7794 (Output_section_incremental_inputs::set_final_data_size): Record
7795 additional information for scripts.
7796 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7797 * incremental.h (Incremental_script_entry::add_object): New function.
7798 (Incremental_script_entry::get_object_count): New function.
7799 (Incremental_script_entry::get_object): New function.
7800 (Incremental_script_entry::objects_): New data member; adjust
7801 constructor.
7802 (Incremental_inputs::report_archive_begin): Add script_info parameter.
7803 (Incremental_inputs::report_object): Add script_info parameter.
7804 (Incremental_inputs_reader::get_object_count): New function.
7805 (Incremental_inputs_reader::get_object_offset): New function.
7806 * options.cc (Input_arguments::add_file): Return reference to
7807 new input argument.
7808 * options.h (Input_argument::set_script_info): New function.
7809 (Input_argument::script_info): New function.
7810 (Input_argument::script_info_): New data member; adjust all
7811 constructors.
7812 (Input_file_group::add_file): Return reference to new input argument.
7813 (Input_file_lib::add_file): Likewise.
7814 (Input_arguments::add_file): Likewise.
7815 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
7816 * script.cc (Parser_closure::Parser_closure): Add script_info
7817 parameter; adjust all callers.
7818 (Parser_closure::script_info): New function.
7819 (Parser_closure::script_info_): New data member.
7820 (read_input_script): Report scripts earlier to incremental info.
7821 (script_add_file): Set script_info in Input_argument.
7822 (script_add_library): Likewise.
7823 * script.h (Script_options::Script_info): Rewrite class.
7824
a869183f 78252011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
7826
7827 * archive.cc (Library_base::should_include_member): Move
7828 method here from class Archive.
7829 (Archive::Archive): Initialize base class.
7830 (Archive::should_include_member): Move to base class.
7831 (Archive::do_for_all_unused_symbols): New function.
7832 (Add_archive_symbols::run): Remove redundant access to
7833 incremental_inputs.
7834 (Lib_group::Lib_group): Initialize base class.
7835 (Lib_group::do_filename): New function.
7836 (Lib_group::include_member): Pass pointer to Lib_group to
7837 report_object.
7838 (Lib_group::do_for_all_unused_symbols): New function.
7839 (Add_lib_group_symbols::run): Report archive information for
7840 incremental links.
7841 * archive.h (class Library_base): New base class.
7842 (class Archive): Derive from Library_base.
7843 (Archive::filename): Move to base class.
7844 (Archive::set_incremental_info): Likewise.
7845 (Archive::incremental_info): Likewise.
7846 (Archive::Should_include): Likewise.
7847 (Archive::should_include_member): Likewise.
7848 (Archive::Armap_entry): Remove.
7849 (Archive::Unused_symbol_iterator): Remove.
7850 (Archive::unused_symbols_begin): Remove.
7851 (Archive::unused_symbols_end): Remove.
7852 (Archive::do_filename): New function.
7853 (Archive::do_get_mtime): New function.
7854 (Archive::do_for_all_unused_symbols): New function.
7855 (Archive::task_): Move to base class.
7856 (Archive::incremental_info_): Likewise.
7857 (class Lib_group): Derive from Library_base.
7858 (Lib_group::do_filename): New function.
7859 (Lib_group::do_get_mtime): New function.
7860 (Lib_group::do_for_all_unused_symbols): New function.
7861 (Lib_group::task_): Move to base class.
7862 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
7863 function.
7864 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
7865 function.
7866 * incremental.cc (Incremental_inputs::report_archive_begin):
7867 Use Library_base; call library's get_mtime; add incremental inputs
7868 entry before members.
7869 (class Unused_symbol_visitor): New class.
7870 (Incremental_inputs::report_archive_end): Use Library_base; use
7871 visitor class to record unused symbols; don't add incremental inputs
7872 entry after members.
7873 (Incremental_inputs::report_object): Use Library_base.
7874 * incremental.h
7875 (Incremental_archive_entry::Incremental_archive_entry): Remove
7876 unused Archive parameter.
7877 (Incremental_inputs::report_archive_begin): Use Library_base.
7878 (Incremental_inputs::report_archive_end): Likewise.
7879 (Incremental_inputs::report_object): Likewise.
7880 * object.cc (Sized_relobj::do_for_all_global_symbols): New
7881 function.
7882 * object.h (Object::for_all_global_symbols): New function.
7883 (Object::do_for_all_global_symbols): New function.
7884 (Sized_relobj::do_for_all_global_symbols): New function.
7885 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
7886 function.
7887 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
7888 function.
7889
61ab3e40
ILT
78902011-03-27 Ian Lance Taylor <iant@google.com>
7891
7892 * archive.cc (Archive::interpret_header): Return -1 if something
7893 goes wrong. Change callers accordingly.
7894
30e1f9e6
CC
78952011-03-25 Cary Coutant <ccoutant@google.com>
7896
7897 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
7898 * testsuite/Makefile.in: Regenerate.
7899
9370ce59 79002011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
7901
7902 * plugin.cc (get_view): New.
7903 (Plugin::load): Pass get_view to the plugin.
7904 (Plugin_manager::get_view): New.
7905
9312bb0a
ILT
79062011-03-21 Ian Lance Taylor <iant@google.com>
7907
7908 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 7909 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 7910
7e12ba9e
ST
79112011-03-21 Sriraman Tallam <tmsriram@google.com>
7912
7913 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
7914 Change == to -eq.
7915 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
7916 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
7917 Change == to -eq.
7918 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
7919 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
7920
fd7a005d
ILT
79212011-03-14 Ian Lance Taylor <iant@google.com>
7922
7923 * script-sections.cc (Sort_output_sections::script_compare):
7924 Rename from is_before, change return type.
7925 (Sort_output_sections::operator()): Adjust accordingly.
7926
ed16fd1b
ILT
79272011-03-11 Jeffrey Yasskin <jyasskin@google.com>
7928
7929 PR gold/12572
7930 * testsuite/odr_violation2.cc: Add comment to make all error line
7931 numbers double digits.
7932 * testsuite/debug_msg.sh: Adjust expected errors.
7933
71ff8986
ILT
79342011-03-09 Jeffrey Yasskin <jyasskin@google.com>
7935
7936 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
7937 but mark earlier ones as non-canonical
7938 (offset_to_iterator): Update search target and example
7939 (do_addr2line): Return extra lines in a vector*
7940 (format_file_lineno): Extract from do_addr2line
7941 (one_addr2line): Add vector* out-param
7942 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
7943 when a lineno entry appeared last for its instruction
7944 (Dwarf_line_info): Add vector* out-param
7945 * object.cc (Relocate_info): Pass NULL for the vector* out-param
7946 * symtab.cc (Odr_violation_compare): Include the lineno in the
7947 comparison again.
7948 (linenos_from_loc): New. Combine the canonical line for an
7949 address with its other lines.
7950 (True_if_intersect): New. Helper functor to make
7951 std::set_intersection a query.
7952 (detect_odr_violations): Compare sets of lines instead of just
7953 one line for each function. This became less deterministic, but
7954 has fewer false positives.
7955 * symtab.h: Declarations.
7956 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
7957 mix an optimized and non-optimized object in the same binary
7958 (odr_violation2.so): Same.
7959 * testsuite/Makefile.in: Regenerate from Makefile.am.
7960 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
7961 * testsuite/debug_msg.sh: Update line numbers and add
7962 assertions.
7963 * testsuite/odr_violation1.cc: Use OdrDerived, in a
7964 non-optimized context.
7965 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
7966 isn't inlined, and use OdrDerived in an optimized context.
7967 * testsuite/odr_header1.h: Defines OdrDerived, where
7968 optimization will change the
7969 first-instruction-in-the-destructor's file and line number.
7970 * testsuite/odr_header2.h: Defines OdrBase.
7971
a19fefdc
ILT
79722011-03-09 Ian Lance Taylor <iant@google.com>
7973
7974 * fileread.cc (File_read::clear_views): Don't delete the whole
7975 file view.
7976
ecb351e9
ILT
79772011-03-08 Ian Lance Taylor <iant@google.com>
7978
7979 PR gold/12525
7980 * fileread.cc: #include <climits>.
7981 (GOLD_IOV_MAX): Define.
7982 (File_read::read_multiple): Limit number of entries by iov_max.
7983 * fileread.h (class File_read): Always set max_readv_entries to
7984 128.
7985
b821d13c
ILT
79862011-03-07 Ian Lance Taylor <iant@google.com>
7987
7988 PR gold/12525
7989 * options.h (class General_options): Add -dy and -dn.
7990
89243142
CC
79912011-03-02 Cary Coutant <ccoutant@google.com>
7992
7993 * testsuite/script_test_9.t: Add TLS segment.
7994
d0773f31
ILT
79952011-03-02 Simon Baldwin <simonb@google.com>
7996
7997 * configure.ac: Add check for gnu_indirect_function support in
7998 the toolchain building binutils.
7999 * configure: Rebuild.
8000
9370ce59 80012011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
8002
8003 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
8004 plugin only symbols.
8005 (Symbol_table::sized_finalize_symbol) Mark symbol only present
8006 in plugin files as not needed in the symbol table.
8007
4cf7a849
ST
80082011-02-11 Sriraman Tallam <tmsriram@google.com>
8009
8010 * output.cc (Output_section::add_input_section): Delay fill
8011 generation for section ordering.
8012
b578bd7d
ILT
80132011-02-09 Ian Lance Taylor <iant@google.com>
8014
8015 PR gold/12316
8016 * object.h (class Sized_relobj): Remove clear_local_symbols.
8017 * reloc.cc (Sized_relobj::do_relocate): Don't call
8018 clear_local_symbols.
8019
9370ce59 80202011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
8021
8022 * plugin.cc (is_visible_from_outside): Return true for symbols
8023 in the -u option.
8024
55382fb7
ILT
80252011-02-04 Jeffrey Yasskin <jyasskin@google.com>
8026
8027 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
8028 filename.
8029
4e271fff
ST
80302011-02-02 Sriraman Tallam <tmsriram@google.com>
8031
8032 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 8033 to std::string.
4e271fff 8034 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 8035 section_name to be std::string.
4e271fff
ST
8036 (is_function_ctor_or_dtor): Change type of parameter to std::string.
8037
d433c3ac
ILT
80382011-01-25 Ian Lance Taylor <iant@google.com>
8039
8040 * script.cc (script_add_extern): Rewrite to use
8041 add_symbol_reference.
8042
880473a6
DK
80432011-01-25 Doug Kwan <dougkwan@google.com>
8044
d433c3ac 8045 * icf.cc (get_section_contents): Always lock section's object.
880473a6 8046
f30f86fa
ILT
80472011-01-24 Ian Lance Taylor <iant@google.com>
8048
8049 * options.h (class General_options): Accept
8050 --no-detect-odr-violations.
8051
8e51a0b9
ILT
80522011-01-24 Ian Lance Taylor <iant@google.com>
8053
8054 * version.cc (version_string): Bump to 1.11.
8055
0f3b89d8
ILT
80562011-01-24 Ian Lance Taylor <iant@google.com>
8057
8058 * plugin.cc (class Plugin_rescan): Define new class.
8059 (Plugin_manager::claim_file): Set any_claimed_.
8060 (Plugin_manager::save_archive): New function.
8061 (Plugin_manager::save_input_group): New function.
8062 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
8063 necessary.
8064 (Plugin_manager::new_undefined_symbol): New function.
8065 (Plugin_manager::rescan): New function.
8066 (Plugin_manager::rescannable_defines): New function.
8067 (Plugin_manager::add_input_file): Set any_added_.
8068 * plugin.h (class Plugin_manager): define new fields rescannable_,
8069 undefined_symbols_, any_claimed_, and any_added_. Declare
8070 Plugin_rescan as friend. Declare new functions.
8071 (Plugin_manager::Rescannable): Define type.
8072 (Plugin_manager::Rescannable_list): Define type.
8073 (Plugin_manager::Undefined_symbol_list): Define type.
8074 (Plugin_manager::Plugin_manager): Initialize new fields.
8075 * archive.cc (Archive::defines_symbol): New function.
8076 (Add_archive_symbols::run): Pass archive to plugins if any.
8077 * archive.h (class Archive): Declare defines_symbol.
8078 * readsyms.cc (Input_group::~Input_group): New function.
8079 (Finish_group::run): Pass input_group to plugins if any.
8080 * readsyms.h (class Input_group): Declare destructor.
8081 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
8082 any.
8083
3bb951e5
ILT
80842011-01-10 Ian Lance Taylor <iant@google.com>
8085
8086 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
8087 section as relro.
8088 (Layout::set_segment_offsets): Reset increase_relro before calling
8089 set_section_addresses a second time.
8090
0aa45fac
CC
80912011-01-04 Cary Coutant <ccoutant@google.com>
8092
8093 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
8094 sections before NOBITS sections.
8095
0db46eb4
L
80962011-01-01 H.J. Lu <hongjiu.lu@intel.com>
8097
8098 * version.cc (print_version): Update copyright to 2011.
8099
829c9745
CC
81002010-12-23 Cary Coutant <ccoutant@google.com>
8101
8102 * output.h (Output_data_reloc::add_output_section): Pass OD instead
8103 of OS to this->add. Add OD parameter to second form of the function.
8104
7500420b
ILT
81052010-12-20 Ian Lance Taylor <iant@google.com>
8106
8107 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
8108 second of two consecutive entries with same offset.
8109
f8e9a930
RW
81102010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8111
8112 * testsuite/Makefile.am (ifuncmain2static_LDADD)
8113 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
8114 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
8115 to avoid unneeded links against $(LDADD).
8116 * testsuite/Makefile.in: Regenerate.
8117
2fbb4320
ILT
81182010-12-15 Ian Lance Taylor <iant@google.com>
8119
8120 PR gold/12324
8121 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
8122 for R_X86_64_32 and R_X86_64_PC32.
8123 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
8124 ver_matching_def_pic.o.
8125 (ver_matching_def_pic.o): New target.
8126
fedb228d
RW
81272010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8128
8129 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
8130 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
8131 Move definition before File_read::View member definitions.
8132 (File_read::View::~View): Initialize and hold lock before
8133 updating current_mapped_bytes.
8134
9b547ce6
RW
81352010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8136
8137 * dwarf_reader.cc: Remove outdated comment.
8138 * gold-threads.cc: Fix typo in error message.
8139 * archive.cc: Fix typos in comments.
8140 * archive.h: Likewise.
8141 * arm-reloc-property.cc: Likewise.
8142 * arm-reloc-property.h: Likewise.
8143 * arm-reloc.def: Likewise.
8144 * arm.cc: Likewise.
8145 * attributes.h: Likewise.
8146 * cref.cc: Likewise.
8147 * ehframe.cc: Likewise.
8148 * fileread.h: Likewise.
8149 * gold.h: Likewise.
8150 * i386.cc: Likewise.
8151 * icf.cc: Likewise.
8152 * incremental.h: Likewise.
8153 * int_encoding.cc: Likewise.
8154 * layout.h: Likewise.
8155 * main.cc: Likewise.
8156 * merge.h: Likewise.
8157 * object.cc: Likewise.
8158 * object.h: Likewise.
8159 * options.cc: Likewise.
8160 * readsyms.cc: Likewise.
8161 * reduced_debug_output.cc: Likewise.
8162 * reloc.cc: Likewise.
8163 * script-sections.cc: Likewise.
8164 * sparc.cc: Likewise.
8165 * symtab.h: Likewise.
8166 * target-reloc.h: Likewise.
8167 * target.cc: Likewise.
8168 * target.h: Likewise.
8169 * timer.cc: Likewise.
8170 * timer.h: Likewise.
8171 * x86_64.cc: Likewise.
8172
83e17bd5
CC
81732010-12-09 Cary Coutant <ccoutant@google.com>
8174
8175 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
8176 stack.
8177 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
8178 parameter; change all callers.
8179 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
8180 * options.h (warn_execstack): New option.
8181
017257f8
DK
81822010-12-07 Doug Kwan <dougkwan@google.com>
8183
8184 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
8185 like function call relocations.
8186
c20cbc06
ILT
81872010-12-07 Ian Lance Taylor <iant@google.com>
8188
8189 * archive.cc (Archive::get_elf_object_for_member): Permit
8190 punconfigured to be NULL.
8191 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
8192 (Archive::include_member): Pass NULL to get_elf_object_for_member
8193 if we searched for the archive and this is the first included
8194 object.
8195
4dbfafcc
ILT
81962010-12-01 Ian Lance Taylor <iant@google.com>
8197
8198 * dwarf_reader.h (class Sized_dwarf_line_info): Add
8199 track_relocs_type_ field.
8200 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8201 Set track_relocs_type_.
8202 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
8203 contents when using RELA relocs.
8204 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
8205 reloc_map_.
8206 * reloc.cc (Track_relocs::next_addend): New function.
8207 * reloc.h (class Track_relocs): Declare next_addend.
8208
e5e19edd
ILT
82092010-12-01 Ian Lance Taylor <iant@google.com>
8210
8211 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
8212 virtual destructor.
8213
9a5ce24c
ILT
82142010-12-01 Ian Lance Taylor <iant@google.com>
8215
8216 * README: Update compilers known to work and fail.
8217
c7791212
NC
82182010-11-23 Matthias Klose <doko@ubuntu.com>
8219
8220 * configure.in: For --enable-gold, handle value `default' instead of
8221 `both*'. Always install ld as ld.bfd, install as ld if gold is
8222 not the default.
8223 * configure: Regenerate.
8224
0ad220c9
DK
82252010-11-18 Doug Kwan <dougkwan@google.com>
8226
8227 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
8228 and right_alignment to be zero. Store result alignment only if it is
8229 greater than existing alignment.
8230
ab8056e0
CC
82312010-11-16 Cary Coutant <ccoutant@google.com>
8232
8233 PR gold/12220
8234 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8235 Check for ".zdebug_line".
8236
fd064a5b
CC
82372010-11-16 Doug Kwan <dougkwan@google.com>
8238 Cary Coutant <ccoutant@google.com>
8239
8240 * output.h (Output_segment::set_section_addresses): Pass increase_relro
8241 by reference; adjust all callers.
8242 * output.cc (Output_segment::set_section_addresses): Adjust references
8243 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
8244 list is empty.
8245 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
8246 end at page boundary.
8247
6fc6ea19
CC
82482010-11-16 Cary Coutant <ccoutant@google.com>
8249
8250 PR gold/12220
8251 * layout.cc (Layout::choose_output_section): Transform names of
8252 compressed sections even when using a script with a SECTIONS clause.
8253 (Layout::output_section_name): Remove code to transform
8254 compressed debug section names.
8255 * output.cc (Output_section::add_input_section): Use uncompressed
8256 section size when tracking input sections.
8257
95a2c8d6
RS
82582010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
8259
8260 * symtab.h (Symbol::NON_PIC_REF): Remove.
8261 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
8262 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
8263 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
8264 (Symbol::use_plt_offset): Take a flags argument and pass it
8265 directly to needs_dynamic_reloc. Restrict check for undefined
8266 weak symbols to function calls.
8267 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
8268 (Target_arm::Scan::global): Use it.
8269 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
8270 (Target_arm::Relocate::relocate): Likewise.
8271 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
8272 parameter with an r_type parameter. Use get_reference_flags
8273 to get the flags.
8274 (Target_arm::Relocate::relocate): Update accordingly.
8275 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
8276 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
8277 (Target_i386::Scan::global): Likewise.
8278 (Target_i386::Relocate::relocate): Likewise.
8279 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
8280 parameter with an r_type parameter. Use get_reference_flags
8281 to get the flags.
8282 (Target_i386::Relocate::relocate): Update accordingly.
8283 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
8284 (Target_powerpc::Scan::global): Use it.
8285 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
8286 (Target_powerpc::Relocate::relocate): Likewise.
8287 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
8288 (Target_sparc::Scan::global): Use it.
8289 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
8290 (Target_sparc::Relocate::relocate): Likewise.
8291 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
8292 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
8293 (Target_x86_64::Scan::global): Likewise.
8294 (Target_x86_64::Relocate::relocate): Likewise.
8295
f625ae50
DK
82962010-11-08 Doug Kwan <dougkwan@google.com>
8297 Cary Coutant <ccoutant@google.com>
8298
8299 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
8300 (Arm_exidx_merge_section::section_contents_): New data member.
8301 (Arm_input_section::Arm_input_section): Initialize original_contents_.
8302 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 8303 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
8304 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
8305 in parameters instead of calling Object::section_contents without
8306 locking.
8307 (Arm_output_section::group_section): New parameter TASK. Pass it
8308 to callees that need locking objects.
8309 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
8310 to lock EXIDX input sections. Fix a formatting issue. Call
8311 Arm_exidx_merged_section::build_contents to create merged section
8312 contents.
8313 (Arm_output_section::create_stub_group): New parameter TASK. Use it
8314 to lock object of stub table owner.
8315 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
8316 TEXT_SIZE to initialize data member TEXT_SIZE_.
8317 (Arm_exidx_input_section::addralign): Fix typo in comment.
8318 (Arm_exidx_input_section::text_size): New method.
8319 (Target_arm::do_relax): New parameter TASK. Pass it to callees
8320 that require locking objects. Lock objects before scanning for stubs
8321 and updating local symbols.
8322 (Arm_input_section<big_endian>::init): Copy contents of original
8323 input section.
2e702c99 8324 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
8325 original input section instead of calling Object::section_contents
8326 without locking.
8327 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
8328 size without calling Object::section_size().
8329 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
8330 for size. Allocate a buffer for merged EXIDX entries.
8331 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 8332 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
8333 building code to Arm_exidx_merged_section::build_contetns. Write
8334 out contetns in buffer instead of building it on the fly.
8335 (Arm_relobj::make_exidx_input_section): Also pass text section size
8336 to Arm_exidx_input_section constructor.
8337 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
8338 (Arm_dynobj::do_read_symbols): Fix memory leak.
8339 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
8340 * target.h: (class Task): Add forward declaration.
8341 (Target::relax): Add new parameter TASK and pass it to
8342 Target::do_relax().
8343 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
8344
5f9bcf58
CC
83452010-11-05 Cary Coutant <ccoutant@google.com>
8346
8347 PR gold/10708
8348 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
8349 object when reading from the file.
8350 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
8351 second layout pass.
8352 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
8353 when reading section contents.
8354 (get_section_contents): Likewise.
8355 (icf::find_identical_sections): Likewise.
8356 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
8357 object when reading from the file.
8358 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
8359 the object when doing deferred section layout.
8360
e597fa08
NC
83612010-11-03 Nick Clifton <nickc@redhat.com>
8362
8363 PR gold/12001
8364 * script.h (class Symbol_assignment: name): New member. Returns
8365 the name of the symbol.
8366 * scrfipt.cc (Script_options::is_pending_assignment): New member.
8367 Returns true if the given symbol name is on the list of
8368 assignments wating to be processed.
8369 * archive.cc (should_incldue_member): If the symbol is undefined,
8370 check to see if it is on the list of symbols pending assignment.
8371
3f9a3278
ILT
83722010-11-03 Ryan Mansfield <rmansfield@qnx.com>
8373
8374 * script-sections.cc (Script_sections::find_memory_region): Check
8375 for a NULL output section pointer.
8376
d06fb4d1
DK
83772010-10-29 Doug Kwan <dougkwan@google.com>
8378
8379 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
8380 Output_section::add_relaxed_input_section.
8381 * output.cc (Output_section::add_relaxed_input_section): Add new
8382 arguments LAYOUT and NAME. Set section order index.
8383 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
8384 Copy section order index.
8385 * output.h (Output_section::add_relaxed_input_section): Add new
8386 arguments LAYOUT and NAME.
8387
90e24de5
ILT
83882010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8389
8390 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 8391 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
8392 * testsuite/Makefile.in: Regenerate.
8393
c9484ea5
DK
83942010-10-20 Doug Kwan <dougkwan@google.com>
8395
8396 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
8397 without SHF_LINK_ORDER flags.
8398 * layout.cc (Layout::choose_output_section): Do not filter
8399 SHF_LINK_ORDER flag in a relocatable link.
8400
5bc2f5be
CC
84012010-10-17 Cary Coutant <ccoutant@google.com>
8402
8403 * output.h (Output_segment::set_section_addresses): Change function
8404 signature. Update all callers.
8405 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
8406 sections.
8407 (Output_segment::set_section_addresses): Align after last TLS
8408 section. Add padding before last relro section instead of after.
8409
0c91cf04
DK
84102010-10-17 Doug Kwan <dougkwan@google.com>
8411
8412 * gold/arm.cc (Target_arm::got_section): Use correct order and set
8413 GOT output section to be writable.
8414
8c21d9d3
CC
84152010-10-14 Cary Coutant <ccoutant@google.com>
8416
8417 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
8418 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
8419 * gold.cc (queue_initial_tasks): Check parameters for incremental link
8420 mode.
8421 * incremental.cc (report_command_line): Ignore all forms of
8422 --incremental.
8423 * layout.cc (Layout::Layout): Check parameters for incremental link
8424 mode.
8425 * options.cc (General_options::parse_incremental): New function.
8426 (General_options::parse_no_incremental): New function.
8427 (General_options::parse_incremental_full): New function.
8428 (General_options::parse_incremental_update): New function.
8429 (General_options::incremental_mode_): New data member.
8430 (General_options::finalize): Check incremental_mode_.
8431 * options.h (General_options): Update help text for --incremental.
8432 Add --no-incremental, --incremental-full, --incremental-update.
8433 (General_options::Incremental_mode): New enum type.
8434 (General_options::incremental_mode): New function.
8435 (General_options::incremental_mode_): New data member.
8436 * parameters.cc (Parameters::incremental_mode_): New data member.
8437 (Parameters::set_options): Set incremental_mode_.
8438 (Parameters::set_incremental_full): New function.
8439 (Parameters::incremental): New function.
8440 (Parameters::incremental_update): New function.
8441 (set_parameters_incremental_full): New function.
8442 * parameters.h (Parameters::set_incremental_full): New function.
8443 (Parameters::incremental): New function.
8444 (Parameters::incremental_update): New function.
8445 (Parameters::incremental_mode_): New data member.
8446 (set_parameters_incremental_full): New function.
8447 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
8448 incremental link mode.
8449 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
8450 (Sized_relobj::do_relocate_sections): Likewise.
8451 * testsuite/Makefile.am (incremental_test): Use --incremental-full
8452 option.
8453 * testsuite/Makefile.in: Regenerate.
8454 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 8455
bb32aa18 84562010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
8457
8458 * script-sections.h (class Script_sections): Make
8459 Sections_elements typedef public.
8460 * script-sections.cc (class Sort_output_sections): Add elements_
8461 field. Add constructor which sets it; change all callers.
8462 (Sort_output_sections::is_before): New function.
8463 (Sort_output_sections::operator()): Call is_before.
8464 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
8465 conditional.
8466 * testsuite/script_test_10.sh: New test. Test script section
8467 order.
8468 * testsuite/script_test_10.t: Likewise.
8469 * testsuite/script_test_10.s: Likewise.
8470 * testsuite/Makefile.am: Wrap the cross linker tests and the
8471 common tests into NATIVE_OR_CROSS_LINKER.
8472 (check_SCRIPTS): Add script_test_10.sh.
8473 (check_DATA): Add script_test_10.stdout.
8474 (script_test_10.o, script_test_10): New targets.
8475 (script_test_10.stdout): New target.
8476 * configure, testsuite/Makefile.in: Regenerate.
8477
3cef7179
ILT
84782010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8479
8480 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
8481 error for the deprecated relocations.
8482 (Target_arm::Scan::global): Likewise.
8483 (Target_arm::Relocate::relocate): Likewise.
8484
7411e9a8
RS
84852010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
8486
8487 * fileread.cc (Input_file::find_file): Initialize *found_name
8488 and *namep when using the fallback search for case 4.
8489
6a9da32a
CC
84902010-10-11 Cary Coutant <ccoutant@google.com>
8491
8492 * options.h (class General_options): Redefine -z lazy as an alias for
8493 the negation of -z now.
8494
ac897c20
ILT
84952010-10-11 Ian Lance Taylor <iant@google.com>
8496
8497 * resolve.cc (symbol_to_bits): Report the value of the unsupported
8498 binding.
8499
ea5cae92
NC
85002010-10-06 Nick Clifton <nickc@redhat.com>
8501
8502 * script-sections.cc(class Memory_region): Remove
8503 current_lma_offset_ field. Rename current_vma_offset_ to
8504 current_offset_. Add last_section_ field.
8505 (Memory_region::get_current_vma_address): Rename to
8506 get_current_address.
8507 (Memory_region::get_current_lma_address): Delete.
8508 (Memory_region::increment_vma_offset): Rename to
8509 increment_offset.
8510 (Memory_region::increment_lma_offset): Delete.
8511 (Memory_region::attributes_compatible): New method. Returns
8512 true if the provided section is compatible with the region.
8513 (Memory_region::get_last_section): New method. Returns the last
8514 section to use the region.
8515 (Memory_region::set_last_section): New method. Stores the last
8516 section to use the region.
8517 (Script_sections::block_in_region): New method. Returns true if
8518 a block of memory is contained within a region.
8519 (Script_sections::find_memory_region): New method. Locates a
8520 memory region to be used to set a VMA or LMA address.
8521 (Output_section_definition::set_section_addresses): Add code to
8522 check for addresses set by memory regions.
8523 (Output_segment::set_section_addresses): Remove memory region
8524 walking code.
8525 (Script_sections::create_segment): Add a warning if a header
8526 segment is created outside of any region.
8527 * script-sections.h (class Script_sections): Add prototypes for
8528 find_memory_region and block_in_region methods.
8529 * testsuite/memory_test.s: Use .long instead of .word.
8530 * testsuite/memory_test.t: Add some more output sections.
8531 * testsuite/memory_test.sh: Update expected output.
8532
a9bfd952
DK
85332010-10-02 Doug Kwan <dougkwan@google.com>
8534
8535 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
8536 defintion to symtab.h
8537 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
8538 declaration to defintion.
8539
bacff3ab
NC
85402010-10-01 Nick Clifton <nickc@redhat.com>
8541
8542 * expression.cc (eval): Replace dummy argument with NULL.
8543 (eval_maybe_dot): Check for a NULL result section pointer.
8544 (Symbol_expression::value): Likewise.
8545 (Dot_expression::value): Likewise.
8546 (BINARY_EXPRESSION): Likewise.
8547 (Max_expression::value): Likewise.
8548 (Min_expression::value): Likewise.
8549 (Absolute_expression::value): Likewise.
8550 (Addr_expression::value_from_output_section): Likewise.
8551 (Loaddddr_expression::value_from_output_section): Likewise.
8552 (Segment_start_expression::value): Likewise.
8553 * script-sections.cc
8554 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
8555 argument with NULL.
8556 (Sections_elememt_dot_assignment::set_section_addresses):
8557 Likewise.
8558 (Output_data_expression::do_write_to_buffer): Likewise.
8559 (Output_section_definition::finalize_symbols): Likewise.
8560 (Output_section_definition::set_section_addresses): Likewise.
8561
f81bc8b5
DK
85622010-09-30 Doug Kwan <dougkwan@google.com>
8563
8564 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
8565
c95e9f27
ST
85662010-09-28 Sriraman Tallam <tmsriram@google.com>
8567
8568 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 8569 function.
c95e9f27
ST
8570 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
8571 virtual function.
8572 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
8573 virtual function.
8574 * icf.cc (get_section_contents): Inline merge sections only when
8575 target allows it.
8576
3cac54d2
RW
85772010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8578
8579 * configure: Regenerate.
8580
2904037a
ILT
85812010-09-17 Ian Lance Taylor <iant@google.com>
8582
8583 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
8584 * testsuite/Makefile.am (memory_test.o): New target.
8585 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
8586 memory_test.t.
8587 * testsuite/Makefile.in: Rebuild.
2904037a 8588
bca7fb63
DK
85892010-09-17 Doug Kwan <dougkwan@google.com>
8590
8591 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
8592 defintion if relocation uses GOT entries of the symbol.
8593 * testsuite/icf_safe_test.sh: Fix test.
8594 * testsuite/icf_safe_so_test.sh: Fix test.
8595
4ef28648
CC
85962010-09-16 Cary Coutant <ccoutant@google.com>
8597
8598 * script_sections.cc (class Memory_region): Remove "NULL" from
8599 vector initializations.
8600
793990de
CC
86012010-09-15 Cary Coutant <ccoutant@google.com>
8602
8603 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
8604 Resolve forwarding symbols.
8605
81e015e2
DK
86062010-09-15 Doug Kwan <dougkwan@google.com>
8607
8608 * gold/testsuite/script_test_3.t: Add ARM special sections.
8609 * gold/testsuite/script_test_4.t: Same.
8610 * gold/testsuite/script_test_5.t: Same.
8611 * gold/testsuite/script_test_6.t: Same.
8612 * gold/testsuite/script_test_7.t: Same.
8613 * gold/testsuite/script_test_7.t: Same.
8614 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
8615
36171d64
CC
86162010-09-14 Cary Coutant <ccoutant@google.com>
8617
8618 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
8619 (Target_x86_64::Relocate::relocate_tls): Replace check for
8620 saw_tls_block_reloc_ with test for executable section.
8621
d89051bd
CC
86222010-09-12 Cary Coutant <ccoutant@google.com>
8623
8624 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
8625 position-independent executables to shared libraries need dynamic
8626 relocations.
8627 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
8628 position-independent executables.
8629 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
8630 * testsuite/Makefile.in: Regenerate.
8631
fca41f0f
NC
86322010-09-10 Nick Clifton <nickc@redhat.com>
8633
8634 PR gold/11997
8635 * testsuite/memory_test.t: Discard any sections that are not
8636 needed.
8637
6695e4b3
L
86382010-09-09 H.J. Lu <hongjiu.lu@intel.com>
8639
8640 PR gold/11996
8641 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
8642 "This::" to work around a bug in gcc 4.2.
8643
8644 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
8645
0f72bf6f
RÁE
86462010-09-09 Rafael Espindola <espindola@google.com>
8647
8648 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
8649 sections with different PF_X flags in the same segment.
8650 (Layout::find_first_load_seg): Search all segments to find the first
8651 one.
8652 * options.h (rosegment): New.
8653
86542010-09-08 Rafael Espindola <espindola@google.com>
a6577478 8655
05a79166 8656 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 8657
aa98ff75
DK
86582010-09-08 Doug Kwan <dougkwan@google.com>
8659
8660 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
8661 (Arm_relobj::do_relocate_sections): Add new parameter for output
8662 file to match the parent.
8663 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
8664 of local symbols instead of input values. Update code to track
8665 changes in gold::relocate_section.
8666 * object.cc (Sized_relobj::compute_final_local_value): New methods.
8667 (Sized_relobj::compute_final_local_value_internal): New methods.
8668 (Sized_relobj::do_finalize_local_symbols): Move code from loop
8669 body into private version of Sized_relobj::compute_final_local_value.
8670 Call the inline method.
8671 * object.h (Symbol_value::Symbol_value): Define destructor. Free
8672 merged symbol value if there is one.
8673 (Symbol_value::has_output_value): New method defintiion.
8674 (Sized_relobj::Compute_final_local_value_status): New enum type.
8675 (Sized_relobj::compute_final_local_value): New methods.
8676 (Sized_relobj::compute_final_local_value_internal): New methods.
8677 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
8678 and arm_cortex_a8.sh.
8679 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
8680 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
8681 New tests.
8682 * Makefile.in: Regenerate.
8683 * testsuite/arm_bl_out_of_range.s: Update test.
8684 * testsuite/thumb_bl_out_of_range.s: Ditto.
8685 * testsuite/thumb_blx_out_of_range.s: Ditto.
8686 * testsuite/arm_branch_out_of_range.sh: New file.
8687 * testsuite/arm_cortex_a8.sh: Ditto.
8688 * testsuite/arm_cortex_a8_b.s: Ditto.
8689 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
8690 * testsuite/arm_cortex_a8_b_local.s: Ditto.
8691 * testsuite/arm_cortex_a8_bl.s: Ditto.
8692 * testsuite/arm_cortex_a8_blx.s: Ditto.
8693 * testsuite/arm_cortex_a8_local.s: Ditto.
8694 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
8695 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
8696
05a79166
L
86972010-09-08 Rafael Espindola <espindola@google.com>
8698
8699 * Makefile.am (memory_test.stdout): Run readelf with -W.
8700 * Makefile.in: Regenerate.
8701 * testsuite/memory_test.sh: Make the regexps accept both 32 and
8702 64 bit output.
8703
33dbc701
RÁE
87042010-09-08 Rafael Espindola <espindola@google.com>
8705
8706 * script-sections.cc (Script_sections::add_memory_region): Convert
8707 field precision to int.
8708 * script.cc (script_set_section_region, script_set_section_region):
8709 Convert field precision to int.
8710
731ca54a
RÁE
87112010-09-08 Rafael Espindola <espindola@google.com>
8712
8713 * arm.cc (do_finalize_sections): Create the __exidx_start and
8714 __exdix_end symbols even when the section is missing.
8715
7f8cd844
NC
87162010-09-08 Nick Clifton <nickc@redhat.com>
8717
8718 * README: Remove claim that MEMORY is not supported.
8719 * expression.cc (script_exp_function_origin)
8720 (script_exp_function_length): Move from here to ...
8721 * script.cc: ... here.
8722 (script_set_section_region, script_add_memory)
8723 (script_parse_memory_attr, script_include_directive): New
8724 functions.
8725 * script-sections.cc
8726 (class Memory_region): New class.
8727 (class Output_section_definition): Add set_memory_region,
8728 set_section_vma, set_section_lma and get_section_name methods.
8729 (class Script_Sections): Add add_memory_region,
8730 find_memory_region, find_memory_region_origin,
8731 find_memory_region_length and set_memory_region methods.
8732 Have set_section_addresses method walk the list of set memory
8733 regions.
8734 Extend the print methos to display memory regions.
8735 * script-sections.h: Add prototypes for new methods.
8736 Add enum for MEMORY region attributes.
8737 * yyscript.y: Add support for parsing MEMORY regions.
8738 * script-c.h: Add prototypes for new functions.
8739 * testsuite/Makefile.am: Add test of MEMORY region functionality.
8740 * testsuite/Makefile.in: Regenerate.
8741 * testsuite/memory_test.sh: New script.
8742 * testsuite/memory_test.s: New assembler source file.
8743 * testsuite/memory_test.t: New linker script.
8744
a4649286
DK
87452010-08-27 Doug Kwan <dougkwan@google.com>
8746
8747 * gold/resolve.cc (Symbol_table::should_override): Let a weak
8748 reference override an existing dynamic weak reference.
8749 * testsuite/Makefile.am: Add new test dyn_weak_ref.
8750 * testsuite/Makefile.in: Regenerate.
8751 * testsuite/dyn_weak_ref.sh: New file.
8752 * testsuite/dyn_weak_ref_1.c: Ditto.
8753 * testsuite/dyn_weak_ref_2.c: Ditto.
8754
b56648ad
ILT
87552010-08-27 Ian Lance Taylor <iant@google.com>
8756
8757 * incremental.h (class Incremental_input_entry): Add virtual
8758 destructor.
8759
809313cb
ILT
87602010-08-27 Ian Lance Taylor <iant@google.com>
8761
8762 * testsuite/start_lib_test_3.c: Mark t3 as used.
8763
11e32464
NC
87642010-08-27 Nick Clifton <nickc@redhat.com>
8765
8766 * options.cc (version_script): Fix small typo in previous
8767 whitespace tidyup.
8768
ca09d69a
NC
87692010-08-25 Nick Clifton <nickc@redhat.com>
8770
8771 * archive.cc: Formatting fixes: Remove whitespace between
8772 typename and following asterisk. Remove whitespace between
8773 function name and opening parenthesis.
8774 * archive.h: Likewise.
8775 * arm.cc: Likewise.
8776 * attributes.cc: Likewise.
8777 * attributes.h: Likewise.
8778 * common.cc: Likewise.
8779 * copy-relocs.cc: Likewise.
8780 * dirsearch.h: Likewise.
8781 * dynobj.cc: Likewise.
8782 * ehframe.cc: Likewise.
8783 * ehframe.h: Likewise.
8784 * expression.cc: Likewise.
8785 * fileread.cc: Likewise.
8786 * fileread.h: Likewise.
8787 * gc.h: Likewise.
8788 * gold-threads.cc: Likewise.
8789 * gold.cc: Likewise.
8790 * i386.cc: Likewise.
8791 * icf.h: Likewise.
8792 * incremental-dump.cc: Likewise.
8793 * incremental.cc: Likewise.
8794 * layout.cc: Likewise.
8795 * layout.h: Likewise.
8796 * main.cc: Likewise.
8797 * merge.cc: Likewise.
8798 * merge.h: Likewise.
8799 * object.cc: Likewise.
8800 * object.h: Likewise.
8801 * options.cc: Likewise.
8802 * options.h: Likewise.
8803 * output.cc: Likewise.
8804 * output.h: Likewise.
8805 * plugin.cc: Likewise.
8806 * plugin.h: Likewise.
8807 * powerpc.cc: Likewise.
8808 * reloc.cc: Likewise.
8809 * script-c.h: Likewise.
8810 * script-sections.cc: Likewise.
8811 * script.cc: Likewise.
8812 * stringpool.cc: Likewise.
8813 * symtab.cc: Likewise.
8814 * symtab.h: Likewise.
8815 * target.cc: Likewise.
8816 * timer.cc: Likewise.
8817 * timer.h: Likewise.
8818 * version.cc: Likewise.
8819 * x86_64.cc: Likewise.
8820
b8fa8750
NC
88212010-08-24 Nick Clifton <nickc@redhat.com>
8822
8823 PR 11899
8824 * layout.cc (segment_precedes): Sort segments by their physical
8825 addresses, if they have been set.
8826
9919d93b
CC
88272010-08-23 Cary Coutant <ccoutant@google.com>
8828
8829 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
8830 symbols data.
8831 (Lib_group::include_member): Unlock object after deleting its
8832 symbols data.
8833 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
8834 the bug fixed here.
8835
97b4be1c
CC
88362010-08-19 Neil Vachharajani <nvachhar@google.com>
8837 Cary Coutant <ccoutant@google.com>
8838
8839 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
8840 constructor, and set_blocker.
8841 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
8842 readsyms_blocker_.
8843 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
8844 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
8845 * testsuite/Makefile.am (start_lib_test): New test case.
8846 * testsuite/Makefile.in: Regenerate.
8847 * testsuite/start_lib_test_main.c: New file.
8848 * testsuite/start_lib_test_1.c: New file.
8849 * testsuite/start_lib_test_2.c: New file.
8850 * testsuite/start_lib_test_3.c: New file.
8851
dd0b1884
ILT
88522010-08-19 Ian Lance Taylor <iant@google.com>
8853
8854 * Makefile.in: Rebuild with automake 1.11.1.
8855 * aclocal.m4: Likewise.
8856 * testsuite/Makefile.in: Likewise.
8857
7223e9ca
ILT
88582010-08-19 Ian Lance Taylor <iant@google.com>
8859
8860 PR 10893
8861 * i386.cc (class Output_data_plt_i386): Update declarations.
8862 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
8863 local_ifuncs_ fields.
8864 (Target_i386::do_plt_section_for_global): New function.
8865 (Target_i386::do_plt_section_for_local): New function.
8866 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
8867 parameter; change all callers. Initialize global_ifuncs_ and
8868 local_ifuncs_. If doing a static link define __rel_iplt_start and
8869 __rel_iplt_end.
8870 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
8871 (Output_data_plt_i386::add_local_ifunc_entry): New function.
8872 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
8873 symbols.
8874 (Target_i386::make_plt_section): New function, broken out of
8875 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
8876 (Target_i386::make_plt_entry): Call make_plt_section.
8877 (Target_i386::make_local_ifunc_plt_entry): New function.
8878 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
8879 (Target_i386::Scan::local): Handle IFUNC symbols. Add
8880 R_386_IRELATIVE to switch.
8881 (Target_i386::Scan::global): Likewise.
8882 (Target_i386::Relocate::relocate): Likewise.
8883 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
8884 switch.
8885 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
8886 (Target_x86_64::do_plt_section_for_global): New function.
8887 (Target_x86_64::do_plt_section_for_local): New function.
8888 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
8889 parameter; change all callers. If doing a static link define
8890 __rela_iplt_start and __rela_iplt_end.
8891 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
8892 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
8893 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
8894 to point to .plt.
8895 (Target_x86_64::make_local_ifunc_plt_entry): New function.
8896 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
8897 switch.
8898 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
8899 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
8900 R_X86_64_IRELATIVE to switch.
8901 (Target_x86_64::Scan::global): Likewise.
8902 (Target_x86_64::Relocate::relocate): Likewise.
8903 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
8904 switch.
8905 * target.h (class Target): Add plt_section_for_global and
8906 plt_section_for_local functions. Add do_plt_section_for_global
8907 and do_plt_section_for_local virtual functions.
8908 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
8909 clarifying comments.
8910 (Symbol::use_plt_offset): Handle IFUNC symbol.
8911 * object.cc (Sized_relobj::Sized_relobj): Initialize
8912 local_plt_offsets_.
8913 (Sized_relobj::local_has_plt_offset): New function.
8914 (Sized_relobj::local_plt_offset): New function.
8915 (Sized_relobj::set_local_plt_offset): New function.
8916 (Sized_relobj::do_count): Handle IFUNC symbol.
8917 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
8918 a bit away from input_shndx_ field. Add set_is_func_symbol and
8919 is_ifunc_symbol functions.
8920 (class Sized_relobj): Update declarations. Remove Tls_got_entry
8921 and Local_tls_got_offsets. Define Local_plt_offsets. Add
8922 local_plt_offsets_ field.
8923 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
8924 * output.h (class Output_section_data): Add non-const
8925 output_section function.
8926 (class Output_data_got): Update declarations.
8927 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
8928 Add use_plt_offset parameter to global and local constructors.
8929 Change all callers. Change local_sym_index_ field to 31 bits.
8930 Change GSYM_CODE and CONSTANT_CODE accordingly.
8931 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
8932 doing a static link don't set sh_link field.
8933 (Output_data_got::Got_entry::write): Use PLT offset if
8934 appropriate.
8935 (Output_data_got::add_global_plt): New function.
8936 (Output_data_got::add_local_plt): New function.
8937 * target-reloc.h (relocate_section): Handle IFUNC symbol.
8938 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
8939 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
8940 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
8941 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
8942 IFUNC conditional.
8943 * testsuite/ifunc-sel.h: New file.
8944 * testsuite/ifuncmain1.c: New file.
8945 * testsuite/ifuncmain1vis.c: New file.
8946 * testsuite/ifuncmod1.c: New file.
8947 * testsuite/ifuncdep2.c: New file.
8948 * testsuite/ifuncmain2.c: New file.
8949 * testsuite/ifuncmain3.c: New file.
8950 * testsuite/ifuncmod3.c: New file.
8951 * testsuite/ifuncmain4.c: New file.
8952 * testsuite/ifuncmain5.c: New file.
8953 * testsuite/ifuncmod5.c: New file.
8954 * testsuite/ifuncmain6pie.c: New file.
8955 * testsuite/ifuncmod6.c: New file.
8956 * testsuite/ifuncmain7.c: New file.
8957 * configure, testsuite/Makefile.in: Rebuild.
8958
56f75c03
ILT
89592010-08-18 Ian Lance Taylor <iant@google.com>
8960
8961 * incremental.cc
8962 (Output_section_incremental_inputs::write_input_files): Add cast
8963 to avoid signed/unsigned comparison warning.
8964 (Output_section_incremental_inputs::write_info_blocks): Likewise.
8965
55455f89
CC
89662010-08-12 Cary Coutant <ccoutant@google.com>
8967
8968 * common.cc (Sort_commons::operator()): Remove unnecessary code.
8969
e2054bcb
ILT
89702010-08-13 Ian Lance Taylor <iant@google.com>
8971
8972 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
8973
74f67560
DK
89742010-08-12 Cary Coutant <ccoutant@google.com>
8975 Doug Kwan <dougkwan@google.com>
8976
8977 * resolve.cc (Symbol_table::should_override): When a weak dynamic
8978 defintion overrides non-weak undef, remember that the original undef
8979 is not weak.
8980 * symtab.cc (Symbol_table::sized_write_global): For undef without
8981 an original weak binding, set binding to global in output.
8982 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
8983 * testsuite/Makefile.in: Regenerate.
8984 * testsuite/strong_ref_weak_def.sh: New file.
8985 * testsuite/strong_ref_weak_def_1.c: Ditto.
8986 * testsuite/strong_ref_weak_def_2.c: Ditto.
8987
d1238d12
CC
89882010-08-12 Cary Coutant <ccoutant@google.com>
8989
8990 * testsuite/incremental_test.sh: Rewrite.
8991 * testsuite/incremental_test_1.c: Rewrite.
8992 * testsuite/incremental_test_2.c: Rewrite.
8993
0e70b911
CC
89942010-08-12 Cary Coutant <ccoutant@google.com>
8995
8996 * arm.cc (Target_arm::got_size): Add const.
8997 (Target_arm::got_entry_count): New function.
8998 (Target_arm::plt_entry_count): New function.
8999 (Target_arm::first_plt_entry_offset): New function.
9000 (Target_arm::plt_entry_size): New function.
9001 (Output_data_plt_arm::entry_count): New function.
9002 (Output_data_plt_arm::first_plt_entry_offset): New function.
9003 (Output_data_plt_arm::get_plt_entry_size): New function.
9004 * i386.cc (Target_i386::got_size): Add const.
9005 (Target_i386::got_entry_count): New function.
9006 (Target_i386::plt_entry_count): New function.
9007 (Target_i386::first_plt_entry_offset): New function.
9008 (Target_i386::plt_entry_size): New function.
9009 (Output_data_plt_i386::entry_count): New function.
9010 (Output_data_plt_i386::first_plt_entry_offset): New function.
9011 (Output_data_plt_i386::get_plt_entry_size): New function.
9012 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
9013 find_incremental_inputs_sections. Dump incremental_got_plt section.
9014 * incremental.cc: Include target.h.
9015 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
9016 parameter. Adjust all callers. Find incremental_got_plt section.
9017 (Incremental_inputs::create_data_sections): Create incremental_got_plt
9018 section.
9019 (Output_section_incremental_inputs::set_final_data_size): Calculate
9020 size of incremental_got_plt section.
9021 (Output_section_incremental_inputs::do_write): Write the
9022 incremental_got_plt section.
9023 (Got_plt_view_info): New struct.
9024 (Local_got_offset_visitor): New class.
9025 (Global_got_offset_visitor): New class.
9026 (Global_symbol_visitor_got_plt): New class.
9027 (Output_section_incremental_inputs::write_got_plt): New function.
9028 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
9029 Add parameter. Adjust all callers.
9030 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
9031 (Incremental_inputs::got_plt_section): New function.
9032 (Incremental_inputs::got_plt_section_): New data member.
9033 (Incremental_got_plt_reader): New class.
9034 * layout.cc (Layout::create_incremental_info_sections): Add the
9035 incremental_got_plt section.
9036 * object.h (Got_offset_list::get_list): New function.
9037 (Got offset_list::for_all_got_offsets): New function.
9038 (Sized_relobj::local_got_offset_list): New function.
9039 * powerpc.cc (Target_powerpc::got_size): Add const.
9040 (Target_powerpc::got_entry_count): New function.
9041 (Target_powerpc::plt_entry_count): New function.
9042 (Target_powerpc::first_plt_entry_offset): New function.
9043 (Target_powerpc::plt_entry_size): New function.
9044 (Output_data_plt_powerpc::entry_count): New function.
9045 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
9046 (Output_data_plt_powerpc::get_plt_entry_size): New function.
9047 * sparc.cc (Target_sparc::got_size): Add const.
9048 (Target_sparc::got_entry_count): New function.
9049 (Target_sparc::plt_entry_count): New function.
9050 (Target_sparc::first_plt_entry_offset): New function.
9051 (Target_sparc::plt_entry_size): New function.
9052 (Output_data_plt_sparc::entry_count): New function.
9053 (Output_data_plt_sparc::first_plt_entry_offset): New function.
9054 (Output_data_plt_sparc::get_plt_entry_size): New function.
9055 * symtab.h (Symbol::got_offset_list): New function.
9056 (Symbol_table::for_all_symbols): New function.
9057 * target.h (Sized_target::got_entry_count): New function.
9058 (Sized_target::plt_entry_count): New function.
9059 (Sized_target::plt_entry_size): New function.
9060 * x86_64.cc (Target_x86_64::got_size): Add const.
9061 (Target_x86_64::got_entry_count): New function.
9062 (Target_x86_64::plt_entry_count): New function.
9063 (Target_x86_64::first_plt_entry_offset): New function.
9064 (Target_x86_64::plt_entry_size): New function.
9065 (Output_data_plt_x86_64::entry_count): New function.
9066 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
9067 (Output_data_plt_x86_64::get_plt_entry_size): New function.
9068
09ec0418
CC
90692010-08-12 Cary Coutant <ccoutant@google.com>
9070
9071 * archive.cc: Include incremental.h.
9072 (Archive::Archive): Initialize incremental_info_.
9073 (Archive::include_member): Record archive members in incremental info.
9074 (Add_archive_symbols::run): Record begin and end of an archive in
9075 incremental info.
9076 (Lib_group::include_member): Record objects in incremental info.
9077 * archive.h (Incremental_archive_entry): Forward declaration.
9078 (Archive::set_incremental_info): New member function.
9079 (Archive::incremental_info): New member function.
9080 (Archive::Unused_symbol_iterator): New class.
9081 (Archive::unused_symbols_begin): New member function.
9082 (Archive::unused_symbols_end): New member function.
9083 (Archive::incremental_info_): New data member.
9084 * incremental-dump.cc (find_input_containing_global): New function.
9085 (dump_incremental_inputs): Dump new incremental info sections.
9086 * incremental.cc: Include symtab.h.
9087 (Output_section_incremental_inputs): New class.
9088 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
9089 new incremental info sections.
9090 (Sized_incremental_binary::do_check_inputs): Likewise.
9091 (Incremental_inputs::report_archive): Remove.
9092 (Incremental_inputs::report_archive_begin): New function.
9093 (Incremental_inputs::report_archive_end): New function.
9094 (Incremental_inputs::report_object): New function.
9095 (Incremental_inputs::finalize_inputs): Remove.
9096 (Incremental_inputs::report_input_section): New function.
9097 (Incremental_inputs::report_script): Rewrite.
9098 (Incremental_inputs::finalize): Do nothing but finalize string table.
9099 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9100 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9101 (Incremental_inputs::create_data_sections): New function.
9102 (Incremental_inputs::relocs_entsize): New function.
9103 (Output_section_incremental_inputs::set_final_data_size): New function.
9104 (Output_section_incremental_inputs::do_write): New function.
9105 (Output_section_incremental_inputs::write_header): New function.
9106 (Output_section_incremental_inputs::write_input_files): New function.
9107 (Output_section_incremental_inputs::write_info_blocks): New function.
9108 (Output_section_incremental_inputs::write_symtab): New function.
9109 * incremental.h (Incremental_script_entry): Forward declaration.
9110 (Incremental_object_entry): Forward declaration.
9111 (Incremental_archive_entry): Forward declaration.
9112 (Incremental_inputs): Forward declaration.
9113 (Incremental_inputs_header_data): Remove.
9114 (Incremental_inputs_header): Remove.
9115 (Incremental_inputs_header_write): Remove.
9116 (Incremental_inputs_entry_data): Remove.
9117 (Incremental_inputs_entry): Remove.
9118 (Incremental_inputs_entry_write): Remove.
9119 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
9120 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
9121 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
9122 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
9123 Likewise.
9124 (Incremental_input_entry): New class.
9125 (Incremental_script_entry): New class.
9126 (Incremental_object_entry): New class.
9127 (Incremental_archive_entry): New class.
9128 (Incremental_inputs::Incremental_inputs): Initialize new data members.
9129 (Incremental_inputs::report_inputs): Remove.
9130 (Incremental_inputs::report_archive): Remove.
9131 (Incremental_inputs::report_archive_begin): New function.
9132 (Incremental_inputs::report_archive_end): New function.
9133 (Incremental_inputs::report_object): Change prototype.
9134 (Incremental_inputs::report_input_section): New function.
9135 (Incremental_inputs::report_script): Change prototype.
9136 (Incremental_inputs::get_reloc_count): New function.
9137 (Incremental_inputs::set_reloc_count): New function.
9138 (Incremental_inputs::create_data_sections): New function.
9139 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9140 (Incremental_inputs::inputs_section): New function.
9141 (Incremental_inputs::symtab_section): New function.
9142 (Incremental_inputs::relocs_section): New function.
9143 (Incremental_inputs::get_stringpool): Add const.
9144 (Incremental_inputs::command_line): Add const.
9145 (Incremental_inputs::inputs): Remove.
9146 (Incremental_inputs::command_line_key): New function.
9147 (Incremental_inputs::input_file_count): New function.
9148 (Incremental_inputs::input_files): New function.
9149 (Incremental_inputs::relocs_entsize): New function.
9150 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9151 (Incremental_inputs::finalize_inputs): Remove.
9152 (Incremental_inputs::Input_info): Remove.
9153 (Incremental_inputs::lock_): Remove.
9154 (Incremental_inputs::inputs_): Change type.
9155 (Incremental_inputs::inputs_map_): Remove.
9156 (Incremental_inputs::current_object_entry_): New data member.
9157 (Incremental_inputs::inputs_section_): New data member.
9158 (Incremental_inputs::symtab_section_): New data member.
9159 (Incremental_inputs::relocs_section_): New data member.
9160 (Incremental_inputs::reloc_count_): New data member.
9161 (Incremental_inputs_reader): New class.
9162 (Incremental_symtab_reader): New class.
9163 (Incremental_relocs_reader): New class.
9164 * layout.cc (Layout::finalize): Move finalization of incremental info
9165 and creation of incremental info sections to follow finalization of
9166 symbol table. Set offsets for postprocessing sections.
9167 (Layout::create_incremental_info_sections): Call
9168 Incremental_inputs::create_data_sections. Add incremental symtab
9169 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
9170 sections to layout after input sections.
9171 * layout.h (struct Timespec): Forward declaration.
9172 (Layout::incremental_inputs): Add const.
9173 (Layout::create_incremental_info_sections): Add parameter.
9174 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
9175 * object.cc: Include incremental.h.
9176 (Relobj::finalize_incremental_relocs): New function.
9177 (Sized_relobj::do_layout): Record input sections in incremental info.
9178 * object.h (Object::output_section): New function.
9179 (Object::output_section_offset): Moved from Relobj.
9180 (Object::get_incremental_reloc_base): New function.
9181 (Object::get_incremental_reloc_count): New function.
9182 (Object::do_output_section): New function.
9183 (Object::do_output_section_offset): Moved from Relobj.
9184 (Object::do_get_incremental_reloc_base): New function.
9185 (Object::do_get_incremental_reloc_count): New function.
9186 (Object::Object): Initialize new data members.
9187 (Relobj::output_section): Renamed do_output_section and moved to
9188 protected.
9189 (Relobj::output_section_offset): Moved to Object.
9190 (Relobj::do_get_incremental_reloc_base): New function.
9191 (Relobj::do_get_incremental_reloc_count): New function.
9192 (Relobj::allocate_incremental_reloc_counts): New function.
9193 (Relobj::count_incremental_reloc): New function.
9194 (Relobj::finalize_incremental_relocs): New function.
9195 (Relobj::next_incremental_reloc_index): New function.
9196 (Relobj::reloc_counts_): New data member.
9197 (Relobj::reloc_bases_): New data member.
9198 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
9199 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
9200 (Sized_relobj::incremental_relocs_scan): New function.
9201 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9202 (Sized_relobj::incremental_relocs_write): New function.
9203 (Sized_relobj::incremental_relocs_write_reltype): New function.
9204 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
9205 incremental link.
9206 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
9207 archives and object files elsewhere.
9208 (Add_symbols::run): Report object files here.
9209 (Finish_group::run): Report end of archive at end of group.
9210 * reloc.cc: Include layout.h, incremental.h.
9211 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
9212 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
9213 (Sized_relobj::incremental_relocs_scan): New function.
9214 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9215 (Sized_relobj::do_relocate_sections): Write incremental relocations.
9216 (Sized_relobj::incremental_relocs_write): New function.
9217 (Sized_relobj::incremental_relocs_write_reltype): New function.
9218 * script.cc (read_input_script): Rewrite test for incremental link.
9219 Change call to Incremental_inputs::report_script.
9220 * symtab.h (Symbol_table::first_global_index): New function.
9221 (Symbol_table::output_count): New function.
9222
ce0d1972
DK
92232010-08-12 Doug Kwan <dougkwan@google.com>
9224
9225 * arm.cc (Target_arm::merge_object_attributes): Check command line
9226 options --no-wchar-size-warning and --no-enum-size-warning.
9227 * options.h (General_options): Add ld-compatible options
9228 --no-enum-size-warning and --no-wchar-size-warning.
9229
6e5710ce
ILT
92302010-08-04 Ian Lance Taylor <iant@google.com>
9231
9232 * x86_64.cc (Target_x86_64::Scan::local): Use
9233 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
9234 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
9235 (Target_x86_64::Scan::global): Likewise.
9236 (Target_x86_64::Relocate::relocate): Likewise.
9237 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
9238 Likewise.
9239
fef830db
CC
92402010-08-03 Cary Coutant <ccoutant@google.com>
9241
9242 * merge.cc (Output_merge_string::do_add_input_section): Count strings
9243 to reserve space in merged_strings vector. Keep total input size
9244 for stats.
9245 (Output_merge_string::do_print_merge_stats): Print total input size.
9246 * merge.h (Output_merge_string): Add input_size_ field.
9247 * stringpool.cc (Stringpool_template::string_length): Move
9248 implementations out of Stringpool_template class and place in
9249 stringpool.h.
9250 * stringpool.h (string_length): Move out of Stringpool_template.
9251
1e3811b0
ILT
92522010-08-03 Ian Lance Taylor <iant@google.com>
9253
9254 PR 11712
9255 * layout.cc (relaxation_loop_body): If address of load segment is
9256 set, adjust address to include headers if possible.
9257
7af0c620
ILT
92582010-08-03 Ian Lance Taylor <iant@google.com>
9259
9260 * version.cc (version_string): Bump to 1.10.
9261
22f0da72
ILT
92622010-08-03 Ian Lance Taylor <iant@google.com>
9263
9264 PR 11805
9265 * layout.h (enum Output_section_order): Define.
9266 (class Layout): Update declarations.
9267 * layout.cc (Layout::get_output_section): Add order parameter.
9268 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
9269 is_first_non_relro parameters. Change all callers.
9270 (Layout::choose_output_section): Likewise.
9271 (Layout::add_output_section_data): Likewise.
9272 (Layout::make_output_section): Likewise. Set order.
9273 (Layout::default_section_order): New function.
9274 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
9275 * output.cc (Output_section::Output_section): Initialize order_.
9276 Don't initialize deleted fields.
9277 (Output_segment::Output_segment): Don't initialize deleted
9278 fields.
9279 (Output_segment::add_output_section_to_load): New function
9280 replacing add_output_section. Change all callers to call this or
9281 add_output_section_to_nonload.
9282 (Output_segment::add_output_section_to_nonload): New function.
9283 (Output_segment::remove_output_section): Rewrite.
9284 (Output_segment::add_initial_output_data): Likewise.
9285 (Output_segment::has_any_data_sections): Likewise.
9286 (Output_segment::is_first_section_relro): Likewise.
9287 (Output_segment::maximum_alignment): Likewise.
9288 (Output_segment::has_dynamic_reloc): New function replacing
9289 dynamic_reloc_count. Change all callers.
9290 (Output_segment::has_dynamic_reloc_list): New function replacing
9291 dynamic_reloc_count_list. Change all callers.
9292 (Output_segment::set_section_addresses): Rewrite.
9293 (Output_segment::set_offset): Rewrite.
9294 (Output_segment::find_first_and_last_list): Remove.
9295 (Output_segment::set_tls_offsets): Rewrite.
9296 (Output_segment::first_section_load_address): Likewise.
9297 (Output_segment::output_section_count): Likewise.
9298 (Output_segment::section_with_lowest_load_address): Likewise.
9299 (Output_segment::write_section_headers): Likewise.
9300 (Output_segment::print_sections_to_map): Likewise.
9301 * output.h (class Output_data): Remove dynamic_reloc_count_
9302 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
9303 (Output_data::add_dynamic_reloc): Rewrite.
9304 (Output_data::has_dynamic_reloc): New function.
9305 (Output_data::dynamic_reloc_count): Remove.
9306 (class Output_section): Add order_ field. Remvoe is_relro_local_,
9307 is_last_relro_, is_first_non_relro_, is_interp_,
9308 is_dynamic_linker_section_ fields. Add order and set_order
9309 functions. Remove is_relro_local, set_is_relro_local,
9310 is_last_relro, set_is_last_relro, is_first_non_relro,
9311 set_is_first_non_relro functions, is_interp, set_is_interp,
9312 is_dynamic_linker_section, and set_is_dynamic_linker_section
9313 functions.
9314 (class Output_segment): Change Output_data_list from std::list to
9315 std:;vector. Add output_lists_ field. Remove output_data_ and
9316 output_bss_ fields. Update declarations.
9317
3ff2ccb0
ILT
93182010-08-02 Ian Lance Taylor <iant@google.com>
9319
9320 * arm.cc (Target_arm::gc_process_relocs): Use typename.
9321 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
9322 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
9323
88a4108b
ILT
93242010-08-02 Ian Lance Taylor <iant@google.com>
9325
9326 PR 11855
9327 * script.cc (Script_options::Script_options): Initialize
9328 symbol_definitions_ and symbol_references_.
9329 (Script_options::add_symbol_assignment): Update
9330 symbol_definitions_ and symbol_references_.
9331 (Script_options::add_symbol_reference): New function.
9332 (script_symbol): New function.
9333 * script.h (class Script_options): Add symbol_definitions_ and
9334 symbol_references_ fields.
9335 (Script_options::referenced_const_iterator): New type.
9336 (Script_options::referenced_begin): New function.
9337 (Script_options::referenced_end): New function.
9338 (Script_options::is_referenced): New function.
9339 (Script_options::any_unreferenced): New function.
9340 * script-c.h (script_symbol): Declare.
9341 * yyscript.y (exp): Call script_symbol.
9342 * symtab.cc: Include "script.h".
9343 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
9344 Change all callers. Check symbols referenced by scripts.
9345 (Symbol_table::add_undefined_symbols_from_command_line): Add
9346 layout parameter. Change all callers.
9347 (Symbol_table::do_add_undefined_symbols_from_command_line):
9348 Likewise. Break out loop body. Check symbols referenced by
9349 scripts.
9350 (Symbol_table::add_undefined_symbol_from_command_line): New
9351 function broken out of
9352 do_add_undefined_symbols_from_command_line.
9353 * symtab.h (class Symbol_table): Update declarations.
9354 * archive.cc: Include "layout.h".
9355 (Archive::should_include_member): Add layout parameter. Change
9356 all callers. Check for symbol mentioned in expression.
9357 * archive.h (class Archive): Update declaration.
9358 * object.cc (Sized_relobj::do_should_include_member): Add layout
9359 parameter.
9360 * object.h (Object::should_include_member): Add layout parameter.
9361 Change all callers.
9362 (Object::do_should_include_member): Add layout parameter.
9363 (class Sized_relobj): Update declaration.
9364 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
9365 parameter.
9366 * dynobj.h (class Sized_dynobj): Update declaration.
9367 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
9368 layout parameter.
9369 * plugin.h (class Sized_pluginobj): Update declaration.
9370
5f1ab67a
ILT
93712010-08-02 Ian Lance Taylor <iant@google.com>
9372
9373 PR 11866
9374 * output.cc (Output_segment::set_offset): Search for the first and
9375 last sections rather than assuming that the list is in order.
9376 (Output_segment::find_first_and_last_list): New function.
9377 * output.h (class Output_segment): Update declarations.
9378 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
9379 (relro_strip_test_SOURCES): New variable.
9380 (relro_strip_test_DEPENDENCIES): New variable.
9381 (relro_strip_test_LDFLAGS): New variable.
9382 (relro_strip_test_LDADD): New variable.
9383 (relro_strip_test.so): New target.
9384
a8df5856
ILT
93852010-08-02 Ian Lance Taylor <iant@google.com>
9386
9387 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
9388 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
9389 (Target_i386::got_tlsdesc_section): New function.
9390 (Target_i386::got_section): Create space for GOT entries for
9391 TLSDESC relocations.
9392 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
9393 R_386_TLS_GOTDESC.
9394 (Target_i386::Scan::global): Likewise.
9395 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
9396 using TLSDESC GOT.
9397 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
9398 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
9399 (Target_x86_64::got_tlsdesc_section): New function.
9400 (Target_x86_64::got_section): Create space for GOT entries for
9401 TLSDESC relocations.
9402 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
9403 R_386_TLS_GOTDESC.
9404 (Target_x86_64::Scan::global): Likewise.
9405 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
9406 using TLSDESC GOT.
9407
0c10a0a6
ILT
94082010-08-02 Ian Lance Taylor <iant@google.com>
9409
9410 * testsuite/final_layout.sh: Use dc to convert from hex to
9411 decimal.
9412
41cbeecc
ST
94132010-07-29 Sriraman Tallam <tmsriram@google.com>
9414
9415 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
9416 paramter to the call to gold::gc_process_relocs.
9417 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
9418 paramter to the call to gold::gc_process_relocs.
9419 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
9420 parameter to the call to gold::gc_process_relocs.
9421 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
9422 template parameter to the call to gold::gc_process_relocs.
9423 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
9424 paramter to the call to gold::gc_process_relocs.
9425 * gc.h (get_embedded_addend_size): New function.
9426 (gc_process_relocs): Save the size of the reloc for use by ICF.
9427 * icf.cc (get_section_contents): Get the addend from the text section
9428 for SHT_REL relocation sections.
9429 * icf.h (Icf::Reloc_addend_size_info): New typedef.
9430 (Icf::Reloc_info): Add new member reloc_addend_size_info.
9431 * int_encoding.h (read_from_pointer): New overloaded function.
9432 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
9433 * testsuite/icf_sht_rel_addend_test.sh: New file.
9434 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
9435 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
9436
6ea55b82
RW
94372010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9438
9439 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
9440 * Makefile.in: Regenerate.
9441 * testsuite/Makefile.in: Regenerate.
9442
9691462b
ILT
94432010-07-27 Jeffrey Yasskin <jyasskin@google.com>
9444
9445 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
9446 * gold/testsuite/debug_msg.cc: Likewise.
9447 * gold/testsuite/odr_violation1.cc
9448 * gold/testsuite/odr_violation2.cc
9449
76897331
CC
94502010-07-21 Cary Coutant <ccoutant@google.com>
9451
9452 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
9453 string, and length fields.
9454 (Output_merge_string::Merged_strings_list): New type.
9455 (Output_merge_string::Merged_strings_lists): New typedef.
9456 (Output_merge_string): Replace merged_strings_ with
9457 merged_strings_lists_.
9458 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
9459 Merged_strings_list per input object and section. Don't store pointer
9460 to the string. Don't store length with each merged string entry.
9461 (Output_merge_string::finalize_merged_data): Loop over list of merged
9462 strings lists. Recompute length of each merged string.
9463
78384e8f
CC
94642010-07-15 Cary Coutant <ccoutant@google.com>
9465
9466 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
9467 here.
9468
783659f9
ILT
94692010-07-14 Ian Lance Taylor <iant@google.com>
9470
9471 * descriptors.cc (Descriptors::open): Report correct name in error
9472 message.
9473
131687b4
DK
94742010-07-13 Doug Kwan <dougkwan@google.com>
9475
9476 * arm.cc (Arm_input_section::Arm_input_section): For a
9477 SHT_ARM_EXIDX section, always keeps the input sections.
9478 (Arm_input_section::set_exidx_section_link): New method.
9479 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
9480 has_errors_ to false.
9481 (Arm_exidx_input_section::has_errors,
9482 Arm_exidx_input_section::set_has_errors): New methods.
9483 (Arm_exidx_input_section::has_errors_): New data member.
9484 (Arm_relobj::get_exidx_shndx_list): New method.
9485 (Arm_output_section::append_text_sections_to_list): Do not skip
9486 section without SHF_EXECINSTR.
9487 (Arm_output_section::fix_exidx_coverage): Skip input sections with
9488 errors.
2e702c99 9489 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
9490 section header. Make error messages more verbose. Check for
9491 a non-executable section linked to an EXIDX section.
9492 (Arm_relobj::do_read_symbols): Remove error checking, which has been
9493 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
9494 check that there is no deferred EXIDX section if we exit early.
9495 Instead of not making an EXIDX section in case of an error, make one
9496 and set the has_errors flag of it.
9497 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
9498 in a relocatable link.
9499 (Target_arm::do_relax): Look for the EXIDX output section instead of
9500 assuming that it is called .ARM.exidx.
2e702c99 9501 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
9502 section list. Do not check for SHF_EXECINSTR section flags but
9503 skip any input section with errors.
9504 * output.cc (Output_section::Output_section): Initialize
9505 always_keeps_input_sections_ to false.
9506 (Output_section::add_input_section): Check for
9507 always_keeps_input_sections_.
9508 * output.h (Output_section::always_keeps_input_sections,
9509 Output_section::set_always_keeps_input_sections): New methods.
9510 (Output_section::always_keeps_input_sections): New data member.
9511
69517287
RÁE
95122010-07-13 Rafael Espindola <espindola@google.com>
9513
9514 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
9515 * fileread.h (Input_file): Add try_extra_search_path and find_file.
9516
82742395
ILT
95172010-07-13 Philip Herron <herron.philip@googlemail.com>
9518 Ian Lance Taylor <iant@google.com>
9519
9520 * output.h (Output_section_lookup_maps::add_merge_section):
9521 Correct check of whether value was inserted.
9522 (Output_section_lookup_maps::add_merge_input_section): Likewise.
9523 (Output_section_lookup_maps::add_relaxed_input_section):
9524 Likewise.
9525 * arm.cc (Target_arm::got_section): Remove used local os.
9526 * i386.cc (Target_i386::got_section): Likewise.
9527 * x86_64.cc (Target_x86_64::got_section): Likewise.
9528 * sparc.cc (Target_sparc::got_section): Likewise.
9529 (Target_sparc::relocate): Remove unused local have_got_offset.
9530 * powerpc.cc (Target_powerpc::relocate): Likewise.
9531
f2d707b5
ILT
95322010-07-13 Ian Lance Taylor <iant@google.com>
9533
241531d6
ILT
9534 * compressed_output.cc (zlib_decompress): Fix signature in
9535 !HAVE_ZLIB_H case.
9536
f2d707b5
ILT
9537 * archive.cc (Archive::include_member): Unlock an external member
9538 of a thin archive. Don't bother to delete an object we know is
9539 NULL.
9540
a2e47362
CC
95412010-07-12 Cary Coutant <ccoutant@google.com>
9542
9543 * compressed_output.cc (zlib_decompress): New function.
9544 (get_uncompressed_size): New function.
9545 (decompress_input_section): New function.
9546 * compressed_output.h (get_uncompressed_size): New function.
9547 (decompress_input_section): New function.
9548 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
9549 Handle compressed debug sections.
9550 * layout.cc (is_compressed_debug_section): New function.
9551 (Layout::output_section_name): Map compressed section names to
9552 canonical names.
9553 * layout.h (is_compressed_debug_section): New function.
9554 (is_debug_info_section): Recognize compressed debug sections.
9555 * merge.cc: Include compressed_output.h.
9556 (Output_merge_data::do_add_input_section): Handle compressed
9557 debug sections.
9558 (Output_merge_string::do_add_input_section): Handle compressed
9559 debug sections.
9560 * object.cc: Include compressed_output.h.
9561 (Sized_relobj::Sized_relobj): Initialize new data members.
9562 (build_compressed_section_map): New function.
9563 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
9564 * object.h (Object::section_is_compressed): New method.
9565 (Object::do_section_is_compressed): New method.
9566 (Sized_relobj::Compressed_section_map): New type.
9567 (Sized_relobj::do_section_is_compressed): New method.
9568 (Sized_relobj::compressed_sections_): New data member.
9569 * output.cc (Output_section::add_input_section): Handle compressed
9570 debug sections.
9571 * reloc.cc: Include compressed_output.h.
9572 (Sized_relobj::write_sections): Handle compressed debug sections.
9573
ce279a62
CC
95742010-07-08 Cary Coutant <ccoutant@google.com>
9575
9576 * resolve.cc (Symbol_table::resolve): Remember whether undef was
9577 weak when resolving to a dynamic def.
9578 (Symbol_table::should_override): Add adjust_dyndef flag; set it
9579 for weak undef/dynamic def cases. Adjust callers.
9580 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
9581 undef_binding_weak_.
9582 (Symbol_table::sized_write_globals): Adjust symbol binding.
9583 (Symbol_table::sized_write_symbol): Add binding parameter.
9584 * symtab.h (Symbol::set_undef_binding): New method.
9585 (Symbol::is_undef_binding_weak): New method.
9586 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
9587 (Symbol_table::should_override): Add new parameter.
9588 (Symbol_table::sized_write_symbol): Add new parameter.
9589
9590 * testsuite/weak_undef_file1.cc: Add new test case.
9591 * testsuite/weak_undef_file2.cc: Fix header comment.
9592 * testsuite/weak_undef_test.cc: Add new test case.
9593
b2286c10
DK
95942010-06-29 Doug Kwan <dougkwan@google.com>
9595
9596 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
9597 Initialize USE_SYMBOL_.
9598 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
9599 definition.
9600 (Arm_reloc_property::uses_symbol_): New data member declaration.
9601 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
9602 uses symbol value and symbol is undefined but not weakly undefined.
9603
4802450a
RÁE
96042010-06-28 Rafael Espindola <espindola@google.com>
9605
9606 * plugin.cc (Plugin::load): Use dlerror.
9607
e5ca47ba
ILT
96082010-06-26 Jeffrey Yaskin <jyasskin@google.com>
9609
9610 * symtab.cc (detect_odr_violations): When reporting an ODR
9611 violation, report an object where the symbol is defined.
9612
8a75a161
DK
96132010-06-25 Doug Kwan <dougkwan@google.com>
9614
9615 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
9616 (Target_arm::section_may_have_icf_unsafe_pointers): New method
9617 definition.
9618 (Target_arm::Scan::local_reloc_may_be_function_pointer,
9619 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
9620 target hook to detect function points.
9621 (Target_arm::Scan::possible_function_pointer_reloc): New method.
9622 * icf.h (Icf::check_section_for_function_pointers): Change type of
9623 parameter SECTION_NAME to const reference to std::string. Use
9624 target hook to determine if section may have unsafe pointers.
9625 * target.h (Target::section_may_have_icf_unsafe_pointers): New
9626 method definition.
9627
42218b9f
RÁE
96282010-06-21 Rafael Espindola <espindola@google.com>
9629
9630 * fileread.cc (Input_file::find_fie): New
9631 (Input_file::open): Use Input_file::find_fie.
9632 * fileread.h (Input_file::find_fie): New
9633 * plugin.cc (set_extra_library_path): New.
9634 (Plugin::load): Add set_extra_library_path to the transfer vector.
9635 (Plugin_manager::set_extra_library_path): New.
9636 (Plugin_manager::add_input_file): Use the extra search path if set.
9637 (set_extra_library_path(): New.
9638 * plugin.h (Plugin_manager): Add set_extra_library_path and
9639 extra_search_path_.
9640
a0506cca
CC
96412010-06-19 Cary Coutant <ccoutant@google.com>
9642
9643 * layout.cc (gdb_sections): Add .debug_types.
9644 (lines_only_debug_sections): Likewise.
9645
6508b958
RÁE
96462010-06-18 Rafael Espindola <espindola@google.com>
9647
9648 * plugin.cc (add_input_file,add_input_library)
9649 (Plugin_manager::add_input_file): Make filename arguments const.
9650 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
9651 const.
9652
3e235302
DK
96532010-06-16 Doug Kwan <dougkwan@google.com>
9654
9655 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
9656 .ARM.attributes section if we have not merged any input
9657 attributes sections.
9658
106e8a6c
DK
96592010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9660
9661 * arm.cc: Allow combining objects with no EABI version
9662 information.
9663
91ff43fe
RÁE
96642010-06-15 Rafael Espindola <espindola@google.com>
9665
9666 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
9667
68ed838c
ILT
96682010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9669
9670 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
9671 (struct iovec): Correct !HAVE_READV definition.
9672
f3a2388f
CC
96732010-06-10 Cary Coutant <ccoutant@google.com>
9674
9675 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
9676 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
9677 reloc sections.
9678 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
9679
9680 PR 11683
9681 * symtab.h (Symbol::is_placeholder): New member function.
9682 * target-reloc.h (relocate_section): Check for placeholder symbols.
9683
9684 * testsuite/Makefile.am (plugin_test_8): New test.
9685 (plugin_test_9): New test.
9686 * testsuite/Makefile.in: Regenerate.
9687
e1df38aa
NC
96882010-06-09 Nick Clifton <nickc@redhat.com>
9689
9690 * yyscript.y (input_list_element): Allow strings prefixed with
9691 the '-' character. Treat these as libraries.
9692 * script.cc (script_add_library): New function. Adds a library
9693 specified by "-l<name>" found in an input script.
9694 * script-c.h: Add prototype for script_add_library.
9695
25bbe950
DK
96962010-06-07 Doug Kwan <dougkwan@google.com>
9697
9698 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
9699 Restrict stub-group size to be within long conditional branch
9700 range when working around cortex-A8 erratum.
9701
0f32ea4c
ILT
97022010-06-07 Damien Diederen <dd@crosstwine.com>
9703
9704 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
9705 #ifdef typo.
9706
8fe2a369
ST
97072010-06-03 Sriraman Tallam <tmsriram@google.com>
9708
9709 PR gold/11658
9710 * output.cc
9711 (Output_section::Input_section_sort_entry::compare_section_ordering):
9712 Change to return non-zero correctly.
9713 (Output_section::Input_section_sort_section_order_index_compare
9714 ::operator()): Change to fix ambiguity in comparisons.
9715
6e9ba2ca
ST
97162010-06-01 Sriraman Tallam <tmsriram@google.com>
9717
9718 * gold.h (is_wildcard_string): New function.
9719 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
9720 (Layout::layout_eh_frame): Ditto.
9721 (Layout::find_section_order_index): New method.
9722 (Layout::read_layout_from_file): New method.
9723 * layout.h (Layout::find_section_order_index): New method.
9724 (Layout::read_layout_from_file): New method.
9725 (Layout::input_section_position_): New private member.
9726 (Layout::input_section_glob_): New private member.
9727 * main.cc (main): Call read_layout_from_file here.
9728 * options.h (--section-ordering-file): New option.
9729 * output.cc (Output_section::input_section_order_specified_): New
9730 member.
9731 (Output_section::Output_section): Initialize new member.
9732 (Output_section::add_input_section): Add new parameter.
9733 Keep input sections when --section-ordering-file is used.
9734 (Output_section::set_final_data_size): Sort input sections when
9735 section ordering file is specified.
9736 (Output_section::Input_section_sort_entry): Add new parameter.
9737 Check sorting type.
9738 (Output_section::Input_section_sort_entry::compare_section_ordering):
9739 New method.
9740 (Output_section::Input_section_sort_compare::operator()): Change to
9741 consider section_order_index.
9742 (Output_section::Input_section_sort_init_fini_compare::operator()):
9743 Change to consider section_order_index.
9744 (Output_section::Input_section_sort_section_order_index_compare
9745 ::operator()): New method.
9746 (Output_section::sort_attached_input_sections): Change to sort
9747 according to section order when specified.
e1df38aa
NC
9748 (Output_section::add_input_section<32, true>): Add new parameter.
9749 (Output_section::add_input_section<64, true>): Add new parameter.
9750 (Output_section::add_input_section<32, false>): Add new parameter.
9751 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
9752 * output.h (Output_section::add_input_section): Add new parameter.
9753 (Output_section::input_section_order_specified): New
9754 method.
9755 (Output_section::set_input_section_order_specified): New method.
9756 (Input_section::Input_section): Initialize section_order_index_.
9757 (Input_section::section_order_index): New method.
9758 (Input_section::set_section_order_index): New method.
9759 (Input_section::section_order_index_): New member.
9760 (Input_section::Input_section_sort_section_order_index_compare): New
9761 struct.
9762 (Output_section::input_section_order_specified_): New member.
9763 * script-sections.cc (is_wildcard_string): Delete and move modified
9764 method to gold.h.
9765 (Output_section_element_input::Output_section_element_input): Modify
9766 call to is_wildcard_string.
9767 (Output_section_element_input::Input_section_pattern
9768 ::Input_section_pattern): Ditto.
9769 (Output_section_element_input::Output_section_element_input): Ditto.
9770 * testsuite/Makefile.am (final_layout): New test case.
9771 * testsuite/Makefile.in: Regenerate.
9772 * testsuite/final_layout.cc: New file.
9773 * testsuite/final_layout.sh: New file.
9774
3537c84b
RÁE
97752010-06-01 Rafael Espindola <espindola@google.com>
9776
9777 * plugin.cc (Plugin::load): Pass the output name to the plugin.
9778
105b6afd
RÁE
97792010-06-01 Rafael Espindola <espindola@google.com>
9780
9781 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
9782 visibility of symbols.
9783
29e11421
DK
97842010-05-27 Doug Kwan <dougkwan@google.com>
9785
9786 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
9787 from start of output section instead of address for a local symbol
9788 in a merged or relaxed section when doing a relocatable link.
9789
5e0f337e
RÁE
97902010-05-26 Rafael Espindola <espindola@google.com>
9791
703d02da 9792 PR 11604
5e0f337e
RÁE
9793 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
9794 adding sections the garbage collector removed.
9795 * gold/testsuite/Makefile.am: Add test.
9796 * gold/testsuite/Makefile.in: Regenerate.
9797 * gold/testsuite/plugin_test_7.sh: New.
9798 * gold/testsuite/plugin_test_7_1.c: New.
9799 * gold/testsuite/plugin_test_7_2.c: New.
9800
f4187277
RÁE
98012010-05-26 Rafael Espindola <espindola@google.com>
9802
9803 * script-sections.cc (Output_section_definition::set_section_addresses):
9804 Check for --section-start.
9805
5c388529
DK
98062010-05-26 Doug Kwan <dougkwan@google.com>
9807
9808 * arm.cc (Arm_scan_relocatable_relocs): New class.
9809 (Target_arm::relocate_special_relocatable): New method.
9810 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
9811 (Arm_relocate_functions::thumb_branch_common): Same.
9812 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
9813 instead of Default_scan_relocatable_relocs.
9814 * target-reloc.h (relocate_for_relocatable): Let target handle
9815 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
9816 * target.h (Sized_target::relocate_special_relocatable): New method.
9817
bca1c3ae
ILT
98182010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9819
9820 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
9821
0439c796
DK
98222010-05-23 Doug Kwan <dougkwan@google.com>
9823
9824 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
9825 instead of a cast.
9826 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
9827 with a direct branch, not a conditional branch, to a stub.
9828 * merge.cc (Output_merge_base::record_input_section): New method
9829 defintion.
9830 (Output_merge_data::do_add_input_section): Record input section if
9831 keeps-input-sections flag is set.
9832 (Output_merge_string::do_add_input_section): Ditto.
9833 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
9834 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
9835 INPUT_SECTIONS_.
9836 (Output_merge_base::keeps_input_sections,
9837 Output_merge_base::set_keeps_input_sections,
9838 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
9839 method definitions.
9840 (Output_merge_base::Input_sections): New type declaration.
9841 (Output_merge_base::input_sections_begin,
9842 Output_merge_base::input_sections_end,
9843 Output_merge_base::do_set_keeps_input_sections): New method definitions.
9844 (Output_merge_base::bool keeps_input_sections_,
9845 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
9846 Output_merge_base::input_sections_): New data members.
9847 (Output_merge_data::do_set_keeps_input_sections): New method
9848 defintion.
9849 (Output_merge_string::do_set_keeps_input_sections): Ditto.
9850 * output.cc (Output_section::Input_section::relobj): Move method
9851 defintion from class declaration to here and handle merge sections.
9852 (Output_section::Input_section::shndx): Ditto.
9853 (Output_section::Output_section): Remove initializations of removed
9854 data members and initialize new data member LOOKUP_MAPS_.
9855 (Output_section::add_input_section): Set keeps-input-sections flag
9856 for a newly created merge output section as appropriate. Adjust code
9857 to use Output_section_lookup_maps class.
9858 (Output_section::add_relaxed_input_section): Adjst code for lookup
9859 maps code refactoring.
2e702c99 9860 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
9861 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
9862 class. If adding input section to a newly created merge output
9863 section fails, remove the new merge section.
9864 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 9865 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 9866 (Output_section::find_merge_section): Ditto.
0439c796 9867 (Output_section::build_lookup_maps): New method defintion.
2e702c99 9868 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
9869 Output_section_lookup_maps class.
9870 (Output_section::get_input_sections): Export merge sections. Adjust
9871 code to use Output_section_lookup_maps class.
9872 (Output_section:::add_script_input_section): Adjust code to use
9873 Output_section_lookup_maps class. Update lookup maps for merge
9874 sections also.
9875 (Output_section::discard_states): Use Output_section_lookup_maps.
9876 (Output_section::restore_states): Same.
9877 * output.h (Merge_section_properties): Move class defintion out of
9878 Output_section.
9879 (Output_section_lookup_maps): New class.
9880 (Output_section::Input_section::is_merge_section): New method
9881 defintion.
9882 (Output_section::Input_section::relobj): Move defintion out of class
9883 defintion. Declare method only.
9884 (Output_section::Input_section::shndx): Ditto.
9885 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 9886 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
9887 (Output_section::Merge_section_by_properties_map,
9888 Output_section::Output_section_data_by_input_section_map,
9889 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
9890 Remove types.
2e702c99 9891 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
9892 KEEPS_INPUT_SECTIONS.
9893 (Output_section::build_lookup_maps): New method declaration.
9894 (Output_section::merge_section_map_,
9895 Output_section::merge_section_by_properties_map_,
9896 Output_section::relaxed_input_section_map_,
9897 Output_section::is_relaxed_input_section_map_valid_): Remove data
9898 members.
9899 (Output_section::lookup_maps_): New data member.
9900
76295588
L
99012010-05-21 Doug Kwan <dougkwan@google.com>
9902
9903 PR gold/11619
9904 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
9905 avoid a compilation error.
9906
d103a984
RÁE
99072010-05-19 Rafael Espindola <espindola@google.com>
9908
9909 * script-sections.cc (Output_section_definition::allocate_to_segment):
9910 Update the phdrs_list even when the output section is NULL.
9911 * testsuite/Makefile.am: Add test.
9912 * testsuite/Makefile.in: Regenerate.
9913 * testsuite/script_test_9.cc: New.
9914 * testsuite/script_test_9.sh: New.
9915 * testsuite/script_test_9.t: New.
9916
6625d24e
DK
99172010-05-19 Doug Kwan <dougkwan@google.com>
9918
9919 * arm.cc (Arm_input_section::original_size): New method.
9920 (Arm_input_section::do_addralign): Add a cast.
9921 (Arm_input_section::do_output_offset): Remove static cast.
9922 (Arm_input_section::original_addralign,
9923 Arm_input_section::original_size_): Change type to uint32_t.
9924 (Arm_input_section::init): Add safe casts for section alignment
9925 and size.
9926 (Arm_input_section::set_final_data_size): Do not set address and
9927 offset of stub table.
9928 (Arm_output_section::fix_exidx_coverage): Change use of of
9929 Output_section::Simple_input_section to that of
9930 Output_section::Input_section.
9931 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
9932 except for the first pass.
9933 * output.cc (Output_section::get_input_sections): Change type of
9934 input_sections to std::list<Input_section>.
9935 (Output_section::add_script_input_section): Rename from
9936 Output_section::add_simple_input_section. Change type of SIS
9937 parameter from Simple_input_section to Input_section.
9938 * output.h (Output_section::Simple_input_section): Remove class.
9939 (Output_section::Input_section): Change class visibility to public.
9940 (Output_section::Input_section::addralign): Use stored alignments
9941 for special input sections if set.
9942 (Output_section::Input_section::set_addralign): New method.
9943 (Output_section::get_input_sections): Change parameter type from
9944 list of Simple_input_section to list of Input_section.
9945 (Output_section::add_script_input_section): Rename from
9946 Output_section::add_simple_input_section. Change first parameter's
9947 type from Simple_input_section to Input_section and remove the
9948 second and third parameters.
9949 * script-sections.cc (Input_section::Input_section_list): Change
9950 type to list of Output_section::Input_section/
9951 (Input_section_info::Input_section_info): Change parameter type of
9952 INPUT_SECTION to Output_section::Input_section.
9953 (Input_section_info::input_section): Change return type.
9954 (Input_section_info::input_section_): Change type to
9955 Output_section::Input_section.
9956 (Output_section_element_input::set_section_addresses): Adjust code
9957 to use Output_section::Input_section instead of
9958 Output_section::Simple_input_section. Adjust code for renaming
9959 of Output_section::add_simple_input_section.
9960 (Orphan_output_section::set_section_addresses): Ditto.
9961
e1e82ea4
RW
99622010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9963
9964 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
9965 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
9966
91e75c8a
RÁE
99672010-05-18 Rafael Espindola <espindola@google.com>
9968
9969 * options.cc (General_options::finalize): Handle -nostdlib.
9970 * options.h (nostdlib): New option.
9971 * script.cc (script_add_search_dir): Handle -nostdlib.
9972
da59ad79
DK
99732010-05-12 Doug Kwan <dougkwan@google.com>
9974
9975 * arm.cc (Target_arm::do_finalize_sections): Create an empty
9976 attributes section only if there no attributes section after merging.
9977 (Target_arm::merge_object_attributes): Move value of
e1df38aa 9978 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
9979 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
9980 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
9981 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
9982 and arm_attr_merge_7.stdout.
9983 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
9984 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
9985 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
9986 arm_attr_merge_7b.o): New rules.
9987 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
9988 arm_attr_merge_7
9989 * testsuite/Makefile.in: Regenerate.
9990 * testsuite/arm_attr_merge.sh: New file.
9991 * testsuite/arm_attr_merge_[67][ab].s: Same.
9992
3e01a7fd
NC
99932010-05-05 Nick Clifton <nickc@redhat.com>
9994
9995 * po/es.po: Updated Spanish translation.
9996
7ad2014a
L
99972010-04-27 H.J. Lu <hongjiu.lu@intel.com>
9998
9999 * Makefile.am (install-exec-local): Properly install gold as
10000 default cross linker.
10001 * Makefile.in: Regenerated.
10002
4fda8867
NC
100032010-04-27 H.J. Lu <hongjiu.lu@intel.com>
10004 Nick Clifton <nickc@redhat.com>
10005
10006 * configure.ac (install_as_default): Define and set to false
10007 unless --enable-gold or --enable-gold=both/gold has been
10008 specified.
10009 * configure: Regenerate.
10010
10011 * Makefile.am (install-exec-local): Install the executable as
10012 'ld.gold'. If install_as_default is true then also install it as
10013 'ld'.
10014 * Makefile.in: Regenerated.
10015
bd288ea2
ILT
100162010-04-24 Ian Lance Taylor <iant@google.com>
10017
10018 * layout.cc (Layout::layout_reloc): In relocatable link don't
10019 combine reloc sections for grouped sections.
10020
ef38fd8a
ST
100212010-04-23 Sriraman Tallam <tmsriram@google.com>
10022
10023 * gc.h (gc_process_relocs): Pass information on relocs pointing to
10024 sections that are not ordinary to icf.
10025 * icf.cc (get_section_contents): Handle relocation pointing to section
10026 with no object or shndx information.
10027 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
10028 * testsuite/Makefile.in: Regenerate.
10029 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
10030 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
10031
f6973bdc
ILT
100322010-04-22 Ian Lance Taylor <iant@google.com>
10033
10034 * expression.cc (Expression::Expression_eval_info): Add
10035 result_alignment_pointer field.
10036 (Expression::eval_with_dot): Add result_alignment_pointer
10037 parameter. Change all callers.
10038 (Expression::eval_maybe_dot): Likewise.
10039 (class Binary_expression): Add alignment_pointer parameter to
10040 left_value and right_value. Change all callers.
10041 (BINARY_EXPRESSION): Set result alignment.
10042 (class Trinary_expression): Add alignment_pointer parameter to
10043 arg2_value and arg3_value. Change all callers.
10044 (Trinary_cond::value): Set result alignment.
10045 (Max_expression::value, Min_expression::value): Likewise.
10046 (Align_expression::value): Likewise.
10047 * script-sections.cc (class Sections_element): Add dot_alignment
10048 parameter to set_section_addresses virtual function. Update
10049 instantiations.
10050 (class Output_section_element): Likewise.
10051 (Script_sections::create_segments): Add dot_alignment parameter.
10052 Change all callers.
10053 (Script_sections::create_segments_from_phdrs_clause): Likewise.
10054 (Script_sections::set_phdrs_clause_addresses): Likewise.
10055 * script-sections.h: Update declarations.
10056 * script.h: Update declarations.
10057 * output.h (Output_segment::set_minimum_p_align): Don't decrease
10058 min_p_align.
10059 * testsuite/script_test_3.t: Set large alignment.
10060 * testsuite/script_test_3.sh: Make sure that at least one LOAD
10061 segment has expected alignment.
10062
9c9c98a5
NC
100632010-04-22 Nick Clifton <nickc@redhat.com>
10064
10065 * po/gold.pot: Updated by the Translation project.
10066 * po/vi.po: Updated Vietnamese translation.
10067
2253bfba
L
100682010-04-22 H.J. Lu <hongjiu.lu@intel.com>
10069
10070 * testsuite/Makefile.am (check_PROGRAMS): Add
10071 icf_virtual_function_folding_test.
10072 * testsuite/Makefile.in: Regenerated.
10073
85fdf906
AH
100742010-04-15 Andrew Haley <aph@redhat.com>
10075
10076 * options.h (merge_exidx_entries): New option.
10077 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
10078 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
10079 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
10080 (Target_arm::merge_exidx_entries): New function.
10081 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
10082 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
10083 to Arm_exidx_fixup constructor.
10084 Add new arg, merge_exidx_entries.
10085 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
10086 Arm_output_section::fix_exidx_coverage.
10087
ce97fa81
ST
100882010-04-18 Sriraman Tallam <tmsriram@google.com>
10089
10090 * icf.cc (get_section_contents): Check for preemptible functions.
10091 Ignore addend when appropriate.
10092 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
10093 section folded.
10094 (add_from_relobj): Check for section folded.
10095 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
10096 * symtab.h (should_add_dynsym_entry): Add new parameter.
10097 * target-reloc.h (scan_relocs): Check for section folded.
10098 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
10099 Check reloc types for function pointers in shared objects.
10100 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
10101 case.
10102 (icf_preemptible_functions_test): New test case.
10103 (icf_string_merge_test): New test case.
10104 * testsuite.Makefile.in: Regenerate.
10105 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
10106 bar_glob. Refactor code.
10107 * testsuite/icf_preemptible_functions_test.cc: New file.
10108 * testsuite/icf_preemptible_functions_test.sh: New file.
10109 * testsuite/icf_string_merge_test.cc: New file.
10110 * testsuite/icf_string_merge_test.sh: New file.
10111 * testsuite/icf_virtual_function_folding_test.cc: New file.
10112 * testsuite/icf_virtual_function_folding_test.sh: New file.
10113
04ceb17c
DK
101142010-04-14 Doug Kwan <dougkwan@google.com>
10115
10116 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
10117 for local symbol recounting if we remove a section due to ICF.
10118 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
10119 there are no regular objects in input.
10120
153e7da4
DK
101212010-04-13 Doug Kwan <dougkwan@google.com>
10122
10123 * arm.cc (Arm_input_section::set_final_data_size): Compute
10124 accurate final data size instead of using current data size.
10125
4dbd9faf
DK
101262010-04-09 Doug Kwan <dougkwan@google.com>
10127
10128 * layout.cc (Layout::choose_output_section): Handle script section
10129 types.
10130 (Layout::make_output_section_for_script): Add section type parameter.
10131 Handle script section types.
10132 * layout.h (Layout::make_output_section_for_script): Add section
10133 type parameter.
10134 * output.cc (Output_section::Output_section): Initialize data member
10135 is_noload_.
10136 (Output_section::do_reset_address_and_file_offset): Do not set address
10137 to 0 if section is a NOLOAD section.
10138 * output.h (Output_section::is_noload): New method.
10139 (Output_section::set_is_noload): Ditto.
10140 (Output_section::is_noload_): New data member.
10141 * script-c.h (Script_section_type): New enum type.
10142 (struct Parser_output_section_header): Add new file section_type.
10143 * script-sections.cc (Sections_element::output_section_name): Add
10144 parameter for returning script section type.
10145 (Output_section_definition::output_section_name): Ditto.
10146 (Output_section_definition::section_type)P; New method.
10147 (Output_section_definiton::script_section_type_name): Ditto.
10148 (Output_section_definition::script_section_type_): New data member.
10149 (Output_section_definition::Output_section_definition): Initialize
10150 data member Output_section_definition::script_section_type_.
10151 (Output_section_definition::create_sections): Pass script section type
10152 to Layout::make_output_section_for_script.
10153 (Output_section_definition::output_section_name): Return script
10154 section type to caller.
10155 (Output_section_definition::set_section_address): Do not advance
10156 dot value and load address if section type is NOLOAD. Set address
10157 of NOLOAD sections regardless of section flags.
10158 (Output_section_definition::print): Print section type if it is
10159 not SCRIPT_SECTION_TYPE_NONE.
10160 (Output_section_definition::section_type): New method.
10161 (Output_section_definition::script_section_type_name): Ditto.
10162 (Script_sections::output_section_name): Add new parameter
10163 PSECTION_TYPE for returning script section type. Pass it to
10164 section elements. Handle discard sections.
10165 (Sort_output_sections::operator()): Handle NOLOAD sections.
10166 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 10167 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
10168 returning script section type.
10169 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
10170 INFO and NOLOAD.
10171 * yyscript.y (union): Add new field SECTION_TYPE.
10172 (COPY, DSECT, INFO, NOLOAD): New tokens.
10173 (opt_address_and_section_type): Change type to output_section_header.
10174 (section_type): New non-terminal
10175 (section_header): Handle section type.
2253bfba 10176 (opt_address_and_section_type): Return section type value.
4dbd9faf 10177
721ea635
L
101782010-04-09 H.J. Lu <hongjiu.lu@intel.com>
10179
10180 * testsuite/plugin_common_test_1.c (foo): Add prototype.
10181 * testsuite/plugin_common_test_2.c (foo): Likewise.
10182
6bf924b0
DK
101832010-04-08 Doug Kwan <dougkwan@google.com>
10184
10185 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
10186 Output_merge_data.
10187 * output.cc (Output_section::add_merge_input_section): Simplify
10188 code and return status of Output_merge_base::add_input_section.
e1df38aa 10189 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
10190 returns true.
10191
24af6f92
DK
101922010-04-07 Doug Kwan <dougkwan@google.com>
10193
10194 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
10195 if section is marked as containing instructions but has no mapping
10196 symbols.
10197 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
10198 correct section index.
10199 (Arm_relobj::find_linked_text_section): Ditto.
10200
00698fc5
CC
102012010-04-07 Cary Coutant <ccoutant@google.com>
10202
10203 * archive.cc (include_member): Destroy Read_symbols_data object before
10204 releasing file.
10205 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
10206 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
10207 (Read_symbols_data::~Read_symbols_data) New destructor.
10208 (Section_relocs::Section_relocs) New constructor.
10209 (Section_relocs::~Section_relocs) New destructor.
10210 (Read_relocs_data::Read_relocs_data) New constructor.
10211 (Read_relocs_data::~Read_relocs_data) New destructor.
10212 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
10213 pointers to NULL after deleting.
10214
7296d933
DK
102152010-04-07 Doug Kwan <dougkwan@google.com>
10216
10217 * arm.cc: Replace "endianity" with "endianness" in comments.
10218 (Arm_exidx_cantunwind): Ditto.
10219 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
10220 (Arm_relobj::merge_flags_and_attributes): New method.
10221 (Arm_relobj::merge_flags_and_attributes_): New data member.
10222 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
10223 (Arm_relobj::scan_sections_for_stubs): Ditto.
10224 (Arm_relobj::do_read_symbols): Check to see if we really want to
10225 merge processor-specific flags and attributes. Exit early if
10226 an object is empty except for section names and the undefined symbol.
10227 (Target_arm::do_finalize_sections): Move check for ELF format to
10228 Arm_relobj::do_read_symbols. Merge processor specific flags and
10229 attributes from a regular object only when we have determined that
10230 it is aapropriate. Do not create an .ARM.attributes section in
10231 output if there is no regular input object.
10232 (Target_arm::merge_processor_specific_flags): Check
10233 --warn-mismatch before printing any error.
10234 (Target_arm::merge_object_attributes): Ditto.
10235 * gold.cc (queue_middle_tasks): Handle the case in which there is
10236 no regular object in input.
10237 * options.cc (General_options::parse_EB): New method.
10238 (General_options::parse_EL): Same.
10239 (General_options::General_options): Initialize endianness_.
10240 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
10241 New options.
10242 (General_options::Endianness): New enum.
10243 (General_options::endianness): New method.
10244 (General_options::endianness_): New data member.
10245 * parameters.cc (Parameters::set_options): Check target endianness.
10246 (Parameters::set_target_once): Ditto.
10247 (Parameters::check_target_endianness): New method.
10248 (parameters_force_valid_target): If either -EL or -EB is specified,
10249 use it to define endianness of default target.
10250 * parameters.h (Parameters::check_target_endianness): New method
10251 declaration.
10252 * target.h (class Target): Change "endianity" to "endianness"
10253 in comments.
10254
efc8d4f2
RW
102552010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10256
10257 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
10258 * configure: Regenerate.
10259 * Makefile.in: Regenerate.
10260 * testsuite/Makefile.in: Regenerate.
10261
be234d88
CC
102622010-04-06 Cary Coutant <ccoutant@google.com>
10263
10264 gcc PR lto/42757
10265 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
10266 prevailing definitions of common symbols.
10267 * testsuite/plugin_test_6.sh: New test case.
10268 * testsuite/plugin_common_test_1.c: New test case.
10269 * testsuite/plugin_common_test_2.c: New test case.
10270 * testsuite/Makefile.am (plugin_test_6): New test case.
10271 * testsuite/Makefile.in: Regenerate.
10272
bd32c6bd
NC
102732010-04-06 Nick Clifton <nickc@redhat.com>
10274
10275 * po/vi.po: New Vietnamese translation.
10276
323c532f
DK
102772010-03-30 Doug Kwan <dougkwan@google.com>
10278
10279 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
10280
4fcd97eb
DK
102812010-03-25 Doug Kwan <dougkwan@google.com>
10282
10283 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
10284 to avoid a conversion warning on a 32-bit host.
10285
4ebf39db
ILT
102862010-03-24 Ian Lance Taylor <iant@google.com>
10287
10288 * testsuite/script_test_3.t: Add a TLS segment.
10289 * testsuite/Makefile.am (check_PROGRAMS): Add
10290 tls_phdrs_script_test.
10291 (tls_phdrs_script_test_SOURCES): Define.
10292 (tls_phdrs_script_test_DEPENDENCIES): Define.
10293 (tls_phdrs_script_test_LDFLAGS): Define.
10294 (tls_phdrs_script_test_LDADD): Define.
10295 * testsuite/Makefile.in: Rebuild.
10296
4a599bdd
CC
102972010-03-23 Cary Coutant <ccoutant@google.com>
10298
10299 * fileread.cc (find_or_make_view): Fix comment.
10300
6c93b22c
ILT
103012010-03-23 Ian Lance Taylor <iant@google.com>
10302
10303 * script-sections.cc (class Orphan_section_placement): Define
10304 PLACE_TLS and PLACE_TLS_BSS.
10305 (Orphan_section_placement::Orphan_section_placement): Initialize
10306 new places.
10307 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
10308 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
10309 (tls_script_test_SOURCES): Define.
10310 (tls_script_test_DEPENDENCIES): Define.
10311 (tls_script_test_LDFLAGS): Define.
10312 (tls_script_test_LDADD): Define.
10313 * testsuite/Makefile.in: Rebuild.
10314
a2c7281b
DK
103152010-03-22 Doug Kwan <dougkwan@google.com>
10316
10317 * arm.cc (Arm_relocate_functions::abs8,
10318 Arm_relocate_functions::abs16): Use correct check for overflow
10319 specified in the ARM ELF specs.
10320 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
10321 target of a BLX instruction specially.
10322 (Reloc_stub::stub_type_for_reloc): Ditto.
10323 (Relocate::relocate): Use symbolic names instead of numeric relocation
10324 codes to report error.
10325 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
10326 workaround.
10327 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
10328 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
10329 thumb2_blx_out_of_range.stdout
10330 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
10331 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
10332 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
10333 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
10334 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
10335 thumb2_blx_in_range, thumb2_blx_in_range.o,
10336 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
10337 thumb2_blx_out_of_range.o): New rules.
2e702c99 10338 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
10339 thumb2_blx_in_range and thumb2_blx_out_of_range.
10340 * testsuite/Makefile.in: Regenerate.
10341 * arm_branch_in_range.sh: Add tests for THUMB BLX.
10342 * testsuite/thumb_blx_in_range.s: New file.
10343 * testsuite/thumb_blx_out_of_range.s: New file.
10344
b0193076
RÁE
103452010-03-22 Rafael Espindola <espindola@google.com>
10346
10347 * archive.cc (Should_include): Move to archive.h.
10348 (should_include_member): Make it a member of Archive.
10349 (Lib_group): New.
10350 (Add_lib_group_symbols): New.
10351 * archive.h: Include options.h.
10352 (Archive_member): Moved from Archive.
10353 (Should_include): Moved from archive.cc.
10354 (Lib_group): New.
10355 (Add_lib_group_symbols): New.
10356 * dynobj.cc (do_should_include_member): New.
10357 * dynobj.h (do_should_include_member): New.
10358 * gold.cc (queue_initial_tasks): Update call to queue.
10359 * main.cc (main): Print lib group stats.
10360 * object.cc (do_should_include_member): New.
10361 * object.h: Include archive.h.
10362 (Object::should_include_member): New.
10363 (Object::do_should_include_member): New.
10364 (Sized_relobj::do_should_include_member): New.
10365 * options.cc (General_options::parse_start_lib): New.
10366 (General_options::parse_end_lib): New.
10367 (Input_arguments::add_file): Handle lib groups.
10368 (Input_arguments::start_group): Check we are not in a lib.
10369 (Input_arguments::start_lib): New.
10370 (Input_arguments::end_lib): New.
10371 * options.h (General_options): Add start_lib and end_lib.
10372 (Input_argument::lib_): New.
10373 (Input_argument::lib): New.
10374 (Input_argument::is_lib): New.
10375 (Input_file_lib): New.
10376 (Input_arguments::in_lib_): New.
10377 (Input_arguments::in_lib): New.
10378 (Input_arguments::start_lib): New.
10379 (Input_arguments::end_lib_): New.
10380 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
10381 in unused members as preempted.
10382 (Sized_pluginobj::do_should_include_member): New.
10383 * plugin.h (Sized_pluginobj::do_should_include_member): New.
10384 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
10385 return the blocker.
10386 (Read_symbols::do_whole_lib_group): New.
10387 (Read_symbols::do_lib_group): New.
10388 (Read_symbols::do_read_symbols): Handle lib groups.
10389 (Read_symbols::get_name): Handle lib groups.
10390 * readsyms.h (Read_symbols): Add an archive member pointer.
10391 (Read_symbols::do_whole_lib_group): New.
10392 (Read_symbols::do_lib_group): New.
10393 (Read_symbols::member_): New.
10394 * script.cc (read_input_script): Update call to queue_soon.
10395
d099120c
DK
103962010-03-19 Doug Kwan <dougkwan@google.com>
10397
10398 * arm.cc (Stub_table::Stub_table): Initialize new data members
10399 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10400 (Stub_table::add_reloc_stub): Assign stub offset and update
10401 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10402 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
10403 New data members.
2e702c99 10404 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
10405 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
10406 instead of going over all reloc stubs.
2e702c99 10407 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
10408 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10409 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 10410 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
10411 Stringpool_template::offset_.
10412 * stringpool.h (Stringpool_template::set_no_zero_null): Set
10413 Stringpool_template::offset_ to zero.
10414
1aa37384
DK
104152010-03-15 Doug Kwan <dougkwan@google.com>
10416
10417 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10418 offset_.
10419 (Stringpool_template::new_key_offset): New method.
10420 (Stringpool_template::add_string): Assign offsets when adding new
10421 strings.
10422 (Stringpool_template::set_string_offsets): Do not set string offsets
10423 when not optimizing.
10424 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
10425 member size_.
2e702c99
RM
10426 (Chunked_vector::clear): Clear size_.
10427 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
10428 (Chunked_vector::size): Return size_.
10429 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 10430 (Chunked_vector::size_): New data member.
1aa37384
DK
10431 (Stringpool_template::set_no_zero_null): Assert string set is empty.
10432 (Stringpool_template::new_key_offset): New method declaration.
10433 (Stringpool_template::offset_): New data member.
10434
b672b057
RÁE
104352010-03-15 Rafael Espindola <espindola@google.com>
10436
10437 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
10438 Add_symbols' constructor.
10439 * readsyms.h (Add_symbols): Remove the input_group member.
10440
b6848d3c
ILT
104412010-03-10 Ian Lance Taylor <iant@google.com>
10442
10443 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
10444 target to ask whether a reference to a symbol requires a stack
10445 split.
10446 * target.h (Target::is_call_to_non_split): New function.
10447 (Target::do_is_call_to_non_split): Declare virtual function.
10448 * target.cc: Include "symtab.h".
10449 (Target::do_is_call_to_non_split): New function.
10450 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
10451
a2a5469e
CC
104522010-03-10 Cary Coutant <ccoutant@google.com>
10453
10454 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
10455 (File_read::open[1]): Remove initial mapping of whole_file_view_.
10456 (File_read::open[2]): Add whole_file_view_ to list of views.
10457 (File_read::make_view): Remove test of whole_file_view_.
10458 (File_read::find_or_make_view): Create whole_file_view_ if
10459 necessary.
10460 (File_read::clear_views): Replace bool parameter with enum;
10461 adjust all callers. Don't delete views with permanent data;
10462 do delete cached views and views from archives if
10463 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
10464 if clearing the corresponding view.
10465 * fileread.h (File_read::Clear_views_mode): New enum.
10466 (File_read::View::is_permanent_view): New method.
10467 (File_read::clear_views): Replace bool parameter
10468 with enum; adjust all callers.
10469 * options.h (General_options): Change keep_files_mapped option;
10470 add map_whole_files.
10471 * readsyms.cc (Add_symbols::run): Delete sd_ object before
10472 releasing the file.
10473 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
10474 the file.
10475
8861f32b
DM
104762010-03-10 David S. Miller <davem@davemloft.net>
10477
10478 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
10479
d62d0f5f
ST
104802010-03-09 Sriraman Tallam <tmsriram@google.com>
10481
10482 * icf.cc (get_section_contents): Add '@' marker after processing the
10483 merge reloc.
10484
9177756d
DK
104852010-03-08 Doug Kwan <dougkwan@google.com>
10486
10487 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
10488 due to a conversion warning.
10489 (Arm_relobj::update_output_local_symbol_count): Check for local
10490 symbol with unset output index.
10491
9e9e071b
ILT
104922010-03-05 Ian Lance Taylor <iant@google.com>
10493
10494 * options.h (class General_options): Add --spare-dynamic-tags.
10495 * output.cc (Output_data_dynamic::set_final_data_size): Implement
10496 --spare-dynamic-tags.
10497
a81ee015
ILT
104982010-03-05 Ian Lance Taylor <iant@google.com>
10499
10500 * incremental.cc: Include "libiberty.h".
10501
44ec90b9
RO
105022010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
10503
10504 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
10505 function, is_info_ member.
10506 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
10507 (Versions::Versions): Update caller.
10508 (Versions::define_base_version): Likewise.
10509 (Versions::add_def): Likewise.
10510
0897ed3b
ST
105112010-03-03 Sriraman Tallam <tmsriram@google.com>
10512
10513 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
10514 (Scan::possible_function_pointer_reloc): New function.
10515 (Scan::local_reloc_may_be_function_pointer): Change to call
10516 possible_function_pointer_reloc.
10517 (Scan::global_reloc_may_be_function_pointer): Ditto.
10518 * icf.h (Icf::check_section_for_function_pointers): Change to reject
10519 relocations in ".data.rel.ro._ZTV" section.
10520 * testsuite/icf_safe_so_test.sh: Change to pass i386.
10521 * testsuite/icf_safe_so_test.cc: Ditto.
10522 * testsuite/icf_safe_test.cc: Ditto.
10523 * testsuite/icf_safe_test.sh: Ditto.
10524
d3bbad62
ILT
105252010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10526 Ian Lance Taylor <iant@google.com>
10527
10528 * target-reloc.h (relocate_section): Check the symbol table index
10529 for -1U before setting the local symbol index.
10530 (scan_relocatable_relocs): If copying the relocation, record that
10531 the local symbol is required.
10532 * object.h (Symbol_value::is_output_symtab_index_set): New
10533 function.
10534 (Symbol_value::may_be_discarded_from_output_symtab): New
10535 function.
10536 (Symbol_value::has_output_symtab_entry): New function.
10537 (Symbol_value::needs_output_symtab_entry): Remove.
10538 (Symbol_value::output_symtab_index): Make sure the symbol index is
10539 set.
10540 (Symbol_value::set_output_symtab_index): Make sure the symbol
10541 index is not set. Make sure the new index is valid.
10542 (Symbol_value::set_must_have_output_symtab_entry): New function.
10543 (Symbol_value::has_output_dynsym_entry): New function.
10544 (Symbol_value::set_output_dynsym_index): Make sure the new index
10545 is valid.
10546 (Sized_relobj::set_must_have_output_symtab_entry): New function.
10547 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
10548 local symbol if permitted.
10549 (Sized_relobj::do_finalize_local_symbols): Call
10550 is_output_symtab_index_set rather than needs_output_symtab_entry.
10551 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
10552 rather than needs_output_symtab_entry. Call
10553 has_output_dynsym_entry rather than needs_output_dynsym_entry.
10554 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
10555 is_output_symtab_index_set rather than needs_output_symtab_entry.
10556 * testsuite/discard_locals_relocatable_test.c: New file.
10557 * testsuite/discard_locals_test.sh: Test -r.
10558 * testsuite/Makefile.am (check_DATA): Add
10559 discard_locals_relocatable_test1.syms,
10560 discard_local_relocatable_test2.syms.
10561 (MOSTLYCLEANFILES): Likewise. Also add
10562 discard_locals_relocatable_test1.lout and
10563 discard_locals_relocatable_test2.out.
10564 (discard_locals_relocatable_test1.syms): New target.
10565 (discard_locals_relocatable_test.o): New target.
10566 (discard_locals_relocatable_test1.out): New target.
10567 (discard_locals_relocatable_test2.syms): New target.
10568 (discard_locals_relocatable_test2.out): New target.
10569 (various): Add missing ../ld-new dependencies.
10570 * testsuite/Makefile.in: Rebuild.
10571
7e8ccf26
NC
105722010-03-03 Nick Clifton <nickc@redhat.com>
10573
10574 * po/fi.po: New Finnish translation.
10575
2a0ff005
DK
105762010-03-01 Doug Kwan <dougkwan@google.com>
10577
10578 * layout.cc (Layout::Layout): Force section types of .init_array*,
10579 .preinit_array* and .fini_array* sections.
10580 * output.cc (Output_section::Input_section_sort_entry::has_priority):
10581 Fix check of return value of std::string::find.().
10582 (Output_section::Input_section_sort_compare::operator()): Remove
10583 comment about .init_array.
10584 (Output_section::Input_section_sort_init_fini_compare::operator()):
10585 New method.
10586 (Output_section::sort_attached_input_sections): Handle .init_array
10587 and .fini_array specially.
10588 * output.h (Output_section::Inut_section_sort_compare): Update
10589 comment.
10590 (Output_section::Input_section_sort_init_fini_compare): New struct.
10591
c3e4ae29
DK
105922010-02-26 Doug Kwan <dougkwan@google.com>
10593
10594 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
10595 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
10596 * testsuite/debug_msg.sh: Avoid matching source line number for
10597 use of global variable undef_int.
10598
2fd9ae7a
DK
105992010-02-26 Doug Kwan <dougkwan@google.com>
10600
10601 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
10602 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
10603 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
10604 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
10605 * options.cc (General_options::General_options): Initialize member
10606 fix_v4bx_.
10607 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
10608 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
10609 and rm_no_fix_v4bx.stdout
10610 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
10611 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
10612 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
10613 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
10614 and arm_no_fix_v4bx.
10615 * Makefile.in: Regenerate.
10616 * testsuite/arm_fix_v4bx.s: New file.
10617 * testsuite/arm_fix_v4bx.sh: Ditto.
10618
67ec7d0b
DK
106192010-02-24 Doug Kwan <dougkwan@google.com>
10620
10621 * arm.cc (Target_arm::got_section): Make the .got section the first
10622 non RELRO section in the data segment.
10623 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
10624 suffixes of section names.
10625
10165461
DK
106262010-02-24 Doug Kwan <dougkwan@google.com>
10627
10628 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
10629 flags and attributes merging if an input file is a binary file.
10630 * fileread.cc (Input_file::open): Record format of original file.
10631 * fileread.h (Input_file::Format): New enum type.
2e702c99 10632 (Input_file::Input_file): Initialize data member format_.
10165461
DK
10633 (Input_file::format): New method definition.
10634 (Input_file::format_):: New data member.
10635
4a54abbb
DK
106362010-02-24 Doug Kwan <dougkwan@google.com>
10637
10638 * arm.cc (Arm_output_data_got): New class.
10639 (ARM_TCB_SIZE): New constant
10640 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
10641 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
10642 If user uses a script with a SECTIONS clause, issue only a warning
10643 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 10644 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
10645 garbage collection.
10646 (Target_arm::got_mode_index_entry): Handle static linking.
10647 (Target_arm::Scan::local): Ditto.
10648 (Target_arm::Scan::global): Ditto.
10649 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
10650 all incorrectly implemented relocations.
e1df38aa 10651 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
10652 Arm_output_section::fix_exidx_coverage.
10653 * layout.cc (Layout::section_name_mapping): Remove trailing dots
10654 from ".ARM.exidx." and ".ARM.extab.".
10655
ca419a6f
ILT
106562010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10657
10658 * arm.cc (Target_arm::do_finalize_sections): Create attribute
10659 section if it does not already exist.
10660 * attributes.cc (Attributes_section_data::Attributes_section_data):
10661 Don't crash if size is zero.
10662
135b9c78
ILT
106632010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10664 Ian Lance Taylor <iant@google.com>
10665
10666 * gold.cc (queue_middle_tasks): If no input files were opened,
10667 exit.
10668 * workqueue.h (Task_function::Task_function): Assert that there is
10669 a blocker.
10670
bb0bfe4f
DK
106712010-02-22 Doug Kwan <dougkwan@google.com>
10672
10673 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
10674 * icf.cc (get_section_contents): Cast snprintf arguments to long long
10675 types to avoid warnings due to different uint64_t implementations
10676 on different hosts.
10677
2a2b6d42
DK
106782010-02-21 Doug Kwan <dougkwan@google.com>
10679
10680 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
10681 handling of the maximum backward branch offset.
2e702c99 10682 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
10683 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
10684 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 10685 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
10686 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
10687 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
10688 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
10689 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
10690 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
10691 thumb_bl_out_of_range thumb_bl_out_of_range.o,
10692 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
10693 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
10694 thumb2_bl_out_of_range.o): New rules.
10695 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
10696 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
10697 thumb2_bl_out_of_range
10698 * testsuite/Makefile.in: Regenerate.
10699 * testsuite/arm_bl_in_range.s: New file.
10700 * testsuite/arm_bl_out_of_range.s: Ditto.
10701 * testsuite/arm_branch_in_range.sh: Ditto.
10702 * testsuite/arm_branch_range.t: Ditto.
10703 * testsuite/thumb2_branch_range.t: Ditto.
10704 * testsuite/thumb_bl_in_range.s: Ditto.
10705 * testsuite/thumb_bl_out_of_range.s: Ditto.
10706 * testsuite/thumb_branch_range.t: Ditto.
10707
b487ad64
ST
107082010-02-20 Sriraman Tallam <tmsriram@google.com>
10709
10710 * gc.h (gc_process_relocs): Change vectors to point to the new list.
10711 Add reloc offset information.
10712 * icf.cc (get_section_contents): Change iterators to point to the new
10713 vectors. Add reloc offset information to the contents.
10714 * icf.h (Icf::Sections_reachable_info): New typedef.
10715 (Icf::Sections_reachable_list): New typedef.
10716 (Icf::Offset_info): New typedef.
10717 (Icf::Reloc_info): New struct typedef.
10718 (Icf::Reloc_info_list): New typedef.
10719 (Icf::symbol_reloc_list): Delete method.
10720 (Icf::addend_reloc_list): Delete method.
10721 (Icf::section_reloc_list): Delete method.
10722 (Icf::reloc_info_list): New method.
10723 (Icf::reloc_info_list_): New member.
10724
f96accdf
DK
107252010-02-19 Doug Kwan <dougkwan@google.com>
10726
10727 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
10728 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
10729 * arm.cc (Arm_relocation_functions): New forward declaration.
10730 (Target_arm::Target_arm): Initialize new data members
10731 got_mod_index_offset_ and tls_base_symbol_defined_.
10732 (Target_arm::Relocate::relocate_tls): New method.
10733 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
10734 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
10735 New methods.
2e702c99 10736 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
10737 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
10738 (Target_arm::got_mod_index_offset_,
10739 Target_arm::tls_base_symbol_defined_): New data members.
10740 (Target_arm::Scan::local, Target::Scan::global,
10741 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
10742 relocations.
10743
c8761b9a
DK
107442010-02-18 Doug Kwan <dougkwan@google.com>
10745
10746 * arm.cc (Arm_relobj::find_linked_text_section): New method.
10747 (Arm_relobj::make_exidx_input_section): Pass section index of linked
10748 text section as a parameter becuase some broken tools may not set
10749 the link in section header.
10750 (Target_arm::has_got_section): New method.
10751 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
10752 without any mapping symbol as data only. Remove warning.
10753 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
10754 link in its section header, try to discover the link by inspecting the
10755 REL31 relocation at the beginning of the section.
10756 (Target_arm::Scan::check_non_pic): Report name of offending relocation
10757 in error message.
10758 (Target_arm::Scan::global): Treat any reference to the symbol
10759 _GLOBAL_OFFSET_TABLE_ as a GOT access.
10760
21bb3914
ST
107612010-02-12 Sriraman Tallam <tmsriram@google.com>
10762
10763 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
10764 (Scan::global_reloc_may_be_function_pointer): New function.
10765 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10766 (Scan::global_reloc_may_be_function_pointer): New function.
10767 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10768 (Scan::global_reloc_may_be_function_pointer): New function.
10769 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
10770 (Scan::global_reloc_may_be_function_pointer): New function.
10771 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
10772 (Scan::global_reloc_may_be_function_pointer): New function.
10773 (Scan::possible_function_pointer_reloc): New function.
10774 (Target_x86_64::can_check_for_function_pointers): New function.
10775 * gc.h (gc_process_relocs): Scan relocation types to determine if
10776 function pointers were taken for targets that support it.
10777 * icf.cc (Icf::find_identical_sections): Include functions for
10778 folding in safe ICF whose pointer is not taken.
10779 * icf.h (Secn_fptr_taken_set): New typedef.
10780 (fptr_section_id_): New member.
10781 (section_has_function_pointers): New function.
10782 (set_section_has_function_pointers): New function.
10783 (check_section_for_function_pointers): New function.
10784 * options.h: Fix comment for safe ICF option.
10785 * target.h (can_check_for_function_pointers): New function.
10786 * testsuite/Makefile.am: Add icf_safe_so_test test case.
10787 Modify icf_safe_test for X86-64.
10788 * testsuite/Makefile.in: Regenerate.
10789 * testsuite/icf_safe_so_test.cc: New file.
10790 * testsuite/icf_safe_so_test.sh: New file.
10791 * testsuite/icf_safe_test.cc (kept_func_3): New function.
10792 (main): Change to take pointer to function kept_func_3.
10793 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
10794 folding is done correctly for X86-64.
10795
0da6fa6c
DM
107962010-02-12 David S. Miller <davem@davemloft.net>
10797
10798 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
10799 is_symbolless parameter.
10800 (Output_reloc<SHT_REL>::is_symbolless): New.
10801 (Output_reloc<SHT_REL>::is_symbolless_): New.
10802 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
10803 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
10804 (Output_reloc<SHT_RELA>::is_symbolless): New.
10805 (Output_data_reloc::add_global): Handle is_symbolless.
10806 (Output_data_reloc::add_global_relative): Likewise.
10807 (Output_data_reloc::add_local): Likewise.
10808 (Output_data_reloc::add_local_relative): Likewise.
10809 (Output_data_reloc::add_symbolless_global_addend): New.
10810 (Output_data_reloc::add_symbolless_local_addend): New.
10811 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
10812 is_symbolless.
10813 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
10814 instead of ->is_relative_
10815 (Output_reloc::write): Likewise.
10816 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
10817 (Output_reloc::write_rel): Simplify.
10818
10819 * sparc.cc (Target_sparc::Scan::local): Use
10820 ->add_symbolless_local_addend as needed.
10821 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
10822 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
10823 based upon relocation offset.
10824
e4782e83
DK
108252010-02-11 Doug Kwan <dougkwan@google.com>
10826
10827 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
10828 (Target_arm::Scan::global): Ditto. Also remove a comment before the
10829 beginning of function.
10830 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
10831 and MOVT_ABS relocations. Those are non issued in scanning. Fix
10832 parameter is_32bit in calls to should_apply_static_reloc.
10833 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
10834 (check_DATA): Add arm_abs_global.stdout.
10835 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
10836 arm_abs_global.stdout): New rules.
10837 (MOSTLLYCLEANFILES): Add arm_abs_global
10838 * Makefile.in: Regenerate.
10839 * testsuite/arm_abs_global.s: New file.
10840 * testsuite/arm_abs_global.sh: Ditto.
10841 * testsuite/arm_abs_lib.s: Ditto.
10842
93ceb764
ILT
108432010-02-11 Ian Lance Taylor <iant@google.com>
10844
10845 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
10846 Read_relocs task.
10847 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
10848 Allocate_commons_task first.
10849 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
10850 task, rather than symtab_lock_.
10851 (Gc_process_relocs::~Gc_process_relocs): New function.
10852 (Gc_process_relocs::is_runnable): Check this_blocker_.
10853 (Gc_process_relocs::locks): Use next_blocker_ rather than
10854 blocker_.
10855 (Scan_relocs::~Scan_relocs): New function.
10856 (Scan_relocs::is_runnable): Check this_blocker_ rather than
10857 symtab_lock_.
10858 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
10859 next_blocker_.
10860 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
10861 fields. Add this_blocker_ and next_blocker_ fields. Adjust
10862 constructor accordingly.
10863 (class Gc_process_relocs): Likewise.
10864 (class Scan_relocs): Likewise.
10865 * common.h (class Allocate_commons_task): Remove symtab_lock_
10866 field, and corresponding constructor parameter.
10867 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
10868 symtab_lock_.
10869 (Allocate_commons_task::locks): Likewise.
10870
114dfbe1
ILT
108712010-02-11 Ian Lance Taylor <iant@google.com>
10872
10873 * gold-threads.h (class Once): Define.
10874 (class Initialize_lock): Rewrite as child of Once.
10875 * gold-threads.cc (class Once_initialize): Define.
10876 (once_pointer_control): New static variable.
10877 (once_pointer, once_arg): New static variables.
10878 (c_run_once): New static function.
10879 (Once::Once, Once::run_once, Once::internal_run): New functions.
10880 (class Initialize_lock_once): Remove.
10881 (initialize_lock_control): Remove.
10882 (initialize_lock_pointer): Remove.
10883 (initialize_lock_once): Remove.
10884 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
10885 (Initialize_lock::initialize): Rewrite.
10886 (Initialize_lock::do_run_once): New function.
10887 * archive.cc (Archive::interpret_header): Only clear name if it is
10888 not already empty.
10889 * fileread.cc: Include "gold-threads.h"
10890 (file_counts_lock): New static variable.
10891 (file_counts_initialize_lock): Likewise.
10892 (File_read::release): Only increment counts when using --stats.
10893 Use a lock around the increment.
10894 * parameters.cc (class Set_parameters_target_once): Define.
10895 (set_parameters_target_once): New static variable.
10896 (Parameters::Parameters): Move here from parameters.h.
10897 (Parameters::set_target): Rewrite.
10898 (Parameters::set_target_once): New function.
10899 (Parameters::clear_target): Move here and rewrite.
10900 * parameters.h (class Parameters): Update declarations. Add
10901 set_parameters_target_once_ field.
10902 (Parameters::Parameters): Move to parameters.cc.
10903 (Parameters::clear_target): Likewise.
10904 * readsyms.cc (Read_symbols::do_group): Create a Start_group
10905 task.
10906 (Start_group::~Start_group): New function.
10907 (Start_group::is_runnable): New function.
10908 (Start_group::locks, Start_group::run): New functions.
10909 (Finish_group::run): Change saw_undefined to size_t.
10910 * readsyms.h (class Start_group): Define.
10911 (class Finish_group): Change saw_undefined_ field to size_t.
10912 (Finish_group::Finish_group): Remove saw_undefined and
10913 this_blocker parameters. Change all callers.
10914 (Finish_group::set_saw_undefined): New function.
10915 (Finish_group::set_blocker): New function.
10916 * symtab.h (class Symbol_table): Change saw_undefined to return
10917 size_t. Change saw_undefined_ field to size_t.
10918 * target-select.cc (Set_target_once::do_run_once): New function.
10919 (Target_selector::Target_selector): Initialize set_target_once_
10920 field. Don't initialize lock_ and initialize_lock_ fields.
10921 (Target_selector::instantiate_target): Rewrite.
10922 (Target_selector::set_target): New function.
10923 * target-select.h (class Set_target_once): Define.
10924 (class Target_selector): Update declarations. Make
10925 Set_target_once a friend. Remove lock_ and initialize_lock_
10926 fields. Add set_target_once_ field.
10927
fa17a3f4
ILT
109282010-02-10 Ian Lance Taylor <iant@google.com>
10929
10930 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
10931 queueing any tasks.
10932 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
10933 (queue_middle_tasks): Add all blockers before queueing any tasks.
10934 (queue_final_tasks): Likewise.
10935 * token.h (Task_token::add_blockers): New function.
10936 * object.h (Input_objects::number_of_relobjs): New function.
10937
c7177d31
ILT
109382010-02-10 Ian Lance Taylor <iant@google.com>
10939
5de0e392
ILT
10940 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
10941 shared, not if not position independent.
10942 * x86_64.cc (Relocate::relocate_tls): Likewise.
10943 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
10944 (tls_pie_pic_test): New target.
10945 * testsuite/Makefile.in: Rebuild.
10946
c7177d31
ILT
10947 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
10948 (tls_test_main_pie.o, tls_test_pie.o): New targets.
10949 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
10950 * testsuite/Makefile.in: Rebuild.
10951
684b268a
DM
109522010-02-09 David S. Miller <davem@davemloft.net>
10953
10954 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
10955 R_SPARC_RELATIVE using ->add_local_relative().
10956 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
10957
612a8d3d
DM
10958 * output.h (Output_data_dynamic::add_section_size): New method
10959 that takes two Output_data objects.
10960 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
10961 entry param. Handle it in initializers.
10962 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
10963 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
10964 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
10965 arg.
10966 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
10967 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
10968 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
10969 for dynrel_includes_plt.
10970 * i386.cc (Target_i386::do_finalize_sections): Likewise.
10971 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
10972 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
10973 before .rela.plt
10974 (Target_sparc::do_finalize_sections): Update to pass true for
10975 dynrel_includes_plt.
10976 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
10977 output before .rela.plt
10978 (Target_powerpc::do_finalize_sections): Update to pass true for
10979 dynrel_includes_plt when 32-bit.
10980
cb1be87e
DK
109812010-02-08 Doug Kwan <dougkwan@google.com>
10982
10983 * arm.cc (Arm_relobj::simple_input_section_output_address): New
10984 method.
10985 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
10986 Arm_relobj::scan_section_for_cortex_a8_stubs,
10987 Arm_relobj::do_relocation_section): Instead of calling
10988 Output_section::output_address, use faster
10989 Arm_relobj::simple_input_section_output_address.
10990
705b5121
DM
109912010-02-08 David S. Miller <davem@davemloft.net>
10992
10993 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
10994 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
10995 relocation helper function.
10996
024c4466
DM
10997 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
10998 just like R_SPARC_GOT{10,13,22}.
10999 (Target_sparc::Scan::local): Likewise.
11000 (Target_sparc::Relocate:relocate): Likewise.
11001
9109c078
ILT
110022010-02-06 Ian Lance Taylor <iant@google.com>
11003
11004 * configure.ac: Rewrite targetobjs duplicate removal code to use
11005 only shell constructs.
11006 * configure: Rebuild.
11007
cf846138
DK
110082010-02-05 Doug Kwan <dougkwan@google.com>
11009
11010 PR 11247
11011 * arm.cc (Arm_relobj::section_is_scannable): New method.
11012 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
11013 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
11014
6cfaf60b
DK
110152010-02-04 Doug Kwan <dougkwan@google.com>
11016
11017 PR 11247
11018 * arm-reloc-property.cc (cstdio): Include.
11019 * configure.ac (targetobjs): Remove duplicates.
11020 * configure: Regenerate.
11021 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
11022 big and little endian version for a given address size.
11023
5c57f1be
DK
110242010-02-03 Doug Kwan <dougkwan@google.com>
11025
11026 * arm-reloc-property.cc
11027 (Arm_reloc_property_table::reloc_name_in_error_message): New method
11028 definition.
11029 * arm-reloc-property.h
11030 (Arm_reloc_property_table::get_implemented_static_reloc_property):
11031 New method definition.
11032 (Arm_reloc_property_table::reloc_name_in_error_message): New method
11033 declaration.
11034 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
11035 overflow to N.
11036 (GOT_PREL): Change implemented to Y.
11037 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
11038 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
11039 (Arm_relocate_functions::movw_abs_nc): Remove method.
11040 (Arm_relocate_functions::movt_abs): Ditto.
11041 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
11042 (Arm_relocate_functions::thm_movt_abs): Ditto.
11043 (Arm_relocate_functions::movw_rel_nc): Ditto.
11044 (Arm_relocate_functions::movw_rel): Ditto.
11045 (Arm_relocate_functions::movt_rel): Ditto.
11046 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
11047 (Arm_relocate_functions:thm_movw_rel): Ditto.
11048 (Arm_relocate_functions:thm_movt_rel): Ditto.
11049 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
11050 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
11051 New method definitions.
11052 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
11053 (Arm_relocation_functions::arm_grp_ldr): Ditto.
11054 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
11055 (Arm_relocation_functions::arm_grp_ldc): Ditto.
11056 (Target_arm::Relocate::relocate): Check for non-static or
11057 unimplemented relocation code and exit early. Change calls to
11058 Target_arm::reloc_uses_thumb_bit and
11059 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
11060 instead. Refactor code to handle similar relocations to increase
11061 code sharing. Remove check for unsupported relocation code in switch
11062 statement.
11063 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
11064 relocation property table to find out size. Change error message to
11065 print out the name of a relocation code instead of the numeric value.
11066 (Target_arm::scan_reloc_for_stub): Use relocation property table
11067 instead of calling Target_arm::reloc_uses_thumb_bit().
11068
218c5831
DK
110692010-02-02 Doug Kwan <dougkwan@google.com>
11070
11071 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
11072 types of relaxed input section.
11073
0d31c79d
DK
110742010-02-02 Doug Kwan <dougkwan@google.com>
11075
11076 * Makefile.am (HFILES): Add arm-reloc-property.h.
11077 (DEFFILES): New.
2e702c99
RM
11078 (TARGETSOURCES): Add arm-reloc-property.cc
11079 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
11080 (libgold_a_SOURCES): $(DEFFILES)
11081 * Makefile.in: Regenerate.
11082 * arm-reloc-property.cc: New file.
11083 * arm-reloc-property.h: New file.
11084 * arm-reloc.def: New file.
11085 * arm.cc: Update comments.
11086 (arm-reloc-property.h): New included header.
11087 (arm_reloc_property_table): New global variable.
11088 (Target_arm::do_select_as_default_target): New method definition.
11089 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
11090 arm-reloc-property to targ_extra_obj.
11091 * parameters.cc (set_parameters_target): Call
11092 Target::select_as_default_target().
11093 * target.h (Target::select_as_default_target): New method definition.
11094 (Target::do_select_as_default_target): Same.
11095
546c7457
DK
110962010-02-01 Doug Kwan <dougkwan@google.com>
11097
11098 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
11099 first_output_text_section_.
11100 (Arm_exidx_fixup::first_output_text_section): New method definition.
11101 (Arm_exidx_fixup::first_output_text_section_): New data member.
11102 (Arm_exidx_fixup::process_exidx_section): Record the first text
11103 output section seen.
11104 (Arm_output_section::fix_exidx_coverage): Set correct linked section
11105 and entsize in output section header.
11106
11b861d5
DK
111072010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11108
11109 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
11110 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
11111 (Arm_relocate_functions::thm_alu11): New Method.
11112 (Arm_relocate_functions::thm_pc8): New Method.
11113 (Arm_relocate_functions::thm_pc12): New Method.
11114 (Target_arm::Scan::local): Handle the relocations.
11115 (Target_arm::Scan::global): Likewise.
11116 (Target_arm::Relocate::relocate): Likewise.
11117 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11118
c9a2c125
DK
111192010-01-29 Doug Kwan <dougkwan@google.com>
11120
11121 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
11122 of relocation types as ld.
11123
1521477a
DK
111242010-01-29 Doug Kwan <dougkwan@google.com>
11125
11126 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
11127 to public.
11128 (Arm_relocate_functions::thumb_branch_common): Ditto.
11129 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
11130 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
11131 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
11132 Arm_relocate_functions::jump24): Remove.
11133 (Target_arm::Relocate::relocate): Adjust code to call
11134 Arm_relocation_functions::arm_branch_common and
11135 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 11136 wrappers. Merge switch-cases together to reduce source code size.
1521477a 11137
e7eca48c
DK
111382010-01-29 Doug Kwan <dougkwan@google.com>
11139
11140 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
11141 output_local_symbol_count_needs_update_.
11142 (Arm_relobj::output_local_symbol_count_needs_update,
11143 Arm_relobj::set_output_local_symbol_count_needs_update,
11144 Arm_relobj::update_output_local_symbol_count): New methods.
11145 (Arm_relobj::output_local_symbol_count_needs_update_): New data
11146 member.
11147 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
11148 of pointed function as in a R_ARM_PREL31 relocation.
11149 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
11150 for output local symbol count updating.
11151 (Target_arm::do_relax): Update output local symbol counts in objects
11152 if necessary.
11153 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
11154
02961d7e
ILT
111552010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11156
11157 * arm.cc: Added support for the ARM relocations:
11158 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
11159 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
11160 (Arm_relocate_functions::movw_rel_nc): Renamed (was
11161 movw_prel_nc).
11162 (Arm_relocate_functions::movw_rel): New method.
11163 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
11164 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
11165 thm_movw_prel_nc).
11166 (Arm_relocate_functions::thm_movw_rel): New method.
11167 (Arm_relocate_functions::thm_movt_rel): Renamed (was
11168 thm_movt_prel).
11169 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
11170 relocations.
11171 (Target_arm::Scan::global): Likewise.
11172 (Target_arm::Relocate::relocate): Likewise.
11173 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11174 Likewise.
11175
b10d2873
ILT
111762010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11177
11178 * arm.cc: Added support for ARM group relocations.
11179 (Target_arm::reloc_needs_sym_origin): New method.
11180 (Arm_relocate_functions::calc_grp_kn): New method.
11181 (Arm_relocate_functions::calc_grp_residual): New method.
11182 (Arm_relocate_functions::calc_grp_gn): New method.
11183 (Arm_relocate_functions::arm_grp_alu): New Method.
11184 (Arm_relocate_functions::arm_grp_ldr): New Method.
11185 (Arm_relocate_functions::arm_grp_ldrs): New Method.
11186 (Arm_relocate_functions::arm_grp_ldc): New Method.
11187 (Target_arm::Scan::local): Handle the ARM group relocations.
11188 (Target_arm::Scan::global): Likewise.
11189 (Target_arm::Relocate::relocate): Likewise.
11190 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11191 Likewise.
11192
2b328d4e
DK
111932010-01-26 Doug Kwan <dougkwan@google.com>
11194
11195 * arm.cc (set): Include.
11196 (class Arm_exidx_fixup): Change type of last_input_section_ to const
11197 pointer type.
2e702c99 11198 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
11199 (Arm_output_section::append_text_sections_to_list): New method.
11200 (Arm_output_section::fix_exidx_coverage): Ditto.
11201 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 11202 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
11203 Relobj::set_section_offset() instead of
11204 Sized_relobj::invalidate_section_offset().
2e702c99 11205 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
11206 parameter for section headers. Ignore relocation sections for
11207 unallocated sections and EXIDX sections.
11208 (Target_arm::fix_exidx_coverage): New method.
11209 (Target_arm::output_section_address_less_than): New type.
11210 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
11211 linked text section instead of the EXIDX section.
11212 (Arm_output_section::create_stub_group): Add an assertion to check
11213 that this is not an EXIDX output section.
11214 (Arm_output_section::append_text_sections_to_list): New method.
11215 (Arm_output_section::fix_exidx_coverage): Ditto.
11216 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 11217 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
11218 (Target_arm::do_relax): Fix EXIDX output section coverage in the
11219 first pass.
11220 (Target_arm::fix_exidx_coverage): New method.
11221 * object.h (Relobj::set_output_section): New method.
11222 (Sized_relobj::invalidate_section_offset): Remove method.
11223 (Sized_relobj::do_invalidate_section_offset): Remove method.
11224 (Sized_relobj::do_set_section_offset): Handle offset value -1.
11225
c7f3c371
DK
112262010-01-25 Doug Kwan <dougkwan@google.com>
11227
11228 * arm.cc (Arm_exidx_merged_section::do_output_offset):
11229 Fix warning due to signed and unsigned comparison on a 32-bit host.
11230
8923b24c
DK
112312010-01-22 Doug Kwan <dougkwan@google.com>
11232
11233 * arm.cc (Target_arm::do_relax): Record an output section for section
11234 offset adjustment it contains any stub table that has changed.
11235 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
11236 offsets in an output section if necessary.
11237 * output.cc (Output_section::Output_section): Initialize
11238 section_offsets_need_adjustments_.
11239 (Output_section::add_input_section_for_script): Renamed to
11240 Output_section::add_simple_input_section.
11241 (Output_section::save_states): Add a comment.
11242 (Output_section::discard_states): New method defintion.
11243 (Output_section::adjust_section_offsets): Same.
11244 * output.h (Output_section::add_input_section_for_script): Renamed to
11245 Output_section::add_simple_input_section.
11246 (Output_section::discard_states): New method declaration.
11247 (Output_section::adjust_section_offsets): Same.
11248 (Output_section::section_offsets_need_adjustment,
11249 Output_section::set_section_offsets_need_adjustment): New method
11250 definitions.
11251 (Output_section::section_offsets_need_adjustment_): New data member.
11252 * script-sections.cc
11253 (Output_section_element_input::set_section_address): Adjust code for
11254 renaming of Output_section::add_input_section_for_script.
11255 (Orphan_output_section::set_section_address): Same.
11256
9b2fd367
DK
112572010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11258
11259 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
11260 Fix_v4bx enum values .
11261 * gold/options.h (General_options): New option definitions.
11262 (General_options::fix_v4bx): New method.
11263 (General_options::Fix_v4bx): New enum.
11264 * gold/options.cc (General_options::parse_fix_v4bx): New method.
11265 (General_options::parse_fix_v4bx_interworking): New method.
11266
80d0d023
DK
112672010-01-22 Doug Kwan <dougkwan@google.com>
11268
11269 * arm.cc (Arm_exidx_fixup): New class.
11270
af2cdeae
DK
112712010-01-21 Doug Kwan <dougkwan@google.com>
11272
11273 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
11274 classes.
11275 (Arm_exidx_section_offset_map): New type.
11276
993d07c1
DK
112772010-01-21 Doug Kwan <dougkwan@google.com>
11278
11279 * arm.cc (Arm_exidx_input_section): New class.
11280 (Arm_relobj::exidx_input_section_by_link,
11281 Arm_relobj::exidx_input_section_by_shndx,
11282 Arm_relobj::make_exidx_input_section): New methods.
11283 (read_arm_attributes_section): Remove.
11284 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
11285 information about them.
11286 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
11287 to here.
11288
5ac169d4
DK
112892010-01-20 Doug Kwan <dougkwan@google.com>
11290
11291 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
11292 Input_section_specifier to Section_id.
11293 (Target_arm::new_arm_input_section: Adjust code for change of key
11294 type.
11295 (Target_arm::find_arm_input_section): Ditto.
11296 * gc.h (object.h): Include for Section_id nand Section_id_hash.
11297 (Section_id): Remove.
11298 (Garbage_collection::Section_id_hash): Remove.
11299 * icf.h (object.h): Include for Section_id nand Section_id_hash.
11300 (Section_id): Remove.
11301 (Icf::Section_id_hash): Remove.
11302 * object.h (Section_id, Const_section_id, Section_id_hash,
11303 Const_section_id_hash): New type definitions.
11304 * output.cc (Output_section::add_relaxed_input_section): Change to
11305 use Const_section_id instead of Input_section_specifier as key type.
11306 (Output_section::add_merge_input_section): Ditto.
11307 (Output_section::build_relaxation_map): Change to use Section_id
11308 instead of Input_section_specifier as key type.
2e702c99 11309 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
11310 Ditto.
11311 (Output_section::convert_input_sections_to_relaxed_sections): Change
11312 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 11313 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
11314 (Output_section::find_relaxed_input_section): Ditto.
11315 * output.h (Input_section_specifier): Remove class.
11316 (Output_section::Output_section_data_by_input_section_map): Change
11317 key type to Const_section_id.
11318 (Output_section::Output_relaxed_input_section_by_input_section_map):
11319 Ditto.
11320 (Output_section::Relaxation_map): Change key type to Section_id.
11321
a2162063
ILT
113222010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11323
11324 * gold/arm.cc: Added support for R_ARM_V4BX relocation
11325 (class Arm_v4bx_stub): New class.
11326 (DEF_STUBS): Updated definition to support v4_veneer_bx.
11327 (Stub_factory::make_arm_v4bx_stub): New method.
11328 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
11329 (Stub_table::empty): Handle v4bx stubs.
11330 (Stub_table::add_arm_v4bx_stub): New method.
11331 (Stub_table::find_arm_v4bx_stub): New method.
11332 (Arm_relocate_functions::v4bx): New method.
11333 (Target_arm::fix_v4bx): New method.
11334 (Target_arm::Target_arm): Handle R_ARM_V4BX.
11335 (Stub_table::relocate_stubs): Likewise.
11336 (Stub_table::do_write): Likewise.
11337 (Stub_table::update_data_size_and_addralign): Likewise.
11338 (Stub_table::finalize_stubs): Likewise.
11339 (Target_arm::Scan::local): Likewise.
11340 (Target_arm::Scan::global): Likewise.
11341 (Target_arm::do_finalize_sections): Likewise.
11342 (Target_arm::Relocate::relocate): Likewise.
11343 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11344 Likewise.
11345 (Target_arm::scan_reloc_for_stub): Likewise.
11346 (Target_arm::scan_reloc_section_for_stubs): Likewise.
11347
5696ab0b
ILT
113482010-01-19 Ian Lance Taylor <iant@google.com>
11349
11350 * output.cc (Output_section_headers::do_sized_write): Write large
11351 segment count to sh_info field.
11352 (Output_file_header::do_sized_write): For large segment count,
11353 write PN_XNUM to e_phnum field.
11354
800d0f56
ILT
113552010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11356
11357 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
11358 (Arm_relocate_functions::thm_jump8): New function.
11359 (Arm_relocate_functions::thm_jump11): New function.
11360 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
11361 R_ARM_THM_JUMP11.
11362 (Target_arm::Scan::global): Likewise.
11363 (Target_arm::Relocate::relocate): Likewise.
11364 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11365 Likewise.
11366
41263c05
DK
113672010-01-14 Doug Kwan <dougkwan@google.com>
11368
11369 * arm.cc (map, utility): Include headers.
11370 (Target_arm::apply_cortex_a8_workaround): New method.
11371 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
11372 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
11373 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
11374 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
11375 the --[no-]fix-cortex-a8 command line options.
11376 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
11377 (Target_arm::relocate_stub): Use addend in instruction template.
11378 * options.h (DEFINE_bool): Set the user-set flag.
11379 (General_options): Add --[no-]-fix-cortex options.
11380 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 11381 : Update fast look-up map after conversion.
41263c05 11382
459e9b03
ST
113832010-01-14 Sriraman Tallam <tmsriram@google.com>
11384
11385 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
11386 in the first pass of do_layout.
11387
b521dfe4
DK
113882010-01-13 Doug Kwan <dougkwan@google.com>
11389
11390 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11391 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
11392 apparent compiler problem of not folding static constant integral
11393 data members of elfcpp::Elf_sizes<32>.
11394
44272192
DK
113952010-01-13 Doug Kwan <dougkwan@google.com>
11396
11397 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11398 Arm_relobj::section_needs_cortex_a8_stub_scanning,
11399 Arm_relobj::scan_section_for_cortex_a8_erratum,
11400 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
11401 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
11402 sections to scan for relocation stubs into a new method
11403 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
11404 relocation and Cortex-A8 stub scanning.
11405 (Target_arm::do_relax): Force stubs to be after stubbed sections
11406 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 11407 the beginning of a new relaxation pass. Update a comment.
44272192
DK
11408 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
11409
44b71ece
ILT
114102010-01-12 Ian Lance Taylor <iant@google.com>
11411
11412 * target-reloc.h (visibility_error): New inline function.
11413 (relocate_section): Call visibility_error.
11414 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
11415 (MOSTLYCLEANFILES): Likewise.
11416 (protected_4_pic.o, protected_3.err): New targets.
11417 * testsuite/protected_4.cc: New file.
11418
a120bc7f
DK
114192010-01-12 Doug Kwan <dougkwan@google.com>
11420
11421 * arm.cc (Cortex_a8_reloc): New class.
11422 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
11423 and cortex_a8_relocs_info_.
11424 (Target_arm::fix_cortex_a8): New method definition.
11425 (Target_arm::Cortex_a8_relocs_info): New type.
11426 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
11427 New data member declarations.
11428 (Target_arm::scan_reloc_for_stub): Record information about
11429 relocations for THUMB branches that might be exempted from the
11430 Cortex-A8 workaround.
11431 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
11432 at the beginning of a relaxation pass.
11433
20138696
DK
114342010-01-12 Doug Kwan <dougkwan@google.com>
11435
11436 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
11437 (Arm_relobj::Mapping_symbol_position,
11438 Arm_reloj::Mapping_symbol_position_less,
11439 Arm_relobj::Mapping_symbols_info): New types.
11440 (Target_arm::is_mapping_symbol_name): New method definition.
11441 (Arm_relobj::do_count_local_symbols): Save information about mapping
11442 symbols.
11443
089d69dc
DK
114442010-01-11 Doug Kwan <dougkwan@google.com>
11445
11446 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
11447 Arm_relocate_functions::thumb32_branch_upper,
11448 Arm_relocate_functions::thumb32_branch_lower,
11449 Arm_relocate_functions::thumb32_cond_branch_offset,
11450 Arm_relocate_functions::thumb32_cond_branch_upper,
11451 Arm_relocate_functions::thumb32_cond_branch_lower,
11452 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
11453 branch offset encoding.
11454 (Arm_relocate_functions::thumb_branch_common): Use new branch
11455 offset encoding methods to avoid code duplication.
11456 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
11457 (Stub_addend_reader::operator()): Use new branch encoding method
11458 to avoid code duplication.
11459
99e5bff2
DK
114602010-01-11 Doug Kwan <dougkwan@google.com>
11461
11462 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
11463 (Target_arm::do_finalize_sections): Define special EXIDX section
11464 symbols only if referenced.
11465 * gc.h (Garbage_collection::add_reference): New method.
11466 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
11467 code duplication.
11468
98e090bd
ILT
114692010-01-11 Ian Lance Taylor <iant@google.com>
11470
d0a91bd8
ILT
11471 * script.cc (Version_script_info::build_expression_list_lookup):
11472 Change complaing about duplicate wildcard match from error to
11473 warning.
11474
98e090bd
ILT
11475 * script.cc (class Lazy_demangler): Recreate--revert part of patch
11476 of 2009-12-30.
11477 (Version_script_info::Version_script_info): Initialize globs_,
11478 default_version_, default_is_global_, and exact_. Don't
11479 initialize globals_ or locals_.
11480 (Version_script_info::build_lookup_tables): Build local symbols
11481 first.
11482 (Version_script_info::unquote): New function.
11483 (Version_script_info::add_exact_match): New function.
11484 (Version_script_info::build_expression_list_lookup): Remove lookup
11485 parameter. Add is_global parameter. Change all callers. Handle
11486 wildcard pattern specially. Unquote pattern. Call
11487 add_exact_match.
11488 (Version_script_info::get_name_to_match): New function.
11489 (Version_script_info::get_symbol_version): New function.
11490 (Version_script_info::get_symbol_version_helper): Remove.
11491 (Version_script_info::check_unmatched_names): Call unquote.
11492 * script.h (class Version_script_info): Change get_symbol_version
11493 to be non-inline and add is_global parameter; change all callers.
11494 Rewrite symbol_is_local. Update declarations. Define struct
11495 Version_tree_match, Exact, Globs. Don't define struct Lookup.
11496 Remove globals_ and locals_ members. Add exact_, globs_,
11497 default_version_, is_global_.
11498 (Version_script_info::Glob): Remove pattern, add expression and
11499 is_global. Update constructor. Change all callers.
11500 * dynobj.cc (Versions::finalize): Mark the version symbol as the
11501 default version.
11502 (Versions::symbol_section_contents): If a symbol is undefined, or
11503 defined in a dynamic object, set the version index to
11504 VER_NDX_LOCAL.
11505 * symtab.cc (Symbol_table::add_from_relobj): Don't call
11506 symbol_is_local.
11507 (Symbol_table::add_from_pluginobj): Likewise.
11508 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
11509
d56962d3
DK
115102010-01-11 Doug Kwan <dougkwan@google.com>
11511
11512 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
11513 (incremental_dump_LDADD): Add linking option for libintl.
11514 * Makefile.in: Regenerate.
11515
94e6ee91
L
115162010-01-11 H.J. Lu <hongjiu.lu@intel.com>
11517
11518 PR gold/11144
11519 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
11520 instead of -Ds.
11521 * testsuite/Makefile.in: Regenerated.
11522
e96c574b
DK
115232010-01-10 Doug Kwan <dougkwan@google.com>
11524
11525 * options.h (DEFINE_var): Use parentheses around argument varname__
11526 in macro body to avoid any unintended subsequent substitutions.
11527
7198066b
ILT
115282010-01-10 Ian Lance Taylor <iant@google.com>
11529
ba4d53bf
ILT
11530 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
11531 candidates before doing symbol resolution.
11532
7198066b
ILT
11533 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
11534 ODR candidates if only one is weak.
11535
a2beed37
ILT
115362010-01-08 Ian Lance Taylor <iant@google.com>
11537
11538 * script.cc (Version_script_info::build_expression_list_lookup):
11539 Don't warn about ambiguous version, just record the ambiguity.
11540 (Version_script_info::get_symbol_version_helper): Give error if
11541 version is ambiguous.
11542
2fb7225c
DK
115432010-01-08 Doug Kwan <dougkwan@google.com>
11544
11545 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
11546 prev_data_size_ and prev_addralign_. Remove initializer for
11547 deleted data member has_been_changed_.
11548 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
11549 to determine if the table is empty.
11550 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
11551 Remove.
11552 (Stub_table::add_reloc_stub): Define method in class definition
11553 instead of just declaring it there.
11554 (Stub_table::add_cortex_a8_stub): New method definition.
11555 (Stub_table::update_data_size_and_addralign): Ditto.
11556 (Stub_table::finalize_stubs): Ditto.
11557 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
11558 (Stub_table::do_addralign_): Return address alignment in the
11559 (Stub_table::do_reset_address_and_file_offset): Define method in
11560 class definition instead of declaring it there. Set current data
11561 size to be the data size of the previous pass.
11562 (Stub_table::set_final_data_size): Use current data size as the
11563 final data size.
11564 (Stub_table::relocate_stub): Change parameter type of stub from
11565 Reloc_stub pointer to Stub pointer.
11566 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
11567 (Stub_table::Cortex_a8_stub_list): New typedef.
11568 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
11569 Stub_table::prev_addralign_): New data member.
11570 (Arm_relobj::Arm_relobj): Initialize data member
11571 section_has_cortex_a8_workaround_.
11572 (Arm_relobj::section_has_cortex_a8_workaround,
11573 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
11574 definitions.
11575 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
11576 declarations.
11577 (Target_arm::relocate_stub): Change parameter type of stub from
11578 Reloc_stub pointer to Stub pointer.
11579 (Insn_template::size, Insn_template::alignment): Handle
11580 THUMB16_SPECIAL_TYPE.
11581 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
11582 Stub_table::update_data_size_and_addralign,
11583 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
11584 definitions.
11585 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
11586 (Stub_table::do_write): Ditto.
11587 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 11588
880cd20d
ILT
115892010-01-08 Ian Lance Taylor <iant@google.com>
11590
11591 PR 11108
11592 * symtab.h (class Symbol): Remove fields is_target_special_ and
11593 has_plt_offset_. Add field is_defined_in_discarded_section_.
11594 (Symbol::is_defined_in_discarded_section): New function.
11595 (Symbol::set_is_defined_in_discarded_section): New function.
11596 (Symbol::has_plt_offset): Rewrite.
11597 (Symbol::set_plt_offset): Verify that new offset is not -1U.
11598 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
11599 Don't initialize is_target_special_ or has_plt_offset_.
11600 Initialize is_defined_in_discarded_section_.
11601 (Symbol_table::add_from_relobj): If appropriate, set
11602 is_defined_in_discarded_section.
11603 * resolve.cc (Symbol::override_base_with_special): Don't test
11604 is_target_special_. Change has_plt_offset_ to has_plt_offset().
11605 * target-reloc.h (relocate_section): Do special handling for
11606 symbols defined in discarded sections for global symbols as well
11607 as local symbols.
11608
2703e3eb
ILT
116092010-01-08 Ian Lance Taylor <iant@google.com>
11610
11611 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
11612 the SHT_SYMTAB case.
11613
339d40a3
ILT
116142010-01-08 Ian Lance Taylor <iant@google.com>
11615
11616 * object.cc (Sized_relobj::do_layout): Don't get confused if
11617 layout_eh_frame returns NULL.
11618
abecea76
ILT
116192010-01-08 Ian Lance Taylor <iant@google.com>
11620
11621 PR 11084
11622 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
11623 dynamic symbol table, use the normal symbol table.
11624 (Sized_dynobj::do_read_symbols): Remove assertion about type of
11625 symbol table.
11626
6b7dd3f3
ILT
116272010-01-08 Ian Lance Taylor <iant@google.com>
11628
11629 PR 11072
11630 * layout.cc (Layout::include_section): Remove .gnu_debuglink
11631 sections.
11632
36c50e63
L
116332010-01-08 H.J. Lu <hongjiu.lu@intel.com>
11634
11635 * version.cc (print_version): Change to "Copyright 2010".
11636
e291e7b9
ILT
116372010-01-08 Ian Lance Taylor <iant@google.com>
11638
11639 PR 10287
11640 PR 11063
11641 * i386.cc (class Target_i386): Change return type of plt_section
11642 to be non-const.
11643 (class Output_data_plt_i386): Add tls_desc_rel_ field.
11644 (Output_data_plt_i386::Output_data_plt_i386): Initialize
11645 tls_desc_rel_ field.
11646 (Output_data_plt_i386::rel_tls_desc): New function.
11647 (Target_i386::rel_tls_desc_section): New function.
11648 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
11649 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
11650 R_386_TLS_DESC reloc in rel_tls_desc_section.
11651 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
11652 Define struct Tlsdesc_info.
11653 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
11654 (Target_x86_64::do_reloc_symbol_index): New function.
11655 (Target_x86_64::add_tlsdesc_info): New function.
11656 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
11657 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
11658 tlsdesc_rel_ field.
11659 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
11660 all callers.
11661 (Output_data_plt_x86_64::rela_tlsdesc): New function.
11662 (Target_x86_64::rela_tlsdesc_section): New function.
11663 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
11664 handling.
11665 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
11666 (Target_x86_64::do_reloc_addend): New function.
11667 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
11668 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
11669 declarations. Define TARGET_CODE. Add arg field to u1_ union.
11670 (Output_reloc::type): New function.
11671 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
11672 (Output_reloc::is_target_specific): New function.
11673 (Output_reloc::target_arg): New function.
11674 (class Output_reloc) [SHT_RELA]: Add four new constructors for
11675 absolute relocs and target specific relocs.
11676 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
11677 add_target_specific.
11678 (class Output_data_reloc) [SHT_RELA]: Likewise.
11679 * output.cc (Output_reloc::Output_reloc): Add four new versions
11680 for absolute relocs and target specific relocs.
11681 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
11682 (Output_reloc::get_symbol_index): Likewise.
11683 (Output_reloc::local_section_offset): Check that local_sym_index_
11684 is not TARGET_CODE or 0.
11685 (Output_reloc::symbol_value): Likewise.
11686 (Output_reloc::write) [SHT_RELA]: Call target for target specific
11687 reloc.
11688 * target.h (class Target): Add reloc_symbol_index and reloc_addend
11689 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
11690 functions.
11691 * layout.cc (add_target_dynamic_tags): Use output section for
11692 DT_PLTRELSZ and DT_JMPREL.
11693
3a44184e
ILT
116942010-01-07 Ian Lance Taylor <iant@google.com>
11695
11696 PR 11061
11697 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
11698 function.
11699 (class Output_data_reloc_generic): Define.
11700 (class Output_data_reloc_base): Change base class to
11701 Output_data_reloc_generic. Change add() method to call
11702 bump_relative_reloc_count for a relative reloc. Remove
11703 sort_relocs_ field.
11704 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
11705 to sort_relocs().
11706 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
11707 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
11708 appropriate.
11709 * layout.h (class Layout): Update declaration.
11710
ea715a34
ILT
117112010-01-07 Ian Lance Taylor <iant@google.com>
11712
11713 * output.h (class Output_data): Add const version of
11714 output_section and do_output_section.
11715 (class Output_section_data): Add const version of
11716 do_output_section.
11717 (class Output_section): Likewise.
11718 * layout.cc (Layout::add_target_dynamic_tags): New function.
11719 * layout.h (class Layout): Update declarations.
11720 * arm.cc (Target_arm::do_finalize_sections): Use
11721 add_target_dynamic_tags.
11722 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11723 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11724 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11725 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11726
659948a4
ILT
117272010-01-07 Ian Lance Taylor <iant@google.com>
11728
11729 PR 11042
11730 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
11731 object as needed.
11732
9d3b86f6
ILT
117332010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
11734 Ian Lance Taylor <iant@google.com>
11735
11736 PR 11019
11737 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
11738 Xindex::read_symtab_xindex.
11739
bb0d3eb0
DK
117402010-01-07 Doug Kwan <dougkwan@google.com>
11741
11742 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
11743 (Insn_template::thumb16_bcond_insn): New method declaration.
11744 (Insn_template): Fix spelling.
11745 (Stub::thumb16_special): New method declaration.
11746 (Stub::do_write): Define virtual method which was previously pure
11747 virtual.
11748 (Stub::do_thumb16_special): New method declaration.
11749 (Stub::do_fixed_endian_write): New template member.
11750 (Reloc_stub::do_write): Remove.
11751 (Reloc_stub::do_fixed_endian_write): Remove.
11752 (Cortex_a8_stub): New class definition.
11753 (Stub_factory::make_cortex_a8_stub): New method definition.
11754 (Stub_factory::Stub_factory): Add missing static storage class
11755 qualifier for elf32_arm_stub_a8_veneer_blx.
11756
ffeef7df
ILT
117572010-01-07 Ian Lance Taylor <iant@google.com>
11758
dc3f80fe
ILT
11759 PR 10980
11760 * options.h (class General_options): Add --warn-unresolved-symbols
11761 and --error-unresolved-symbols.
11762 * errors.cc (Errors::undefined_symbol): Implement
11763 --warn-unresolved-symbols.
11764
ffeef7df
ILT
11765 * options.h (class General_options): Add -z text and -z textoff.
11766 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
11767
f1ec9ded
ST
117682010-01-06 Sriraman Tallam <tmsriram@google.com>
11769
11770 * gc.h (Garbage_collection::Cident_section_map): New typedef.
11771 (Garbage_collection::cident_sections): New function.
11772 (Garbage_collection::add_cident_section): New function.
11773 (Garbage_collection::cident_sections_): New member.
11774 (gc_process_relocs): Add references to sections whose names are C
11775 identifiers.
11776 * gold.h (cident_section_start_prefix): New constant.
11777 (cident_section_stop_prefix): New constant.
11778 (is_cident): New function.
11779 * layout.cc (Layout::define_section_symbols): Replace string constants
11780 with the newly defined constants.
11781 * object.cc (Sized_relobj::do_layout): Track sections whose names are
11782 C identifiers.
11783 * testsuite/Makefile.am: Add gc_orphan_section_test.
11784 * testsuite/Makefile.in: Regenerate.
11785 * testsuite/gc_orphan_section_test.cc: New file.
11786 * testsuite/gc_orphan_section_test.sh: New file.
11787
6eda8c29
ILT
117882010-01-06 Ian Lance Taylor <iant@google.com>
11789
b9674e17
ILT
11790 PR 10980
11791 * options.h (class General_options): Add --warn-shared-textrel.
11792 * layout.cc (Layout::finish_dynamic_section): Implement
11793 --warn-shared-textrel.
11794
6eda8c29
ILT
11795 PR 10980
11796 * options.h (class General_options): Add --warn-multiple-gp.
11797
32dcd44e
ILT
117982010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11799
11800 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
11801 $(THREADSLIB) and $(LIBDL).
11802 * Makefile.in: Rebuild.
11803
a192ba05
ILT
118042010-01-06 Ian Lance Taylor <iant@google.com>
11805
11806 PR 10980
11807 * options.cc (General_options::parse_section_start): New function.
11808 (General_options::section_start): New function.
11809 (General_options::General_options): Initialize all members.
11810 * options.h: Include <map>
11811 (class General_options): Add --section-start. Add section_starts_
11812 member.
11813 * layout.cc (Layout::attach_allocated_section_to_segment): If
11814 --section-start was used, set the address of the segment. Remove
11815 local sort_sections.
11816 (Layout::relaxation_loop_body): If the address of the load segment
11817 has been set by --section-start, don't use it.
11818 * output.h (Output_segment::update_flags_for_output_section): New
11819 function.
11820 * output.cc (Output_segment::add_output_section): Call
11821 update_flags_for_output_section.
11822
dde3f402
ILT
118232010-01-05 Ian Lance Taylor <iant@google.com>
11824
62dfdd4d
ILT
11825 PR 10980
11826 * options.h (class General_options): Add --undefined-version.
11827 * script.cc (struct Version_expression): Add was_matched_by_symbol
11828 field.
11829 (Version_script_info::matched_symbol): New function.
11830 (Version_script_info::get_symbol_version_helper): Call
11831 matched_symbol.
11832 (Version_script_info::check_unmatched_names): New function.
11833 * script.h (class Version_script_info): Update declarations.
11834 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
11835
9c4ae156
ILT
11836 * options.h (class General_options): Use DEFINE_bool_alias for
11837 allow_multiple_definition.
11838 * resolve.cc (Symbol_table::should_override): Don't test
11839 allow_multiple_definition.
11840
dde3f402
ILT
11841 PR 10980
11842 * options.h (class General_options): Add --cref.
11843 * main.cc (main): Print cref table if --cref. Don't close mapfile
11844 until after printing cref table.
11845 * cref.cc: Include "symtab.h".
11846 (class Cref_inputs): Define Cref_table_compare and Cref_table.
11847 (Cref_table_compare::operator()): New function.
11848 (Cref_inputs::gather_cref): New function.
11849 (filecol): New static const.
11850 (Cref_inputs::print_cref): New function.
11851 (Cref::print_cref): New function.
11852 * cref.h: Include <cstdio>.
11853 (class Cref): Update declarations.
11854 * mapfile.h (Mapfile::file): New function.
11855 * object.h (class Object): Define Symbols. Declare virtual
11856 do_get_global_symbols.
11857 (Object::get_global_symbols): New function.
11858 * object.cc (Input_objects::add_object): Pass object to cref_ if
11859 --cref.
11860 (Input_objects::archive_start): Likewise.
11861 (Input_objects::archive_stop): Likewise.
11862 (Input_objects::print_cref): New function.
11863 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
11864 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
11865 --cref.
11866 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
11867 function.
11868 * plugin.h (class Sized_pluginobj): Update declarations.
11869
8781f709
ILT
118702010-01-05 Ian Lance Taylor <iant@google.com>
11871
11872 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
11873 to is_default_version. Rename insdef to insdefault.
11874 (Symbol_table::add_from_relobj): Rename def to is_default_version
11875 and local to is_forced_local.
11876 (Symbol_table::add_from_pluginobj): Likewise.
11877 (Symbol_table::add_from_dynobj): Likewise.
11878 (Symbol_table::define_special_symbol): Rename insdef to
11879 insdefault.
11880
fe35d28d
ILT
118812010-01-04 Ian Lance Taylor <iant@google.com>
11882
30bc8c46
ILT
11883 PR 10980
11884 * options.h (class General_options): Add
11885 --allow-multiple-definition and -z muldefs.
11886 * resolve.cc (Symbol_table::should_override): Don't warn about a
11887 multiple symbol definition if --allow-multiple-definition or -z
11888 muldefs.
11889
7eaea549
ILT
11890 PR 10980
11891 * options.h (class General_options): Add --add-needed and
11892 --copy-dt-needed-entries. Tweak --as-needed help entry.
11893 * object.cc (Input_objects::check_dynamic_dependencies): Give an
11894 error if --copy-dt-needed-entries aka --add-needed is used and
11895 would cause a change in behaviour.
11896
fe35d28d
ILT
11897 PR 10980
11898 * options.h (class General_options): Add -G as a short version of
11899 --shared. Add no-op options -assert, -g, and -i.
11900
55a2bb35
ST
119012010-01-04 Sriraman Tallam <tmsriram@google.com>
11902
11903 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
11904 check for .text or .gnu.linkonce.t sections.
11905 * icf.cc (Icf::find_identical_sections): Ditto.
11906 Change the detection for mangled function name within the section
11907 name.
11908 * icf.h (is_section_foldable_candidate): New function.
11909
719328e1
ILT
119102009-12-30 Ian Lance Taylor <iant@google.com>
11911
11912 PR 10980
11913 * options.h (class General_options): Permit two dashes with
11914 --retain-symbols-file.
11915
d7bb5745
ILT
119162009-12-30 Ian Lance Taylor <iant@google.com>
11917
403a15dd
ILT
11918 PR 10979
11919 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
11920 don't put the file header and segment headers in the text
11921 segment.
11922
eda294df
ILT
11923 PR 10979
11924 * common.cc (Sort_commons::operator()): Stabilize sort when both
11925 entries are NULL.
11926 (Symbol_table::do_allocate_commons_list): When allocating common
11927 symbols, skip a symbol which is no longer common.
11928 * symtab.h (Symbol::is_common): Test whether the symbol comes from
11929 an object before checking its type.
11930 * testsuite/common_test_2.c: New file.
11931 * testsuite/common_test_3.c: New file.
11932 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
11933 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
11934 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
11935 (common_test_2_pic.o, common_test_2.so): New targets.
11936 (common_test_3_pic.o, common_test_3.so): New targets.
11937 * testsuite/Makefile.in: Rebuild.
11938
d7bb5745
ILT
11939 PR 10979
11940 * script.cc (read_input_script): If we see a new SECTIONS clause,
11941 and we have added an input section, give an error.
11942 * layout.h (class Layout): Add have_added_input_section function.
11943 Add have_added_input_section_ field.
11944 * layout.cc (Layout::Layout): Initialize
11945 have_added_input_section_.
11946 (Layout::layout): Set have_added_input_section_.
11947 (Layout::layout_eh_frame): Likewise.
11948
fc59c572
ILT
119492009-12-30 Ian Lance Taylor <iant@google.com>
11950
11951 PR 10931
11952 * options.h (class General_options): Add --sort-common option.
11953 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
11954 * common.cc (Sort_common): Add sort_order parameter to
11955 constructor. Add sort_order_ field.
11956 (Sort_commons::operator): Check sort_order_.
11957 (Symbol_table::allocate_commons): Determine the sort order.
11958 (Symbol_table::do_allocate_commons): Add sort_order parameter.
11959 Change all callers.
11960 (Symbol_table::do_allocate_commons_list): Likewise.
11961
1c74fab0
ILT
119622009-12-30 Ian Lance Taylor <iant@google.com>
11963
11964 PR 10916
11965 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
11966 symbols from this object, don't change the visibility of an
11967 undefined symbol.
11968 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
11969
6affe781
ILT
119702009-12-30 Ian Lance Taylor <iant@google.com>
11971
11972 PR 10861
11973 * script.h (class Version_script_info): Define Language enum.
11974 Update declarations. Define Glob, Exact, and Lookup types. Add
11975 new fields globals_, locals_, and is_finalized_.
11976 * script.cc: Various formatting fixes.
11977 (class Parser_closure): Change language_stack_ from a vector of
11978 std::string to one of Version_script_info::Language. Adjust all
11979 uses accordingly.
11980 (class Lazy_demangler): Remove.
11981 (struct Version_expression): Change language from std::string to
11982 Version_script_info::Language.
11983 (Version_script_info::Version_script_info): New function.
11984 (Version_script_info::~Version_script_info): Don't call clear.
11985 (Version_script_info::finalize): New function.
11986 (Version_script_info::build_lookup_tables): New function.
11987 (Version_script_info::build_expression_list_lookup): New
11988 function.
11989 (Version_script_info::get_symbol_version_helper): Rewrite to use
11990 lookup tables.
11991 (Version_script_info::print_expression_list): Adjust to use
11992 Version_script_info::Language.
11993 (script_push_lex_into_version_mode): Check that the version script
11994 has not been finalized.
11995 (version_script_push_lang): Change language string to
11996 Version_script_info::Language.
11997 * options.cc (Command_line::version_script): New function.
11998 * options.h (class General_options): Add finalize_dynamic_list
11999 function. Change version_script from declaration to definition.
12000 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
12001 * testsuite/version_script.map: Remove duplicate def of foo.
12002 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
12003 version_script.map.
12004 * testsuite/Makefile.in: Rebuild.
12005
818bf354
ILT
120062009-12-30 Ian Lance Taylor <iant@google.com>
12007
12008 PR 10843
12009 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
12010 if the input symbol index is 0, make the output symbol index 0.
12011
ebcc8304
ILT
120122009-12-30 Ian Lance Taylor <iant@google.com>
12013
12014 PR 10670
12015 * options.h (class General_options): Add -x/--discard-all.
12016 * object.cc (Sized_relobj::do_count_local_symbols): Handle
12017 --discard-all. If the local symbol needs a dynamic entry, check
12018 that before handling --discard-locals.
12019
176fe33f
ILT
120202009-12-30 Ian Lance Taylor <iant@google.com>
12021
bb321bb1
ILT
12022 PR 10450
12023 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
12024 flags to PF_R.
12025 (Output_segment::add_output_section): Don't change the flags if
12026 the type is PT_TLS.
12027
176fe33f
ILT
12028 PR 10450
12029 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
12030 GNU hash table if they need a dynamic value. Otherwise, don't add
12031 them if they are defined in a dynamic object or are forced local.
12032
e8cd95c7
ILT
120332009-12-29 Ian Lance Taylor <iant@google.com>
12034
1b81fb71
ILT
12035 PR 10450
12036 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
12037 .gnu.hash table for a 32-bit target.
12038
8d6d383d
ILT
12039 PR 10450
12040 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
12041 regular and a dynamic object only needs a dynamic symbol table
12042 entry if it is externally visible.
12043
e785ec03
ILT
12044 PR 10450
12045 * i386.cc (class Target_i386): Initialize global_offset_table_ in
12046 constructor. Add global_offset_table_ field.
12047 (Target_i386::got_section): Set global_offset_table_.
12048 (Target_i386::do_finalize_sections): Set global_offset_table_
12049 size.
12050 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
12051 in constructor. Add global_offset_table_ field.
12052 (Target_x86_64::got_section): Set global_offset_table_.
12053 (Target_x86_64::do_finalize_sections): Set global_offset_table_
12054 size.
12055
1a2dff53
ILT
12056 * layout.cc (Layout::Layout): Initialize increase_relro_.
12057 (Layout::get_output_section): Add is_relro, is_last_relro, and
12058 is_first_non_relro parameters. Change all callers.
12059 (Layout::choose_output_section): Likewise.
12060 (Layout::add_output_section_data): Likewise.
12061 (Layout::make_output_section): Likewise.
12062 (Layout::set_segment_offsets): Clear increase_relro when using a
12063 linker script.
12064 * layout.h (class Layout): Add increase_relro method. Add
12065 increase_relro_ field. Update declarations.
12066 * output.cc (Output_section::Output_section): Initialize
12067 is_last_relro_ and is_first_non_relro_.
12068 (Output_segment::add_output_section): Group relro sections is
12069 do_sort is true. Handle is_last_relro and is_first_non_relro.
12070 (Output_segment::maximum_alignment): Remove relro handling.
12071 (Output_segment::set_section_addresses): Add increase_relro
12072 parameter. Change all callers. Add initial alignment to align
12073 relro sections on separate page. Remove old relro handling.
12074 (Output_segment::set_section_list_addresses): Remove in_relro
12075 parameter. Change all callers.
12076 (Output_segment::set_offset): Add increase parameter. Change all
12077 callers. Remove old relro handling.
12078 * output.h (class Output_section): Add new methods: is_last_relro,
12079 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
12080 Add is_last_relro_ and is_first_non_relro_ fields.
12081 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
12082 Create separate .got.plt section. Call increase_relro.
12083 * x86_64.cc (Target_x86_64::got_section): Likewise.
12084 * testsuite/relro_script_test.t: Add .got.plt.
12085
f0ba79e2
ILT
12086 PR 10450
12087 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
12088 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
12089 (Layout::finalize): Call set_dynamic_symbol_size.
12090 (Layout::set_dynamic_symbol_size): New function.
12091 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
12092 set_dynamic_symbol_size.
12093
e8cd95c7
ILT
12094 PR 10450
12095 * output.h (class Output_section): Add is_entsize_zero_ field.
12096 * output.cc (Output_section::Output_section): Initialize
12097 is_entsize_zero_.
12098 (Output_section::set_entsize): If two different entsizes are
12099 requested, force it to zero.
12100 (Output_section::add_input_section): Set flags for .debug_str
12101 before updating section flags. Set entsize.
12102 (Output_section::update_flags_for_input_section): Set SHF_MERGE
12103 and SHF_STRING if all input sections have those flags.
12104
3e1b9a8a
RÁE
121052009-12-29 Rafael Espindola <espindola@google.com>
12106
12107 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
12108 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
12109 reporting.
3e1b9a8a 12110
3dcad376
ST
121112009-12-29 Sriraman Tallam <tmsriram@google.com>
12112
12113 * options.cc (General_options::parse_version): Allow -v to exit
12114 without an error if there is nothing to link.
12115
084e2665
ILT
121162009-12-29 Ian Lance Taylor <iant@google.com>
12117
12118 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
12119 using a version of gcc before 4.1.
12120 * configure: Rebuild.
12121
250acde3
CD
121222009-12-28 Chris Demetriou <cgd@google.com>
12123
12124 * attributes.cc (Output_attributes_section_data::do_write): Use
12125 std::vector::front rather than std::vector::data.
12126
99fff23b
ILT
121272009-12-28 Ian Lance Taylor <iant@google.com>
12128
12129 * symtab.h (class Symbol_table): Add enum Defined.
12130 * resolve.cc (Symbol_table::should_override): Add defined
12131 parameter. Change all callers. Test whether object is NULL
12132 before calling a method on it.
12133 (Symbol_table::report_resolve_problem): Add defined parameter.
12134 Change all callers.
12135 (Symbol_table::should_override_with_special): Likewise.
12136 * symtab.cc (Symbol_table::define_in_output_data): Add defined
12137 parameter. Change all callers.
12138 (Symbol_table::do_define_in_output_data): Likewise.
12139 (Symbol_table::define_in_output_segment): Likewise.
12140 (Symbol_table::do_define_in_output_segment): Likewise.
12141 (Symbol_table::define_as_constant): Likewise.
12142 (Symbol_table::do_define_as_constant): Likewise.
12143 * script.h (class Symbol_assignment): Add is_defsym parameter to
12144 constructor; change all callers.
12145 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
12146 parameter. Change all callers. Add is_defsym_ field.
12147 (class Parser_closure): Add parsing_defsym parameter to
12148 constructor; change all callers. Add parsing_defsym accessor
12149 function. Add parsing_defsym_ field.
12150
556bd683
ILT
121512009-12-28 Ian Lance Taylor <iant@google.com>
12152
12153 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 12154 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 12155
1782c879
ILT
121562009-12-23 Ian Lance Taylor <iant@google.com>
12157
12158 * i386.cc (Target_i386::do_calls_non_split): Recognize
12159 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
12160 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
12161 -fsplit-stack prologue when using %r11.
1782c879 12162
329ca2b1
ST
121632009-12-21 Sriraman Tallam <tmsriram@google.com>
12164
12165 * options.cc (General_options::parse_version): Make -v continue and do
12166 the link like GNU ld does.
12167
d675ff46
RÁE
121682009-12-17 Rafael Avila de Espindola <espindola@google.com>
12169
12170 * Makefile.am (CCFILES): Add timer.cc.
12171 (HFILES): Add timer.h.
12172 * configure.ac: Check for sysconf and times.
12173 * main.cc: include timer.h.
12174 (main): Use Timer instead of get_run_time.
12175 * timer.cc: New.
12176 * timer.h: New.
12177 * workqueue.cc: include timer.h.
12178 (Workqueue::find_and_run_task):
12179 Report user, sys and wall time.
12180 * Makefile.in: Regenerate.
12181 * config.in: Regenerate.
12182 * configure: Regenerate.
12183
d6344fb5
DK
121842009-12-16 Doug Kwan <dougkwan@google.com>
12185
12186 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
12187 sections.
12188 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
12189 relaxed input sections.
12190 * output.cc (Output_section::find_relaxed_input_section): Change
12191 return type to Output_relaxed_input_section pointer. Adjust code
12192 for new type of relaxed_input_section_map_.
12193 * output.h (Output_section::find_relaxed_input_section): Change
12194 return type to Output_relaxed_input_section pointer.
12195 (Output_section::Output_relaxed_input_section_by_input_section_map):
12196 New type.
12197 (Output_section::relaxed_input_section_map_): Change type to
12198 Output_section::Output_relaxed_input_section_by_input_section_map.
12199 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
12200 input section.
12201
0e0d5469
ILT
122022009-12-15 Ian Lance Taylor <iant@google.com>
12203
12204 * layout.cc (Layout::create_shstrtab): Only write out after input
12205 sections if we are compressing debug sections.
12206
0649a889
ILT
122072009-12-15 Ian Lance Taylor <iant@google.com>
12208
12209 * archive.cc (Archive::add_symbols): Only look up a symbol without
12210 a version if there is, in fact, a version.
12211
2ea97941
ILT
122122009-12-14 Ian Lance Taylor <iant@google.com>
12213
12214 Revert -Wshadow changes, all changes from:
12215 2009-12-11 Doug Kwan <dougkwan@google.com>
12216 2009-12-11 Nick Clifton <nickc@redhat.com>
12217 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
12218
b0eec2cc
DK
122192009-12-11 Doug Kwan <dougkwan@google.com>
12220
12221 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
12222 due to -Wshadow.
12223 * attributes.cc (Object_attribute::size): Ditto.
12224 (Attributes_section_data::size): Ditto.
12225 (Attributes_section_data::Attributes_section_data): Ditto.
12226 (Output_attributes_section_data::do_write): Ditto.
12227 * attributes.h (Object_attribute::set_type): Ditto.
12228 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
12229
91d6fa6a
NC
122302009-12-11 Nick Clifton <nickc@redhat.com>
12231
12232 * archive.cc: Fix shadowed variable warnings.
12233 * arm.cc: Likewise.
12234 * compressed_output.cc: Likewise.
12235 * compressed_output.h: Likewise.
12236 * configure: Likewise.
12237 * dwarf_reader.cc: Likewise.
12238 * dynobj.cc: Likewise.
12239 * dynobj.h: Likewise.
12240 * ehframe.cc: Likewise.
12241 * ehframe.h: Likewise.
12242 * errors.cc: Likewise.
12243 * expression.cc: Likewise.
12244 * fileread.cc: Likewise.
12245 * fileread.h: Likewise.
12246 * freebsd.h: Likewise.
12247 * i386.cc: Likewise.
12248 * icf.cc: Likewise.
12249 * incremental.h: Likewise.
12250 * layout.cc: Likewise.
12251 * layout.h: Likewise.
12252 * mapfile.cc: Likewise.
12253 * merge.cc: Likewise.
12254 * merge.h: Likewise.
12255 * object.cc: Likewise.
12256 * object.h: Likewise.
12257 * options.h: Likewise.
12258 * output.cc: Likewise.
12259 * output.h: Likewise.
12260 * parameters.cc: Likewise.
12261 * plugin.cc: Likewise.
12262 * powerpc.cc: Likewise.
12263 * reduced_debug_output.cc: Likewise.
12264 * reduced_debug_output.h: Likewise.
12265 * reloc.cc: Likewise.
12266 * reloc.h: Likewise.
12267 * resolve.cc: Likewise.
12268 * script-sections.cc: Likewise.
12269 * script.cc: Likewise.
12270 * script.h: Likewise.
12271 * sparc.cc: Likewise.
12272 * symtab.cc: Likewise.
12273 * symtab.h: Likewise.
12274 * target-select.cc: Likewise.
12275 * target-select.h: Likewise.
12276 * token.h: Likewise.
12277 * workqueue.cc: Likewise.
12278 * workqueue.h: Likewise.
12279 * x86_64.cc: Likewise.
12280
a0351a69
DK
122812009-12-10 Doug Kwan <dougkwan@google.com>
12282
12283 * arm.cc (attributes.h): New include.
12284 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
12285 (Arm_relobj::~Arm_relobj): Delete object pointed by
12286 attributes_section_data_.
12287 (Arm_relobj::attributes_section_data): New method definition.
12288 (Arm_relobj::attributes_section_data_): New data member declaration.
12289 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
12290 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
12291 attributes_section_data_.
12292 (Arm_dynobj::attributes_section_data): New method definition.
12293 (Arm_dynobj::attributes_section_data_): New data member declaration.
12294 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
12295 initialization value of may_use_blx_ to false.
2e702c99 12296 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
12297 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
12298 object attributes to compute results instead of hard-coding.
12299 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
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):
12304 New method declarations.
12305 (Target_arm::get_aeabi_object_attribute): New method definition.
12306 (Target_arm::attributes_section_data_): New data member declaration.
12307 (read_arm_attributes_section): New template definition.
12308 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
12309 (Arm_dynobj::do_read_symbols): Ditto.
12310 (Target_arm::do_finalize_sections): Merge attributes sections from
12311 input. Check for BLX use after attributes section merging.
12312 Fix __exidx_start and __exidx_end visibility. Create an
12313 .ARM.attributes section if necessary.
12314 (Target_arm::get_secondary_compatible_arch,
12315 Target_arm::set_secondary_compatible_arch,
12316 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12317 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 12318 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
12319 New method definitions.
12320
b59befec
ILT
123212009-12-09 Ian Lance Taylor <iant@google.com>
12322
12323 * plugin.cc (Plugin::load): Don't cast from void* to a function
12324 pointer.
12325
1276bc89
ILT
123262009-12-09 Ian Lance Taylor <iant@google.com>
12327
12328 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
12329 information fields.
12330
2f2de248
L
123312009-12-09 H.J. Lu <hongjiu.lu@intel.com>
12332
12333 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
12334 Replace two_file_shared_1.so with two_file_shared_2.so.
12335 * testsuite/Makefile.in: Regenerated.
12336
4f787271
DK
123372009-12-08 Doug Kwan <dougkwan@google.com>
12338
12339 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
12340 (HFILES): Add attributes.h and int_encoding.h.
12341 * Makefile.in: Regenerate.
12342 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
12343 function definitions to int_encoding.cc
12344 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
12345 prototypes to int_encoding.h
12346 * reduced_debug_output.cc (int_encoding.h): New include.
12347 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
12348 function definitions to int_encoding.cc
12349 (insert_into_vector, read_from_pointer): Move template definitions to
12350 int_encoding.h
12351 * attributes.cc: New file.
12352 * attributes.h: New file.
12353 * int_encoding.cc: New file.
12354 * int_encoding.h: New file.
12355
20b52f1a
RÁE
123562009-12-07 Rafael Avila de Espindola <espindola@google.com>
12357
12358 PR gold/11055
12359 * incremental-dump.cc (dump_incremental_inputs): New.
12360 (main): Use dump_incremental_inputs.
12361
53d7974c
L
123622009-12-07 H.J. Lu <hongjiu.lu@intel.com>
12363
12364 PR gold/10893
12365 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
12366 checking elfcpp::STT_FUNC.
12367 (Target_i386::Relocate::relocate): Likewise.
12368 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
12369
12370 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
12371 symbols from shared libraries into normal FUNC symbols.
12372
12373 * symtab.h (Symbol): Add is_func and use it.
12374
05a352e6
DK
123752009-12-05 Doug Kwan <dougkwan@google.com>
12376
12377 * arm.cc (Target_arm::arm_info): Initialize new fields
12378 attributes_section and attributes_vendor.
12379 * i386.cc (Target_i386::i386_info): Same.
12380 * object.cc (Sized_relobj::do_layout): Skip attribute section.
12381 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
12382 fields attributes_section and attributes_vendor.
53d7974c 12383 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
12384 * target.h (Target::attributes_section, Target::attributes_vendor,
12385 Target::is_attributes_section, Target::attribute_arg_type,
12386 Target::attributes_order): New method definitions.
12387 (Target::Target_info::attributes_section,
12388 Target::Target_info::attributes_vendor): New fields.
12389 (Target::do_attribute_arg_type, Target::do_attributes_order): New
12390 virtual method definitions.
12391 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
12392 attributes_section and attributes_vendor.
12393 * testsuite/testfile.cc (Target_test::test_target_info): Same.
12394
f4e5969c
DK
123952009-12-05 Doug Kwan <dougkwan@google.com>
12396
12397 * arm.cc: Update comments about interworking and stub generation.
12398 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
12399 considered as non-PIC.
12400 (Arm_relocate_functions::base_abs): Fix formatting.
12401 (Arm_relocate_functions::got_prel): Fix comment. Change interface
12402 of function to use GOT entry address instead of offset.
12403 (Target_arm::Scan::global): Issue an error if a symbol would need a
12404 PLT does not get one because it is untyped. Remove code to create
12405 dynamic symbols for relative branches.
12406 (Target_arm::Relocate::relocate: Use 0 instead of false since function
12407 takes unsigned integer instead of boolean.
12408
1abce4a6
L
124092009-12-05 H.J. Lu <hongjiu.lu@intel.com>
12410
12411 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
12412 (two_file_test_LDADD): Likewise.
12413 (common_test_1_LDADD): Likewise.
12414 (exception_test_LDADD) Likewise.
12415 (weak_test_LDADD): Likewise.
12416 (many_sections_test_LDADD): Likewise.
12417 (initpri1_LDADD): Likewise.
12418 (script_test_1_LDADD): Likewise.
12419 (script_test_2_LDADD): Likewise.
12420 (justsyms_LDADD): Likewise.
12421 (binary_test_LDADD): Likewise.
12422 (large_LDADD): Likewise.
12423 * testsuite/Makefile.in: Regenerated.
12424
adcf2816 124252009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 12426
adcf2816
L
12427 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
12428 (Symbol_table::override_with_special): Likewise.
12429 (Symbol_table::add_from_object): Likewise.
12430
28e67f5d
RÁE
124312009-12-04 Rafael Avila de Espindola <espindola@google.com>
12432
12433 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12434 Don't set the data_offset twice.
12435
ae10a101
RÁE
124362009-12-04 Rafael Avila de Espindola <espindola@google.com>
12437
12438 * testsuite/Makefile.in: Regenerate.
12439
f59f41f3
DK
124402009-12-03 Doug Kwan <dougkwan@google.com>
12441
12442 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
12443 (Target_arm::do_finalize_sections): Add parameter for symbol table
12444 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
12445 * i386.cc (Target_i386::do_finalize_sections): Add an additional
12446 parameter for symbol table pointer.
12447 * layout.cc (Layout::finalize): Call Target::finalize_sections with
12448 an additional parameter for a pointer to symbol table.
12449 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
12450 parameter for a symbol table pointer.
12451 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
12452 * target.h (Target::finalize_sections, Target::do_finalize_sections):
12453 Ditto.
12454 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
12455 parameter for a symbol table pointer.
12456
ca55d848
RÁE
124572009-12-03 Rafael Avila de Espindola <espindola@google.com>
12458
12459 * incremental.cc (Incremental_inputs_header)
12460 (Incremental_inputs_header_write, Incremental_inputs_entry)
12461 (Incremental_inputs_entry_write): Move ...
12462 * incremental.h (Incremental_inputs_header)
12463 (Incremental_inputs_header_write, Incremental_inputs_entry)
12464 (Incremental_inputs_entry_write): here.
12465
3aec4f9c
RÁE
124662009-12-02 Rafael Avila de Espindola <espindola@google.com>
12467
12468 * incremental.cc (make_sized_incremental_binary): Set the target.
12469 Error if it is incompatible.
12470 * output.h (Output_file): Add filename method.
12471
9c0ae74d
RÁE
124722009-12-02 Rafael Avila de Espindola <espindola@google.com>
12473
12474 * incremental.cc (Incremental_inputs_entry): Remove unused argument
12475 from the get_* methods.
12476
a45500ae
RÁE
124772009-12-02 Rafael Avila de Espindola <espindola@google.com>
12478
12479 * incremental-dump.cc (main): Check that the offeset of a script is 0.
12480 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12481 Write 0 for the data_offset of scripts.
12482
325e6408
RÁE
124832009-12-02 Rafael Avila de Espindola <espindola@google.com>
12484
12485 * testsuite/Makefile.am: Add the incremental_test.sh test.
12486 * testsuite/incremental_test.sh: New.
12487 * testsuite/incremental_test_1.c: New.
12488 * testsuite/incremental_test_2.c: New.
12489
954c3e2e
RÁE
124902009-12-01 Rafael Avila de Espindola <espindola@google.com>
12491
703d02da 12492 * incremental-dump.cc (main): Fix typos.
954c3e2e 12493
f8086623
RÁE
124942009-11-27 Rafael Avila de Espindola <espindola@google.com>
12495
12496 PR gold/11025
12497 * incremental-dump.cc (main): Use llu to print 64 bit values.
12498
3b0dd6ac
L
124992009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
12500 H.J. Lu <hongjiu.lu@intel.com>
12501
12502 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
12503 $(LIBDL).
12504 (incremental_dump_LDADD): Likewise.
12505 * Makefile.in: Regenerated.
12506
a6d1ef57 125072009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 12508
a6d1ef57
DK
12509 Revert:
12510
12511 2009-11-25 Doug Kwan <dougkwan@google.com>
12512
12513 * arm.cc (Target_arm::Target_arm): Move method definition
12514 outside of class definition. Add code to handle
12515 --target1-rel, --target1-abs and --target2= options.
12516 (Target_arm::get_reloc_reloc_type): Change method to be
12517 non-static and const.
12518 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
12519 New data member declaration.
12520 (Target_arm::Scan::local, Target_arm::Scan::global,
12521 Target_arm::Relocate::relocate,
12522 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12523 Adjust call to Target_arm::get_real_reloc_type.
12524 (Target_arm::get_real_reloc_type): Use command line options
12525 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12526 * options.h (--target1-rel, --target1-abs, --target2): New
12527 ARM-only options.
12528
50aeb7d4
DK
125292009-11-25 Doug Kwan <dougkwan@google.com>
12530
12531 * arm.cc (Target_arm::Target_arm): Move method definition outside of
12532 class definition. Add code to handle --target1-rel, --target1-abs
12533 and --target2= options.
12534 (Target_arm::get_reloc_reloc_type): Change method to be non-static
12535 and const.
12536 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
12537 member declaration.
12538 (Target_arm::Scan::local, Target_arm::Scan::global,
12539 Target_arm::Relocate::relocate,
12540 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
12541 call to Target_arm::get_real_reloc_type.
12542 (Target_arm::get_real_reloc_type): Use command line options to
12543 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12544 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
12545 options.
12546
51938283
DK
125472009-11-25 Doug Kwan <dougkwan@google.com>
12548
12549 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
12550 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
12551 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
12552 formatting.
12553 (Arm_relocate_functions::thm_call): Replace body with a call to
12554 Arm_relocate_functions::thumb_branch_common.
12555 (Arm_relocate_functions::thm_jump24,
12556 Arm_relocate_functions::thm_xpc22): New method definitions.
12557 (Arm_relocate_functions::thumb_branch_common): New method definition.
12558 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
12559 operator.
12560 (Target_arm::Relocate::relocate): Adjust call to thm_call.
12561 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
12562
e2b8f3c4
RÁE
125632009-11-24 Rafael Avila de Espindola <espindola@google.com>
12564
12565 * Makefile.am: Build incremental-dump
12566 * Makefile.in: Regenerate.
12567 * incremental-dump.cc: New.
12568 * incremental.cc (Incremental_inputs_header_data,
12569 Incremental_inputs_entry_data): Move to incremental.h
12570 * incremental.h: (Incremental_inputs_header_data,
12571 Incremental_inputs_entry_data): Move from incremental.cc
12572
bcba9aec
RÁE
125732009-11-24 Rafael Avila de Espindola <espindola@google.com>
12574
12575 * incremental.cc (Incremental_inputs_header,
12576 Incremental_inputs_header_write, Incremental_inputs_entry,
12577 Incremental_inputs_entry_write): Add a typedef with the data type.
12578
7c3afe08
RÁE
125792009-11-24 Rafael Avila de Espindola <espindola@google.com>
12580
12581 * incremental.cc (Incremental_inputs_header,
12582 Incremental_inputs_header_write, Incremental_inputs_entry,
12583 Incremental_inputs_entry_write): Update comment about which
12584 type has the filed descriptions.
12585
d204b6e9
DK
125862009-11-15 Doug Kwan <dougkwan@google.com>
12587
12588 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
12589 (Arm_relocate_functions::arm_branch_common): Change method defintion
12590 in class definition to a method declaration and update list of formal
12591 parameters.
12592 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
12593 Arm_relocation_functions::jump24): Adjust call to
12594 Arm_relocate_functions::arm_branch_common. Update list of formal
12595 parameters.
12596 (Arm_relocate_functions::xpc25): New method definition.
12597 (Arm_relocate_functions::arm_branch_common): Move method defintion
12598 out from class definition. Use stubs for mode-switching and extending
12599 branch ranges.
12600 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
12601 specially. Change code to enable use of stubs in ARM branches.
12602
43d12afe
DK
126032009-11-10 Doug Kwan <dougkwan@google.com>
12604
12605 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
12606 in method declaration.
12607 (Target_arm::relocate_stub): New method declaration.
12608 (Target_arm::default_target): Change to return a pointer instead of
12609 a const reference.
12610 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
12611 Target_arm::default_target.
12612 (Arm_Relobj::do_relocate_sections): Remove options paramater in
12613 method definition.
12614 (Target_arm::relocate_section): Adjust view.
12615 (Target_arm::relocate_stub): New method definition.
12616
ac33a407
DK
126172009-11-10 Doug Kwan <dougkwan@google.com>
12618
12619 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
12620 a format warning.
12621 * incremental.cc (open_incremental_binary): Initialized local
12622 variables to avoid warnings.
12623 * object.cc (make_elf_object): Ditto.
12624 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
12625 a format warning.
e1df38aa 12626
88ee28e9
L
12627009-11-09 H.J. Lu <hongjiu.lu@intel.com>
12628
12629 PR gold/10930
12630 * testsuite/plugin_test.c: Include "config.h".
12631
2daedcd6
DK
126322009-11-09 Doug Kwan <dougkwan@google.com>
12633
12634 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
12635 (arm_symbol_value): Remove.
12636 (Arm_relocate_functions::arm_branch_common,
12637 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
12638 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
12639 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
12640 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
12641 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
12642 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
12643 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
12644 Arm_relocate_functions::thm_mobw_abs_nc,
12645 Arm_relocate_functions::thm_mov_abs,
12646 Arm_relocate_functions::movw_prel_nc,
12647 Arm_relocate_functions::thm_movt_abs,
12648 Arm_relocate_functions::movt_prel,
12649 Arm_relocate_functions::thm_movw_prel_nc,
12650 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
12651 (Target_arm::Relocate::relocate): Only decompose address into two
12652 parts if relocation type uses the thumb-bit and pass the actual
12653 bit instead of a flag indicating that the thumb-bit is used. Adjust
12654 calls to methods in Arm_relocate_functions for this change.
12655
1276bc89 126562009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
12657
12658 PR 10925
12659 * reloc.cc: Instantiate
12660 Sized_relobj::initialize_input_to_output_maps and
12661 Sized_relobj:free_input_to_output_maps.
12662
e53ad1b5
ILT
126632009-11-06 Ian Lance Taylor <iant@google.com>
12664
12665 PR 10876
12666 * defstd.cc (in_segment): Set only_if_ref true for "end".
12667
eb44217c
DK
126682009-11-06 Doug Kwan <dougkwan@google.com>
12669
12670 * arm.cc (class Reloc_stub): Correct a comment.
12671 (Target_arm::Target_arm): Initialize arm_input_section_map_.
12672 (Target_arm::scan_section_for_stubs): New method declaration.
12673 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
12674 Change methods from private to protected.
12675 (Target_arm::do_may_relax): New method definition.
12676 (Target_arm::do_relax, Target_arm::group_sections,
12677 Target_arm::scan_reloc_for_stub,
12678 Target_arm::scan_reloc_section_for_stubs): New method declarations.
12679 (Target_arm::arm_input_section_map_): New data member declaration.
12680 (Target_arm::scan_reloc_for_stub,
12681 Target_arm::scan_reloc_section_for_stubs,
12682 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
12683 Target_arm::do_relax): New method definitions.
12684
5d329b7d
ILT
126852009-11-06 Mikolaj Zalewski <mikolaj@google.com>
12686
12687 * configure.ac: Check for (struct stat)::st_mtim
12688 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
12689 * config.in: Regenerate.
12690 * configure: Regenerate.
12691
96a0d71b
ILT
126922009-11-05 Ian Lance Taylor <iant@google.com>
12693
12694 PR 10910
12695 * output.cc (Output_segment::add_output_section): Add missing
12696 return statement.
12697
594c8e5e
ILT
126982009-11-04 Ian Lance Taylor <iant@google.com>
12699
12700 PR 10880
12701 * object.h (class Object): Add is_needed and set_is_needed
12702 methods. Add is_needed_ field. Make bool fields into bitfields.
12703 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
12704 defined in a dynamic object and referenced by a regular object,
12705 set is_needed for the dynamic object.
12706 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
12707 if the file is marked with as_needed and it is not needed.
12708
22b127cc
ILT
127092009-11-04 Ian Lance Taylor <iant@google.com>
12710
12711 PR 10887
12712 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
12713 tags if data is discarded by linker script.
12714 * i386.cc (Target_i386::do_finalize_sections): Likewise.
12715 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
12716 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
12717 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
12718
f5c870d2
ILT
127192009-11-04 Ian Lance Taylor <iant@google.com>
12720
12721 * layout.cc (Layout::get_output_section): Add is_interp and
12722 is_dynamic_linker_section parameters. Change all callers.
12723 (Layout::choose_output_section): Likewise.
12724 (Layout::make_output_section): Likewise.
12725 (Layout::add_output_section_data): Add is_dynamic_linker_section
12726 parameter. Change all callers.
12727 * layout.h (class Layout): Update declarations.
12728 * output.h (class Output_section): Add is_interp, set_is_interp,
12729 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
12730 Add is_interp_, is_dynamic_linker_section_ fields. Change
12731 generate_code_fills_at_write_ to a bitfield.
12732 * output.cc (Output_section::Output_sections): Initialize new
12733 fields.
12734 (Output_segment::add_output_section): Add do_sort parameter.
12735 Change all callers.
12736
1ae4d23b
ILT
127372009-11-03 Ian Lance Taylor <iant@google.com>
12738
12739 PR 10860
12740 * options.h (class General_options): Add --warn-common.
12741 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
12742 merging two common symbols.
12743 (Symbol_table::should_override): Handle --warn-common when merging
12744 a common symbol with a defined symbol. Use report_resolve_problem
12745 for multiple definitions.
12746 (Symbol_table::report_resolve_problem): New function.
12747 * symtab.h (class Symbol_table): Declare report_resolve_problem.
12748
55da9579
DK
127492009-11-03 Doug Kwan <dougkwan@google.com>
12750
12751 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
12752 stub_factory_.
12753 (Target_arm::stub_factory): New method definition.
12754 (Target_arm::new_arm_input_section,
12755 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
12756 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 12757 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
12758 New type definitions.
12759 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
12760 member declarations.
12761 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
12762 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
12763 New method definitions.
12764
37a9ac43
ILT
127652009-11-03 Ian Lance Taylor <iant@google.com>
12766
12767 * options.h (class General_options): Add --warn_constructors.
12768
b3d6a3d4
ILT
127692009-11-03 Ian Lance Taylor <iant@google.com>
12770
12771 PR 10893
12772 * defstd.cc (in_section): Add entries for __rel_iplt_start,
12773 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
12774
934b01dd
ILT
127752009-11-03 Ian Lance Taylor <iant@google.com>
12776
12777 PR 10895
12778 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
12779 --msgid-bugs-address.
12780 (install-pdf): New target.
12781 (install-data_yes): Look up one directory to find mkinstalldirs.
12782
03c1939b
L
127832009-11-03 H.J. Lu <hongjiu.lu@intel.com>
12784
12785 * po/Make-in (.po.gmo): Don't generate .gmo files in source
12786 tree.
12787
ebd95253
DK
127882009-10-30 Doug Kwan <dougkwan@google.com>
12789
12790 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
12791
e9bbb538
DK
127922009-10-30 Doug Kwan <dougkwan@google.com>
12793
12794 * arm.cc (Stub_addend_reader): New struct template definition
12795 and partial specializations.
12796 (Stub_addend_reader::operator()): New method definition for a
12797 partially specialized template.
12798
d5b40221
DK
127992009-10-30 Doug Kwan <dougkwan@google.com>
12800
12801 * arm.cc (Arm_relobj::processor_specific_flags): New method
12802 definition.
12803 (Arm_relobj::do_read_symbols): New method declaration.
12804 (Arm_relobj::processor_specific_flags_): New data member declaration.
12805 (Arm_dynobj): New class definition.
12806 (Target_arm::do_finalize_sections): Add input_objects parameter.
12807 (Target_arm::do_adjust_elf_header): New method declaration.
12808 (Target_arm::are_eabi_versions_compatible,
12809 (Target_arm::merge_processor_specific_flags): New method declaration.
12810 (Target_arm::do_make_elf_object): New overloaded method definitions
12811 and declaration.
12812 (Arm_relobj::do_read_symbols): New method definition.
12813 (Arm_dynobj::do_read_symbols): Ditto.
12814 (Target_arm::do_finalize_sections): Add input_objects parameters.
12815 Merge processor-specific flags from all input objects.
12816 (Target_arm::are_eabi_versions_compatible,
12817 Target_arm::merge_processor_specific_flags,
12818 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
12819 New method definitions.
12820 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
12821 Input_objects pointer type parameter.
12822 * layout.cc (Layout::finalize): Pass input objects to target's.
12823 finalize_sections function.
12824 * output.cc (Output_file_header::do_sized_write): Set ELF file
12825 header's processor-specific flags.
12826 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
12827 Input_objects pointer type parameter.
12828 * sparc.cc (Target_sparc::do_finalize_sections): Same.
12829 * target.h (Input_objects): New forward class declaration.
12830 (Target::processor_specific_flags,
12831 Target::are_processor_specific_flags_sect): New method definitions.
12832 (Target::finalize_sections): Add input_objects parameter.
12833 (Target::Target): Initialize processor_specific_flags_ and
12834 are_processor_specific_flags_set_.
12835 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
12836 parameter.
12837 (Target::set_processor_specific_flags): New method definition.
12838 (Target::processor_specific_flags_,
12839 Target::are_processor_specific_flags_set_): New data member
12840 declarations.
12841 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
12842 Input_objects pointer type parameter.
12843
ebabffbd
DK
128442009-10-30 Doug Kwan <dougkwan@google.com>
12845
12846 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
12847
ad0f2072
ILT
128482009-10-28 Ian Lance Taylor <iant@google.com>
12849
12850 * object.h (class Relobj): Drop options parameter from
12851 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
12852 do_scan_relocs, do_relocate. Change all callers.
12853 (class Sized_relobj): Drop options parameters from
12854 do_gc_process_relocs, do_scan_relocs, do_relocate,
12855 do_relocate_sections, relocate_sections, emit_relocs_scan,
12856 emit_relocs_scan_reltype. Change all callers.
12857 (struct Relocate_info): Remove options field and all references to
12858 it.
12859 * reloc.h (class Read_relocs): Remove options constructor
12860 parameter and options_ field. Change all callers.
12861 (class Gc_process_relocs, class Scan_relocs): Likewise.
12862 (class Relocate_task): Likewise.
12863 * target-reloc.h (scan_relocs): Remove options parameter. Change
12864 all callers.
12865 (scan_relocatable_relocs): Likewise.
12866 * target.h (class Sized_target): Remove options parameter from
12867 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
12868 all callers.
12869 * gc.h (gc_process_relocs): Remove options parameter. Change all
12870 callers.
12871 * arm.cc: Update functions to remove options parameters.
12872 * i386.cc: Likewise.
12873 * powerpc.cc: Likewise.
12874 * sparc.cc: Likewise.
12875 * x86_64.cc: Likewise.
12876 * testsuite/testfile.cc: Likewise.
12877
8ffa3667
DK
128782009-10-28 Doug Kwan <dougkwan@google.com>
12879
12880 * arm.cc (Arm_relobj): New class definition.
e1df38aa 12881 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
12882 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
12883 New method definitions.
12884
40f36857
CC
128852009-10-28 Cary Coutant <ccoutant@google.com>
12886
12887 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
12888 (Plugin::cleanup_done_): New member.
12889 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
12890 (Plugin_manager::cleanup_done_): Remove.
12891 (Plugin_manager::add_input_file): Edit error message.
12892 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
12893 (Plugin_manager::cleanup): Remove use of cleanup_done_.
12894
2c849493
ILT
128952009-10-27 Mikolaj Zalewski <mikolajz@google.com>
12896
12897 * fileread.cc: (File_read::View::~View): Use the new
12898 data_ownership_ filed.
12899 (File_read::~File_read): Dispose the new whole_file_view_.
12900 (File_read::open): Mmap the whole file if needed.
12901 (File_read::open): Use whole_file_view_ instead of contents_.
12902 (File_read::find_view): Use whole_file_view_ if applicable.
12903 (File_read::do_read): Use whole_file_view_ instead of contents_.
12904 (File_read::make_view): Use whole_file_view_ instead of contents_,
12905 update File_read::View::View call.
12906 (File_read::find_or_make_view): Update File_read::View::View
12907 call.
12908 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
12909 remove contents_
12910 (File_read::View::Data_ownership): New enum.
12911 (File_read::View::View): Replace bool mapped_ with Data_ownership
12912 argument.
12913 (File_read::View::mapped_): Remove (replaced by data_ownership_).
12914 (File_read::View::data_ownership_): New field.
12915 (File_read::contents_): Remove (replaced by whole_file_view_).
12916 (File_read::whole_file_view_): New field.
12917 * options.h (class General_options): Add --keep-files-mapped.
12918
24998053
CC
129192009-10-27 Cary Coutant <ccoutant@google.com>
12920
12921 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
12922 * testsuite/Makefile.am (plugin_test_5): New test case.
12923 * testsuite/Makefile.in: Regenerate.
12924
72adc4fa
DK
129252009-10-25 Doug Kwan <dougkwan@google.com>
12926
12927 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
12928 from private to protected to allow access by child class.
12929 (Sized_relobj::do_relocate_sections): New method declaration.
12930 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 12931 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
12932 Sized_relobj::relocate_sections. Instantiate template explicitly
12933 for different target sizes and endianity.
12934
07f508a2
DK
129352009-10-24 Doug Kwan <dougkwan@google.com>
12936
12937 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
12938 (Arm_input_section::as_arm_input_section): New method.
12939 (Arm_output_section): New class definition.
12940 (Arm_output_section::create_stub_group,
12941 Arm_output_section::group_sections): New method definitions.
12942
10ad9fe5
DK
129432009-10-22 Doug Kwan <dougkwan@google.com>
12944
12945 * arm.cc (Arm_input_section): New class definition.
12946 (Arm_input_section::init, Arm_input_section:do_write,
12947 Arm_input_section::set_final_data_size,
12948 Arm_input_section::do_reset_address_and_file_offset): New method
12949 definitions.
12950
56ee5e00
DK
129512009-10-21 Doug Kwan <dougkwan@google.com>
12952
12953 * arm.cc (Stub_table, Arm_input_section): New forward class
12954 declarations.
12955 (Stub_table): New class defintion.
12956 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
12957 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
12958 New method definition.
12959
b569affa
DK
129602009-10-21 Doug Kwan <dougkwan@google.com>
12961
12962 * arm.cc: Update copyright comments.
12963 (Target_arm): New forward class template declaration.
12964 (Arm_address): New type.
12965 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
12966 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
12967 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
12968 constants.
12969 (Insn_template): Same.
12970 (DEF_STUBS): New macro.
12971 (Stub_type): New enum type.
12972 (Stub_template): New class definition.
12973 (Stub): Same.
12974 (Reloc_stub): Same.
12975 (Stub_factory): Same.
12976 (Target_arm::Target_arm): Initialize may_use_blx_ and
12977 should_force_pic_veneer_.
12978 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
12979 Target_arm::should_force_pic_veneer,
12980 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
12981 Target_arm::using_thumb_only, Target_arm:;default_target): New
12982 method defintions.
12983 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
12984 New data member declarations.
12985 (Insn_template::size, Insn_template::alignment): New method defintions.
12986 (Stub_template::Stub_template): New method definition.
12987 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
12988 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
12989 (Stub_factory::Stub_factory): New method definition.
12990 * gold.h (string_hash): New template.
12991 * output.h (Input_section_specifier::hash_value): Use
12992 gold::string_hash.
12993 (Input_section_specifier::string_hash): Remove.
12994 * stringpool.cc (Stringpool_template::string_hash): Use
12995 gold::string_hash.
12996
6c172549
DK
129972009-10-20 Doug Kwan <dougkwan@google.com>
12998
12999 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
13000 symbols of relaxed input sections.
13001 * output.h (Output_section::find_relaxed_input_section): Make
13002 method public.
13003
c5617f2f
DK
130042009-10-16 Doug Kwan <dougkwan@google.com>
13005
13006 * dynobj.cc (Versions::Versions): Initialize version_script_.
13007 Only insert base version symbol definition for a shared object
13008 if version script defines any version versions.
13009 (Versions::define_base_version): New method definition.
13010 (Versions::add_def): Check that base version is not needed.
13011 (Versions::add_need): Define base version lazily.
13012 * dynobj.h (Versions::define_base_version): New method declaration.
13013 (Versions::needs_base_version_): New data member declaration.
13014 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
13015 (check_DATA): Add no_version_test.stdout.
13016 (libno_version_test.so, no_version_test.o no_version_test.stdout):
13017 New make rules.
13018 * testsuite/Makefile.in: Regenerate.
13019 * testsuite/no_version_test.c: New file.
13020 * testsuite/no_version_test.sh: Ditto.
13021
3c12dcdb
DK
130222009-10-16 Doug Kwan <dougkwan@google.com>
13023
13024 * expression.cc (class Segment_start_expression): New class definition.
13025 (Segment_start_expression::value): New method definition.
13026 (script_exp_function_segment_start): Return a new
13027 Segment_start_expression.
13028 * gold/script-c.h (script_saw_segment_start_expression): New function
13029 prototype.
13030 * script-sections.cc (Script_sections::Script_sections): Initialize
13031 SAW_SEGMENT_START_EXPRESSION_ to false.
13032 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
13033 and -Tbbs options to specify section addresses if given in
13034 command line and no SEGMENT_START expression is seen in a script.
13035 * script-sections.h (Script_sections::saw_segment_start_expression,
13036 Script_sections::set_saw_segment_start_expression): New method
13037 definition.
13038 (Script_sections::saw_segment_start_expression_): New data member
13039 declaration.
13040 * script.cc (script_saw_segment_start_expression): New function.
13041 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
13042 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
13043 script_test_7.sh and script_test_8.sh.
13044 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
13045 script_test_8.stdout.
13046 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
13047 (script_test_6, script_test_6.stdout, script_test_7,
13048 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
13049 * Makefile.in: Regenerate.
13050 * testsuite/script_test_6.sh: New file.
13051 * testsuite/script_test_6.t: Same.
13052 * testsuite/script_test_7.sh: Same.
13053 * testsuite/script_test_7.t: Same.
13054 * testsuite/script_test_8.sh: Same.
13055
64b1ae37
DK
130562009-10-16 Doug Kwan <dougkwan@google.com>
13057
13058 * output.cc (Output_segment::set_section_list_address): Cast
13059 expressions to unsigned long long type to avoid format warnings.
13060
661be1e2
ILT
130612009-10-15 Ian Lance Taylor <iant@google.com>
13062
12edd763 13063 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 13064 dot assignment to script_sections_.
12edd763
ILT
13065 * script-sections.cc (Script_sections::add_dot_assignment):
13066 Initialize if necessary.
13067
68b6574b
ILT
13068 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
13069 program headers with no load segment if there is a linker script.
13070
661be1e2
ILT
13071 * layout.cc (Layout::set_segment_offsets): Align the file offset
13072 to the segment aligment for -N or -n with no load segment.
13073 * output.cc (Output_segment::add_output_section): Don't crash if
13074 the first section is a TLS section.
13075 (Output_segment::set_section_list_addresses): Print an error
13076 message if the address moves backward in a linker script.
13077 * script-sections.cc
13078 (Output_section_element_input::set_section_addresses): Don't
13079 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
13080 (Orphan_output_section::set_section_addresses): Likewise.
13081
f15f61a7
DK
130822009-10-15 Doug Kwan <dougkwan@google.com>
13083
13084 * layout.cc (Layout::finish_dynamic_section): Generate tags
13085 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
13086 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
13087 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
13088
82bb573a
ILT
130892009-10-14 Ian Lance Taylor <iant@google.com>
13090
13091 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
13092 fields.
13093 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
13094 data_shdr fields of relinfo.
13095 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
13096 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
13097 R_386_TLS_LDO_32, adjust based on section flags.
13098 (Target_i386::Relocate::fix_up_ldo): Remove.
13099
374ad285
ILT
131002009-10-13 Ian Lance Taylor <iant@google.com>
13101
13102 Add support for -pie.
13103 * options.h (class General_options): Add -pie and
13104 --pic-executable.
13105 (General_options::output_is_position_independent): Test -pie.
13106 (General_options::output_is_executable): Return true if not shared
13107 and not relocatable.
13108 (General_options::output_is_pie): Remove.
13109 * options.cc (General_options::finalize): Reject incompatible uses
13110 of -pie.
13111 * gold.cc (queue_middle_tasks): A -pie link is not static.
13112 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
13113 * symtab.cc (Symbol::final_value_is_known): Return false if
13114 output_is_position_independent.
13115 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
13116 output_is_position_independent.
13117 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
13118 output_is_position_independent.
13119 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
13120 output_is_position_independent.
13121 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
13122 two_file_pie_test.
13123 (basic_pie_test.o, basic_pie_test): New targets.
13124 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
13125 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
13126 (two_file_pie_test): New target.
13127 * testsuite/Makefile.in: Rebuild.
13128 * README: Remove note saying that -pie is not supported.
13129
c6585162
ILT
131302009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
13131
13132 * options.h (class General_options): Add -init and -fini.
13133 * layout.cc (Layout::finish_dynamic_section): Emit
13134 given init and fini functions.
13135
032ce4e9
ST
131362009-10-13 Sriraman Tallam <tmsriram@google.com>
13137
13138 * gc.h (gc_process_relocs): Check if icf is enabled using new
13139 function.
13140 * gold.cc (queue_initial_tasks): Likewise.
13141 (queue_middle_tasks): Likewise.
13142 * object.cc (do_layout): Likewise.
13143 * symtab.cc (is_section_folded): Likewise.
13144 * main.cc (main): Likewise.
13145 * reloc.cc (Read_relocs::run): Likewise.
13146 (Sized_relobj::do_scan_relocs): Likewise.
13147 * icf.cc (is_function_ctor_or_dtor): New function.
13148 (Icf::find_identical_sections): Check if function is ctor or dtor when
13149 safe icf is chosen.
13150 * options.h (General_options::icf): Change option to be an enum.
13151 (Icf_status): New enum.
13152 (icf_enabled): New method.
13153 (icf_safe_folding): New method.
13154 (set_icf_status): New method.
13155 (icf_status_): New variable.
13156 * (options.cc) (General_options::finalize): Set icf_status_.
13157 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
13158 icf_test and icf_keep_unique_test to use the --icf enum flag.
13159 * testsuite/icf_safe_test.sh: New file.
e1df38aa 13160 * testsuite/icf_safe_test.cc: New file.
032ce4e9 13161
f345227a
ST
131622009-10-12 Sriraman Tallam <tmsriram@google.com>
13163
13164 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
13165 includes to gc.h and icf.h.
13166 * arm.cc: Include gc.h.
13167 * gold.cc: Likewise.
13168 * i386.cc: Likewise.
13169 * powerpc.cc: Likewise.
13170 * sparc.cc: Likewise.
13171 * x86_64.cc: Likewise.
13172 * gc.h: Include icf.h.
13173
1c7814ed
ILT
131742009-10-11 Ian Lance Taylor <iant@google.com>
13175
13176 * plugin.cc: Include "gold.h" before other header files.
13177
ae3b5189
CD
131782009-10-10 Chris Demetriou <cgd@google.com>
13179
13180 * options.h (Input_file_argument::Input_file_type): New enum.
13181 (Input_file_argument::is_lib_): Replace with...
13182 (Input_file_argument::type_): New member.
13183 (Input_file_argument::Input_file_argument): Take Input_file_type
13184 'type' rather than boolean 'is_lib' as second argument.
13185 (Input_file_argument::is_lib): Use type_.
13186 (Input_file_argument::is_searched_file): New function.
13187 (Input_file_argument::may_need_search): Handle is_searched_file.
13188 * options.cc (General_options::parse_library): Support -l:filename.
13189 (General_options::parse_just_symbols): Update for Input_file_argument
13190 changes.
13191 (Command_line::process): Likewise.
13192 * archive.cc (Archive::get_file_and_offset): Likewise.
13193 * plugin.cc (Plugin_manager::release_input_file): Likewise.
13194 * script.cc (read_script_file, script_add_file): Likewise.
13195 * fileread.cc (Input_file::Input_file): Likewise.
13196 (Input_file::will_search_for): Handle is_searched_file.
13197 (Input_file::open): Likewise.
13198 * readsyms.cc (Read_symbols::get_name): Likewise.
13199 * testsuite/Makefile.am (searched_file_test): New test.
13200 * testsuite/Makefile.in: Regenerate.
13201 * testsuite/searched_file_test.cc: New file.
13202 * testsuite/searched_file_test_lib.cc: New file.
13203
f3048a1d
ILT
132042009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13205 Ian Lance Taylor <iant@google.com>
13206
13207 * descriptor.cc: Include <cstdio> and "binary-io.h".
13208 (Descriptors::open): Open the files in binary mode always.
13209 * script.cc (Lex::get_token): Treat \r as whitespace.
13210
d4780e57
ILT
132112009-10-09 Ian Lance Taylor <iant@google.com>
13212
13213 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
13214
d9a893b8
ILT
132152009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13216 Ian Lance Taylor <iant@google.com>
13217
13218 * configure.ac: Check for readv function also.
13219 * fileread.cc (readv): Define if not HAVE_READV.
13220 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
13221 does not exist.
13222 * config.in: Regenerate.
13223 * configure: Regenerate.
13224
c0a62865
DK
132252009-10-09 Doug Kwan <dougkwan@google.com>
13226
13227 * layout.cc (Layout::make_output_section): Call target hook to make
13228 ordinary output section.
13229 (Layout::finalize): Adjust parameter list of call the
13230 Target::may_relax().
13231 * layout.h (class Layout::section_list): New method.
13232 * merge.h (Output_merge_base::entsize): Change visibility to public.
13233 (Output_merge_base::is_string, Output_merge_base::do_is_string):
13234 New methods.
13235 (Output_merge_string::do_is_string): New method.
13236 * object.cc (Sized_relobj::do_setup): renamed from
13237 Sized_relobj::set_up.
13238 * object.h (Sized_relobj::adjust_shndx,
13239 Sized_relobj::initializ_input_to_output_maps,
13240 Sized_relobj::free_input_to_output_maps): Change visibilities to
13241 protected.
13242 (Sized_relobj::setup): Virtualize.
13243 (Sized_relobj::do_setup): New method declaration.
13244 (Sized_relobj::invalidate_section_offset,
13245 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
13246 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
13247 * options.cc (parse_int): New function.
13248 * options.h (parse_int): New declaration.
13249 (DEFINE_int): New macro.
13250 (stub_group_size): New option.
13251 * output.cc (Output_section::Output_section): Initialize memebers
13252 merge_section_map_, merge_section_by_properties_map_,
13253 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
13254 (Output_section::add_input_section): Handled deferred code-fill
13255 generation and remove an old comment.
13256 (Output_section::add_relaxed_input_section): New method definition.
13257 (Output_section::add_merge_input_section): Use merge section by
13258 properties map to speed to search. Update merge section maps
13259 as appropriate.
13260 (Output_section::build_relaxation_map): New method definition.
13261 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
13262 Same.
13263 (Output_section::relax_input_section): Renamed to
13264 Output_section::convert_input_sections_to_relaxed_sections and change
13265 interface to take a vector of pointers to relaxed sections.
13266 (Output_section::find_merge_section,
13267 Output_section::find_relaxed_input_section): New method definitions.
13268 (Output_section::is_input_address_mapped,
13269 Output_section::output_offset, Output_section::output_address):
13270 Use output section data maps to speed up searching.
13271 (Output_section::find_starting_output_address): Add comments.
13272 (Output_section::do_write,
13273 Output_section::write_to_postprocessing_buffer): Do code-fill
13274 generation as appropriate.
13275 (Output_section::get_input_sections): Invalidate relaxed input section
13276 map.
13277 (Output_section::restore_states): Adjust type of checkpoint .
13278 Invalidate relaxed input section map.
13279 * output.h (Output_merge_base): New class declaration.
13280 (Input_section_specifier): New class defintion.
13281 (class Output_relaxed_input_section) Change base class to
13282 Output_section_data_build.
13283 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
13284 base class initializer.
13285 (Output_section::add_relaxed_input_section): New method declaration.
13286 (Output_section::Input_section): Change visibility to protected.
2e702c99 13287 (Output_section::Input_section::relobj,
c0a62865
DK
13288 Output_section::Input_section::shndx): Handle relaxed input sections.
13289 Output_section::input_sections) Change visibility to protected. Also
13290 define overload to return a non-const pointer.
13291 (Output_section::Merge_section_properties): New class defintion.
13292 (Output_section::Merge_section_by_properties_map,
13293 Output_section::Output_section_data_by_input_section_map,
13294 Output_section::Relaxation_map): New types.
13295 (Output_section::relax_input_section): Rename method to
13296 Output_section::convert_input_sections_to_relaxed_sections and change
13297 interface to take a vector of relaxed section pointers.
13298 (Output_section::find_merge_section,
13299 Output_section::find_relaxed_input_section,
13300 Output_section::build_relaxation_map,
13301 Output_section::convert_input_sections_in_list_to_relaxed_sections):
13302 New method declarations.
13303 (Output_section::merge_section_map_
13304 Output_section::merge_section_by_properties_map_,
13305 Output_section::relaxed_input_section_map_,
13306 Output_section::is_relaxed_input_section_map_valid_,
13307 Output_section::generate_code_fills_at_write_): New data members.
13308 * script-sections.cc
13309 (Output_section_element_input::set_section_addresses): Call
13310 current_data_size and addralign methods of relaxed input sections.
13311 (Orphan_output_section::set_section_addresses): Call current_data_size
13312 and addralign methods of relaxed input sections.
13313 * symtab.cc (Symbol_table::compute_final_value): Extract template
13314 from the body of Symbol_table::sized_finalize_symbol.
13315 (Symbol_table::sized_finalized_symbol): Call
13316 Symbol_table::compute_final_value.
13317 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
13318 (Symbol_table::compute_final_value): New templated method declaration.
13319 * target.cc (Target::do_make_output_section): New method defintion.
13320 * target.h (Target::make_output_section): New method declaration.
13321 (Target::relax): Add more parameters for input objects, symbol table
13322 and layout. Adjust call to do_relax.
13323 (Target::do_make_output_section): New method declaration.
13324 (Target::do_relax): Add parameters for input objects, symbol table
13325 and layout.
13326
d446d6c4
ILT
133272009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13328
13329 * pread.c: Include stdio.h.
13330
bc06c745
ILT
133312009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13332
13333 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
13334 defined.
13335
75aea3d0
ILT
133362009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13337
13338 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
13339 Change read_shndx type to unsigned int.
13340 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13341 int.
13342 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13343 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
13344 Change read_shndx type to unsigned int.
13345 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13346 int.
13347 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13348 * layout.cc (Layout::create_symtab_sections): Cast the result of
13349 local_symcount * symsize to off_t in the gold_assert.
13350
be8fcb75
ILT
133512009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13352
13353 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
13354 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
13355 R_ARM_BASE_ABS.
13356 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
13357 (Arm_relocate_functions::thm_abs5): New function.
13358 (Arm_relocate_functions::abs12): New function.
13359 (Arm_relocate_functions::abs16): New function.
13360 (Arm_relocate_functions::base_abs): New function.
13361 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
13362 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
13363 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
13364 R_ARM_BASE_ABS.
13365 (Scan::global): Likewise.
13366 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
13367 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
13368 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
13369 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
13370 R_ARM_BASE_ABS.
13371
c2a122b6
ILT
133722009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13373
13374 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
13375 (Arm_relocate_functions::movt_prel): New function.
13376 (Arm_relocate_functions::thm_movw_prel_nc): New function.
13377 (Arm_relocate_functions::thm_movt_prel): New function.
13378 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
13379 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
13380 (Scan::global, Relocate::relocate): Likewise.
13381 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13382
c4aa1e2d
ILT
133832009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13384
13385 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
13386 Incremental_checker.
13387 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
13388 unsigned int.
13389 (class Incremental_inputs_header): New class.
13390 (Incremental_inputs_header_writer): Edit comment.
13391 (Incremental_inputs_entry): New class.
13392 (Incremental_inputs_entry_writer): Edit comment.
13393 (Sized_incremental_binary::do_find_incremental_inputs_section):
13394 Add *strtab_shndx parameter, fill it.
13395 (Sized_incremental_binary::do_check_inputs): New method.
13396 (Incremental_checker::can_incrementally_link_output_file): Use
13397 Sized_incremental_binary::check_inputs.
13398 (Incremental_inputs::report_command_line): Save command line in
13399 command_line_.
13400 * incremental.h:
13401 (Incremental_binary::find_incremental_inputs_section): New
13402 method.
13403 (Incremental_binary::do_find_incremental_inputs_section): Add
13404 strtab_shndx parameter.
13405 (Incremental_binary::do_check_inputs): New pure virtual method.
13406 (Sized_incremental_binary::do_check_inputs): Declare.
13407 (Incremental_checker::Incremental_checker): Add incremental_inputs
13408 parameter, use it to initialize incremental_inputs_.
13409 (Incremental_checker::incremental_inputs_): New field.
13410 (Incremental_checker::command_line): New method.
13411 (Incremental_checker::inputs): New method.
13412 (Incremental_checker::command_line_): New field.
13413
c549a694
ILT
134142009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13415
13416 * incremental.cc: Include <cstdarg> and "target-select.h".
13417 (vexplain_no_incremental): New function.
13418 (explain_no_incremental): New function.
13419 (Incremental_binary::error): New method.
13420 (Sized_incremental_binary::do_find_incremental_inputs_section): New
13421 method.
13422 (make_sized_incremental_binary): New function.
13423 (open_incremental_binary): New function.
13424 (can_incrementally_link_file): Add checks if output is ELF and has
13425 inputs section.
13426 * incremental.h: Include "elfcpp_file.h" and "output.h".
13427 (Incremental_binary): New class.
13428 (Sized_incremental_binary): New class.
13429 (open_incremental_binary): Declare.
13430 * object.cc (is_elf_object): Use
13431 elfcpp::Elf_recognizer::is_elf_file.
13432 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
13433 * output.h (Output_file::filesize): New method.
13434
fd3c5f0b
ILT
134352009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13436
13437 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
13438 New function.
13439 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
13440 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
13441 function.
13442 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
13443 function.
13444 (Arm_relocate_functions::movw_abs_nc): New function.
13445 (Arm_relocate_functions::movt_abs): New function.
13446 (Arm_relocate_functions::thm_movw_abs_nc): New function.
13447 (Arm_relocate_functions::thm_movt_abs): New function.
13448 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
13449 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
13450 (Scan::global): Likewise.
13451 (Relocate::relocate): Likewise.
13452 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13453
7f5309a5
ILT
134542009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13455
13456 * arm.cc (Arm_relocate_functions::got_prel) New function.
13457 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
13458 (Relocate::relocate): Likewise.
13459 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13460
364c7fa5
ILT
134612009-10-06 Ian Lance Taylor <iant@google.com>
13462
13463 * options.h (class General_options): Define
13464 split_stack_adjust_size parameter.
13465 * object.h (class Object): Add uses_split_stack_ and
13466 has_no_split_stack_ fields. Add uses_split_stack and
13467 has_no_split_stack accessor functions. Declare
13468 handle_split_stack_section.
13469 (class Reloc_symbol_changes): Define.
13470 (class Sized_relobj): Define Function_offsets. Declare
13471 split_stack_adjust, split_stack_adjust_reltype, and
13472 find_functions.
13473 * object.cc (Object::handle_split_stack_section): New function.
13474 (Sized_relobj::do_layout): Call handle_split_stack_section.
13475 * dynobj.cc (Sized_dynobj::do_layout): Call
13476 handle_split_stack_section.
13477 * reloc.cc (Sized_relobj::relocate_sections): Call
13478 split_stack_adjust for executable sections in split_stack
13479 objects. Pass reloc_map to relocate_section.
13480 (Sized_relobj::split_stack_adjust): New function.
13481 (Sized_relobj::split_stack_adjust_reltype): New function.
13482 (Sized_relobj::find_functions): New function.
13483 * target-reloc.h: Include "object.h".
13484 (relocate_section): Add reloc_symbol_changes parameter. Change
13485 all callers.
13486 * target.h (class Target): Add calls_non_split method. Declare
13487 do_calls_non_split virtual method. Declare match_view and
13488 set_view_to_nop.
13489 * target.cc: Include "elfcpp.h".
13490 (Target::do_calls_non_split): New function.
13491 (Target::match_view): New function.
13492 (Target::set_view_to_nop): New function.
13493 * gold.cc (queue_middle_tasks): Give an error if mixing
13494 split-stack and non-split-stack objects with -r.
13495 * i386.cc (Target_i386::relocate_section): Add
13496 reloc_symbol_changes parameter.
13497 (Target_i386::do_calls_non_split): New function.
13498 * x86_64.cc (Target_x86_64::relocate_section): Add
13499 reloc_symbol_changes parameter.
13500 (Target_x86_64::do_calls_non_split): New function.
13501 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
13502 parameter.
13503 * powerpc.cc (Target_powerpc::relocate_section): Add
13504 reloc_symbol_changes parameter.
13505 * sparc.cc (Target_sparc::relocate_section): Add
13506 reloc_symbol_changes parameter.
13507 * configure.ac: Call AM_CONDITIONAL for the default target.
13508 * configure: Rebuild.
13509 * testsuite/Makefile.am (TEST_AS): New variable.
13510 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
13511 (check_DATA): Add split_i386 and split_x86_64 files.
13512 (SPLIT_DEFSYMS): Define.
13513 (split_i386_[1234n].o): New targets.
13514 (split_i386_[124]): New targets.
13515 (split_i386_[1234r].stdout): New targets.
13516 (split_x86_64_[1234n].o): New targets.
13517 (split_x86_64_[124]): New targets.
13518 (split_x86_64_[1234r].stdout): New targets.
13519 (MOSTLYCLEANFILES): Add new executables.
13520 * testsuite/split_i386.sh: New file.
13521 * testsuite/split_x86_64.sh: New file.
13522 * testsuite/split_i386_1.s: New file.
13523 * testsuite/split_i386_2.s: New file.
13524 * testsuite/split_i386_3.s: New file.
13525 * testsuite/split_i386_4.s: New file.
13526 * testsuite/split_i386_n.s: New file.
13527 * testsuite/split_x86_64_1.s: New file.
13528 * testsuite/split_x86_64_2.s: New file.
13529 * testsuite/split_x86_64_3.s: New file.
13530 * testsuite/split_x86_64_4.s: New file.
13531 * testsuite/split_x86_64_n.s: New file.
13532 * testsuite/testfile.cc (Target_test): Update relocation_section
13533 function.
13534 * testsuite/Makefile.in: Rebuild.
13535
e8a9fcda
ILT
135362009-10-06 Ian Lance Taylor <iant@google.com>
13537
13538 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
13539 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
13540 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
13541 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
13542 the address on ldo_addrs_.
13543 (Target_i386::Relocate::fix_up_ldo): New function.
13544
e99daf92
ILT
135452009-10-06 Rafael Espindola <espindola@google.com>
13546
13547 * plugin.cc (add_input_library): New.
13548 (Plugin::load): Add add_input_library to tv.
13549 (Plugin_manager::add_input_file): Add the is_lib argument.
13550 (add_input_file): Update call to Plugin_manager::add_input_file.
13551 (add_input_library): New.
13552 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
13553
966d4097
DK
135542009-09-30 Doug Kwan <dougkwan@google.com>
13555
13556 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
13557 symbol and call Symbol::may_need_copy_reloc to determine if
13558 a copy reloc is needed.
13559 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
13560 nocopyreloc is given in command line.
13561 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
13562 given in command line.
13563 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
13564 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
13565 of the removed Target_i386::may_need_copy_reloc.
13566 * options.h (copyreloc): New option with default value false.
13567 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13568 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
13569 instead of the removed Target_powerpc::may_need_copy_reloc.
13570 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13571 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
13572 instead of the removed Target_sparc::may_need_copy_reloc.
13573 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
13574 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
13575 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
13576 instead of the removed Target_x86_64::may_need_copy_reloc.
13577
029ba973
ILT
135782009-09-30 Ian Lance Taylor <iant@google.com>
13579
13580 * object.h (class Object): Remove target_ field, and target,
13581 sized_target, and set_target methods.
13582 (Object::sized_target): Remove.
13583 (class Sized_relobj): Update declarations. Remove sized_target.
13584 * object.cc (Sized_relobj::setup): Remove target parameter.
13585 Change all callers.
13586 (Input_objects::add_object): Don't do anything with the target.
13587 (make_elf_sized_object): Add punconfigured parameter. Change all
13588 callers. Set or test parameter target.
13589 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
13590 Change all callers.
13591 * parameters.cc (Parameters::set_target): Change parameter type to
13592 be non-const.
13593 (Parameters::default_target): Remove.
13594 (set_parameters_target): Change parameter type to be non-const.
13595 (parameters_force_valid_target): New function.
13596 (parameters_clear_target): New function.
13597 * parameters.h (class Parameters): Update declarations. Remove
13598 default_target method. Add sized_target and clear_target
13599 methods. Change target_ to be non-const.
13600 (set_parameters_target): Update declaration.
13601 (parameters_force_valid_target): Declare.
13602 (parameters_clear_target): Declare.
13603 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
13604 as NULL if we aren't searching.
13605 (Add_symbols::run): Don't check for compatible target.
13606 * fileread.cc (Input_file::open_binary): Call
13607 parameters_force_valid_target.
13608 * gold.cc (queue_middle_tasks): Likewise.
13609 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
13610 set_target on object.
13611 * dynobj.h (class Sized_dynobj): Update declarations.
13612 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
13613 make_elf_object returns NULL.
13614 (Archive::include_member): Don't check whether object target is
13615 compatible.
13616 * output.cc (Output_section::add_input_section): Get target from
13617 parameters.
13618 (Output_section::relax_input_section): Likewise.
13619 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
13620 parameters.
13621 (Sized_relobj::do_scan_relocs): Likewise.
13622 (Sized_relobj::relocate_sections): Likewise.
13623 * resolve.cc (Symbol_table::resolve): Likewise.
13624 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
13625 parameter. Change all callers.
13626 (Symbol_table::add_from_object): Get target from parameters.
13627 (Symbol_table::add_from_relobj): Don't check object target.
13628 (Symbol_table::add_from_dynobj): Likewise.
13629 (Symbol_table::define_special_symbol): Get target from
13630 parameters.
13631 * symtab.h (class Symbol_table): Update declaration.
13632 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
13633 parameter. Change all callers. Clear parameter target.
13634 (Binary_test): Test target here.
13635 * testsuite/object_unittest.cc (gold_testsuite): Remove
13636 target_test_pointer parameter. Change all callers.
13637 (Object_test): Test target here.
13638
a6a22b83
ILT
136392009-09-26 Ian Lance Taylor <iant@google.com>
13640
13641 * testsuite/initpri1.c: Don't try to use constructor priorities if
13642 compiling with gcc before 4.3.
13643
6a8f49fe
ILT
136442009-09-22 Mikolaj Zalewski <mikolajz@google.com>
13645
13646 * testsuite/retain_symbols_file_test.sh (check_present): Change
13647 output file name to retain_symbols_file_test.stdout.
13648 (check_absent): Likewise.
13649
8c604651
CS
136502009-09-18 Craig Silverstein <csilvers@google.com>
13651
13652 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
13653 * options.cc: Include <cerrno> and <fstream>.
13654 (General_options::finalize): Parse -retain-symbols-file tag.
13655 * options.h: New flag.
13656 (General_options): New method should_retain_symbol, new
13657 variable symbols_to_retain.
13658 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
13659 should_retain_symbol map.
13660 * testsuite/Makefile.am (retain_symbols_file_test): New test.
13661 * testsuite/Makefile.in: Regenerate.
13662 * testsuite/retain_symbols_file_test.sh: New file.
13663
ca58b19f
NC
136642009-09-18 Nick Clifton <nickc@redhat.com>
13665
13666 * po/es.po: Updated Spanish translation.
13667
20e6d0d6
DK
136682009-09-17 Doug Kwan <dougkwan@google.com>
13669
13670 * debug.h (DEBUG_RELAXATION): New constant.
13671 (DEBUG_ALL): Add DEBUG_RELAXATION.
13672 (debug_string_to_enum): Add relaxation debug option.
13673 * layout.cc
13674 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
13675 Layout::Relaxation_debug_check::read_sections,
13676 Layout::Relaxation_debug_check::read_sections): New method definitions.
13677 (Layout::Layout): Initialize data members
13678 record_output_section_data_from_scrips_,
13679 script_output_section_data_list_ and relaxation_debug_check_.
13680 (Layout::save_segments, Layout::restore_segments,
13681 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13682 Layout::relaxation_loop_body): New method definitions.
13683 (Layout::finalize): Support relaxation. Move section layout code to
13684 Layout::relaxation_loop_body.
13685 (Layout::set_asection_address_from_script): Move code for orphan
13686 section placement out.
13687 (Layout::place_orphan_sections_in_script): New method definition.
13688 * layout.h (Output_segment_headers, Output_file_header):
13689 New forward class declarations.
13690 (Layout::~Layout): Define.
13691 (Layout::new_output_section_data_from_script): New method definition.
13692 (Layout::place_orphan_sections_in_script): New method declaration.
13693 (Layout::Segment_states): New type declaration.
13694 (Layout::save_segments, Layout::restore_segments,
13695 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13696 Layout::relaxation_loop_body): New method declarations.
13697 (Layout::Output_section_data_list): New type declaration.
13698 (Layout::Relaxation_debug_check): New class definition.
13699 (Layout::record_output_section_data_from_script_,
13700 Layout::script_output_section_data_list_, Layout::segment_states_,
13701 Layout::relaxation_debug_check_): New data members.
13702 * output.cc: (Output_section_headers::do_size): New method definition.
13703 (Output_section_headers::Output_section_headers): Move size
13704 computation to Output_section_headers::do_size.
13705 (Output_segment_headers::do_size): New method definition.
e1df38aa 13706 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
13707 Output_file_header::do_size and call it.
13708 (Output_file_header::do_size): New method definition.
13709 (Output_data_group::Output_data_group): Adjust call to
13710 Output_section_data.
13711 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
13712 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 13713 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
13714 RELAXED_INPUT_SECTION_CODE.
13715 (Output_section::Output_section): Initialize data member checkpoint_.
13716 (Output_section::~Output_section): Delete checkpoint object pointed
13717 by checkpoint_.
13718 (Output_section::add_input_section): Always add an Input_section if
13719 relaxing.
13720 (Output_section::add_merge_input_section): Add assert.
13721 (Output_section::relax_input_section): New method definition.
13722 (Output_section::set_final_data_size): Set load address to zero for
13723 an unallocated section.
13724 (Output_section::do_address_and_file_offset_have_reset_values):
13725 New method definition.
13726 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
13727 Handle relaxed input section.
13728 (Output_section::sort_attached_input_sections): Checkpoint input
13729 section list lazily.
13730 (Output_section::get_input_sections): Change type of input_sections to
13731 list of Simple_input_section pointers. Checkpoint input section list
13732 lazily. Also handle relaxed input sections.
13733 (Output_section::add_input_section_for_script): Take a reference to
13734 a Simple_input_section object instead of Relobj pointer and section
13735 index as parameter. Handle relaxed input sections.
13736 (Output_section::save_states, Output_section::restore_states): New
13737 method definitions.
13738 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
13739 (Output_data::is_data_size_fixed): New method definition.
13740 (Output_data::reset_addresss_and_file_offset): Do not reset data size
13741 if it is fixed.
13742 (Output_data::address_and_file_offset_have_reset_values): New method
13743 definition.
13744 (Output_data::do_address_and_file_offset_have_reset_values): New method
13745 definition.
13746 (Output_data::set_data_size): Check that data size is not fixed.
13747 (Output_data::fix_data_size): New method definition.
13748 (Output_data::is_data_size_fixed_): New data member.
13749 (Output_section_headers::set_final_data_size): New method definition.
13750 (Output_section_headers::do_size): New method declaration.
13751 (Output_segment_headers::set_final_data_size): New method definition.
13752 (Output_segment_headers::do_size): New method declaration.
13753 (Output_file_header::set_final_data_size)::New method definition.
13754 (Output_file_header::do_size)::New method declaration.
13755 (Output_section_data::Output_section_data): Add new parameter
13756 is_data_size_fixed and use it to fix data size.
13757 (Output_data_const::Output_data_const): Adjust call to base class
13758 constructor and fix data size.
13759 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
13760 base class constructor and fix data size.
13761 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
13762 base class constructor and fix data size.
13763 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
13764 class constructor and fix data size.
13765 (Output_data_group::set_final_data_size): New method definition.
13766 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
13767 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
13768 class constructor and fix data size.
13769 (Output_relaxed_input_section): New class definition.
13770 (Output_section::Simple_input_section): New class definition.
13771 (Output_section::get_input_sections): Adjust parameter list.
13772 (Output_section::add_input_section_for_script): Same.
13773 (Output_section::save_states, Output_section::restore_states,
13774 Output_section::do_address_and_file_offset_have_reset_values,
13775 (Output_section::Input_section::Input_section): Handle
13776 RELAXED_INPUT_SECTION_CODE. Add new overload for
13777 Output_relaxed_input_section.
13778 (Output_section::Input_section::is_input_section,
13779 Output_section::Input_section::set_output_section): Handle relaxed
13780 input section.
13781 (Output_section::Input_section::is_relaxed_input_section,
13782 Output_section::Input_section::output_section_data,
13783 Output_section::Input_section::relaxed_input_section): New method
13784 definitions.
13785 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
13786 value.
13787 (Output_section::Input_section::u1_): Update comments.
13788 (Output_section::Input_section::u2_): Add new union member poris.
13789 (Output_section::Checkpoint_output_section): New classs definition.
13790 (Output_section::relax_input_section): New method declaration.
13791 (Output_section::checkpoint_): New data member.
13792 (Output_segment): Update comments.
13793 (Output_segment::Output_segment): Un-privatize copy constructor.
13794 (Output_segment::operator=): Un-privatize.
13795 * script-sections.cc (Output_section_element::Input_section_list):
13796 Change element type to Output_section::Simple_input_section.
13797 (Output_section_element_dot_assignment::set_section_addresses):
13798 Register output section data for relaxation clean up.
13799 (Output_data_exression::Output_data_expression): Adjust call to base
13800 constructor to fix data size.
13801 (Output_section_element_data::set_section_addresses): Register
13802 Output_data_expression object for relaxation clean up.
13803 (struct Input_section_info): Replace Relobj pointer and section index
13804 pair with Output_section::Simple_input_section and Convert struct to a
13805 class.
13806 (Input_section_sorter::operator()): Adjust access to
e1df38aa 13807 Input_section_info data member to use accessors.
20e6d0d6
DK
13808 (Output_section_element_input::set_section_addresses): Use layout
13809 parameter. Adjust code to use Output_section::Simple_input_section
13810 and Input_secction_info classes. Register filler for relaxation
13811 clean up.
13812 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
13813 and section index pair with Output_section::Simple_input_section
13814 class. Adjust code accordingly.
13815 (Phdrs_element::release_segment): New method definition.
13816 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
13817 segment list.
13818 (Script_sections::release_segments): New method definition.
13819 * gold/script-sections.h (Script_sections::release_segments): New
13820 method declaration.
13821 * gold/target.h (Target::may_relax, Target::relax,
13822 Target::do_may_relax, Target::do_relax): New method definitions.
13823
5e445df6
ILT
138242009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13825
13826 * arm.cc (has_signed_unsigned_overflow): New function.
13827 (Arm_relocate_functions::abs8): New function.
13828 (Target_arm::Scan::local): Handle R_ARM_ABS8.
13829 (Target_arm::Scan::global): Likewise.
13830 (Target_arm::relocate::relocate): Likewise.
13831 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
13832 Likewise.
13833
8c604651 138342009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
13835
13836 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
13837 * testsuite/Makefile.in: Regenerate.
13838
1e9cc1c2
NC
138392009-09-11 Nick Clifton <nickc@redhat.com>
13840
13841 * po/gold.pot: Updated by the Translation project.
13842
6a89f575
CC
138432009-09-08 Cary Coutant <ccoutant@google.com>
13844
13845 * output.cc (Output_file::open): Add execute permission to empty file.
13846 * testsuite/Makefile.am (permission_test): New test.
13847 * testsuite/Makefile.in: Regenerate.
13848
fdcac5af
ILT
138492009-09-02 Ian Lance Taylor <iant@google.com>
13850
13851 * output.cc (Output_file::resize): Call map_no_anonymous rather
13852 than map.
13853
44453f85
ILT
138542009-09-01 Mikolaj Zalewski <mikolajz@google.com>
13855
13856 * gold.cc: Include "incremental.h".
13857 (queue_initial_tasks): Call Incremental_checker methods.
13858 * incremental.cc: Include "output.h".
13859 (Incremental_checker::can_incrementally_link_output_file): New
13860 method.
13861 * incremental.h (Incremental_checker): New class.
13862
13863 * output.cc (Output_file::open_for_modification): New method.
13864 (Output_file::map_anonymous): Changed return type to bool. Record
13865 map in base_ field.
13866 (Output_file::map_no_anonymous): New method, broken out of map.
13867 (Output_file::map): Use map_no_anonymous and map_anonymous.
13868 * output.h (class Output_file): Update declarations.
13869
293c1386
CC
138702009-08-24 Cary Coutant <ccoutant@google.com>
13871
13872 * options.h (Command_line::Pre_options): New class.
13873 (Command_line::pre_options): New member.
13874 * options.cc (gold::options::ready_to_register): New variable.
13875 (One_option::register_option): Do nothing if not registering options.
13876 Assert if same short option registered twice.
13877 (General_options::General_options): Turn off option registration when
13878 done constructing.
13879 (Command_line::Pre_options::Pre_options): New constructor.
13880
f773f3d2
CC
138812009-08-24 Cary Coutant <ccoutant@google.com>
13882
06a73cfe
CC
13883 * options.h (General_options::no_keep_memory): Remove incorrect
13884 short option.
f773f3d2 13885
a15af8e2
RW
138862009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13887
13888 * Makefile.am (am__skiplex, am__skipyacc): New.
13889 * Makefile.in: Regenerate.
13890
c462b41b
RW
138912009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13892
14ec8efd
RW
13893 * Makefile.am (AM_CPPFLAGS): Renamed from ...
13894 (INCLUDES): ... this.
13895 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
13896 (AM_CPPFLAGS): Renamed from ...
13897 (INCLUDE): ... this.
13898 * Makefile.in, testsuite/Makefile.in: Regenerate.
13899
81ecdfbb
RW
13900 * Makefile.in: Regenerate.
13901 * aclocal.m4: Likewise.
13902 * config.in: Likewise.
13903 * configure: Likewise.
13904 * testsuite/Makefile.in: Likewise.
13905
c462b41b
RW
13906 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
13907 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
13908 * Makefile.in: Regenerate.
13909 * testsuite/Makefile.in: Regenerate.
13910
2da73f13
CC
139112009-08-19 Cary Coutant <ccoutant@google.com>
13912
13913 * resolve.cc (Symbol_table::resolve): Don't complain about defined
13914 symbols in shared libraries overridden by hidden or internal symbols
13915 in the main program.
13916
2db70501
CD
139172009-08-19 Chris Demetriou <cgd@google.com>
13918
13919 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
13920 checking source file names in error messages.
13921
f733487b
DK
139222009-08-18 Doug Kwan <dougkwan@google.com>
13923
13924 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
13925 an elcpp::Ehdr as parameter. Adjust call to set_target.
13926 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
13927 an elfcpp::Ehdr as parameter.
13928 * object.cc (Object::set_target): Remove the version that looks up
13929 a target and sets it.
13930 (Sized_relobj::setup): Take a Target object instead of
13931 an elfcpp::Ehdr as parameter. Adjust call to set_target.
13932 (make_elf_sized_object): Find target and ask target to
13933 make an ELF object.
13934 * object.h: (Object::set_target): Remove the version that looks up
13935 a target and sets it.
13936 (Sized_relobj::setup): Take a Target object instead of
13937 an elfcpp:Ehdr as parameter.
13938 * target.cc: Include dynobj.h.
13939 (Target::do_make_elf_object_implementation): New.
2e702c99 13940 (Target::do_make_elf_object): New.
f733487b
DK
13941 * target.h (Target::make_elf_object): New template declaration.
13942 (Target::do_make_elf_object): New method declarations.
13943 (Target::do_make_elf_object_implementation): New template declaration.
13944
cc70f101
ILT
139452009-08-14 Ian Lance Taylor <iant@google.com>
13946
13947 * gold.h (FUNCTION_NAME): Define.
13948 (gold_unreachable): Use FUNCTION_NAME.
13949
ef5e0cb1
ST
139502009-08-12 Sriraman Tallam <tmsriram@google.com>
13951
13952 * icf.cc (Icf::find_identical_sections): Issue a warning when a
13953 symbol in the --keep-unique list is not found.
13954
48c187ce
ST
139552009-08-12 Sriraman Tallam <tmsriram@google.com>
13956
13957 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
13958 been maked as --keep-unique.
13959 (Icf::unfold_section): New function.
13960 * icf.h (Icf::unfold_section): New function.
13961 * options.h (General_options::keep_unique): New option.
13962 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
13963 * testsuite/Makefile.in: Regenerate.
13964 * testsuite/icf_keep_unique_test.sh: New file.
13965 * testsuite/icf_keep_unique_test.cc: New file.
13966
645afe0c
CC
139672009-08-12 Cary Coutant <ccoutant@google.com>
13968
13969 PR 10471
13970 * resolve.cc (Symbol_table::resolve): Check for references from
13971 dynamic objects to hidden and internal symbols.
13972 * testsuite/Makefile.am (hidden_test.sh): New test.
13973 * testsuite/Makefile.in: Regenerate.
13974 * testsuite/hidden_test.sh: New script.
13975 * testsuite/hidden_test_1.c: New test source.
13976 * testsuite/hidden_test_main.c: New test source.
13977
11af873f
DK
139782009-08-11 Doug Kwan <dougkwan@google.com>
13979
13980 * arm.cc: Update comments.
13981 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
13982 segment to locate the .ARM.exidx section if present.
13983
b9f7d72d
DK
139842009-08-09 Doug Kwan <dougkwan@google.com>
13985
13986 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
13987 patch.
13988
ddd3c53c
ST
139892009-08-07 Sriraman Tallam <tmsriram@google.com>
13990 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
13991 compiler warnings.
13992
27721062
ST
139932009-08-06 Sriraman Tallam <tmsriram@google.com>
13994
13995 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
13996 valid tls_segment only for non-debug-section relocations.
13997 * testsuite/Makefile.am: Add gc_tls_test.
13998 * testsuite/Makefile.in: Regenerate.
13999 * testsuite/gc_tls_test.cc: New file.
14000 * testsuite/gc_tls_test.sh: New file.
14001
ef15dade 140022009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 14003
ef15dade
ST
14004 * icf.cc: New file.
14005 * icf.h: New file.
14006 * Makefile.am (CCFILES): Add icf.cc.
14007 (HFILES): Add icf.h
14008 * Makefile.in: Regenerate.
14009 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
14010 * gc.h (gc_process_relocs): Populate lists used by icf to contain
14011 section, symbol and addend information for the relocs.
14012 * gold.cc (queue_middle_tasks): Call identical code folding.
14013 * gold.h: Add defines for multimap.
14014 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
14015 to the call of finalize_local_symbols.
14016 * main.cc (main): Create object of class Icf.
14017 * object.cc (Sized_relobj::do_layout): Allow this function to be
14018 called twice during icf.
14019 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
14020 to sections marked as identical by icf.
14021 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
14022 when available.
14023 (Sized_relobj::do_section_entsize): New function.
14024 * object.h (Object::section_entsize): New function.
14025 (Object::do_section_entsize): New pure virtual function.
14026 (Relobj::finalize_local_symbols): Add new parameter.
14027 (Relobj::do_section_entsize): New function.
14028 * options.h (General_options::icf): New option.
14029 (General_options::icf_iterations): New option.
14030 (General_options::print_icf_sections): New option.
14031 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
14032 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
14033 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
14034 icf.
14035 * symtab.cc (Symbol_table::is_section_folded): New function.
14036 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
14037 to sections marked as identical by icf.
14038 * symtab.h (Symbol_table::set_icf): New function.
14039 (Symbol_table::icf): New function.
14040 (Symbol_table::is_section_folded): New function.
14041 (Symbol_table::icf_): New data member.
14042 * target-reloc.h (relocate_section): Ignore sections folded by icf.
14043 * testsuite/Makefile.am: Add commands to build icf_test.
14044 * testsuite/Makefile.in: Regenerate.
14045 * testsuite/icf_test.sh: New file.
14046 * testsuite/icf_test.cc: New file.
14047
c3b65ac4
CD
140482009-07-24 Chris Demetriou <cgd@google.com>
14049
14050 * layout.cc (is_compressible_debug_section): Fix incorrect
14051 comment about compressed section names.
14052
1caf2c51
ILT
140532009-07-20 Ian Lance Taylor <ian@airs.com>
14054
14055 PR 10419
14056 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
14057
1ef4d87f
ILT
140582009-07-16 Ian Lance Taylor <iant@google.com>
14059
14060 PR 10400
14061 * layout.h: #include <map>.
14062 (class Kept_section): Change from struct to class. Add accessors
14063 and setters. Add section size to Comdat_group mapping. Change
14064 Comdat_group to std::map. Add is_comdat_ field. Add
14065 linkonce_size field in union.
14066 (class Layout): Update declaration of find_or_add_kept_section.
14067 Don't declare find_kept_object.
14068 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
14069 parameter. Add object, shndx, is_comdat, and is_group_name
14070 parameters. Change all callers. Adjust for new Kept_section.
14071 (Layout::find_kept_object): Remove.
14072 * object.cc (Sized_relobj::include_section_group): Update use of
14073 Kept_section. Rename secnum to shndx. Only record
14074 Kept_comdat_section if sections are the same size.
14075 (Sized_relobj::include_linkonce_section): Update use of
14076 Kept_section. Only record Kept_comdat_section if sections are the
14077 same size. Set size of linkonce section.
14078 (Sized_relobj::map_to_kept_section): Update call to
14079 get_kept_comdat_section.
14080 * object.h (class Sized_relobj): Rename fields in
14081 Kept_comdat_section to drop trailing underscores; change object
14082 field to Relobj*. Change Kept_comdat_section_table to store
14083 struct rather than pointer.
14084 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
14085 Add kept_object and kept_shndx parameters. Change all callers.
14086 (Sized_relobj::get_kept_comdat_section): Change return type to
14087 bool. Add kept_object and kept_shndx parameters. Change all
14088 callers.
14089 * plugin.cc (Pluginobj::include_comdat_group): Update call to
14090 Layout::find_or_add_kept_section.
14091
37c3b7b0
ILT
140922009-07-09 Ian Lance Taylor <iant@google.com>
14093
14094 * merge.cc (Object_merge_map::initialize_input_to_output_map):
14095 Reserve space in the hash table.
14096
98fa85cb
ILT
140972009-07-06 Mikolaj Zalewski <mikolajz@google.com>
14098
14099 * fileread.cc (File_read::get_mtime): New method.
14100 * fileread.h (Timespec): New structure.
14101 (File_read::get_mtime): New method.
14102 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
14103 Renamed from timestamp_nsec.
14104 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
14105 Elf_Xword.
e1df38aa 14106 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 14107 timestamp_nsec.
e1df38aa 14108 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
14109 (Incremental_inputs::report_obejct): Save mtime; style fix.
14110 (Incremental_inputs::report_script): Save mtime; style fix.
14111 (Incremental_inputs::finalize_inputs): Style fix.
14112 (Incremental_inputs::finalize): Style fix.
14113 (Incremental_inputs::create_input_section_data): Store inputs
14114 mtime.
14115 * incremental.h (Incremental_inputs::report_script): Add mtime
14116 argument.
14117 (Incremental_inputs::Input_info::Input_info): Intialize only one
14118 union member.
14119 (Incremental_inputs::Input_info::archive): Move to nameless
14120 union.
14121 (Incremental_inputs::Input_info::obejct): Move to nameless union.
14122 (Incremental_inputs::Input_info::script): Move to nameless union.
14123 (Incremental_inputs::mtime): New field.
14124 * script.cc (read_input_script): Pass file mtime to
14125 Incremental_input.
14126 * script.h (Script_info::inputs): Style fix.
14127
c9d70757
ILT
141282009-07-01 Ian Lance Taylor <ian@airs.com>
14129
14130 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
14131 instead of 32.
14132
9c547ec3
ILT
141332009-06-24 Ian Lance Taylor <iant@google.com>
14134
14135 PR 10156
14136 * layout.cc (Layout::choose_output_section): If we find an
14137 existing section, update the flags.
14138 (Layout::create_notes): New function, broken out of
14139 Layout::finalize.
14140 (Layout::finalize): Don't create note sections.
14141 (Layout::create_note): Don't crash if linker script discards
14142 section.
14143 (Layout::create_gold_note): Likewise.
14144 (Layout::create_build_id): Likewise. Don't set
14145 after_input_sections on the section.
14146 (Layout::create_executable_stack_info): Remove target parameter.
14147 Change caller.
14148 * layout.h (class Layout): Declare create_notes. Update
14149 declaration of create_executable_stack_info.
14150 * gold.cc (queue_middle_tasks): Call create_notes.
14151 * output.cc (Output_section::update_flags_for_input_section): Move
14152 here from output.h. If SHF_ALLOC flag is newly set, mark address
14153 invalid.
14154 * output.h (Output_data::mark_address_invalid): New function.
14155 (class Output_section): Only declare, not define,
14156 update_flags_for_input_section. Remove set_flags.
14157
55458500
ILT
141582009-06-24 Ian Lance Taylor <iant@google.com>
14159
14160 * script-sections.cc (Output_section_definition::
14161 set_section_addresses): Rename shadowing local load_address to
14162 laddr.
14163
1307d6cd
ILT
141642009-06-24 Ian Lance Taylor <iant@google.com>
14165
14166 PR 10244
14167 * reloc.cc (relocate_sections): Skip empty relocation sections.
14168
ec3f783e
ILT
141692009-06-23 Ian Lance Taylor <iant@google.com>
14170
14171 PR 10156
14172 * layout.cc (Layout::create_note): Use choose_output_section
14173 rather than make_output_section.
14174
459c9f1c
ILT
141752009-06-23 Ian Lance Taylor <iant@google.com>
14176
14177 PR 10237
14178 * options.cc (General_options::parse_V): Set printed_version_.
14179 (General_options::General_options): Initialize printed_version_.
14180 * options.h (class General_options): Add printed_version_ field.
14181 * gold.cc (queue_initial_tasks): If there are no input files,
14182 don't give a fatal error if we printed the version information.
14183 (queue_middle_tasks): If using -r with a shared object, give a
14184 fatal error rather than an ordinary error.
14185
1518dc8f
ILT
141862009-06-23 Ian Lance Taylor <iant@google.com>
14187
14188 PR 10219
14189 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
14190 (Layout::make_output_section): Set have_stabstr_section_ if we see
14191 a .stab*str section.
14192 (Layout::finalize): Call link_stabs_sections.
14193 (Layout::link_stabs_sections): New file.
14194 * layout.h (class Layout): Add have_stabstr_section_ field.
14195 Declare link_stabs_sections.
14196
3d857b98
DK
141972009-06-23 Doug Kwan <dougkwan@google.com>
14198
14199 * Makefile.am (libgold_a_LIBADD): New.
14200 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 14201 * Makefile.in: Regenerate.
3d857b98
DK
14202 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
14203 * configure: Regenerate.
14204 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
14205 * fileread.cc: Include sys/state.h
14206 * gold.h: Declare memmem and strndup if found missing.
14207 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
14208
0639a6f6
ILT
142092009-06-23 Ian Lance Taylor <iant@google.com>
14210
14211 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
14212 * configure: Rebuild.
14213
8d63875c
ILT
142142009-06-23 Ian Lance Taylor <iant@google.com>
14215
14216 PR 10147
14217 * object.cc (Object::section_contents): Don't try to get a view if
14218 the section has length zero.
14219 (Object::handle_gnu_warning_section): If the section is empty, use
14220 the name of the section as the warning.
14221
f7c8a183
ILT
142222009-06-23 Ian Lance Taylor <iant@google.com>
14223
14224 PR 10133
14225 * stringpool.h (class Stringpool_template): Add optimize_ field.
14226 (Stringpool_template::set_optimize): New function.
14227 * stringpool.cc (Stringpool_template::Stringpool_template):
14228 Initialize optimize_ field.
14229 (Stringpool_template::set_string_offsets): Test local optimize
14230 fild rather than parameter.
14231 * layout.cc (Layout::Layout): Call set_optimize on the section
14232 name stringpool.
14233
e6a307ba
ILT
142342009-06-22 Ian Lance Taylor <iant@google.com>
14235
14236 PR 10030
14237 * yyscript.y: Parse TARGET.
14238 * script.cc (script_set_target): New function.
14239 * script-c.h (script_set_target): Declare.
14240 * options.cc (General_options::string_to_object_format): Rename
14241 from string_to_object_format in anonymous namespace. Change
14242 callers.
14243 * options.h (class General_options): Declare
14244 string_to_object_format.
14245
3ee173de
ILT
142462009-06-22 Ian Lance Taylor <iant@google.com>
14247
14248 * script-sections.cc (Script_sections::create_segments): Don't put
14249 program headers in a PT_LOAD segment if -n or -N.
14250
142512009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
14252
14253 PR 10141
14254 * options.h (class General_options): Add -z lazy and -z now. Sort
14255 -z options into alphabetical order.
14256 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
14257
cd6739a1 142582009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
14259
14260 * layout.cc (Layout::make_output_section): Call
14261 Target::new_output_section.
14262 (Layout::attach_allocated_section_to_segment): Put large section
14263 sections in a separate load segment with the large segment flag
14264 set.
14265 (Layout::segment_precedes): Sort large data segments after other
14266 load segments.
14267 (align_file_offset): New static function.
14268 (Layout::set_segment_offsets): Use align_file_offset.
14269 * output.h (class Output_section): Add is_small_section_ and
14270 is_large_section_ fields.
14271 (Output_section::is_small_section): New function.
14272 (Output_section::set_is_small_section): New function.
14273 (Output_section::is_large_section): New function.
14274 (Output_section::set_is_large_section): New function.
14275 (Output_section::is_large_data_section): New function.
14276 (class Output_segment): Add is_large_data_segment_ field.
14277 (Output_segment::is_large_data_segment): New function.
14278 (Output_segment::set_is_large_data_segment): New function.
14279 * output.cc (Output_section::Output_section): Initialize new
14280 fields.
14281 (Output_segment::Output_segment): Likewise.
14282 (Output_segment::add_output_section): Add assertion that large
14283 data sections always go in large data segments. Force small data
14284 sections to the end of the list of data sections. Force small BSS
14285 sections to the start of the list of BSS sections. For large BSS
14286 sections to the end of the list of BSS sections.
14287 * symtab.h (class Symbol): Declare is_common_shndx.
14288 (Symbol::is_defined): Check Symbol::is_common_shndx.
14289 (Symbol::is_common): Likewise.
14290 (class Symbol_table): Define enum Commons_section_type. Update
14291 declarations. Add small_commons_ and large_commons_ fields.
14292 * symtab.cc (Symbol::is_common_shndx): New function.
14293 (Symbol_table::Symbol_table): Initialize new fields.
14294 (Symbol_table::add_from_object): Put small and large common
14295 symbols in the right list.
14296 (Symbol_table::sized_finalized_symbol): Check
14297 Symbol::is_common_shndx.
14298 (Symbol_table::sized_write_globals): Likewise.
14299 * common.cc (Symbol_table::do_allocate_commons): Allocate new
14300 common symbol lists. Don't call do_allocate_commons_list if the
14301 list is empty.
14302 (Symbol_table::do_allocate_commons_list): Remove is_tls
14303 parameter. Add comons_section_type parameter. Change all
14304 callers. Handle small and large common symbols.
14305 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
14306 Symbol::is_common_shndx.
14307 * resolve.cc (symbol_to_bits): Likewise.
14308 * target.h (Target::small_common_shndx): New function.
14309 (Target::small_common_section_flags): New function.
14310 (Target::large_common_shndx): New function.
14311 (Target::large_common_section_flags): New function.
14312 (Target::new_output_section): New function.
14313 (Target::Target_info): Add small_common_shndx, large_common_shndx,
14314 small_common_section_flags, and large_common_section_flags
14315 fields.
14316 (Target::do_new_output_section): New virtual function.
14317 * arm.cc (Target_arm::arm_info): Initialize new fields.
14318 * i386.cc (Target_i386::i386_info): Likewise.
14319 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
14320 Likewise.
14321 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
14322 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
14323 (Target_x86_64::do_new_output_section): New function.
14324 * configure.ac: Define conditional MCMODEL_MEDIUM.
14325 * testsuite/Makefile.am (check_PROGRAMS): Add large.
14326 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
14327 (large_LDFLAGS): Define.
14328 * testsuite/large.c: New file.
14329 * testsuite/testfile.cc (Target_test::test_target_info):
14330 Initialize new fields.
14331 * configure, testsuite/Makefile.in: Rebuild.
14332
bb04269c
DK
143332009-06-05 Doug Kwan <dougkwan@google.com>
14334
14335 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 14336 * Makefile.in: Regenerate.
bb04269c
DK
14337 * i386.cc (class Target_i386): Define new virtual method to
14338 override do_is_local_label_name in parent.
14339 * object.cc (Sized_relobj::do_count_local_symbols): Discard
14340 local symbols if --discard-locals or -X is given.
14341 * options.h (class General_options): Declare new options
14342 '--discard-locals' and '-X' for discarding locals.
14343 * target.h (class Target): Define new methods is_local_label_name.
14344 Declare new virtual method do_is_local_label_name.
14345 * target.cc: New file.
14346 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
14347 (check_SCRIPTS): Add discard_locals_test.sh.
14348 (check_DATA): Add discard_local_tests.syms.
14349 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
14350 (discard_local_tests.syms, discard_locals_test.o): New make rules.
14351 * testsuite/Makefile.in: Regenerate.
14352 * testsuite/discard_locals_test.c: New file.
14353 * testsuite/discard_locals_test.sh: Same.
14354
805bb01c
DK
143552009-06-05 Doug Kwan <dougkwan@google.com>
14356
14357 * object.cc (Sized_relobj::Sized_relobj): Initialize
14358 discarded_eh_frame_shndx_ to -1U.
14359 (Sized_relobj::do_layout): Record index of a discard .eh_frame
14360 section.
14361 (Sized_relobj::do_count_local_symbols): Skip local symbols in
14362 a discarded .eh_frame section.
14363 (Sized_relobj::do_finalize_local_symbols): Ditto.
14364 * object.h (class Sized_relobj): Declare new member
14365 discarded_eh_frame_shndx_.
14366 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
14367 (local_labels_test.o, local_labels_test): New rules.
14368 * testsuite/Makefile.in: Regenerate.
14369
1dcd334d
DK
143702009-06-04 Doug Kwan <dougkwan@google.com>
14371
14372 * layout.cc (Layout::section_name_mapping): Add mapping for
14373 special ARM sections.
14374
96d49306
DK
143752009-06-03 Doug Kwan <dougkwan@google.com>
14376
14377 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
14378 (utils::has_overflow): Same.
14379
dff16297
ILT
143802009-06-03 Ian Lance Taylor <iant@google.com>
14381
14382 * layout.cc (Layout::section_name_mapping): New array, replacing
14383 Layout::linkonce_mapping.
14384 (Layout::section_name_mapping_count): New variable, replacing
14385 Layout::linkonce_mapping_count.
14386 (Layout::linkonce_output_name): Remove.
14387 (Layout::output_section_name): Rewrite.
14388 * layout.h (class Layout): Rename Linkonce_mapping to
14389 Section_name_mapping, linkonce_mapping to section_name_mapping,
14390 linkonce_mapping_count to section_name_mapping_count. Don't
14391 declare linkonce_output_name.
14392
c121c671
DK
143932009-06-03 Doug Kwan <dougkwan@google.com>
14394
14395 * gold/arm.cc (namespace utils): New.
14396 (Target_arm::reloc_is_non_pic): Define new method.
14397 (class Arm_relocate_functions): New.
14398 (Target_arm::Relocate::relocate): Handle relocation types used by
14399 Android.
14400
07800fab
ILT
144012009-06-03 Ian Lance Taylor <iant@google.com>
14402
14403 * arm.cc (Target_arm::scan::global): Use || instead of |.
14404
c121c671
DK
144052009-06-02 Doug Kwan <dougkwan@google.com>
14406
14407 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
14408 issued_non_pic_error_.
14409 (class Target_arm::Scan): Declare new method check_non_pic.
14410 Define new method symbol_needs_plt_entry.
14411 Declare new data member issued_non_pic_error_.
14412 (class Target_arm::Relocate): Declare new method
14413 should_apply_static_reloc.
14414 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
14415 (Target_arm::Scan::check_non_pic): Define new method.
14416 (Target_arm::Scan::local): Handle a small subset of reloc types used
14417 by Android.
14418 (Target_arm::Scan::local): Same.
14419 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
14420
b19b0c6d
ILT
144212009-05-31 Mikolaj Zalewski <mikolajz@google.com>
14422
14423 * incremental.cc (Incremental_inputs::report_command_line): Filter
14424 out --incremental-* options.
14425
94cdfcff
DK
144262009-05-29 Doug Kwan <dougkwan@google.com>
14427
14428 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
14429 template class.
14430 (class Target_arm): Update comment.
14431 (Target_arm::Target_arm): Initialize new data members GOT_,
14432 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
14433 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
14434 and Target_arm::rel_dyn_section.
14435 Declare new_enum Target_arm::Got_type.
14436 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
14437 and DYNBSS_.
14438 Update commments for member do_dynsym_value.
14439 (Target_arm::got_size, Target_arm::plt_section,
14440 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
14441 new methods inside class defintion.
14442 (Target_arm::got_section): Define new method.
14443 (Target_arm::rel_dyn_section): Same.
14444 (Output_data_plt_arm): New template class.
14445 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
14446 (Output_data_plt_arm:do_adjust_output_section): Define new method.
14447 (Output_data_plt_arm::add_entry): Same.
14448 (Output_data_plt_arm::first_plt_entry): Define new
14449 static data member for PLT instruction template.
14450 (Output_data_plt_arm::plt_entry): Same.
14451 (Output_data_plt_arm::do_write): Define new method.
14452 (Target_arm::make_plt_entry): Same.
14453 (Target_arm::do_finalize_sections): Same.
14454 (Target_arm::do_dynsym_value): Same.
14455
4a657b0d
DK
144562009-05-28 Doug Kwan <dougkwan@google.com>
14457
14458 * Makefile.am (TARGETSOURCES): Add arm.cc.
14459 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
14460 * Makefile.in: Regenerate.
14461 * arm.cc: New file.
14462 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
14463
e7ae8c36
DK
144642009-05-26 Doug Kwan <dougkwan@google.com>
14465
14466 * options.cc (General_options::parse_exclude_libs). Fix a comment.
14467 (General_options::check_excluded_libs): Strip off directories in
14468 archive name before matching like GNU ld does.
14469 * testsuite/Makefile.am (MOSTLYCLEANFILES,
14470 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
14471 (exclude_libs_test_LDFLAGS): Add linker option
14472 -Wl,--exclude-libs,libexclude_libs_test_3
14473 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
14474 an explicit archive without using -l.
14475 (alt/libexclude_libs_test_3.a): New make rule.
14476 * testsuite/Makefile.in: Regenerate.
14477 * testsuite/exclude_libs_test.c : Declare lib3_default().
14478 (main): Call it.
14479 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
14480 * exclude_libs_test_3.c: New file.
14481
f12e7348
NC
144822009-05-26 Nick Clifton <nickc@redhat.com>
14483
14484 * po/id.po: New Indonesian translation.
14485 * po/gold.pot: Updated template file.
14486
4daadc0d
ST
144872009-05-22 Sriraman Tallam <tmsriram@google.com>
14488
e1df38aa 14489 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
14490 gc_comdat_test files. Add -Wl,--gc-sections to build
14491 gc_comdat_test.
14492 * testsuite/Makefile.in: Regenerate.
14493 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
14494
531813ad
ST
144952009-05-21 Sriraman Tallam <tmsriram@google.com>
14496
14497 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
14498 kept comdat section was garbage collected.
14499 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
14500 * testsuite/Makefile.in: Regenerate.
14501 * testsuite/gc_comdat_test.sh: New file.
14502 * testsuite/gc_comdat_test_1.cc: New file.
14503 * testsuite/gc_comdat_test_2.cc: New file.
14504
65514900
CC
145052009-05-19 Doug Kwan <dougkwan@google.com>
14506
14507 * archive.cc (Archive::Archive): Move constructor from archive.h
14508 to here. Initialize no_export_.
14509 (Archive::get_elf_object_for_member): Set no_export flag of object.
14510 * archive.h (Archive::Archive): Move constructor body to
14511 archive.cc.
14512 (Archive::no_export): New method.
14513 (Archive::no_export_): New field.
14514 * object.h (Object::Object): Initialize no_export_ to false.
14515 (Object::no_export, Object::set_no_export): New methods.
14516 (Object::no_export_): New field.
14517 * options.cc (General_options::parse_exclude_libs): New method.
14518 (General_options::check_excluded_libs) Same.
14519 * options.h (exclude_libs): New option.
14520 (General_options::check_excluded_libs): New method declaration.
14521 (General_options::excluded_libs_): New field.
14522 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
14523 default or protected visibility if an object has no-export flag set.
14524 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
14525 (check_SCRIPTS): Add exclude_libs_test.sh.
14526 (check_DATA): Add exclude_libs_test.syms.
14527 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
14528 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
14529 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
14530 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
14531 (exclude_libs_test.syms, libexclude_libs_test_1.a,
14532 libexclude_libs_test_2.a): New rules.
14533 * testsuite/Makefile.in: Regenerate.
14534 * testsuite/exclude_libs_test.c: New file.
14535 * testsuite/exclude_libs_test.sh: Ditto.
14536 * testsuite/exclude_libs_test_1.c: Ditto.
14537 * testsuite/exclude_libs_test_2.c: Ditto.
14538
1b77ea50
ILT
145392009-05-15 Ian Lance Taylor <iant@google.com>
14540
14541 * configure.ac: Check for declarations for cases where libiberty.h
14542 checks HAVE_DECL_xxx.
14543 * configure, config.in: Rebuild.
14544
072fe7ce
ILT
145452009-05-15 Mikolaj Zalewski <mikolajz@google.com>
14546
14547 * gold.h (Incremental_argument_list): Remove (invalid) forward
14548 declaration.
14549 * incremental.cc (Incremental_inputs::report_achive): New method.
14550 (Incremental_inputs::report_object): New method.
14551 (Incremental_inputs::report_script): New method.
14552 (Incremental_inputs::finalize_inputs): New method.
14553 (Incremental_inputs::finalize): Call finalize_inputs().
14554 (Incremental_inputs::sized_create_incremental_inputs_section_data):
14555 Create inputs entries.
14556 * incremental.h (Incremental_input_type): New enum.
14557 (Incremental_inputs::Incremental_input): Initialize new fields.
14558 (Incremental_inputs::report_inputs): New method.
14559 (Incremental_inputs::report_achive): New method.
14560 (Incremental_inputs::report_object): New method.
14561 (Incremental_inputs::report_script): New method.
14562 (Incremental_inputs::finalize_inputs): New method.
14563 (Incremental_inputs::Input_info): New struct.
14564 (Incremental_inputs::Input_info_map): New typedef.
14565 (Incremental_inputs::lock_): New field.
14566 (Incremental_inputs::Inputs_): New field.
14567 (Incremental_inputs::Inputs_map): New field.
14568 * main.cc (main): Call Incremental_input::report_inputs.
14569 * options.h (Input_argument_list): Typedef moved from
14570 Input_arguments.
14571 (Input_file_group::Files): Remove, use ::Input_argument_list.
14572 (Input_file_group::Input_argument_list): Remove, use
14573 ::Input_argument_list.
14574 * plugin.cc (Plugin_manager::add_input_file): Add error in
14575 incremental build.
14576 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
14577 functions.
14578 * script.cc (read_input_script): Call
14579 Incremental_input::report_script.
14580 * script.h (Script_info): New class.
14581
b0481b0b
ILT
145822009-04-27 Ian Lance Taylor <iant@google.com>
14583
14584 * x86_64.cc (do_adjust_output_section): Set entsize to
14585 plt_entry_size.
14586
b22a5a41 145872009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
14588
14589 * output.cc (Output_file::close): After short writes, continue
14590 writing from the correct offset in the buffer being written.
14591
40fde488
CD
145922009-04-23 Chris Demetriou <cgd@google.com>
14593
14594 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
14595 * configure: Regenerate.
14596 * config.in: Regenerate.
14597 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
14598 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
14599
3ce2c28e
ILT
146002009-04-21 Mikolaj Zalewski <mikolajz@google.com>
14601
14602 * incremental.cc (Incremental_inputs_header_data): Renamed from
14603 Incremental_input_header_data.
14604 (Incremental_inputs_header_data::data_size): New field.
14605 (Incremental_inputs_header_data::put_input_file_count): Renamed
14606 from input_file_count.
14607 (Incremental_inputs_header_data::put_command_line_offset): Renamed
14608 from command_line_offset.
14609 (Incremental_inputs_header_data::put_reserved): Renamed from
14610 put_reserved.
14611 (Incremental_inputs_entry_data): Renamed from
14612 Incremental_input_entry_data.
14613 (Incremental_inputs_entry_data::data_size): New field.
14614 (Incremental_inputs::report_command_line): New method.
14615 (Incremental_inputs::finalize): New method.
14616 (Incremental_inputs::create_incremental_inputs_data): New method.
14617 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
14618 * incremental.h: New file.
14619 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 14620 (Layout::finalize): Create incremental inputs section in
3ce2c28e 14621 incremental builds.
703d02da 14622 (Layout::create_incremental_info_sections): New method.
3ce2c28e 14623 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
14624 (Layout::create_incremental_info_sections): New method.
14625 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
14626 * main.cc (main): Notify Incremental_input of the command line.
14627
e55bde5e
ILT
146282009-04-01 Ian Lance Taylor <iant@google.com>
14629 Mikolaj Zalewski <mikolajz@google.com>
14630
14631 * gold.h (reserve_unordered_map): Define, three versions, one for
14632 each version of Unordered_map.
14633 * layout.cc (Layout::Layout): Remove options parameter. Add
14634 number_of_input_files parameter. Don't initialize options_.
14635 Initialize number_of_input_files_ and resized_signatures_. Move
14636 sections_are_attached_.
14637 (Layout::layout_group): Reserve space for group_signatures_.
14638 (Layout::find_or_add_kept_section): Change name parameter to be a
14639 reference. Resize signatures_ map when it gets large enough.
14640 (Layout::layout_eh_frame): Use parameters->options() instead of
14641 this->options_.
14642 (Layout::make_output_section): Likewise.
14643 (Layout::attach_allocated_section_to_segment): Likewise.
14644 (Layout::finalize, Layout::create_executable_stack): Likewise.
14645 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
14646 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
14647 * layout.h (class Layout): Update declarations. Remove options_
14648 field. Add number_of_input_files_ and resized_signatures_
14649 fields. Move sections_are_attached_ field.
14650 * main.cc (main): Pass number of input files to Layout
14651 constructor. Don't pass options.
14652
154b857c
ILT
146532009-03-30 Ian Lance Taylor <iant@google.com>
14654
14655 * ffsll.c (ffsll): Correct implementation.
14656
2f35ab9b
ILT
146572009-03-27 Ian Lance Taylor <iant@google.com>
14658
fd03461a
ILT
14659 * ffsll.c: New file.
14660 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
14661 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
14662 * ftruncate.c (ftruncate): Declare before definition.
14663 * mremap.c (mremap): Likewise.
14664 * pread.c (pread): Likewise.
14665 * configure, Makefile.in, config.in: Rebuild.
14666
2f35ab9b
ILT
14667 * mremap.c: New file.
14668 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
14669 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
14670 (mremap): Declare if HAVE_MREMAP is not defined.
14671 * configure, Makefile.in, config.in: Rebuild.
14672
33aea2fd
CC
146732009-03-27 Cary Coutant <ccoutant@google.com>
14674
14675 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
14676 position independent.
14677 * sparc.cc (Target_sparc::check_non_pic): Likewise.
14678 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
14679
6d479619
CC
146802009-03-24 Cary Coutant <ccoutant@google.com>
14681
14682 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
14683 an executable.
14684 (needs_dynamic_reloc): Likewise.
14685
afc06bb8
ILT
146862009-03-24 Ian Lance Taylor <iant@google.com>
14687
14688 * yyscript.y (file_cmd): Recognize EXTERN.
14689 (extern_name_list, extern_name_list_body): New nonterminals.
14690 * script.cc (script_add_extern): Define.
14691 * script-c.h (script_add_extern): Declare.
14692
f6060a4d
ILT
146932009-03-24 Rafael Avila de Espindola <espindola@google.com>
14694
14695 * object.cc (is_elf_object): Define.
14696 * object.h (is_elf_object): Declare.
14697 * archive.cc (Archive::get_elf_object_for_member): Call
14698 is_elf_object.
33aea2fd 14699 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 14700
26736d8e
ILT
147012009-03-24 Elliott Hughes <enh@google.com>
14702
14703 * output.cc (Output_file::map_anonymous): Define.
14704 (Output_file::map): Use map_anonymous. If the regular mmap fails,
14705 try an anonymous one. Report the size if the mmap fails.
14706 * output.h (class Output_file): Declare map_anonymous.
14707
22fd9730
ILT
147082009-03-24 Ian Lance Taylor <iant@google.com>
14709
14710 * target-select.cc (instantiate_target): Don't acquire the lock if
14711 the instantiated_target_ field has already been set.
14712
cb010894
ILT
147132009-03-23 Ian Lance Taylor <iant@google.com>
14714
7f055c20
ILT
14715 * gold-threads.h (class Initialize_lock): Define.
14716 * gold-threads.cc (class Initialize_lock_once): Define.
14717 (initialize_lock_control): New static variable.
14718 (initialize_lock_pointer): New static variable.
14719 (initialize_lock_once): New static function.
14720 (Initialize_lock::Initialize_lock): Define.
14721 (Initialize_lock::initialize): Define.
14722 * target-select.h: Include "gold-threads.h".
14723 (class Target_selector): Add lock_ and initialize_lock_ fields.
14724 Don't define instantiate_target, just declare it.
14725 * target-select.cc (Target_selector::Target_selector): Initialize
14726 new fields.
14727 (Target_selector::instantiate_target): Define.
14728 * descriptors.h: Include "gold-threads.h".
14729 (class Descriptors): Add initialize_lock_ field.
14730 * descriptors.cc (Descriptors::Descriptors): Initialize new
14731 field.
14732 (Descriptors::open): Use initialize_lock_ field
14733 * errors.h (class Errors): Add initialize_lock_ field.
14734 * errors.cc (Errors::Errors): Initialize new field.
14735 (Errors::initialize_lock): Use initialize_lock_ field.
14736 * powerpc.cc (class Target_selector_powerpc): Remove
14737 instantiated_target_ field. In do_recognize call
14738 instantiate_target rather than do_instantiate_target. In
14739 do_instantiate_target just allocate a new target.
14740 * sparc.cc (class Target_selector_sparc): Likewise.
14741
36959681
ILT
14742 * freebsd.h: New file.
14743 * i386.cc: Include "freebsd.h".
14744 (Target_i386): Derive from Target_freebsd rather than
14745 Sized_target.
14746 (Target_selector_i386): Derive from Target_selector_freebsd rather
14747 than Target_selector.
14748 * x86_64.cc: Include "freebsd.h".
14749 (Target_x86_64): Derive from Target_freebsd rather than
14750 Sized_target.
14751 (Target_selector_x86_64): Derive from Target_selector_freebsd
14752 rather than Target_selector.
14753 * target.h (class Target): Add adjust_elf_header and
14754 do_adjust_elf_header.
14755 * output.cc (Output_file_header:: do_sized_write): Call target
14756 adjust_elf_header routine.
14757 * configure.tgt: Set targ_osabi.
14758 * configure.ac: Define GOLD_DEFAULT_OSABI.
14759 * parameters.cc (Parameters::default_target): Pass
14760 GOLD_DEFAULT_OSABI to select_target.
14761 * target-select.h (class Target_selector): Make instantiate_target
14762 protected rather than private.
14763 * Makefile.am (HFILES): Add freebsd.h.
14764 * configure, Makefile.in, config.in: Rebuild.
14765
cb010894
ILT
14766 * merge.cc (do_add_input_section): Correct pend value. Change
14767 message about last entry not being null terminated from error to
14768 warning.
14769
0e879927
ILT
147702009-03-20 Mikolaj Zalewski <mikolajz@google.com>
14771
14772 * incremental.cc: New file.
14773 * Makefile.am (CCFILES): Add incremental.cc.
14774 * Makefile.in: Rebuild.
14775
41105937
PP
147762009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
14777
14778 * layout.cc (Layout::output_section_name): Preserve names
14779 of '.note.' sections.
e1df38aa 14780
60439920
ILT
147812009-03-19 Ian Lance Taylor <iant@google.com>
14782
14783 * descriptors.cc (Descriptors::open): Check that the options are
14784 valid before using them.
14785
0d371ad3
ILT
147862009-03-18 Ian Lance Taylor <iant@google.com>
14787
14788 * script-sections.h: Include <list>.
14789 (class Script_sections): Change Sections_elements from std::vector
14790 to std::list. Typedef public Elements_iterator. Add
14791 orphan_section_placement_, data_segment_align_start_, and
14792 saw_data_segment_align_ fields. Remove data_segment_align_index_
14793 field.
14794 * script-sections.cc (class Orphan_section_placement): New class.
14795 (class Sections_element): Add virtual functions is_relro and
14796 orphan_section_init. Remove virtual function place_orphan_here.
14797 (class Output_section_definition): Add is_relro and
14798 orphan_section_init. Remove place_orphan_here.
14799 (class Orphan_output_section): Likewise.
14800 (Script_sections::Script_sections): Update for field changes.
14801 (Script_sections::data_segment_align): Set saw_data_segment_align_
14802 and data_segment_align_start_, not data_segment_align_index.
14803 (Script_sections::data_segment_relro_end): Check
14804 saw_data_segment_align_. Use data_segment_align_start_ rather
14805 than data_segment_align_index_.
14806 (Script_sections::place_orphan): Rewrite to use
14807 Orphan_section_placement.
14808
9201d894
ILT
148092009-03-17 Ian Lance Taylor <iant@google.com>
14810
9c5b8369
ILT
14811 * archive.cc (Archive::add_symbols): Check for a version attached
14812 to the symbol name in the archive map.
14813 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
14814 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
14815 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
14816 (ver_test_11.a): New target.
14817 * testsuite/Makefile.in: Rebuild.
14818
9201d894
ILT
14819 * configure.ac: Check for chsize and posix_fallocate. Replace
14820 ftruncate.
14821 * ftruncate.c: New file, from gnulib.
14822 * output.cc (posix_fallocate): Define dummy version if not
14823 HAVE_POSIX_FALLOCATE.
14824 (Output_file::map): Call posix_fallocate rather than lseek and
14825 write.
14826 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
14827 * configure, Makefile.in, config.in: Rebuild.
14828
ef4ab7a8 148292009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 14830
ef4ab7a8
PP
14831 * layout.h (Layout::create_note): Add section_name parameter.
14832 * layout.cc (Layout::create_note): Likewise.
14833 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 14834
8c500701
ILT
148352009-03-17 Ian Lance Taylor <iant@google.com>
14836
e85b18e1
ILT
14837 * descriptors.cc: Include "options.h".
14838 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
14839 (Descriptors::open): Always use O_CLOEXEC when opening a new
14840 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
14841 then set FD_CLOEXEC.
14842
9efe6174
ILT
14843 * sparc.cc (class Target_sparc): Add has_got_section.
14844 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
14845 make sure we have a GOT section.
14846
14847 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
14848 (Target_sparc::Scan::local): Likewise.
14849 (Target_sparc::Scan::global): Likewise.
14850 (Target_sparc::Relocate::relocate): Likewise.
14851 (Target_sparc::Relocate::relocate_tls): Likewise.
14852
8c500701
ILT
14853 * symtab.cc (Symbol_table::define_default_version): New function,
14854 broken out of add_from_object.
14855 (Symbol_table::add_from_object): Call define_default_version.
14856 (Symbol_table::define_special_symbol): Add resolve_oldsym
14857 parameter. Change all callers. If the version for a symbol comes
14858 from a version script, resolve it with the symbol with the same
14859 name with no version. Also add the symbol without a version if
14860 appropriate.
14861 (do_define_in_output_data): If resolving with oldsym, don't delete
14862 sym.
14863 (do_define_in_output_segment): Likewise.
14864 (do_define_as_constant): Likewise.
14865 * symtab.h (class Symbol_table): Update declarations.
14866
f1ed28fb
ILT
148672009-03-13 Ian Lance Taylor <iant@google.com>
14868
15f8229b
ILT
14869 * readsyms.cc (Read_symbols::incompatible_warning): New function.
14870 (Read_symbols::requeue): New function.
14871 (Read_symbols::do_read_symbols): If make_elf_object fails because
14872 the target type is not configured, and the file was searched for,
14873 issue a warning and retry with the next directory.
14874 (Add_symbols::run): If the file has an incompatible format, and
14875 it was searched for, requeue the Read_symbols task. On error,
14876 release the object.
14877 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
14878 dirindex parameter to constructor. Change all callers. Declare
14879 incompatible_warning and requeue.
14880 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
14881 input_argument_ and input_group_ fields. Add them to
14882 constructor. Change all callers.
14883 (class Read_script): Add dirindex_ field. Add it to constructor.
14884 Change all callers.
14885 * archive.cc (Archive::setup): Remove input_objects parameter.
14886 Change all callers.
14887 (Archive::get_file_and_offset): Likewise.
14888 (Archive::read_all_symbols): Likewise.
14889 (Archive::read_symbols): Likewise.
14890 (Archive::get_elf_object_for_member): Remove input_objects
14891 parameter. Add punconfigured parameter. Change all callers.
14892 (Archive::add_symbols): Change return type to bool. Check return
14893 value of include_member.
14894 (Archive::include_all_members): Likewise.
14895 (Archive::include_member): Change return type to bool. Return
14896 false if first included object has incompatible target. Set
14897 included_member_ field.
14898 (Add_archive_symbols::run): If add_symbols returns false, requeue
14899 Read_symbols task.
14900 * archive.h (class Archive): Add included_member_ field.
14901 Initialize it in constructor. Add input_file and searched_for
14902 methods. Update declarations.
14903 (class Add_archive_symbols): Add dirpath_, dirindex_, and
14904 input_argument_ fields. Add them to constructor. Change all
14905 callers.
14906 * script.cc: Include "target-select.h".
14907 (class Parser_closure): Add skip_on_incompatible_target_ and
14908 found_incompatible_target_ fields. Add
14909 skip_on_incompatible_target parameter to constructor. Change all
14910 callers. Add methods skip_on_incompatible_target,
14911 clear_skip_on_incompatible_target, found_incompatible_target, and
14912 set_found_incompatible_target.
14913 (read_input_script): Add dirindex parameter. Change all callers.
14914 If parser finds an incompatible target, requeue Read_symbols
14915 task.
14916 (script_set_symbol): Clear skip_on_incompatible_target in
14917 closure.
14918 (script_add_assertion, script_parse_option): Likewise.
14919 (script_start_sections, script_add_phdr): Likewise.
14920 (script_check_output_format): New function.
14921 * script.h (read_input_script): Update declaration.
14922 * script-c.h (script_check_output_format): Declare.
14923 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
14924 (ignore_cmd): Remove OUTPUT_FORMAT.
14925 * fileread.cc (Input_file::Input_file): Add explicit this.
14926 (Input_file::will_search_for): New function.
14927 (Input_file::open): Add pindex parameter. Change all callers.
14928 * fileread.h (class Input_file): Add input_file_argument method.
14929 Declare will_search_for. Update declarations.
14930 * object.cc (make_elf_object): Add punconfigured parameter.
14931 Change all callers.
14932 * object.h (class Object): Make input_file public. Add
14933 searched_for method.
14934 (make_elf_object): Update declaration.
14935 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
14936 restart search.
14937 * dirsearch.h (class Dirsearch): Update declaration.
14938 * options.h (class General_options): Add --warn-search-mismatch.
14939 * parameters.cc (Parameters::is_compatible_target): New function.
14940 * parameters.h (class Parameters): Declare is_compatible_target.
14941 * workqueue.cc (Workqueue::add_blocker): New function.
14942 * workqueue.h (class Workqueue): Declare add_blocker.
14943
f1ed28fb
ILT
14944 * fileread.cc (Input_file::open): Remove options parameter.
14945 Change all callers.
14946 (Input_file::open_binary): Likewise.
14947 * script.cc (read_input_script): Likewise.
14948 * readsyms.h (class Read_symbols): Remove options_ field. Remove
14949 options parameter from constructor. Change all callers.
14950 (class Read_script): Likewise.
14951 * fileread.h (class Input_file): Update declarations.
14952 * script.h (read_input_script): Update declaration.
14953
34dd024a
NC
149542009-03-10 Nick Clifton <nickc@redhat.com>
14955
14956 * po/es.po: New Spanish translation.
14957
6d71b17c
CC
149582009-03-06 Cary Coutant <ccoutant@google.com>
14959
14960 * options.cc (parse_short_option): Keep dash_z from registering itself.
14961
031cdbed
ILT
149622009-03-03 Ian Lance Taylor <iant@google.com>
14963
14964 PR 9918
14965 * target-reloc.h (relocate_section): Pass output_section to
14966 relocate.
14967 * i386.cc (Target_i386::should_apply_static_reloc): Add
14968 output_section parameter. Change all callers.
14969 (Target_i386::Relocate::relocate): Add output_section parameter.
14970 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
14971 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
14972 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
14973 * testsuite/two_file_shared.sh: New script.
14974 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
14975 (check_DATA): Add two_file_shared.dbg.
14976 (two_file_shared.dbg): New target.
14977 * testsuite/Makefile.in: Rebuild.
14978
15d5fa16
ILT
149792009-03-01 Ian Lance Taylor <iant@google.com>
14980
14981 * configure.ac: Check for byteswap.h.
14982 * configure: Rebuild.
14983 * config.in: Rebuild.
14984
8a4c0b0d
ILT
149852009-03-01 Mikolaj Zalewski <mikolajz@google.com>
14986
14987 * layout.cc (Layout::find_or_add_kept_section): New function.
14988 (Layout::add_comdat): Removed.
14989 * layout.h (struct Kept_section): Move out of class Layout.
14990 Remove trailing underscores from field names. Add group_sections
14991 field. Rename group_ field to is_group. Change all uses.
14992 (class Layout): Declare find_or_add_kept_section, not add_comdat.
14993 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
14994 comdat_groups_ field.
14995 (Sized_relobj::include_section_group): Use
14996 find_or_add_kept_section and Kept_section::group_sections.
14997 (Sized_relobj::include_linkonce_section): Likewise.
14998 * object.cc (class Sized_relobj): Don't define Comdat_group or
14999 Comdat_group_table. Remove find_comdat_group and
15000 add_comdat_group. Remove comdat_groups_ field.
15001 * plugin.cc (include_comdat_group): Use
15002 Layout::find_or_add_kept_section.
15003
b4ecf66b
ILT
150042009-02-28 Ian Lance Taylor <iant@google.com>
15005
14359ca0
ILT
15006 * README: --gc-sections and map files are now supported. Document
15007 some build requirements.
15008
b4ecf66b
ILT
15009 PR 6992
15010 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
15011 relocatable link set the value of the section symbol to zero.
15012 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
15013 relocatable link don't include the section address in the local
15014 symbol value.
15015
0602e05a
ILT
150162009-02-27 Ian Lance Taylor <iant@google.com>
15017
fd9d194f
ILT
15018 PR 6811
15019 * options.h (class Search_directory): Add is_system_directory.
15020 (class General_options): Declare is_in_system_directory.
15021 * options.cc (get_relative_sysroot): Make static.
15022 (get_default_sysroot): Make static.
15023 (General_optoins::is_in_system_directory): New function.
15024 * fileread.cc (Input_file::is_in_system_directory): New function.
15025 * fileread.h (class Input_file): Declare is_in_system_directory.
15026 * object.h (class Object): Add is_in_system_directory.
15027 (class Input_objects): Remove system_library_directory_ field.
15028 * object.cc (Input_objects::add_object): Don't set
15029 system_library_directory_.
15030 (input_objects::found_in_system_library_directory): Remove.
15031 * symtab.cc (Symbol_table::write_globals): Remove input_objects
15032 parameter. Change all callers.
15033 (Symbol_table::sized_write_globals): Likewise.
15034 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
15035 Call Object::is_in_system_directory.
15036 * symtab.h (class Symbol_table): Update declarations.
15037
61edd21f
ILT
15038 PR 5990
15039 * descriptors.h (Open_descriptor): Add is_on_stack field.
15040 * descriptors.cc (Descriptors::open): If the descriptor is on the
15041 top of the stack, remove it. Initialize is_on_stack field.
15042 (Descriptors::release): Only add pod to stack if it is not on the
15043 stack already.
15044 (Descriptors::close_some_descriptor): Clear stack_next and
15045 is_on_stack fields.
15046
e29e076a
ILT
15047 PR 7091
15048 * output.cc (Output_section::find_starting_output_address): Rename
15049 from starting_output_address; add PADDR parameter; change return
15050 type.
15051 * output.h (class Output_section): Declare
15052 find_starting_output_address instead of starting_output_address.
15053 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
15054 section symbol for which we can't find a merge section.
15055
0602e05a
ILT
15056 PR 9836
15057 * symtab.cc (Symbol_table::add_from_object): If the visibility is
15058 hidden or internal, force the symbol to be local.
15059 * resolve.cc (Symbol::override_visibility): Define.
15060 (Symbol::override_base): Use override_visibility.
15061 (Symbol_table::resolve): Likewise.
15062 (Symbol::override_base_with_special): Likewise.
15063 (Symbol_table::override_with_special): If the visibility is hidden
15064 or internal, force the symbol to be local.
15065 * symtab.h (class Symbol): Add set_visibility and
15066 override_visibility.
15067 * testsuite/ver_test_1.sh: New file.
15068 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
15069 (check_DATA): Add ver_test_1.syms.
15070 (ver_test_1.syms): New target.
15071 * testsuite/Makefile.in: Rebuild.
15072
401a9a73
CC
150732009-02-25 Cary Coutant <ccoutant@google.com>
15074
15075 * layout.cc (Layout::choose_output_section): Don't rename sections
15076 when using a linker script that has a SECTIONS clause.
15077 * Makefile.in: Regenerate.
15078
15079 * testsuite/Makefile.am (script_test_5.sh): New test case.
15080 * testsuite/Makefile.in: Regenerate.
15081 * testsuite/script_test_5.cc: New file.
15082 * testsuite/script_test_5.sh: New file.
15083 * testsuite/script_test_5.t: New file.
15084
f488e4b0
CC
150852009-02-13 Rafael Avila de Espindola <espindola@google.com>
15086
15087 * archive.cc (Archive::include_member): Update calls to add_symbols.
15088 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
15089 the Layout argument.
15090 * dynobj.h (do_add_symbols): Add the Layout argument.
15091 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
15092 Layout argument.
15093 * object.h (Object::add_symbols): Add the Layout argument.
15094 (Object::do_add_symbols): Add the Layout argument.
15095 (Sized_relobj::do_add_symbols): Add the Layout argument.
15096 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
15097 Unify the two versions.
15098 (Add_plugin_symbols): Remove.
15099 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
15100 (Sized_pluginobj::do_add_symbols): Unify the two versions.
15101 (Add_plugin_symbols): Remove.
15102 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
15103 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
15104 (Add_symbols::run): Make it work with Pulginobj.
15105
89dd1680
ILT
151062009-02-06 Ian Lance Taylor <iant@google.com>
15107
15108 * object.cc (Sized_relobj::do_layout): Make info message start
15109 with lower case letter.
15110
266d0a74
ILT
151112009-02-06 Mikolaj Zalewski <mikolajz@google.com>
15112
602b464e
ILT
15113 * binary.cc: Fix file comment.
15114
266d0a74
ILT
15115 * options.h (enum Incremental_disposition): Define.
15116 (class General_options): Add new options: --incremental,
15117 --incremental_changed, --incremental_unchanged,
15118 --incremental_unknown. Add incremental_disposition_ and
15119 implicit_incremental_ fields.
15120 (General_options::incremental_disposition): New function.
15121 (class Position_dependent_options): Add incremental_disposition
15122 option.
15123 (Position_dependent_options::copy_from_options): Set incremental
15124 dispositions.
15125 * options.cc (General_options::parse_incremental_changed): New
15126 function.
2e702c99
RM
15127 (General_options::parse_incremental_unchanged): New function.
15128 (General_options::parse_incremental_unknown): New function.
15129 (General_options::General_options): Initialize new fields
266d0a74 15130 incremental_disposition_ and implicit_incremental_.
2e702c99 15131 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
15132 without --incremental.
15133
f073bbf7
CD
151342009-02-06 Chris Demetriou <cgd@google.com>
15135
15136 * gold.h (gold_undefined_symbol): Change to take only a Symbol
15137 pointer and to report location as the file name associated with
15138 the symbol.
15139 (gold_undefined_symbol_at_location): New function to replace the
15140 old gold_undefined_symbol functionality.
15141 * target-reloc.h (relocate_section): Update to use
15142 gold_undefined_symbol_at_location.
15143 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
15144 Call gold_undefined_symbol function rather than gold_error.
15145 * errors.h (Errors::undefined_symbol): Take location as a
15146 string, rather than calculating it from a relocation.
15147 * errors.cc (Errors::fatal): Print "fatal error:" before the
15148 formatted message.
15149 (Errors::error, Errors::error_at_location): Print "error: "
15150 before the formatted message.
15151 (Errors::undefined_symbol): Take location as a string, rather
15152 than calculating it from a relocation.
15153 (gold_undefined_symbol_at_location): New function akin to
15154 old gold_undefined_symbol, calculates location from relocation.
15155 (gold_undefined_symbol): Change to take only a Symbol pointer
15156 and to report location as the file name associated with the symbol.
15157 * testsuite/debug_msg.sh: Update for changed error messages.
15158 * testsuite/undef_symbol.sh: Likewise.
15159
8e94a90c
ILT
151602009-02-04 Duncan Sands <baldrick@free.fr>
15161
15162 PR 9812
15163 * reduced_debug_output.h
15164 (Output_reduced_debug_abbrev_section::failed): Use format for
15165 gold_warning.
15166 (Output_reduced_debug_info_section::faild): Likewise.
15167
88a0e15b
ILT
151682009-01-31 Mikolaj Zalewski <mikolajz@google.com>
15169
15170 * script.cc (Lazy_demangler): New class.
2e702c99 15171 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
15172 symbol only once.
15173
5efc7cd2
CC
151742009-01-29 Cary Coutant <ccoutant@google.com>
15175
15176 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
15177 to __tls_get_addr.
15178 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
15179
e0ebcf42
ILT
151802009-01-28 Ian Lance Taylor <iant@google.com>
15181
5efc7cd2 15182 * version.cc (version_string): Bump to 1.9.
75fe7426 15183
e0ebcf42
ILT
15184 * gold.h: Include <cstring> and <stdint.h>.
15185 * version.cc: Include <cstdio>.
15186 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
15187 warning.
15188 * reduced_debug_output.cc (insert_into_vector): Rename from
15189 Insert_into_vector; change all callers. Use Swap_unaligned to
15190 avoid aliasing issue; remove union since it is unnecessary.
15191
8e2813be 151922009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
15193
15194 * Makefile.am (CCFILES): Add gc.cc.
15195 (HFILES): Add gc.h.
15196 * Makefile.in: Regenerate.
15197 * gold.cc (Gc_runner): New class.
15198 (queue_initial_tasks): Call garbage collection related tasks
15199 when corresponding options are invoked.
15200 (queue_middle_gc_tasks): New function.
15201 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
15202 processed early before laying out sections during garbage collection.
15203 * gold.h (queue_middle_gc_tasks): New function.
15204 (is_prefix_of): Move from "layout.cc".
15205 * i386.cc (Target_i386::gc_process_relocs): New function.
15206 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
15207 * main.cc (main): Create object of class "Garbage_collection".
15208 * object.cc (Relobj::copy_symbols_data): New function.
15209 (Relobj::is_section_name_included): New function.
e1df38aa
NC
15210 (Sized_relobj::do_layout): Allow this function to be called twice
15211 during garbage collection and defer layout of section during the
6d03d481
ST
15212 first call.
15213 * object.h (Relobj::get_symbols_data): New function.
15214 (Relobj::is_section_name_included): New function.
15215 (Relobj::copy_symbols_data): New function.
15216 (Relobj::set_symbols_data): New function.
15217 (Relobj::get_relocs_data): New function.
15218 (Relobj::set_relocs_data): New function.
15219 (Relobj::is_output_section_offset_invalid): New pure virtual function.
15220 (Relobj::gc_process_relocs): New function.
15221 (Relobj::do_gc_process_relocs): New pure virtual function.
15222 (Relobj::sd_): New data member.
15223 (Sized_relobj::is_output_section_offset_invalid): New function.
15224 (Sized_relobj::do_gc_process_relocs): New function.
15225 * options.h (General_options::gc_sections): Modify to not be a no-op.
15226 (General_options::print_gc_sections): New option.
15227 * plugin.cc (Plugin_finish::run): Remove function call to
15228 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
15229 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
15230 * reloc.cc (Read_relocs::run): Add task to process relocs and
15231 determine unreferenced sections when doing garbage collection.
15232 (Gc_process_relocs): New class.
15233 (Sized_relobj::do_gc_process_relocs): New function.
15234 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
15235 sections that are garbage collected.
15236 * reloc.h (Gc_process_relocs): New class.
15237 * sparc.cc (Target_sparc::gc_process_relocs): New function.
15238 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
15239 symbols whose corresponding sections are garbage collected.
15240 (Symbol_table::Symbol_table): Add new parameter for the garbage
15241 collection object.
15242 (Symbol_table::gc_mark_undef_symbols): New function.
15243 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15244 (Symbol_table::gc_mark_dyn_syms): New function.
15245 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
15246 as garbage.
15247 (Symbol_table::add_from_object): Likewise.
15248 (Symbol_table::add_from_relobj): When building shared objects, do not
15249 treat externally visible symbols as garbage.
15250 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
15251 table information for static and relocatable links.
15252 * symtab.h (Symbol_table::set_gc): New function.
15253 (Symbol_table::gc): New function.
15254 (Symbol_table::gc_mark_undef_symbols): New function.
15255 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15256 (Symbol_table::gc_mark_dyn_syms): New function.
15257 (Symbol_table::gc_): New data member.
e1df38aa 15258 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
15259 function.
15260 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
15261 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
15262
3b293544
CF
152632009-01-20 Chris Faylor <me.sourceware@sourceware.org>
15264
15265 * options.h (General_options::gc_sections): Define as a no-op for now.
15266 (General_options::no_keep_memory): Ditto.
15267 (General_options::Bshareable): Define.
15268 * options.cc (General_options::finalize): Honor -Bshareable.
15269
83d22aa8
AS
152702009-01-20 Andreas Schwab <schwab@suse.de>
15271
15272 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
15273 read the value in the contents, since we don't use it. Use the
15274 template endianness when writing.
15275 (Relocate::relocate): Use it for R_PPC_REL16_HA.
15276
cd536b21
AS
152772009-01-19 Andreas Schwab <schwab@suse.de>
15278
15279 * configure.tgt (powerpc64-*): Fix targ_obj.
15280
99e9a495
ILT
152812009-01-15 Ian Lance Taylor <iant@google.com>
15282
15283 * object.cc (Sized_relobj::write_local_symbols): Don't write out
15284 local symbols when stripping all symbols.
15285
bbbfea06
CC
152862009-01-14 Cary Coutant <ccoutant@google.com>
15287
99e9a495 15288 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 15289
0f7c0701
CC
152902009-01-14 Cary Coutant <ccoutant@google.com>
15291
15292 * archive.cc (Archive::get_elf_object_for_member): Remove call
15293 to File_read::claim_for_plugin.
15294 * descriptors.cc (Descriptors::open): Remove reference to
15295 is_claimed.
15296 (Descriptors::claim_for_plugin): Remove.
15297 * descriptors.h (Descriptors::claim_for_plugin): Remove.
15298 (Descriptors::is_claimed): Remove.
15299 (claim_descriptor_for_plugin): Remove.
15300 * fileread.cc (File_read::claim_for_plugin): Remove.
15301 * fileread.h (File_read::claim_for_plugin): Remove.
15302 (File_read::descriptor): Reopen descriptor if necessary.
15303 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
15304 (Plugin_manager::all_symbols_read): Add task parameter. Change
15305 all callers.
15306 (Plugin_manager::get_input_file): New function.
15307 (Plugin_manager::release_input_file): New function.
15308 (Pluginobj::Pluginobj): Add filesize parameter and initialize
15309 corresponding data member.
15310 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
15311 and pass to base constructor. Change all callers.
15312 (get_input_file, release_input_file): New functions.
15313 (make_sized_plugin_object): Add filesize parameter. Change all callers.
15314 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
15315 (Plugin_manager::all_symbols_read): Add task parameter.
15316 (Plugin_manager::get_input_file): New function.
15317 (Plugin_manager::release_input_file): New function.
15318 (Plugin_manager::task_): New data member.
15319 (Pluginobj::Pluginobj): Add filesize parameter.
15320 (Pluginobj::filename): New function.
15321 (Pluginobj::descriptor): New function.
15322 (Pluginobj::filesize): New function.
15323 (Pluginobj::filesize_): New data member.
15324 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
15325 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
15326 File_read::claim_for_plugin; use Object::unlock to unlock the file.
15327
15328 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
15329 with archive libraries.
15330 * testsuite/Makefile.in: Regenerate.
15331 * testsuite/plugin_test.c (struct sym_info): New type.
15332 (get_input_file, release_input_file): New static variables.
15333 (onload): Capture new transfer vector entries.
15334 (claim_file_hook): Stop reading at end of file according to filesize.
15335 Factor out parsing of readelf output into separate function.
15336 (all_symbols_read_hook): Exercise get_input_file and release_input_file
15337 APIs and get the source file name from the symbol table. Convert
15338 source file name to corresponding object file name. Print info
15339 message when adding new input files.
15340 (parse_readelf_line): New function.
15341 * testsuite/plugin_test_1.sh: Add checks for new info messages.
15342 * testsuite/plugin_test_2.sh: Likewise.
15343 * testsuite/plugin_test_3.sh: Likewise.
15344 * testsuite/plugin_test_4.sh: New test case.
15345
62a6d109
ILT
153462009-01-07 Ian Lance Taylor <iant@google.com>
15347
15348 * version.cc (version_string): Bump to 1.8.
15349
483620e8
CC
153502008-12-23 Cary Coutant <ccoutant@google.com>
15351
15352 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
15353 * plugin.cc (Plugin_manager::finish): Rename as
15354 layout_deferred_objects. Move cleanup to separate function.
15355 (Plugin_manager::cleanup): New function.
15356 (Plugin_finish::run): Call layout_deferred_objects and cleanup
15357 separately.
15358 * plugin.h (Plugin_manager::finish): Rename as
15359 layout_deferred_objects.
15360 (Plugin_manager::cleanup): New function.
15361 (Plugin_manager::cleanup_done): New field.
15362
d66a9eb3
CC
153632008-12-23 Cary Coutant <ccoutant@google.com>
15364
15365 * plugin.cc (is_visible_from_outside): New function.
15366 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
15367 so we don't return "IR only" status for exported symbols or -r links.
15368
15369 * testsuite/Makefile.am (plugin_test_3): New test case.
15370 * testsuite/Makefile.in: Regenerate.
15371 * testsuite/plugin_test_3.sh: New file.
15372
5995b570
CC
153732008-12-22 Cary Coutant <ccoutant@google.com>
15374
15375 * object.cc (Sized_relobj::layout_section): New function.
15376 (Sized_relobj::do_layout): Defer layout of input sections until after
15377 plugin has provided replacement files.
15378 (Sized_relobj::do_layout_deferred_sections): New function.
15379 * object.h (Relobj::set_section_offset): Remove virtual keyword.
15380 (Relobj::layout_deferred_sections): New function.
15381 (Relobj::do_layout_deferred_sections): New function.
15382 (Sized_relobj::do_layout_deferred_sections): New function.
15383 (Sized_relobj::layout_section): New function.
15384 (Sized_relobj::Deferred_layout): New structure.
15385 (Sized_relobj::deferred_layout_): New field.
15386 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
15387 Change all callers. Layout deferred sections.
15388 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
15389 references.
15390 (Plugin_hook::run): Move code from do_plugin_hook inline.
15391 (Plugin_hook::do_plugin_hook): Remove.
15392 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
15393 (Plugin_manager::finish): Renamed, was cleanup.
15394 (Plugin_manager::should_defer_layout): New function.
15395 (Plugin_manager::add_deferred_layout_object): New function.
15396 (Plugin_manager::Deferred_layout_list): New type.
15397 (Plugin_manager::deferred_layout_objects_): New field.
15398 (Plugin_hook::do_plugin_hook): Remove.
15399
ee769c88
ILT
154002008-12-17 Ian Lance Taylor <iant@google.com>
15401
15402 * options.h (class General_options): Add --no case for
15403 --export-dynamic.
15404
abc8dcba
CC
154052008-12-16 Cary Coutant <ccoutant@google.com>
15406
15407 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
15408 vector.
15409 (Plugin_manager::claim_file): Create plugin object even if
15410 plugin did not call the add_symbols callback.
15411 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
15412 asking for more symbols than were added.
15413 * testsuite/Makefile.am (plugin_test_1): Add test case with
15414 no global symbols.
15415 (empty.syms): New target.
15416 * testsuite/Makefile.in: Regenerate.
15417 * testsuite/plugin_test.c (claim_file_hook): Add new debug
15418 message. Don't call add_symbols if no globals.
15419 (all_symbols_read_hook): Don't provide replacement for empty
15420 claimed file.
15421
b0074644
ILT
154222008-12-12 Ian Lance Taylor <iant@google.com>
15423
68943102
ILT
15424 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
15425 r_type == 0 for a local symbol with r_sym == 0.
15426 (scan_relocatable_relocs): Pass r_sym to
15427 local_non_section_strategy.
15428 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
15429 r_sym parameter.
15430
b0074644
ILT
15431 * configure.ac: Update test for TLS descriptors: they are
15432 supported as of glibc 2.9.
15433 * configure: Rebuild.
15434
c2508178
ILT
154352008-12-11 Ian Lance Taylor <iant@google.com>
15436
15437 PR 7091
15438 * target-reloc.h (Default_scan_relocatable_relocs): For each
15439 function, map r_type == 0 to RELOC_DISCARD.
15440
2756a258
CC
154412008-12-10 Cary Coutant <ccoutant@google.com>
15442
15443 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
15444 object to override a kept COMDAT group from a plugin object.
15445
bb6f53d3
ILT
154462008-12-09 Ian Lance Taylor <iant@google.com>
15447
fbc558e1
ILT
15448 PR 7088
15449 * yyscript.y (file_cmd): Handle INPUT.
15450
bb6f53d3
ILT
15451 * testsuite/initpri1.c: Change all declarations to be full
15452 prototypes by adding void, to avoid compiler warnings.
15453
4674ecfc
CC
154542008-12-05 Rafael Avila de Espindola <espindola@google.com>
15455
15456 * options.cc (General_options::parse_plugin_opt): New.
15457 (General_options::add_plugin): The argument now is just the filename.
15458 (General_options::add_plugin_option): New.
15459 * options.h (plugin_opt): New.
15460 (add_plugin): Change argument name.
15461 (add_plugin_option): New.
15462 * plugin.cc (Plugin::load): Don't parse the plugin option.
15463 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
15464 (Plugin::add_option): New.
15465 (Plugin::args_): Change type.
15466 (Plugin::filename_): New.
15467 (Plugin_manager::add_plugin_option): New.
15468 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
15469 * testsuite/Makefile.in: Regenerate.
15470
fd06b4aa
CC
154712008-12-05 Cary Coutant <ccoutant@google.com>
15472
15473 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
15474 Handle --strip-lto-sections option.
15475 * options.h (strip_lto_sections): New option.
15476
6c52134c
CC
154772008-12-01 Cary Coutant <ccoutant@google.com>
15478
15479 * plugin.cc (ld_plugin_message): Change format parameter to const.
15480 Fix mismatch between new[] and delete.
15481
a45248e0
CC
154822008-11-14 Cary Coutant <ccoutant@google.com>
15483
15484 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
15485 instead of -1U.
15486
c82fbeee
CS
154872008-11-05 Craig Silverstein <csilvers@google.com>
15488
15489 * options.cc (General_options::parse_dynamic_list): New function.
15490 * options.h (General_options): New flags dynamic_list,
15491 dynamic_list_data, dynamic_list_cpp_new, and
15492 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
15493 (General_options::in_dynamic_list): New function.
15494 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
15495 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
15496 (Lex::can_continue_name): Likewise.
15497 (yylex): Likewise.
15498 (read_script_file): New parameter script_options.
15499 (read_dynamic_list): New function.
15500 (Script_options::define_dynamic_list): New function.
15501 (dynamic_list_keyword_parsecodes): New variable.
15502 (dynamic_list_keywords): New variable.
15503 * script.h (Script_options::define_dynamic_list): New function
15504 prototype.
15505 (read_dynamic_list): New function prototype.
15506 * symtab.cc (strprefix): New macro.
15507 (Symbol::should_add_dynsym_entry): Support dynamic_list,
15508 dynamic_list_data, dynamic_list_cpp_new, and
15509 dynamic_list_cpp_typeinfo.
15510 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
15511 (dynamic_list_expr): New rule.
15512 (dynamic_list_nodes): Likewise.
15513 (dynamic_list_node): Likewise.
15514 * testsuite/Makefile.am (dynamic_list): New test.
15515 * testsuite/Makefile.in: Regenerated.
15516 * testsuite/dynamic_list.t: New file.
15517 * testsuite/dynamic_list.sh: New file.
15518
e0bb29a5
CS
155192008-11-05 Craig Silverstein <csilvers@google.com>
15520
15521 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
15522 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
15523 (t11_last): Likewise.
15524 * testsuite/ver_test_6.c (main): Likewise.
15525
4e1e25e0
CC
155262008-10-07 Cary Coutant <ccoutant@google.com>
15527
15528 * options.c (General_options::finalize): Add check for -static and
15529 -shared.
15530 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
15531 is not empty.
15532
92f03fcb
CC
155332008-10-02 Cary Coutant <ccoutant@google.com>
15534
15535 * plugin.cc (make_sized_plugin_object): Fix conditional
15536 compilation to work when not all targets are enabled.
15537
fbd8a257
CC
155382008-09-29 Cary Coutant <ccoutant@google.com>
15539
15540 * archive.cc (Archive::get_file_and_offset): Use filename instead
15541 of name to get library path.
15542 (Archive::include_member): Unlock external member of a thin archive.
15543
15544 * testsuite/Makefile.am (TEST_AR): New variable.
15545 (thin_archive_test_1): New test.
15546 (thin_archive_test_2): New test.
81636b3f
CC
15547 * testsuite/Makefile.in: Regenerate.
15548 * testsuite/thin_archive_main.cc: New file.
15549 * testsuite/thin_archive_test_1.cc: New file.
15550 * testsuite/thin_archive_test_2.cc: New file.
15551 * testsuite/thin_archive_test_3.cc: New file.
15552 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 15553
eff45813
CC
155542008-09-29 Cary Coutant <ccoutant@google.com>
15555
15556 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
15557 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
15558 instead of -1U.
15559 (Sized_relobj::do_finalize_local_symbols): Likewise.
15560 (Sized_relobj::map_to_kept_section): Likewise.
15561 * object.h (Sized_relobj::invalid_address): New constant.
15562 (Sized_relobj::do_output_section_offset): Check for invalid_address
15563 and return -1ULL.
15564 * output.cc (Output_reloc::local_section_offset): Use constant
15565 invalid_address instead of -1U.
15566 (Output_reloc::get_address): Likewise.
15567 (Output_section::output_address): Change -1U to -1ULL.
15568 * output.h (Output_reloc::invalid_address): New constant.
15569 * reloc.cc (Sized_relobj::write_sections): Use constant
15570 invalid_address instead of -1U.
15571 (Sized_relobj::relocate_sections): Likewise.
15572 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
15573 values for merge sections.
15574 * target-reloc.h (relocate_for_relocatable): Use constant
15575 invalid_address instead of -1U.
15576
89fc3421
CC
155772008-09-19 Cary Coutant <ccoutant@google.com>
15578
15579 Add plugin functionality for link-time optimization (LTO).
15580 * configure.ac (plugins): Add --enable-plugins option.
15581 * configure: Regenerate.
15582 * config.in: Regenerate.
15583 * Makefile.am (LIBDL): New variable.
15584 (CCFILES): Add plugin.cc.
15585 (HFILES): Add plugin.h.
15586 (ldadd_var): Add LIBDL.
15587 * Makefile.in: Regenerate.
15588
15589 * archive.cc: Include "plugin.h".
15590 (Archive::setup): Don't preread archive symbols when using a plugin.
15591 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
15592 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
15593 files.
15594 (Archive::include_member): Add symbols from plugin objects.
15595 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
15596 * descriptors.cc (Descriptors::open): Check for file descriptors
15597 abandoned by plugins.
15598 (Descriptors::claim_for_plugin): New function.
15599 * descriptors.h (Descriptors::claim_for_plugin): New function.
15600 (Open_descriptor::is_claimed): New field.
15601 (claim_descriptor_for_plugin): New function.
15602 * fileread.cc (File_read::claim_for_plugin): New function.
15603 * fileread.h (File_read::claim_for_plugin): New function.
15604 (File_read::descriptor): New function.
15605 * gold.cc: Include "plugin.h".
15606 (queue_initial_tasks): Add task to call plugin hooks for generating
15607 new object files.
15608 * main.cc: Include "plugin.h".
15609 (main): Load plugin libraries.
15610 * object.h (Pluginobj): Declare.
15611 (Object::pluginobj): New function.
15612 (Object::do_pluginobj): New function.
15613 (Object::set_target): New function.
15614 * options.cc: Include "plugin.h".
15615 (General_options::parse_plugin): New function.
15616 (General_options::General_options): Initialize plugins_ field.
15617 (General_options::add_plugin): New function.
15618 * options.h (Plugin_manager): Declare.
15619 (General_options): Add --plugin option.
15620 (General_options::has_plugins): New function.
15621 (General_options::plugins): New function.
15622 (General_options::add_plugin): New function.
15623 (General_options::plugins_): New field.
15624 * plugin.cc: New file.
15625 * plugin.h: New file.
15626 * readsyms.cc: Include "plugin.h".
15627 (Read_symbols::do_read_symbols): Check for archive before checking
15628 for ELF file. Call plugin hooks to claim files.
15629 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
15630 from a real object file; force override when processing replacement
15631 files.
15632 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
15633 (Symbol::init_base_object): Likewise.
15634 (Symbol::init_base_output_data): Likewise.
15635 (Symbol::init_base_output_segment): Likewise.
15636 (Symbol::init_base_constant): Likewise.
15637 (Symbol::init_base_undefined): Likewise.
15638 (Symbol::output_section): Assert that object is not a plugin.
15639 (Symbol_table::add_from_pluginobj): New function.
15640 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
15641 undefined.
15642 (Symbol_table::sized_write_globals): Likewise.
15643 (Symbol_table::add_from_pluginobj): Instantiate template.
15644 * symtab.h (Sized_pluginobj): Declare.
15645 (Symbol::in_real_elf): New function.
15646 (Symbol::set_in_real_elf): New function.
15647 (Symbol::in_real_elf_): New field.
15648 (Symbol_table::add_from_pluginobj): New function.
15649
15650 * testsuite/Makefile.am (AM_CFLAGS): New variable.
15651 (LIBDL): New variable.
15652 (LDADD): Add LIBDL.
15653 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
15654 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
15655 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
15656 (MOSTLYCLEANFILES): Likewise.
15657 * testsuite/Makefile.in: Regenerate.
15658 * testsuite/plugin_test.c: New file.
15659 * testsuite/plugin_test_1.sh: New file.
15660 * testsuite/plugin_test_2.sh: New file.
15661
de31bda5
ILT
156622008-09-16 Ian Lance Taylor <iant@google.com>
15663
9c2d0ef9
ILT
15664 * target-reloc.h (relocate_section): Check whether a symbol is
15665 defined by the ABI before reporting an undefined symbol error.
15666 * target.h (Target::is_defined_by_abi): Make parameter const.
15667 (Target::do_is_defined_by_abi): Likewise.
15668 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
15669 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
15670 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
15671 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
15672 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
15673 * testsuite/Makefile.in: Rebuild.
15674
de31bda5
ILT
15675 * fileread.cc (make_view): Add casts to avoid warning.
15676
9fa33bee
AO
156772008-09-16 Alexandre Oliva <aoliva@redhat.com>
15678
15679 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
15680 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15681
183fd0e3
AO
156822008-09-16 Alexandre Oliva <aoliva@redhat.com>
15683
15684 * options.h (General_options::output_is_executable): New.
15685 (General_options::output_is_pie): New.
15686 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
15687 for shared libraries.
15688 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15689
7be8330a
CD
156902008-09-11 Chris Demetriou <cgd@google.com>
15691
15692 * options.h (origin): New -z option.
15693 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
15694 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
15695 in DT_FLAGS_1.
15696
a9caad02
CC
156972008-09-05 Cary Coutant <ccoutant@google.com>
15698
15699 * fileread.cc (File_read::make_view): Add check for attempt to map
15700 beyond end of file.
15701
ae6dce4d
CC
157022008-09-05 Cary Coutant <ccoutant@google.com>
15703
15704 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
15705 explicit instantiations.
15706
d7ab2a47
KVH
157072008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
15708
15709 PR gold/6858
15710 * options.cc (General_options::finalize): Allow undefined symbols
15711 in shlibs if linking -shared.
15712
15713 PR gold/6859
15714 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
15715 symbols as not needing a dynsym entry.
15716
1e52a9c1
CS
157172008-08-20 Craig Silverstein <csilvers@google.com>
15718
15719 * fileread.cc (File_read::open): Do not lock the file unless it
15720 was successfully opened.
15721
d85c80a3
CC
157222008-08-14 Cary Coutant <ccoutant@google.com>
15723
15724 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
15725 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
15726 * testsuite/tls_test.cc (struct int128): 128-bit struct
15727 for testing TLS relocs with non-zero addend.
15728 (v12): New TLS variable.
15729 (t12): New test.
15730 (t_last): Add check for v12.
15731 * testsuite/tls_test.h (t12): New function.
15732 * testsuite/tls_test_main.cc (thread_routine): Call new test.
15733
2d924fd9
ILT
157342008-08-13 Ian Lance Taylor <iant@google.com>
15735
15736 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
15737 set tls_segment_ or relro_segment_.
15738 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
15739 when appropriate.
15740 * output.h (Output_section::clear_is_relro): New function.
15741 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
15742 sections specially even when output_data_ is empty.
15743 (Output_segment::maximum_alignment): When first section is relro,
15744 only force alignment for PT_LOAD segments.
15745 * script.cc (script_data_segment_align): New function.
15746 (script_data_segment_relro_end): New function.
15747 * script-c.h (script_data_segment_align): Declare.
15748 (script_data_segment_relro_end): Declare.
15749 * script-sections.h (class Script_sections): Declare
15750 data_segment_align and data_segment_relro_end. Add fields
15751 segment_align_index_ and saw_relro_end_.
15752 * script-sections.cc (class Sections_element): Add set_is_relro
15753 virtual function. Add new bool* parameter to place_orphan_here.
15754 Add get_output_section virtual function.
15755 (class Output_section_definition): Add set_is_relro. Add new
15756 bool* parameter to place_orphan_here. Add get_output_section.
15757 Add is_relro_ field.
15758 (Output_section_definition::Output_section_definition): Initialize
15759 evaluated_address_, evaluated_load_address, evaluated_addralign_,
15760 and is_relro_ fields.
15761 (Output_section_definition::place_orphan_here): Add is_relro
15762 parameter.
15763 (Output_section_definition::set_section_addresses): Set relro for
15764 output section.
15765 (Output_section_definition::alternate_constraint): Likewise.
15766 (class Orphan_output_section): Add new bool* parameter to
15767 place_orphan_here. Add get_output_section.
15768 (Orphan_output_section::place_orphan_here): Add is_relro
15769 parameter.
15770 (Script_sections::Script_sections): Initialize
15771 data_segment_align_index_ and saw_relro_end_.
15772 (Script_sections::data_segment_align): New function.
15773 (Script_sections::data_segment_relro_end): New function.
15774 (Script_sections::place_orphan): Set or clear is_relro.
15775 (Script_sections::set_section_addresses): Force alignment of first
15776 TLS section.
15777 * yyscript.y (exp): Call script_data_segment_align and
15778 script_data_segment_relro_end.
15779 * testsuite/relro_script_test.t: New file.
15780 * testsuite/relro_test.cc (using_script): Declare.
15781 (t1, t2): Test using_script.
15782 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
15783 (relro_script_test_SOURCES): Define.
15784 (relro_script_test_DEPENDENCIES): Define.
15785 (relro_script_test_LDFLAGS): Define.
15786 (relro_script_test_LDADD): Define.
15787 (relro_script_test.so): New target.
15788 * testsuite/Makefile.in: Rebuild.
15789
f827c9a9
CC
157902008-08-06 Cary Coutant <ccoutant@google.com>
15791
15792 * archive.cc (Archive::total_archives, Archive::total_members)
15793 (Archive::total_members_loaded): New variables.
15794 (Archive::setup): Add parameter. Add option to preread
15795 archive symbols.
15796 (Archive::read_armap): Add counter.
15797 (Archive::get_file_and_offset): New function.
15798 (Archive::get_elf_object_for_member): New function.
15799 (Archive::read_all_symbols): New function.
15800 (Archive::read_symbols): New function.
15801 (Archive::add_symbols): Add counters.
15802 (Archive::include_all_members): Use armap to find members if it's
15803 already built.
15804 (Archive::include_member): Skip reading symbols if already read.
15805 Factored code into Archive::get_file_and_offset and
15806 Archive::get_elf_object_for_member. Changed call to
15807 Mapfile::report_include_archive_member.
15808 (Archive::print_stats): New function.
15809 * archive.h: Declare Object and Read_symbols_data classes.
15810 (Archive::Archive): Add initializers for new members.
15811 (Archive::setup): Add parameter.
15812 (Archive::print_stats): New function.
15813 (Archive::total_archives, Archive::total_members)
15814 (Archive::total_members_loaded): New variables.
15815 (Archive::get_file_and_offset): New function.
15816 (Archive::get_elf_object_for_member): New function.
15817 (Archive::read_all_symbols): New function.
15818 (Archive::read_symbols): New function.
15819 (Archive::Archive_member): New class.
15820 (Archive::members_): New member.
15821 (Archive::num_members_): New member.
15822 * main.cc: Include archive.h.
15823 (main): Call Archive::print_stats.
15824 * mapfile.cc (Mapfile::report_include_archive_member): Delete
15825 archive parameter; member_name is now the fully-decorated name.
15826 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
15827 * options.h: (General_options): Add --preread-archive-symbols option.
15828 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
15829 Archive::setup.
15830
de4c45bd
ILT
158312008-08-04 Ian Lance Taylor <iant@google.com>
15832
15833 * symtab.h (Symbol::use_plt_offset): New function.
15834 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
15835 * powerpc.cc (Relocate::relocate): Likewise.
15836 * sparc.cc (Relocate::relocate): Likewise.
15837 * x86_64.cc (Relocate::relocate): Likewise.
15838 * testsuite/weak_plt.sh: New test.
15839 * testsuite/weak_plt_main.cc: New test.
15840 * testsuite/weak_plt_shared.cc: New test.
15841 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
15842 (check_PROGRAMS): Add weak_plt.
15843 (check_DATA): Add weak_plt_shared.so.
15844 (weak_plt_main_pic.o, weak_plt): New targets.
15845 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
15846 * testsuite/Makefile.in: Rebuild.
15847
15848 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
15849 gcctestdir/ld.
15850 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
15851 * testsuite/Makefile.in: Rebuild.
15852
323ee3f4
AM
158532008-08-04 Alan Modra <amodra@bigpond.net.au>
15854
15855 * Makefile.am (POTFILES.in): Set LC_ALL=C.
15856 * Makefile.in: Regenerate.
15857 * po/POTFILES.in: Regenerate.
15858
7c07ecec
ILT
158592008-07-29 Ian Lance Taylor <iant@google.com>
15860
15861 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
15862 symbols before other symbols.
15863 * testsuite/script_test_2.cc (test_addr): Declare.
15864 (test_addr_alias): Declare.
15865 (main): Check that test_addr and test_addr_alias have the right
cd536b21 15866 values.
7c07ecec
ILT
15867 * testsuite/script_test_2.t: Define test_addr_alias and
15868 test_addr.
15869
5778530e
ILT
158702008-07-24 Ian Lance Taylor <iant@google.com>
15871
2a00e4fb
ILT
15872 PR 5990
15873 * descriptors.cc: New file.
15874 * descriptors.h: New file.
15875 * gold-threads.h (class Hold_optional_lock): New class.
15876 * fileread.cc: Include "descriptors.h".
15877 (File_read::~File_read): Release descriptor rather than closing
15878 it.
15879 (File_read::open) [file]: Call open_descriptor rather than open.
15880 Set is_descriptor_opened_.
15881 (File_read::open) [memory]: Assert that descriptor is not open.
15882 (File_read::reopen_descriptor): New function.
15883 (File_read::release): Release descriptor.
15884 (File_read::do_read): Make non-const. Reopen descriptor.
15885 (File_read::read): Make non-const.
15886 (File_read::make_view): Reopen descriptor.
15887 (File_read::do_readv): Likewise.
15888 * fileread.h (class File_read): Add is_descriptor_opened_ field.
15889 Update declarations.
15890 * layout.cc: Include "descriptors.h".
15891 (Layout::create_build_id): Use open_descriptor rather than open.
15892 * output.cc: Include "descriptors.h".
15893 (Output_file::open): Use open_descriptor rather than open.
15894 * archive.cc (Archive::const_iterator): Change Archive to be
15895 non-const.
15896 (Archive::begin, Archive::end): Make non-const.
15897 (Archive::count_members): Likewise.
15898 * archive.h (class Archive): Update declarations.
15899 * object.h (Object::read): Make non-const.
15900 * Makefile.am (CCFILES): Add descriptors.cc.
15901 (HFILES): Add descriptors.h.
15902 * Makefile.in: Rebuild.
15903
801647d1
ILT
15904 PR 6716
15905 * gold.h: Always include <clocale>. Add Solaris workarounds
15906 following code in binutils/sysdep.h.
15907
5edd166e
ILT
15908 PR 6048
15909 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
15910 this->eh_frame_hdr_ is NULL before using it.
15911
c89ad728
ILT
15912 * dynobj.cc (Versions::Versions): Update comment.
15913
aa86f06b
ILT
15914 * dynobj.cc (Versions::Versions): If there is an soname, use it as
15915 the base version name.
15916
5778530e
ILT
15917 * stringpool.cc (Stringpool_template::add_with_length): Set key to
15918 array size plus one.
15919 (Stringpool_template::set_string_offsets): Subtract one from key
15920 before using it as an array index.
15921 (Stringpool_template::get_offset_with_length): Likewise.
15922 (Stringpool_template::write_to_buffer): Likewise.
15923 * stringpool.h (Stringpool_template::get_offset_from_key):
15924 Likewise.
15925
057ead22
ILT
159262008-07-23 Ian Lance Taylor <iant@google.com>
15927
7f649c59
ILT
15928 PR 6658
15929 * object.h (Merged_symbol_value::value): Do our best to handle a
15930 negative addend.
15931
057ead22
ILT
15932 PR 6647
15933 * script.cc (Version_script_info::get_versions): Don't add empty
15934 version tag to return value.
15935 (Version_script_info::get_symbol_version_helper): Change return
15936 type to bool. Add pversion parameter. Change all callers.
15937 (script_register_vers_node): Don't require a non-NULL tag.
15938 * script.h (class Version_script_info): Update declarations.
15939 (Version_script_info::get_symbol_version): Change return type to
15940 bool. Add version parameter. Change all callers.
15941 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
15942 handling. Handle an empty version from a version script.
15943 (Symbol_table::define_special_symbol): Likewise.
15944 * testsuite/ver_test_10.script: New file.
15945 * testsuite/ver_test_10.sh: New file.
15946 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
15947 (check_DATA): Add ver_test_10.syms.
15948 (ver_test_10.syms, ver_test_10.so): New target.
15949 * testsuite/Makefile.in: Rebuild.
15950
58e54ac2
CD
159512008-07-23 Simon Baldwin <simonb@google.com>
15952
15953 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
15954 to zero for undefined symbols from dynamic libraries.
15955
95d14cd3
ILT
159562008-07-23 Ian Lance Taylor <iant@google.com>
15957
15958 * symtab.cc (Symbol_table::resolve): Remove version parameter.
15959 Change all callers.
15960 * symtab.h (class Symbol_table): Update declaration.
15961 * testsuite/ver_test_9.cc: New file.
15962 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
15963 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
15964 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
15965 (ver_test_9.so, ver_test_9.o): New targets.
15966 * testsuite/Makefile.in: Rebuild.
15967
92de84a6
ILT
159682008-07-22 Ian Lance Taylor <iant@google.com>
15969
34810851
ILT
15970 * options.h (class General_options): Define --check-sections.
15971 * layout.cc (Layout::set_segment_offsets): Handle
15972 --check-sections.
15973
af6156ef
ILT
15974 * options.h (class General_options): Define -n/--nmagic and
15975 -N/--omagic.
15976 * options.cc (General_options::finalize): For -n/--nmagic or
15977 -N/--omagic, set -static.
15978 * layout.cc (Layout::attach_allocated_section_to_segment): If
15979 -N/--omagic, don't put read-only and read-write sections in
15980 different segments.
15981 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
15982 finding a read-only segment.
15983 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
15984 don't set the minimum segment alignment to the common page size,
15985 and don't set the file offset to the address modulo the page size.
15986 * script-sections.cc (Script_sections::create_segments): If
15987 -n/--omagic, don't put read-only and read-write sections in
15988 different segments.
15989
92de84a6
ILT
15990 * cref.cc: New file.
15991 * cref.h: New file.
15992 * options.h (class General_options): Add --print-symbol-counts.
15993 * main.cc (main): Issue defined symbol report if requested.
15994 * archive.cc (Archive::interpret_header): Make into a const member
15995 function.
15996 (Archive::add_symbols): Call Input_objects::archive_start and
15997 archive_stop.
15998 (Archive::const_iterator): Define new class.
15999 (Archive::begin, Archive::end): New functions.
16000 (Archive::include_all_members): Rewrite to use iterator.
16001 (Archive::count_members): New function.
16002 * archive.h (class Archive): Update declarations.
16003 (Archive::filename): New function.
16004 * object.cc: Include "cref.h".
16005 (Sized_relobj::Sized_relobj): Initialize defined_count_.
16006 (Sized_relobj::do_get_global_symbol_counts): New function.
16007 (Input_objects::add_object): Add object to cross-referencer.
16008 (Input_objects::archive_start): New function.
16009 (Input_objects::archive_stop): New function.
16010 (Input_objects::print_symbol_counts): New function.
16011 * object.h: Declare Cref and Archive.
16012 (Object::get_global_symbol_counts): New function.
16013 (Object::do_get_global_symbol_counts): New pure virtual function.
16014 (class Sized_relobj): Add defined_count_ field. Update
16015 declarations.
16016 (class Input_objects): Add cref_ field. Update constructor.
16017 Update declarations.
16018 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
16019 defined_count_.
16020 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
16021 symbol counts.
16022 (Sized_dynobj::do_get_global_symbol_counts): New function.
16023 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
16024 defined_count_. Update declarations. Define Symbols typedef.
16025 * symtab.cc (Symbol_table::add_from_relobj): Add defined
16026 parameter. Change all callers.
16027 (Symbol_table::add_from_dynobj): Add sympointers and defined
16028 parameters. Change all callers.
16029 * symtab.h (class Symbol_table): Update declarations.
16030 * Makefile.am (CCFILES): Add cref.cc.
16031 (HFILES): Add cref.h.
16032 * Makefile.in: Rebuild.
16033
3f7c5e1d
CD
160342008-07-22 Simon Baldwin <simonb@google.com>
16035
16036 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
16037 to zero when writing undefined symbols.
16038
e0b64032
ILT
160392008-07-22 Ian Lance Taylor <iant@google.com>
16040
16041 * output.cc (Output_section::add_input_section): Don't try to
16042 merge empty merge sections.
16043
096b02cf
CS
160442008-07-21 Craig Silverstein <csilvers@google.com>
16045
16046 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
16047 Include symbol version in error message.
cd536b21 16048
1d1f116d
CD
160492008-07-20 Chris Demetriou <cgd@google.com>
16050
cd536b21 16051 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
16052 (RANDOM_SEED_CFLAGS): New substituted variable.
16053 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
16054 * configure: Rebuild.
16055 * Makefile.in: Likewise.
16056 * testsuite/Makefile.in: Likewise.
16057
a18f591e
ILT
160582008-07-18 Ian Lance Taylor <iant@google.com>
16059
16060 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
16061 where we see NAME/NULL and NAME/VERSION as separate symbols.
16062 * testsuite/ver_test_main.cc (main): Call t4.
16063 (t4, t4_2a): Define.
16064 * testsuite/ver_test_2.cc (t4_2): Define.
16065 * testsuite/ver_test_2.script: Put t4_2a in VER2.
16066 * testsuite/ver_test_4.cc (t4_2a): Define.
16067 * testsuite/ver_test_4.script: Put t4_2a in VER2.
16068 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
16069
c6e3f6ed
ILT
160702008-07-17 Ian Lance Taylor <iant@google.com>
16071
16072 * dynobj.cc (Versions::add_def): If we give an error about a
16073 missing version, go ahead and create the version anyhow.
16074
ef9beddf
ILT
160752008-07-10 Ian Lance Taylor <iant@google.com>
16076
16077 Handle output sections with more than 0x7fffffff bytes.
16078 * object.h (class Relobj): Change map_to_output_ to
16079 output_sections_, and just keep a section pointer. Change all
16080 uses. Move comdat group support to Sized_relobj.
16081 (Relobj::is_section_specially_mapped): Remove.
16082 (Relobj::output_section): Remove poff parameter. Change all
16083 callers.
16084 (Relobj::output_section_offset): New function.
16085 (Relobj::set_section_offset): Rewrite.
16086 (Relobj::map_to_output): Remove.
16087 (Relobj::output_sections): New function.
16088 (Relobj::do_output_section_offset): New pure virtual function.
16089 (Relobj::do_set_section_offset): Likewise.
16090 (class Sized_relobj): Add section_offsets_ field. Add comdat
16091 group support from Relobj. Update declarations.
16092 (Sized_relobj::get_output_section_offset): New function.
16093 (Sized_relobj::do_output_section_offset): New function.
16094 (Sized_relobj::do_set_section_offset): New function.
16095 * object.cc (Relobj::output_section_address): Remove.
16096 (Sized_relobj::Sized_relobj): Initialize new fields.
16097 (Sized_relobj::include_section_group): Cast find_kept_object to
16098 Sized_relobj.
16099 (Sized_relobj::include_linkonce_section): Likewise.
16100 (Sized_relobj::do_layout): Use separate arrays for output section
16101 and output offset.
16102 (Sized_relobj::do_count_local_symbols): Change map_to_output to
16103 output_sections.
16104 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
16105 output_sections and section_offsets.
16106 (Sized_relobj::write_local_symbols): Likewise.
16107 (map_to_kept_section): Compute output address directly.
16108 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
16109 output_sections and section_offsets.
16110 (Sized_relobj::write_sections): Likewise.
16111 (Sized_relobj::relocate_sections): Likewise.
16112 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
16113 * output.h (class Output_reloc): Update declarations. Change
16114 u2_.relobj to Sized_relobj*.
16115 (class Output_data_reloc): Change add functions to use
16116 Sized_relobj*.
16117 * output.cc (Output_reloc::Output_reloc): Change relobj to
16118 Sized_relobj*.
16119 (Output_reloc::local_section_offset): Change return type to
16120 Elf_Addr. Use get_output_section_offset.
16121 (Output_reloc::get_address): Likewise.
16122 (Output_section::is_input_address_mapped): Don't call
16123 is_section_specially_mapped.
16124 (Output_section::output_offset): Likewise.
16125 (Output_section::output_address): Likewise.
16126 (Output_section::starting_output_address): Likewise.
16127 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
16128 parameter to Sized_relobj*.
16129 (Copy_relocs::need_copy_reloc): Likewise.
16130 (Copy_relocs::save): Likewise.
16131 * copy-relocs.h (class Copy_relocs): Update declarations.
16132 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
16133 Sized_relobj*. Change relobj_ field to Sized_relobj*.
16134 * target-reloc.h (relocate_for_relocatable): Change
16135 offset_in_output_section type to Elf_Addr. Change code that uses
16136 it as well.
16137 * layout.cc (Layout::layout): Always set *off.
16138 * mapfile.cc (Mapfile::print_input_section): Use
16139 output_section_offset.
16140 * i386.cc (Target_i386::copy_reloc): Change object parameter to
16141 Sized_relobj*.
16142 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
16143 * sparc.cc (Target_sparc::copy_reloc): Likewise.
16144 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
16145
5cb66f97
ILT
161462008-07-03 Ian Lance Taylor <iant@google.com>
16147
16148 * layout.cc (Layout::include_section): Do not discard unrecognized
16149 SHT_STRTAB sections.
16150
afe47622
CS
161512008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
16152
16153 * script.cc (Lex::can_continue_name): Make '?' allowable in
16154 version-script names.
16155 * testsuite/version_script.map: Change glob pattern to use '?'
16156
5adf9721
ILT
161572008-06-30 Manish Singh <yosh@gimp.org>
16158
16159 PR 6585
16160 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
16161 Correct typo.
16162
e6fde208
ILT
161632008-06-30 Ian Lance Taylor <iant@google.com>
16164
16165 PR 6660
16166 PR 6682
16167 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
16168 versions]: Don't try to read the value in the contents, since we
16169 don't use it. Use the template endianness when writing.
16170
3f2e6a2d
CC
161712008-06-25 Cary Coutant <ccoutant@google.com>
16172
16173 * fileread.cc (File_read::make_view): Assert on zero-length view.
16174 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
16175 symbol table when there are no symbols to read.
16176
c43d3a48
CS
161772008-06-23 Craig Silverstein <csilvers@google.com>
16178
16179 * version.cc (version_string): Bump to 1.7
16180
5f494ea0
CS
161812008-06-18 Craig Silverstein <csilvers@google.com>
16182
16183 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
16184 constant 0xFFFF to type Valtype.
16185 (Powerpc_relocate_functions::rel16_ha): Likewise.
16186
c42e122e
ILT
161872008-06-17 Ian Lance Taylor <iant@google.com>
16188
f34787f8
ILT
16189 * output.h (Output_section::Input_section): Initialize p2align_ to
16190 zero for Output_section_data constructors.
16191 (Output_section::Input_section::addralign): If not an input
16192 section, return the alignment of the Output_section_data.
16193 * testsuite/copy_test.cc: New file.
16194 * testsuite/copy_test_1.cc: New file.
16195 * testsuite/copy_test_2.cc: New file.
16196 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
16197 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
16198 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
16199 (copy_test_1_pic.o, copy_test_1.so): New targets.
16200 (copy_test_2_pic.o, copy_test_2.so): New targets.
16201 * testsuite/Makefile.in: Rebuild.
16202
c42e122e
ILT
16203 * script-sections.cc (Script_sections::place_orphan): Initialize
16204 local variable exact.
16205
ce3ac18a
DE
162062008-06-13 David Edelsohn <edelsohn@gnu.org>
16207
16208 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
16209
42cacb20
DE
162102008-06-12 David Edelsohn <edelsohn@gnu.org>
16211 David S. Miller <davem@davemloft.net>
16212
16213 * powerpc.cc: New file.
16214 * Makefile.am (TARGETSOURCES): Add powerpc.cc
16215 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
16216 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
16217 * Makefile.in: Rebuild.
16218
7b308235
ILT
162192008-06-09 Ian Lance Taylor <iant@google.com>
16220
16221 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
16222 <exception>.
16223 (throwing, orig_terminate): New static variables.
16224 (terminate_handler): New static function.
16225 (t2): Set terminate handler.
16226
f0b886e3
ILT
162272008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
16228
16229 PR 6584
cd536b21 16230 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
16231 alignment.
16232
3e90f135
CC
162332008-05-30 Cary Coutant <ccoutant@google.com>
16234
16235 * archive.cc (Archive::include_all_members) Correct to step
16236 over symbol table and extended name table in thin archives.
16237
e09ad04a
ILT
162382008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
16239
16240 PR 6407
16241 * target-reloc.h (relocate_for_relocatable): Fix new_offset
16242 calculation.
16243
62b01cb5
ILT
162442008-05-28 Caleb Howe <cshowe@google.com>
16245
16246 * reduced_debug_output.cc: New file.
16247 * reduced_debug_output.h: New file.
92de84a6 16248 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
16249 * options.cc (General_options::finalize): Add strip_debug_non_line
16250 to the strip heirarchy.
16251 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
16252 fields.
16253 * layout.cc: Include "reduced_debug_output.h".
16254 (Layout::Layout): Initialize new fields.
16255 (line_only_debug_sections): New static array.
16256 (is_lines_only_debug_sections): New static inline function.
16257 (Layout::include_section): Handle --strip-debug-non-line.
16258 (Layout::make_output_section): If --strip-debug-non-line, build
16259 new output sections for .debug_abbrev and .debug_info.
16260 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
16261 gold. Warn about possible overflow.
16262 (read_signed_LEB_128): Likewise.
16263 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
16264 (read_signed_LEB_128): Declare.
16265 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
16266 (HFILES): Add reduced_debug_output.h.
16267 * Makefile.in: Rebuild.
16268
7d9e3d98
ILT
162692008-05-21 Ian Lance Taylor <iant@google.com>
16270
16271 * mapfile.cc: New file.
16272 * mapfile.h: New file.
16273 * options.h (class General_options): Add -M/--print-map and -Map.
16274 * options.cc (General_options::finalize): Make -M equivalent to
16275 -Map -.
16276 * main.cc: Include <cstdio> and "mapfile.h".
16277 (main): Open mapfile if requested.
16278 * gold.cc (class Middle_runner): Add mapfile_ field. Update
16279 constructor. Change caller.
16280 (queue_initial_tasks): Add mapfile parameter. Change caller.
16281 (queue_middle_tasks): Likewise.
16282 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
16283 declarations.
16284 * archive.cc: Include "mapfile.h".
16285 (Archive::add_symbols): Add mapfile parameter. Change all
16286 callers. Pass mapfile, symbol, and reason to include_member.
16287 (Archive::include_all_members): Add mapfile parameter. Change all
16288 callers.
16289 (Archive::include_member): Add mapfile, sym, and why parameters.
16290 Change all callers. Report inclusion to map file.
16291 * archive.h: Include "fileread.h".
16292 (class Archive): Update declarations.
16293 (Archive::file): New const method.
16294 (class Add_archive_symbols): Add mapfile_ field. Update
16295 constructor. Change all callers.
16296 * readsyms.h (class Read_symbols): Likewise.
16297 (class Finish_group): Likewise.
16298 (class Read_script): Likewise.
16299 * common.cc: Include "mapfile.h".
16300 (Symbol_table::allocate_commons): Add mapfile parameter. Change
16301 all callers.
16302 (Symbol_table::do_allocate_commons): Likewise.
16303 (Symbol_table::do_allocate_commons_list): Likewise. Report common
16304 symbol allocation to mapfile.
16305 * common.h (class Allocate_commons_task): Add mapfile_ field.
16306 Update constructor. Change all callers.
16307 * symtab.h (class Symbol_table): Update declarations.
16308 * layout.cc: Include "mapfile.h".
16309 (Layout_task_runner::run): Print information to mapfile.
16310 (Layout::create_gold_note): Change Output_data_fixed_space to
16311 Output_data_zero_fill.
16312 (Layout::create_build_id): Likewise.
16313 (Layout::print_to_mapfile): New function.
16314 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
16315 constructor. Change caller.
16316 (class Layout): Declare print_to_mapfile.
16317 * output.cc (Output_section::Input_section::print_to_mapfile): New
16318 function.
16319 (Output_section::add_input_section): If producing a map, always
16320 add to input_sections_ list.
16321 (Output_section::do_print_to_mapfile): New function.
16322 (Output_segment::print_sections_to_mapfile): New function.
16323 (Output_segment::print_section_list_to_mapfile): New function.
16324 * output.h: Include "mapfile.h".
16325 (Output_data::print_to_mapfile): New function.
16326 (Output_data::do_print_to_mapfile): New virtual function.
16327 (Output_segment_headers::do_print_to_mapfile): New function.
16328 (Output_file_header::do_print_to_mapfile): New function.
16329 (Output_data_const::do_print_to_mapfile): New function.
16330 (class Output_data_const_buffer): Add map_name_ field. Update
16331 constructor. Change all callers. Add do_print_to_mapfile
16332 function.
16333 (class Output_data_fixed_space): Likewise.
16334 (class Output_data_space): Likewise.
16335 (class Output_data_zero_fill): New class.
16336 (Output_data_strtab::do_print_to_mapfile): New function.
16337 (Output_data_reloc_base::do_print_to_mapfile): New function.
16338 (Output_relocatable_relocs::do_print_to_mapfile): New function.
16339 (Output_data_group::do_print_to_mapfile): New function.
16340 (Output_data_got::do_print_to_mapfile): New function.
16341 (Output_data_dynamic::do_print_to_mapfile): New function.
16342 (Output_symtab_xindex::do_print_to_mapfile): New function.
16343 (class Output_section): Declare do_print_to_mapflie. Declare
16344 print_to_mapfile in Input_section.
16345 (class Output_segment): Declare new functions.
16346 * object.h (Sized_relobj::symbol_count): New function.
16347 * script-sections.cc
16348 (Output_section_element_dot_assignment::set_section_addresses):
16349 Change Output_data_fixed_space to Output_data_zero_fill.
16350 (Output_data_expression::do_print_to_mapfile): New function.
16351 * script.cc (read_input_script): Add mapfile parameter. Change
16352 all callers.
16353 * script.h (read_input_script): Update declaration.
16354 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
16355 (Eh_frame::do_print_to_mapfile): New function.
16356 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
16357 (Output_merge_string::do_print_to_mapfile): New function.
16358 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
16359 function.
16360 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
16361 function.
16362 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
16363 function.
16364 * Makefile.am (CCFILES): Add mapfile.cc.
16365 (HFILES): Add mapfile.h.
16366 * Makefile.in: Rebuild.
16367
9f1d377b
ILT
163682008-05-19 Ian Lance Taylor <iant@google.com>
16369
16370 * options.h (class General_options): Add -z relro.
16371 * layout.cc (Layout::Layout): Initialize relro_segment_.
16372 (Layout::add_output_section_data): Return the output section.
16373 (Layout::make_output_section): Rcognize relro sections and mark
16374 them appropriately.
16375 (Layout::attach_allocated_section_to_segment): Put relro sections
16376 in a PT_GNU_RELRO segment.
16377 (Layout::create_initial_dynamic_sections): Mark the .dynamic
16378 section as relro.
16379 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
16380 PT_TLS segments.
16381 (Layout::linkonce_mapping): Map d.rel.ro.local to
16382 .data.rel.ro.local.
16383 (Layout::output_section_name): Us .data.rel.ro.local for any
16384 section which begins with that.
16385 * layout.h (class Layout): Update add_output_section_data
16386 declaration. Add relro_segment_ field.
16387 * output.cc (Output_section::Output_section): Initialize is_relro_
16388 and is_relro_local_ fields.
16389 (Output_segment::add_output_section): Group relro sections.
16390 (Output_segment::is_first_section_relro): New function.
16391 (Output_segment::maximum_alignment): If there is a relro section,
16392 align the segment to the common page size.
16393 (Output_segment::set_section_addresses): Track whether we are
16394 looking at relro sections. If the last section is a relro
16395 section, align to the common page size.
16396 (Output_segment::set_section_list_addresses): Add in_relro
16397 parameter. Change all callers. Align to the page size when
16398 moving from relro to non-relro section.
16399 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
16400 segment.
16401 * output.h (class Output_section): Add is_relro_ and
16402 is_relro_local_ fields.
16403 (Output_section::is_relro): New function.
16404 (Output_section::set_is_relro): New function.
16405 (Output_section::is_relro_local): New function.
16406 (Output_section::set_is_relro_local): New function.
16407 (class Output_segment): Update declarations.
16408 * i386.cc (Target_i386::got_section): Mark .got section as relro.
16409 * sparc.cc (Target_sparc::got_section): Likewise.
16410 * x86_64.cc (Target_x86_64::got_section): Likewise.
16411 * testsuite/relro_test_main.cc: New file.
16412 * testsuite/relro_test.cc: New file.
16413 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
16414 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
16415 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
16416 (relro_test.so, relro_test_pic.o): New targets.
16417 * testsuite/Makefile.in: Rebuild.
16418
a984ee1d
ILT
164192008-05-16 Ian Lance Taylor <iant@google.com>
16420
01676dcd
ILT
16421 * output.cc (Output_segment::add_output_section): Remove front
16422 parameter.
16423 * output.h (class Output_segment): Remove
16424 add_initial_output_section and overloaded add_output_section.
16425 Update declaration of remaining add_output_section.
16426 * layout.cc (Layout::create_interp): Call add_output_section
16427 rather than add_initial_output_section.
16428 (Layout::finish_dynamic_section): Likewise.
16429
497897f9
ILT
16430 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
16431 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
16432 know the dynamic type.
16433 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
16434 field. Initialize it in constructor.
16435 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
16436 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
16437 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
16438 reloc.
16439
a984ee1d
ILT
16440 * output.cc (Output_reloc::get_address): Change return type to
16441 Elf_Addr.
16442 * output.h (class Output_reloc): Update get_address declaration.
16443 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
16444 for section addresses.
16445
55ba0940
ILT
164462008-05-09 Ian Lance Taylor <iant@google.com>
16447
16448 PR 6493
16449 * gold.cc (gold_nomem): Use return value of write.
16450
75517b77
ILT
164512008-05-08 Ian Lance Taylor <iant@google.com>
16452
16453 * symtab.c (Symbol::init_base_output_data): Add version
16454 parameter. Change all callers.
16455 (Symbol::init_base_output_segment): Likewise.
16456 (Symbol::init_base_constant): Likewise.
16457 (Symbol::init_base_undefined): Likewise.
16458 (Sized_symbol::init_output_data): Likewise.
16459 (Sized_symbol::init_output_segment): Likewise.
16460 (Sized_symbol::init_constant): Likewise.
16461 (Sized_symbol::init_undefined): Likewise.
16462 (Symbol_table::do_define_in_output_data): If the new symbol has a
16463 version, mark it as the default.
16464 (Symbol_table::do_define_in_output_segment): Likewise.
16465 (Symbol_table::do_define_as_constant): Likewise.
16466 * symtab.h (class Symbol): Update declarations.
16467 (class Sized_symbol): Likewise.
16468 * resolve.cc (Symbol::override_version): New function.
c42e122e 16469 (Symbol::override_base): Call override_version.
75517b77
ILT
16470 (Symbol::override_base_with_special): Likewise.
16471 * testsuite/ver_script_8.script: New file.
16472 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
16473 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
16474 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
16475 (ver_test_8_1.so, ver_test_8_2.so): New targets.
16476
f1f70eae
ILT
164772008-05-06 Ian Lance Taylor <iant@google.com>
16478
f3e9c5c5
ILT
16479 PR 6049
16480 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
16481 functions.
16482 (class General_options): Remove existing --undefined, and add
16483 --no-undefined instead. Add new --undefined as synonym for -u.
16484 * archive.cc (Archive::add_symbols): Check whether symbol was
16485 named with -u.
16486 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
16487 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
16488 all uses. Add IS_UNDEFINED. Update declarations to split
16489 different versions of init_base. Declare init_base_undefined.
16490 (Symbol::is_defined): Handle IS_UNDEFINED.
16491 (Symbol::is_undefined): Likewise.
16492 (Symbol::is_weak_undefined): Call is_undefined.
16493 (Symbol::is_absolute): Handle IS_CONSTANT.
16494 (class Sized_symbol): Update declarations to split different
16495 versions of init. Declare init_undefined.
16496 (class Symbol_table): Declare new functions.
16497 * symtab.cc (Symbol::init_base_object): Rename from init_base.
16498 Change all callers.
16499 (Symbol::init_base_output_data): Likewise.
16500 (Symbol::init_base_output_segment): Likewise.
16501 (Symbol::init_base_constant): Likewise.
16502 (Symbol::init_base_undefined): New function.
16503 (Sized_symbol::init_object): Rename from init. Change all
16504 callers.
16505 (Sized_symbol::init_output_data): Likewise.
16506 (Sized_symbol::init_output_segment): Likewise.
16507 (Sized_symbol::init_constant): Likewise.
16508 (Sized_symbol::init_undefined): New function.
16509 (Symbol_table::add_undefined_symbols_from_command_line): New
16510 function.
16511 (Symbol_table::do_add_undefined_symbols_from_command_line): New
16512 function.
16513 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
16514 (Symbol::output_section): Likewise.
16515 (Symbol::set_output_section): Likewise.
16516 (Symbol_table::sized_finalize_symbol): Likewise.
16517 (Symbol_table::sized_write_globals): Likewise.
16518 * resolve.cc (Symbol_table::should_override): Likewise.
16519 (Symbol::override_base_with_special): Likewise.
16520
8bdcdf2c
ILT
16521 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
16522 symbol, change it to have default visibility.
16523 * testsuite/protected_1.cc: New file.
16524 * testsuite/protected_2.cc: New file.
16525 * testsuite/protected_3.cc: New file.
16526 * testsuite/protected_main_1.cc: New file.
16527 * testsuite/protected_main_2.cc: New file.
16528 * testsuite/protected_main_3.cc: New file.
16529 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
16530 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
16531 (protected_1_LDFLAGS, protected_1_LDADD): Define.
16532 (protected_1.so): New target.
16533 (protected_1_pic.o, protected_2_pic.o): New targets.
16534 (protected_3_pic.o): New target.
16535 (check_PROGRAMS): Add protected_2.
16536 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
16537 (protected_2_LDFLAGS, protected_2_LDADD): Define.
16538 * testsuite/Makefile.in: Rebuild.
16539
2b706932
ILT
16540 * options.h (DEFINE_var): Add set_user_set_##varname__.
16541 (DEFINE_bool_alias): New macro.
16542 (class General_options): Define -Bstatic using DEFINE_bool_alias
16543 rather than DEFINE_special. Add --undefined as an alias for -z
16544 defs.
16545 * options.cc (General_options::parse_Bstatic): Remove.
16546
d82a5bcc
ILT
16547 * options.h (class General_options): Add --fatal-warnings.
16548 * main.cc (main): Implement --fatal-warnings.
16549 * errors.h (Errors::warning_count): New function.
16550
f1f70eae
ILT
16551 * options.h (class General_options): Add -Bsymbolic-functions.
16552 * symtab.h (Symbol::is_preemptible): Check for
16553 -Bsymbolic-functions.
16554
8825ac63
ILT
165552008-05-05 Ian Lance Taylor <iant@google.com>
16556
d98bc257
ILT
16557 * options.h (DEFINE_bool): For DASH_Z, create the negative option
16558 as noVARNAME rather than no-VARNAME.
16559 (class General_options): Add option -z combreloc.
16560 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
16561 get_address.
16562 (Output_reloc::sort_before) [SHT_REL]: New function.
16563 (Output_reloc::sort_before) [SHT_RELA]: New function.
16564 (class Output_data_reloc_base): Add sort_relocs_ field. Define
16565 Sort_relocs_comparison.
16566 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
16567 parameter. Change all callers.
16568 (Output_data_reloc::Output_data_reloc) [both versions]: Add
16569 sort_relocs parameter. Change all callers.
16570 * output.cc (Output_reloc::get_address): New function, broken out
16571 of write_rel.
16572 (Output_reloc::write_rel): Call it.
16573 (Output_reloc::compare): New function.
16574 (Output_data_reloc_base::do_write): Optionally sort relocs.
16575
60b2b4e7
ILT
16576 * configure.ac: If targ_extra_obj is set, link it in.
16577 * configure.tgt: Initialize all variables.
16578 (x86_64*): Set targ_extra_obj and targ_extra_size.
16579 * configure: Rebuild.
16580
8825ac63
ILT
16581 * object.cc (Sized_relobj::include_section_group): Adjust section
16582 indexes read from group data. Build vector to pass to
16583 layout_group.
16584 * layout.cc (Layout::layout_group): Add flags and shndxes
16585 parameters. Remove contents parameter. Change caller. Update
16586 explicit instantiations.
16587 * layout.h (class Layout): Update layout_group declaration.
16588 * output.cc (Output_data_group::Output_data_group): Add flags and
16589 input_shndxes parameters. Remove contents parameter. Change
16590 caller.
16591 (Output_data_group::do_write): Change input_sections_ to
16592 input_shndxes_.
16593 * output.h (class Output_data_group): Update constructor
16594 declaration. Rename input_sections_ to input_shndxes_.
16595 * testsuite/many_sections_test.cc: Add template.
16596
e94cf127
CC
165972008-04-30 Cary Coutant <ccoutant@google.com>
16598
4418b2d5
CC
16599 * target-reloc.h (relocate_section): Fix dead-pointer bug.
16600
e94cf127
CC
16601 * layout.cc (Layout::include_section): Refactored check for debug
16602 info section.
16603 (Layout::add_comdat): Add new parameters. Change type
16604 of signature parameter. Add object and shndx to signatures table.
16605 (Layout::find_kept_object): New function.
16606 * layout.h: Include <cstring>.
16607 (Layout::is_debug_info_section): New function.
16608 (Layout::add_comdat): Add new parameters.
16609 (Layout::find_kept_object): New function.
16610 (Layout::Kept_section): New struct.
16611 (Layout::Signatures): Change type of map range.
16612 * object.cc (Relobj::output_section_address): New function.
16613 (Sized_relobj::include_section_group): Add new parameters. Change
16614 calls to Layout::add_comdat. Change to build table of kept comdat
16615 groups and table mapping discarded sections to kept sections.
16616 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
16617 (Sized_relobj::do_layout): Change calls to include_section_group and
16618 include_linkonce_section.
16619 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
16620 value to zero when section is discarded.
16621 (Sized_relobj::map_to_kept_section): New function.
16622 * object.h (Relobj::output_section_address): New function.
16623 (Relobj::Comdat_group): New type.
16624 (Relobj::find_comdat_group): New function.
16625 (Relobj::Comdat_group_table): New type.
16626 (Relobj::Kept_comdat_section): New type.
16627 (Relobj::Kept_comdat_section_table): New type.
16628 (Relobj::add_comdat_group): New function.
16629 (Relobj::set_kept_comdat_section): New function.
16630 (Relobj::get_kept_comdat_section): New function.
16631 (Relobj::comdat_groups_): New field.
16632 (Relobj::kept_comdat_sections_): New field.
16633 (Symbol_value::input_value): Update comment.
16634 (Sized_relobj::map_to_kept_section) New function.
16635 (Sized_relobj::include_linkonce_section): Add new parameter.
16636 * target-reloc.h (Comdat_behavior): New type.
16637 (get_comdat_behavior): New function.
16638 (relocate_section): Add code to map a discarded section to the
16639 corresponding kept section when applying a relocation.
16640
e4e5049b
CS
166412008-04-30 Craig Silverstein <csilvers@google.com>
16642
16643 * dwarf_reader.cc (next_generation_count): New static var.
16644 (Addr2line_cache_entry): New struct.
16645 (addr2line_cache): New static var.
16646 (Dwarf_line_info::one_addr2line): Added caching.
16647 (Dwarf_line_info::clear_addr2line_cache): New function.
16648 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
16649 cache-size parameter.
16650 (Dwarf_line_info::one_addr2line_cache): New function.
16651 * symtab.cc (Symbol_table::detect_odr_violations): Pass
16652 new cache-size argument to one_addr2line(), and clear cache.
16653
d09e9154
CC
166542008-04-28 Cary Coutant <ccoutant@google.com>
16655
16656 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
16657 R_386_PC8 relocations.
16658
7ef73768
ILT
166592008-04-23 Ian Lance Taylor <iant@google.com>
16660
55438702
ILT
16661 * object.cc (Sized_relobj::include_section_group): Check for
16662 invalid section group.
16663
c165fb93
ILT
16664 * object.cc (make_elf_object): Correct test for 64-bit ELF file
16665 header size.
16666
7ef73768
ILT
16667 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
16668 than read for file header.
16669 * archive.cc (Archive::include_member): Likewise.
16670
6194aaab
L
166712008-04-23 Paolo Bonzini <bonzini@gnu.org>
16672
16673 * aclocal.m4: Regenerate.
16674 * configure: Regenerate.
16675
d491d34e
ILT
166762008-04-19 Ian Lance Taylor <iant@google.com>
16677
5ea2bac6
ILT
16678 * version.cc (version_string): Bump to 1.6.
16679
7bc3e21a
ILT
16680 * testsuite/Makefile.am (many_sections_r_test): New target.
16681 (many_sections_r_test_SOURCES): Remove.
16682 (many_sections_r_test_DEPENDENCIES): Remove.
16683 (many_sections_r_test_LDFLAGS): Remove.
16684 (many_sections_r_test_LDADD): Remove.
16685
7fcd3aa9
ILT
16686 * object.cc (Sized_relobj::do_add_symbols): Always pass
16687 local_symbol_count_ to add_from_relobj.
16688
4c94d6ae
ILT
16689 * testsuite/Makefile.am (many_sections_check.h): Only check one in
16690 every thousand variables.
16691 * testsuite/Makefile.in: Rebuild.
16692
d491d34e
ILT
16693 * object.cc (Xindex::initialize_symtab_xindex): New function.
16694 (Xindex::read_symtab_xindex): New function.
16695 (Xindex::sym_xindex_to_shndx): New function.
16696 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
16697 available.
16698 (Sized_relobj::do_initialize_xindex): New function.
16699 (Sized_relobj::do_read_symbols): Adjust section links.
16700 (Sized_relobj::symbol_section_and_value): Add is_ordinary
16701 parameter. Change all callers.
16702 (Sized_relobj::include_section_group): Adjust section links and
16703 symbol section indexes.
16704 (Sized_relobj::do_layout): Adjust section links.
16705 (Sized_relobj::do_count_local_symbols): Adjust section links and
16706 symbol section indexes.
16707 (Sized_relobj::do_finalize_local_symbols): Distinguish between
16708 ordinary and special symbols.
16709 (Sized_relobj::write_local_symbols): Add symtab_xindex and
16710 dynsym_xindex parameters. Change all callers. Adjust section
16711 links. Use SHN_XINDEX when needed.
16712 (Sized_relobj::get_symbol_location_info): Adjust section links.
16713 Don't get fooled by special symbols.
16714 * object.h (class Xindex): Define.
16715 (class Object): Add xindex_ parameter. Declare virtual functoin
16716 do_initialize_xindex.
16717 (Object::adjust_sym_shndx): New function.
16718 (Object::set_xindex): New protected function.
16719 (class Symbol_value): Add is_ordinary_shndx_ field.
16720 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
16721 (Symbol_value::value): Assert ordinary section.
16722 (Symbol_value::initialize_input_to_output_map): Likewise.
16723 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
16724 Change all callers.
16725 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
16726 all callers.
16727 (class Sized_relobj): Update declarations.
16728 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
16729 parameter. Change all callers.
16730 (Sized_relobj::adjust_shndx): New function.
16731 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
16732 field.
16733 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
16734 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
16735 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
16736 (Sized_dynobj::read_dynsym_section): Adjust section links.
16737 (Sized_dynobj::read_dynamic): Likewise.
16738 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
16739 section links.
16740 (Sized_dynobj::do_initialize_xindex): New function.
16741 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
16742 do_initialize_xindex.
16743 (Sized_dynobj::adjust_shndx): New function.
16744 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
16745 dynsym_xindex_ fields.
16746 (Layout::finalize): Add a call to set_section_indexes before
16747 creating the symtab sections.
16748 (Layout::set_section_indexes): Don't do anything if the section
16749 already has a section index.
16750 (Layout::create_symtab_sections): Add shnum parameter. Change
16751 caller. Create .symtab_shndx section if needed.
16752 (Layout::create_shdrs): Add shstrtab_section parameter. Change
16753 caller.
16754 (Layout::allocated_output_section_count): New function.
16755 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
16756 needed.
16757 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
16758 fields. Update declarations.
16759 (Layout::symtab_xindex): New function.
16760 (Layout::dynsym_xindex): New function.
16761 (class Write_symbols_task): Add layout_ field.
16762 (Write_symbols_task::Write_symbols_task): Add layout parameter.
16763 Change caller.
16764 * output.cc (Output_section_headers::Output_section_headers): Add
16765 shstrtab_section parameter. Change all callers.
16766 (Output_section_headers::do_sized_write): Store overflow values
16767 for section count and section string table section index in
16768 section header zero.
16769 (Output_file_header::do_sized_write): Check for overflow of
16770 section count and section string table section index.
16771 (Output_symtab_xindex::do_write): New function.
16772 (Output_symtab_xindex::endian_do_write): New function.
16773 * output.h (class Output_section_headers): Add shstrtab_section_.
16774 Update declarations.
16775 (class Output_symtab_xindex): Define.
16776 (Output_section::has_out_shndx): New function.
16777 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
16778 field.
16779 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
16780 Change all callers.
16781 (Sized_symbol::init): Likewise.
16782 (Symbol::output_section): Check for ordinary symbol.
16783 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
16784 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
16785 callers.
16786 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
16787 Change all callers. Simplify handling of symbols from sections
16788 not included in the link.
16789 (Symbol_table::add_from_dynobj): Handle ordinary symbol
16790 distinction.
16791 (Weak_alias_sorter::operator()): Assert that symbols are
16792 ordinary.
16793 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
16794 distinction.
16795 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
16796 parameters. Change all callers.
16797 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
16798 symbol distinction. Use SHN_XINDEX when needed.
16799 (Symbol_table::write_section_symbol): Add symtab_xindex
16800 parameter. Change all callers.
16801 (Symbol_table::sized_write_section_symbol): Likewise. Use
16802 SHN_XINDEX when needed.
16803 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
16804 declarations.
16805 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
16806 (Symbol::is_defined): Check is_ordinary.
16807 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
16808 (Symbol::is_absolute, Symbol::is_common): Likewise.
16809 (class Sized_symbol): Update declarations.
16810 (class Symbol_table): Update declarations.
16811 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
16812 parameters. Change all callers.
16813 (Sized_symbol::override): Likewise.
16814 (Symbol_table::override): Likewise.
16815 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
16816 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
16817 is_ordinary, and orig_st_shndx parameters. Change all callers.
16818 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
16819 to be in an ordinary section.
16820 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
16821 object and is_ordinary parameters. Change all callers.
16822 (Sized_dwarf_line_info::read_relocs): Add object parameter.
16823 Change all callers. Don't add undefined or non-ordinary symbols
16824 to reloc_map_.
16825 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
16826 Change all callers.
16827 * dwarf_reader.h (class Sized_dwarf_line_info): Update
16828 declarations.
16829 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
16830 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
16831 (Sized_relobj::relocate_sections): Likewise.
16832 * target-reloc.h (scan_relocs): Adjust section symbol index.
16833 (scan_relocatable_relocs): Likewise.
16834 * i386.cc (Scan::local): Check for ordinary symbols.
16835 * sparc.cc (Scan::local): Likewise.
16836 * x86_64.cc (Scan::local): Likewise.
16837 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
16838 to symbol_section_and_value.
16839 * testsuite/many_sections_test.cc: New file.
16840 * testsuite/Makefile.am (BUILT_SOURCES): Define.
16841 (check_PROGRAMS): Add many_sections_test.
16842 (many_sections_test_SOURCES): Define.
16843 (many_sections_test_DEPENDENCIES): Define.
16844 (many_sections_test_LDFLAGS): Define.
16845 (BUILT_SOURCES): Add many_sections_define.h.
16846 (many_sections_define.h): New target.
16847 (BUILT_SOURCES): Add many_sections_check.h.
16848 (many_sections_check.h): New target.
16849 (check_PROGRAMS): Add many_sections_r_test.
16850 (many_sections_r_test_SOURCES): Define.
16851 (many_sections_r_test_DEPENDENCIES): Define.
16852 (many_sections_r_test_LDFLAGS): Define.
16853 (many_sections_r_test_LDADD): Define.
16854 (many_sections_r_test.o): New target.
16855 * testsuite/Makefile.in: Rebuild.
16856
c5818ff1
CC
168572008-04-17 Cary Coutant <ccoutant@google.com>
16858
16859 * errors.cc (Errors::info): New function.
16860 (gold_info): New function.
16861 * errors.h (Errors::info): New function.
16862 * gold.h (gold_info): New function.
16863 * object.cc (Input_objects::add_object): Print trace output.
16864 * options.cc (options::parse_set): New function.
16865 (General_options::parse_wrap): Deleted.
16866 (General_options::General_options): Deleted initializer.
16867 * options.h (options::String_set): New typedef.
16868 (options::parse_set): New function.
16869 (DEFINE_set): New macro.
16870 (General_options::wrap): Changed to use DEFINE_set. Changed
16871 callers of any_wrap_symbols and is_wrap_symbol.
16872 (General_options::trace, General_options::trace_symbol):
16873 New options.
16874 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
16875 (General_options::wrap_symbols_): Deleted.
16876 * symtab.cc (Symbol_table::add_from_object): Print trace output.
16877
b5be4a7c
DM
168782008-04-17 David S. Miller <davem@davemloft.net>
16879
16880 * options.cc (General_options::parse_V): New function.
16881 * options.h: Add entries for -V and -Qy.
16882
155a0dd7
ILT
168832008-04-17 Ian Lance Taylor <iant@google.com>
16884
16885 * common.cc (Symbol_table::allocate_commons): Remove options
16886 parameter. Change caller.
16887 (Symbol_table::do_allocate_commons): Remove options parameter.
16888 Change caller. Just call do_allocate_commons_list twice.
16889 (Symbol_table::do_allocate_commons_list): New function, broken out
16890 of do_allocate_commons.
16891 * common.h (class Allocate_commons_task): Remove options_ field.
16892 Update constructor.
16893 * symtab.cc (Symbol_table::Symbol_table): Initialize
16894 tls_commons_.
16895 (Symbol_table::add_from_object): Put TLS common symbols on
16896 tls_commons_ list.
16897 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
16898 which are IN_OUTPUT_DATA.
16899 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
16900 allocate_commons and do_allocate_commons declarations. Declare
16901 do_allocate_commons_list.
16902 * gold.cc (queue_middle_tasks): Update creation of
16903 Allocate_commons_task to not pass options.
16904 * testsuite/Makefile.am (INCLUDES): Add -I.. .
16905 (TLS_TEST_C_FLAGS): New variable.
16906 (tls_test_c_pic.o): New target.
16907 (tls_test_shared.so): Link in tls_test_c_pic.o.
16908 (tls_test_c_pic_ie.o): New target.
16909 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
16910 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
16911 (tls_test_c.o): New target.
16912 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
16913 (tls_pic_test_LDADD): Likewise.
16914 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
16915 (tls_shared_gd_to_ie_test_LDADD): Likewise.
16916 (tls_test_c_gnu2.o): New target.
16917 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
16918 tls_test_c_gnu2.o.
16919 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
16920 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
16921 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
16922 * testsuite/tls_test.cc: Include "config.h".
16923 (t_last): Call t11_last.
16924 * testsuite/tls_test.h (t11, t11_last): Declare.
16925 * testsuite/tls_test_c.c: New file.
16926 * testsuite/tls_test_main.cc (thread_routine): Call t11.
16927 * configure.ac: Check for OpenMP support.
16928 * configure, config.in, Makefile.in: Rebuild.
16929 * testsuite/Makefile.in: Rebuild.
16930
edfbb029
CC
169312008-04-16 Cary Coutant <ccoutant@google.com>
16932
16933 * i386.cc (Target_i386::define_tls_base_symbol): New function.
16934 (Target_i386::tls_base_symbol_defined_): New field.
16935 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
16936 (Target_i386::Scan::global): Likewise.
16937 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
16938 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
16939 (Target_x86_64::tls_base_symbol_defined_): New field.
16940 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
16941 (Target_x86_64::Scan::global): Likewise.
16942
f3c69fca
CC
169432008-04-16 Cary Coutant <ccoutant@google.com>
16944
16945 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
16946 (Symbol::needs_plt_entry): Allow weak undefined symbols.
16947 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
16948 building shared libraries.
16949 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
16950 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
16951 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
16952 * testsuite/Makefile.in: Rebuild.
16953 * testsuite/weak_undef.h: New file.
16954 * testsuite/weak_undef_file1.cc: Add extra test cases.
16955 * testsuite/weak_undef_file2.cc: Likewise.
16956 * testsuite/weak_undef_test.cc: Likewise.
16957
7c414435
DM
169582008-04-16 David S. Miller <davem@davemloft.net>
16959
32b769e1
DM
16960 * sparc.cc (Target_sparc::Scan): Change from struct to class.
16961 Add issued_non_pic_error_ field. Declare check_non_pic.
16962 (Target_sparc::Scan::check_non_pic): New function.
16963 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
16964 (Target_sparc::Scan::global): Likewise.
16965
11936fb1
DM
16966 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
16967 * configure: Rebuild.
16968
7c414435
DM
16969 * options.h (DEFINE_enable): New macro.
16970 (new_dtags): New enable option.
16971 (initfirst, interpose, loadfltr, nodefaultlib,
16972 nodelete, nodlopen, nodump): New -z options.
16973 * layout.cc (Layout:finish_dynamic_section): If new
16974 dtags enabled, emit DT_RUNPATH. Also, emit a
16975 DT_FLAGS_1 containing any specified -z flags.
16976
85c7bf8b
ILT
169772008-04-16 Ian Lance Taylor <iant@google.com>
16978
12c0daef
ILT
16979 * copy-relocs.cc: New file.
16980 * copy-relocs.h: New file.
16981 * reloc.cc: Remove Copy_relocs code.
16982 * reloc.h: Likewise.
16983 * reloc-types.h (struct Reloc_types) [both versions]: Add
16984 get_reloc_addend_noerror.
16985 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
16986 variants of add_global which take an addend which must be zero.
16987 * i386.cc: Include "copy-relocs.h".
16988 (class Target_i386): Change type of copy_relocs_ to variable,
16989 update initializer.
16990 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
16991 Change all callers.
16992 (Target_i386::do_finalize_sections): Change handling of
16993 copy_relocs_.
16994 * sparc.cc: Include "copy-relocs.h".
16995 (class Target_sparc): Change type of copy_relocs_ to variable,
16996 update initializer.
16997 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
16998 Change all callers.
16999 (Target_sparc::do_finalize_sections): Change handling of
17000 copy_relocs_.
17001 * x86_64.cc: Include "copy-relocs.h".
17002 (class Target_x86_64): Change type of copy_relocs_ to variable,
17003 update initializer.
17004 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
17005 class. Change all callers.
17006 (Target_x86_64::do_finalize_sections): Change handling of
17007 copy_relocs_.
17008 * Makefile.am (CCFILES): Add copy-relocs.cc.
17009 (HFILES): Add copy-relocs.h.
17010
4f4995b6
ILT
17011 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
17012
85c7bf8b
ILT
17013 * testsuite/script_test_4.sh: Permit leading zeroes.
17014
4f2a9edd
ILT
170152008-04-15 Ian Lance Taylor <iant@google.com>
17016
e6188289
ILT
17017 * script-sections.cc (Script_sections::create_segments): Use
17018 header_size_adjustment even when there is enough room for the
17019 headers.
17020 * testsuite/script_test_4.sh: New file.
17021 * testsuite/script_test_4.t: New file.
17022 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
17023 (check_DATA): Add script_test_4.stdout.
17024 (MOSTLYCLEANFILES): Likewise.
17025 (script_test_4): New target.
17026 (script_test_4.stdout): New target.
17027 * testsuite/Makefile.in: Rebuild.
17028
4f2a9edd
ILT
17029 * sparc.cc: Add definitions for Output_data_plt_sparc class
17030 constants.
17031
f5314dd5
DM
170322008-04-14 David S. Miller <davem@davemloft.net>
17033
17034 * sparc.cc: New file.
17035 * Makefile.am (TARGETSOURCES): Add sparc.cc
17036 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
17037 * configure.tgt: Document targ_extra_size and
17038 targ_extra_big_endian. Add entries for sparc-* and
17039 sparc64-*.
17040 * configure.ac: Handle targ_extra_size and
17041 targ_extra_big_endian.
17042 * Makefile.in: Rebuild.
17043 * configure: Likewise.
17044 * po/POTFILES.in: Likewise.
17045 * po/gold.pot: Likewise.
17046
154e0e9a
ILT
170472008-04-14 Ian Lance Taylor <iant@google.com>
17048
17049 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
17050 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
17051 in the name/type/flags to section mapping. Don't call
17052 allocate_output_section.
17053 (Layout::choose_output_section): Change parameter from adjust_name
17054 to is_input_section. Don't permit input sections after sections
17055 are attached to segments. Don't call allocate_output_section.
17056 (Layout::layout_eh_frame): Call update_flags_for_input_section,
17057 not write_enable_output_section.
17058 (Layout::make_output_section): Don't push to
17059 unattached_section_list_ nor call attach_to_segment. Call
17060 attach_section_to_segment if sections are attached.
17061 (Layout::attach_sections_to_segments): New function.
17062 (Layout::attach_section_to_segment): New function.
17063 (Layout::attach_allocated_section_to_segment): Rename from
17064 attach_to_segment. Remove flags parameter.
17065 (Layout::allocate_output_section): Remove function.
17066 (Layout::write_enable_output_section): Remove function.
17067 * layout.h (class Layout): Update for above changes. Add new
17068 field sections_are_attached_.
17069 * output.h (Output_section::update_flags_for_input_section): New
17070 function.
17071 * output.cc (Output_section::add_input_section): Call
17072 update_flags_for_input_section.
17073 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
17074
009a67a2
CC
170752008-04-11 Cary Coutant <ccoutant@google.com>
17076
17077 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
17078 thought unnecessary.
17079 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
17080
759b1a24
ILT
170812008-04-11 Ian Lance Taylor <iant@google.com>
17082
17083 * output.h (class Output_section_data): Remove inline definition
17084 of set_addralign.
17085 * output.cc (Output_section_data::set_addralign): New function.
17086
c2b45e22
CC
170872008-04-11 Cary Coutant <ccoutant@google.com>
17088
17089 Add support for TLS descriptors for i386 and x86_64.
17090 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
17091 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
17092 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
17093 GOT_TYPE_TLS_DESC.
17094 (Target_i386::got_mod_index_entry): Remove unnecessary code.
17095 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
17096 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
17097 relocations.
17098 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
17099 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
17100 Fix problem with initial-exec relocations.
17101 (Target_i386::Relocate::relocate_tls): Likewise.
17102 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
17103 relaxation.
17104 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
17105 support for section-plus-offset dynamic table entries.
17106 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
17107 (Output_data_dynamic::Dynamic_entry): Add support for
17108 section-plus-offset dynamic table entries.
17109 (Output_data_dynamic::Classification): Likewise.
17110 (Output_data_dynamic::classification_): Renamed offset_.
17111 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
17112 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
17113 (Target_x86_64::make_plt_section): New function.
17114 (Target_x86_64::reserve_tlsdesc_entries): New function.
17115 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
17116 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
17117 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
17118 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
17119 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
17120 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
17121 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
17122 add extra PLT entry for TLS descriptors.
17123 (Output_data_plt_x86_64::got_): New field.
17124 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
17125 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
17126 fields.
17127 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
17128 descriptors.
17129 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
17130 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
17131 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
17132 R_386_TLS_DESC_CALL relocations.
17133 (Target_x86_64::Scan::global): Likewise.
17134 (Target_x86_64::do_finalize_sections): Add dynamic table entries
17135 for TLS descriptors.
17136 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
17137 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
17138 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
17139 GD-to-IE relaxation.
17140 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
17141 and TLS_DESCRIPTORS.
17142 * Makefile.in: Rebuild.
17143 * configure: Rebuild.
17144 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
17145 (tls_test_shared2.so): New target.
17146 (tls_shared_gd_to_ie_test_SOURCES): New variable.
17147 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
17148 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
17149 (tls_shared_gd_to_ie_test_LDADD): New variable.
17150 (tls_shared_gnu2_gd_to_ie_test): New target.
17151 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
17152 New targets.
17153 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
17154 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
17155 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
17156 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
17157 (tls_shared_gnu2_test): New target.
17158 (tls_test_gnu2_shared.so): New target.
17159 (tls_shared_gnu2_test_SOURCES): New variable.
17160 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
17161 (tls_shared_gnu2_test_LDFLAGS): New variable.
17162 (tls_shared_gnu2_test_LDADD): New variable.
17163 * testsuite/Makefile.in: Rebuild.
17164 * testsuite/Makefile.
17165
83bfb6b7
ILT
171662008-04-11 Ian Lance Taylor <iant@google.com>
17167
17168 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
17169 justsyms.t.
17170 * testsuite/Makefile.in: Rebuild.
17171
17172 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
17173 long.
17174 * testsuite/script_test_2.cc (main): Adjust test.
17175
706e1f5e
ILT
171762008-04-11 David S. Miller <davem@davemloft.net>
17177 Ian Lance Taylor <iant@google.com>
17178
17179 * options.h (General_options): Add entries for '-Y' and
17180 '-relax'.
17181 * options.cc (General_options:finalize): If -Y was used, add those
17182 entries to the library path instead of the default "/lib" and
17183 "/usr/lib".
17184
7c98e6bb
DM
171852008-04-11 David S. Miller <davem@davemloft.net>
17186
17187 * testsuite/justsyms.t: Start at 0x100.
17188 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
17189 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
17190 long.
17191 * testsuite/script_test_2.cc: Adjust string and section length
17192 checks.
7c98e6bb 17193
99a37bfd
ILT
171942008-04-09 Ian Lance Taylor <iant@google.com>
17195
2cefc357
ILT
17196 PR gold/5996
17197 * script-sections.cc (Sections_element::allocate_to_segment): Add
17198 orphan parameter.
17199 (Output_section_definition::allocate_to_segment): Likewise.
17200 (Orphan_output_section::allocate_to_segment): Likewise.
17201 (Script_sections::attach_sections_using_phdrs_clause): Don't
17202 propagate non-PT_LOAD segments to orphan sections.
17203 * testsuite/Makefile.am (script_test_3.stdout): Generate using
17204 readelf rather than objdump.
17205 * testsuite/script_test_3.sh: Adjust accordingly. Test that
17206 .interp section and PT_INTERP segment are the same size.
17207 * testsuite/Makefile.in: Rebuild.
17208
99a37bfd
ILT
17209 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
17210 aliases for symbols defined in the same object.
17211 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
17212 (weak_alias_test_SOURCES): New variable.
17213 (weak_alias_test_DEPENDENCIES): New variable.
17214 (weak_alias_test_LDFLAGS): New variable.
17215 (weak_alias_test_LDADD): New variable.
17216 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
17217 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
17218 (weak_alias_test_3.o): New target.
17219 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
17220 * testsuite/weak_alias_test_main.cc: New file.
17221 * testsuite/weak_alias_test_1.cc: New file.
17222 * testsuite/weak_alias_test_2.cc: New file.
17223 * testsuite/weak_alias_test_3.cc: New file.
17224
780e49c5
ILT
172252008-04-08 Ian Lance Taylor <iant@google.com>
17226
cdb0b8f5
ILT
17227 * options.h (class General_options): Add --noinhibit-exec option.
17228 * main.cc (main): Check --noinhibit-exec.
17229
0864d551
ILT
17230 * options.h (class General_options): Define --wrap as a special
17231 option. Add wrap_symbols_ field.
17232 (General_options::any_wrap_symbols): New function.
17233 (General_options::is_wrap_symbol): New function.
17234 * options.cc (General_options::parse_wrap): New function.
17235 (General_options::General_options): Initialize wrap_symbols_.
17236 * symtab.cc (Symbol_table::wrap_symbol): New function.
17237 (Symbol_table::add_from_object): Handle --wrap.
17238 * symtab.h (class Symbol_table): Declare wrap_symbol.
17239 * target.h (Target::wrap_char): New function.
17240 (Target::Target_info): Add wrap_char field.
17241 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
17242 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
17243 * testsuite/testfile.cc (Target_test::test_target_info):
17244 Likewise.
17245
789aa6de
ILT
17246 * errors.cc (Errors::undefined_symbol): Mention symbol version if
17247 there is one.
17248
2c38906f
ILT
17249 * layout.h (class Layout): Add added_eh_frame_data_ field.
17250 * layout.cc (Layout::Layout): Initialize new field.
17251 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
17252 output section until we find a section we merged successfully.
17253 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
17254 that the size be non-zero.
17255
780e49c5
ILT
17256 * merge.cc (Object_merge_map::get_output_offset): Remove inline
17257 qualifier.
17258
7fcd0256
ILT
172592008-04-08 Craig Silverstein <csilvers@google.com>
17260
17261 * configure.ac: Export new conditional variable HAVE_ZLIB.
17262 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
17263 on HAVE_ZLIB.
17264 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
17265 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17266
6835af53
ILT
172672008-04-07 Ian Lance Taylor <iant@google.com>
17268
e24f324c
ILT
17269 * version.cc (version_string): Set to "1.5".
17270
a036edd8
ILT
17271 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
17272 Add issued_non_pic_error_ field. Declare check_non_pic.
17273 (Target_x86_64::Scan::check_non_pic): New function.
17274 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
17275 (Target_x86_64::Scan::global): Likewise.
17276
624f8810
ILT
17277 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
17278 addend parameter. Change caller. Handle merge sections.
17279 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
17280 Address to Addend. Don't add in the result of
17281 local_section_offset, pass down the addend and use the returned
17282 value.
17283 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
17284 Update declarations of local_section_offset and symbol_value.
17285 * testsuite/two_file_test_1.cc (t18): New function.
17286 * testsuite/two_file_test_2.cc (f18): New function.
17287 * testsuite/two_file_test_main.cc (main): Call t18.
17288 * testsuite/two_file_test.h (t18, f18): Declare.
17289
6835af53
ILT
17290 * configure.ac: Don't test for objdump, c++filt, or readelf.
17291 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
17292 conditionals.
17293 (TEST_READELF): New variable.
17294 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
17295 (check_PROGRAMS): Add two_file_strip_test.
17296 (two_file_strip_test): New target.
17297 (check_PROGRAMS): Add two_file_same_shared_strip_test.
17298 (two_file_same_shared_strip_test_SOURCES): New variable.
17299 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
17300 (two_file_same_shared_strip_test_LDFLAGS): New variable.
17301 (two_file_same_shared_strip_test_LDADD): New variable.
17302 (two_file_shared_strip.so): New target.
17303 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
17304 (ver_test_5.syms, ver_test_7.syms): Likewise.
17305 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
17306 (strip_test_3.stdout): Use TEST_OBJDUMP.
17307 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17308
86925eef
CC
173092008-04-04 Cary Coutant <ccoutant@google.com>
17310
17311 * symtab.h (Symbol::is_weak_undefined): New function.
17312 (Symbol::is_strong_undefined): New function.
17313 (Symbol::is_absolute): New function.
17314 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
17315 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
17316 absolute symbols.
17317 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
17318 (weak_undef_test): New target.
17319 * testsuite/Makefile.in: Rebuild.
17320 * testsuite/weak_undef_file1.cc: New file.
17321 * testsuite/weak_undef_file2.cc: New file.
17322 * testsuite/weak_undef_test.cc: New file.
17323
126f3ece
ILT
173242008-04-03 Craig Silverstein <csilvers@google.com>
17325
17326 * compressed_output.h (class Output_compressed_section): Use
17327 unsigned buffer.
17328 * compressed_output.cc (zlib_compress): Use unsigned buffers,
17329 add zlib header.
17330 (zlib_compressed_suffix): Removed.
17331 (Output_compressed_section::set_final_data_size): Use unsigned
17332 buffers.
17333 * testsuite/Makefile.am (flagstest_compress_debug_sections):
17334 Fix linker invocation.
17335 (flagstest_o_specialfile_and_compress_debug_sections):
17336 Likewise.
17337 * testsuite/Makefile.in: Regenerated.
17338
deae2a14
DM
173392008-04-02 David S. Miller <davem@davemloft.net>
17340
17341 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
17342 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
17343
70752818
ILT
173442008-04-02 Craig Silverstein <csilvers@google.com>
17345
17346 * TODO: New file.
17347
39d0cb0e
ILT
173482008-04-02 Ian Lance Taylor <iant@google.com>
17349
17350 * fileread.cc (File_read::find_view): Add byteshift and vshifted
17351 parameters. Update for new key type to views_. Change all
17352 callers.
17353 (File_read::read): Adjust for byteshift in returned view.
17354 (File_read::add_view): New function, broken out of
17355 find_and_make_view.
17356 (File_read::make_view): New function, broken out of
17357 find_and_make_view.
17358 (File_read::find_or_make_view): Add offset and aligned
17359 parameters. Rewrite accordingly. Change all callers.
17360 (File_read::get_view): Add offset and aligned parameters. Adjust
17361 for byteshift in return value.
17362 (File_read::get_lasting_view): Likewise.
17363 * fileread.h (class File_read): Update declarations.
17364 (class File_read::View): Add byteshift_ field. Add byteshift to
17365 constructor. Add byteshift method.
17366 * archive.h (Archive::clear_uncached_views): New function.
17367 (Archive::get_view): Add aligned parameter. Change all callers.
17368 * object.h (Object::get_view): Add aligned parameter. Change all
17369 callers.
17370 (Object::get_lasting_view): Likewise.
17371
17372 * fileread.cc (File_read::release): Don't call clear_views if
17373 there are multiple objects.
17374 * fileread.h (File_read::clear_uncached_views): New function.
17375 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
17376 on the archive.
17377
a1207466
CC
173782008-03-31 Cary Coutant <ccoutant@google.com>
17379
17380 Add thin archive support.
17381 * archive.cc (Archive::armagt): New const.
17382 (Archive::setup): Remove task parameter and calls to unlock.
17383 (Archive::unlock_nested_archives): New function.
17384 (Archive::read_header): Add nested_off parameter. Change
17385 all callers.
17386 (Archive::interpret_header): Likewise.
17387 (Archive::include_all_members): Change to handle thin
17388 archives.
17389 (Archive::include_member): Likewise.
17390 * archive.h (Archive::Archive): Add new parameters and
17391 initializers.
17392 (Archive::armagt): New const.
17393 (Archive::setup): Remove task parameter.
17394 (Archive::unlock_nested_archives): New function.
17395 (Archive::read_header): Add nested_off parameter.
17396 (Archive::interpret_header): Likewise.
17397 (Archive::Nested_archive_table): New typedef.
17398 (Archive::is_thin_archive_): New field.
17399 (Archive::nested_archives_): New field.
17400 (Archive::options_): New field.
17401 (Archive::dirpath_): New field.
17402 (Archive::task_): New field.
17403 * readsyms.cc (Read_symbols::do_read_symbols): Add check
17404 for thin archives. Pass additional parameters to
17405 Archive::Archive. Unlock the archive file after calling
17406 Archive::setup.
cd536b21 17407
479f6503
ILT
174082008-03-29 Ian Lance Taylor <iant@google.com>
17409
686c8caf
ILT
17410 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
17411 version symbol to be local.
17412 * testsuite/ver_test_4.sh: New file.
17413 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
17414 (check_DATA): Add ver_test_4.syms.
17415 (ver_test_4.syms): New target.
17416 * testsuite/Makefile.in: Rebuild.
17417
ab794b6b
ILT
17418 * output.cc
17419 (Output_section::Input_section_sort_entry::has_priority): New
17420 function.
17421 (Output_section::Input_section_sort_entry::match_file_name): New
17422 function.
17423 (Output_section::Input_section_sort_entry::match_section_name):
17424 Remove.
17425 (Output_section::Input_section_sort_entry::match_section_name_prefix):
17426 Remove.
17427 (Output_section::Input_section_sort_entry::match_section_file):
17428 Remove.
17429 (Output_section::Input_section_sort_compare::operator()): Rewrite
17430 using new Input_section_sort_entry functions. Sort crtbegin and
17431 crtend first. Sort sections with no priority before sections with
17432 a priority.
17433 * testsuite/initpri1.c (d3): Check j != 4.
17434 (cd5): New constructor/destructor function.
17435 (main): Check j != 2.
17436
479f6503
ILT
17437 * symtab.cc (Symbol_table::add_from_object): If we don't use the
17438 new symbol when resolving, don't call set_is_default.
17439 * testsuite/ver_test_7.cc: New file.
17440 * testsuite/ver_test_7.sh: New file.
17441 * testsuite/Makefile.am (ver_test_7.so): New target.
17442 (ver_test_7.o): New target.
17443 (check_SCRIPTS): Add ver_test_7.sh.
17444 (check_DATA): Add ver_test_7.syms.
17445 (ver_test_7.syms): New target.
17446
2fd32231
ILT
174472008-03-28 Ian Lance Taylor <iant@google.com>
17448
17449 * layout.cc (Layout::layout): If we see an input section with a
17450 name that needs sorting, set the must_sort flag for the output
17451 section.
17452 (Layout::make_output_section): If the name of the output section
17453 indicates that it might require sorting, set the may_sort flag.
17454 * output.h (Output_section::may_sort_attached_input_sections): New
17455 function.
17456 (Output_section::set_may_sort_attached_input_sections): New
17457 function.
17458 (Output_section::must_sort_attached_input_sections): New
17459 function.
17460 (Output_section::set_must_sort_attached_input_sections): New
17461 function.
17462 (class Output_section): Declare Input_section_sort_entry. Define
17463 Input_section_sort_compare. Declare
17464 sort_attached_input_sections. Add new fields:
17465 may_sort_attached_input_sections_,
17466 must_sort_attached_input_sections_,
17467 attached_input_sections_are_sorted_.
17468 * output.cc (Output_section::Output_section): Initialize new
17469 fields.
17470 (Output_section::add_input_section): Add an entry to
17471 input_sections_ if may_sort or must_sort are true.
17472 (Output_section::set_final_data_size): Call
17473 sort_attached_input_sections if necessary.
17474 (Output_section::Input_section_sort_entry): Define new class.
17475 (Output_section::Input_section_sort_compare::operator()): New
17476 function.
17477 (Output_section::sort_attached_input_sections): New function.
17478 * configure.ac: Check whether the compiler supports constructor
17479 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
17480 * testsuite/initpri1.c: New file.
17481 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
17482 CONSTRUCTOR_PRIORITY.
17483 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
17484 (initpri1_LDFLAGS): New variable.
17485 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17486
18e6b24e
ILT
174872008-03-27 Ian Lance Taylor <iant@google.com>
17488
49bdd526
ILT
17489 * common.cc (Sort_commons::operator): Correct sorting algorithm.
17490 * testsuite/common_test_1.c: New file.
17491 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
17492 (common_test_1_SOURCES): New variable.
17493 (common_test_1_DEPENDENCIES): New variable.
17494 (common_test_1_LDFLAGS): New variable.
17495
18e6b24e
ILT
17496 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
17497 and commons_ correctly when NAME/VERSION does not override
17498 NAME/NULL.
17499 * testsuite/ver_test_6.c: New file.
17500 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
17501 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
17502 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
17503
04bf7072
ILT
175042008-03-26 Ian Lance Taylor <iant@google.com>
17505
5871526f
ILT
17506 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
17507 of an undefined symbol from a version script.
17508 * testsuite/Makefile.am (ver_test_5.so): New target.
17509 (ver_test_5.o): New target.
17510 (check_SCRIPTS): Add ver_test_5.sh.
17511 (check_DATA): Add ver_test_5.syms.
17512 (ver_test_5.syms): New target.
17513 * testsuite/ver_test_5.cc: New file.
17514 * testsuite/ver_test_5.script: New file.
17515 * testsuite/ver_test_5.sh: New file.
17516 * Makefile.in, testsuite/Makefile.in: Rebuild.
17517
04bf7072
ILT
17518 PR gold/5986
17519 Fix problems building gold with gcc 4.3.0.
17520 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
17521 (gold_error_at_location, gold_warning_at_location): Use it.
17522 * configure.ac: Check whether we can compile and use a template
17523 function with a printf attribute.
17524 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
17525 when jumping over bytes.
17526 * object.cc: Instantiate Object::read_section_data.
17527 * debug.h: Include <cstring>
17528 * dwarf_reader.cc: Include <algorithm>
17529 * main.cc: Include <cstring>.
17530 * options.cc: Include <cstring>.
17531 * output.cc: Include <cstring>.
17532 * script.cc: Include <cstring>.
17533 * script.h: Include <string>.
17534 * symtab.cc: Include <cstring> and <algorithm>.
17535 * target-select.cc: Include <cstring>.
17536 * version.cc: Include <string>.
17537 * testsuite/testmain.cc: Include <cstdlib>.
17538 * configure, config.in: Rebuild.
17539
874c5b28
ILT
175402008-03-25 Ian Lance Taylor <iant@google.com>
17541
819d6c3a
ILT
17542 * options.cc: Include "../bfd/bfdver.h".
17543 (options::help): Print bug reporting address.
17544
f4b2c6f5
ILT
17545 * version.cc (print_version): Adjust output for current value of
17546 BFD_VERSION_STRING.
17547
17548 * NEWS: New file.
17549
e96caa79
ILT
17550 * options.cc (options::help): Print list of supported targets.
17551 * target-select.h: Include <vector>.
17552 (class Target_selector): Make machine_, size_, and is_big_endian_
17553 fields const. Add bfd_name_ and instantiated_target_ fields.
17554 (Target_selector::Target_selector): Add bfd_name parameter.
17555 (Target_selector::recognize): Make non-virtual, call
17556 do_recognize.
17557 (Target_selector::recognize_by_name): Make non-virtual, call
17558 do_recognize_by_name.
17559 (Target_selector::supported_names): New function.
17560 (Target_selector::bfd_name): New function.
17561 (Target_selector::do_instantiate_target): New pure virtual
17562 function.
17563 (Target_selector::do_recognize): New virtual function.
17564 (Target_selector::do_recognize_by_name): New virtual function.
17565 (Target_selector::instantiate_target): New private function.
17566 (supported_target_names): Declare.
17567 * target-select.cc (Target_selector::Target_selector): Update for
17568 new parameter and fields.
17569 (select_target_by_name): Check that the name matches before
17570 calling recognize_by_name.
17571 (supported_target_names): New function.
17572 * i386.cc (class Target_selector_i386): Update Target_selector
17573 constructor call. Remove recognize and recognize_by_name. Add
17574 do_instantiate_target.
17575 * x86_64.cc (class Target_selector_x86_64): Likewise.
17576 * testsuite/testfile.cc (class Target_selector_test): Update for
17577 changes to Target_selector.
17578
874c5b28
ILT
17579 * README: Rewrite, with some notes on unsupported features.
17580
0a65a3a7
CC
175812008-03-24 Cary Coutant <ccoutant@google.com>
17582
17583 * i386.cc (Target_i386::Got_type): New enum declaration.
17584 (Target_i386::Scan::local): Updated callers of Output_data_got
17585 member functions.
17586 (Target_i386::Scan::global): Likewise.
17587 (Target_i386::Relocate::relocate): Likewise.
17588 (Target_i386::Relocate::relocate_tls): Likewise.
17589 * object.h (Got_offset_list): New class.
17590 (Sized_relobj::local_has_got_offset): Added got_type parameter.
17591 (Sized_relobj::local_got_offset): Likewise.
17592 (Sized_relobj::set_local_got_offset): Likewise.
17593 (Sized_relobj::local_has_tls_got_offset): Removed.
17594 (Sized_relobj::local_tls_got_offset): Removed.
17595 (Sized_relobj::set_local_tls_got_offset): Removed.
17596 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
17597 * output.cc (Output_data_got::add_global): Added got_type parameter.
17598 (Output_data_got::add_global_with_rel): Likewise.
17599 (Output_data_got::add_global_with_rela): Likewise.
17600 (Output_data_got::add_global_pair_with_rel): New function.
17601 (Output_data_got::add_global_pair_with_rela): New function.
17602 (Output_data_got::add_local): Added got_type parameter.
17603 (Output_data_got::add_local_with_rel): Likewise.
17604 (Output_data_got::add_local_with_rela): Likewise.
17605 (Output_data_got::add_local_pair_with_rel): New function.
17606 (Output_data_got::add_local_pair_with_rela): New function.
17607 (Output_data_got::add_global_tls): Removed.
17608 (Output_data_got::add_global_tls_with_rel): Removed.
17609 (Output_data_got::add_global_tls_with_rela): Removed.
17610 (Output_data_got::add_local_tls): Removed.
17611 (Output_data_got::add_local_tls_with_rel): Removed.
17612 (Output_data_got::add_local_tls_with_rela): Removed.
17613 * output.h (Output_data_got::add_global): Added got_type parameter.
17614 (Output_data_got::add_global_with_rel): Likewise.
17615 (Output_data_got::add_global_with_rela): Likewise.
17616 (Output_data_got::add_global_pair_with_rel): New function.
17617 (Output_data_got::add_global_pair_with_rela): New function.
17618 (Output_data_got::add_local): Added got_type parameter.
17619 (Output_data_got::add_local_with_rel): Likewise.
17620 (Output_data_got::add_local_with_rela): Likewise.
17621 (Output_data_got::add_local_pair_with_rel): New function.
17622 (Output_data_got::add_local_pair_with_rela): New function.
17623 (Output_data_got::add_global_tls): Removed.
17624 (Output_data_got::add_global_tls_with_rel): Removed.
17625 (Output_data_got::add_global_tls_with_rela): Removed.
17626 (Output_data_got::add_local_tls): Removed.
17627 (Output_data_got::add_local_tls_with_rel): Removed.
17628 (Output_data_got::add_local_tls_with_rela): Removed.
17629 * resolve.cc (Symbol::override_base_with_special): Removed
17630 reference to has_got_offset_ field.
17631 * symtab.cc (Symbol::init_fields): Replaced initialization
17632 of got_offset_ with got_offsets_. Removed initialization
17633 of has_got_offset_
53fcba31 17634 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
17635 (Symbol::got_offset): Likewise.
17636 (Symbol::set_got_offset): Likewise.
17637 (Symbol::has_tls_got_offset): Removed.
17638 (Symbol::tls_got_offset): Removed.
17639 (Symbol::set_tls_got_offset): Removed.
17640 (Symbol::got_offset_): Removed.
17641 (Symbol::tls_mod_got_offset_): Removed.
17642 (Symbol::tls_pair_got_offset_): Removed.
17643 (Symbol::got_offsets_): New field.
17644 (Symbol::has_got_offset): Removed.
17645 (Symbol::has_tls_mod_got_offset): Removed.
17646 (Symbol::has_tls_pair_got_offset): Removed.
17647 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
17648 (Target_x86_64::Scan::local): Updated callers of Output_data_got
17649 member functions.
17650 (Target_x86_64::Scan::global): Likewise.
17651 (Target_x86_64::Relocate::relocate): Likewise.
17652 (Target_x86_64::Relocate::relocate_tls): Likewise.
17653
bd52eafb
BE
176542008-03-25 Ben Elliston <bje@au.ibm.com>
17655
17656 * yyscript.y: Fix spelling error in comment.
17657
8b105e34
ILT
176582008-03-24 Ian Lance Taylor <iant@google.com>
17659
8ed814a9
ILT
17660 * options.h (class General_options): Define build_id option.
17661 * layout.h (class Layout): Declare write_build_id, create_note,
17662 create_build_id. Add build_id_note_ member.
17663 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
17664 "libiberty.h", "md5.h", "sha1.h".
17665 (Layout::Layout): Initialize eh_frame_data_,
17666 eh_frame_hdr_section_, and build_id_note_.
17667 (Layout::finalize): Call create_build_id.
17668 (Layout::create_note): New function, broken out of
17669 Layout::create_gold_note.
17670 (Layout::create_gold_note): Call create_note.
17671 (Layout::create_build_id): New function.
17672 (Layout::write_build_id): New function.
17673 (Close_task_runner::run): Call write_build_id.
17674
8b105e34
ILT
17675 * x86_64.cc: Correct license to GPLv3.
17676
086a1841
ILT
176772008-03-23 Ian Lance Taylor <iant@google.com>
17678
17679 * options.cc: Include "demangle.h".
17680 (parse_optional_string): New function.
17681 (parse_long_option): Handle takes_optional_argument.
17682 (parse_short_option): Update dash_z initializer. Handle
17683 takes_optional_argument.
17684 (General_options::General_options): Initialize do_demangle_.
17685 (General_options::finalize): Set do_demangle_. Handle demangling
17686 style.
17687 * options.h (parse_optional_string): Declare.
17688 (struct One_option): Add optional_arg field. Update constructor.
17689 Update call constructor calls. Add takes_optional_argument
17690 function.
17691 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
17692 (DEFINE_optional_string): Define.
17693 (General_options::demangle): Change from DEFINE_bool to
17694 DEFINE_optional_string.
17695 (General_options::no_demangle): New function.
17696 (General_options::do_demangle): New function.
17697 (General_options::set_do_demangle): New function.
17698 (General_options::execstack_status_): Move definition to end of
17699 class definition.
17700 (General_options::static_): Likewise.
17701 (General_options::do_demangle_): New field.
17702 * object.cc (big_endian>::get_symbol_location_info): Call
17703 Options::do_demangle, not Options::demangle.
17704 * symtab.cc (demangle): Likewise.
17705
cbb93e63
ILT
177062008-03-22 Ian Lance Taylor <iant@google.com>
17707
17708 * gold.h: Include <cstddef> and <sys/types.h>
17709 * options.h: Include <cstring>.
17710
ec531623
ILT
177112008-03-21 Ian Lance Taylor <iant@google.com>
17712
17713 * Added source code to GNU binutils.
752937aa 17714\f
b90efa5b 17715Copyright (C) 2008-2015 Free Software Foundation, Inc.
752937aa
NC
17716
17717Copying and distribution of this file, with or without modification,
17718are permitted in any medium without royalty provided the copyright
17719notice and this notice are preserved.
17720
17721Local Variables:
17722mode: change-log
17723left-margin: 8
17724fill-column: 74
17725version-control: never
17726End:
This page took 1.251667 seconds and 4 git commands to generate.