[nto] Implement procfs_pid_to_exec_file.
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
64571972
L
12015-10-16 H.J. Lu <hongjiu.lu@intel.com>
2
3 PR gold/19119
4 * options.h (General_options): Remove "obsolete" from -m.
5 * parameters.cc (set_parameters_target): Check if input target
6 is compatible with output emulation set by "-m emulation".
7
01f573ad
L
82015-10-13 H.J. Lu <hongjiu.lu@intel.com>
9
10 PR gold/19118
11 * i386.cc (Target_iamcu): New class.
12 (Target_selector_iamcu): Likewise.
13 (Target_iamcu::iamcu_info): New variable.
14 (target_selector_iamcu): Likewise.
15
3b0357da
AS
162015-10-07 Andreas Schwab <schwab@suse.de>
17
18 * aarch64.cc (aarch64_info): Set abi_pagesize to 64K.
19
9eacb935
CC
202015-10-06 Cary Coutant <ccoutant@gmail.com>
21
22 PR gold/18855
23 * sparc.cc (Sparc_relocate_functions::gdop_hix22): Remove addend
24 parameter.
25 (Sparc_relocate_functions::gdop_lox10): Likewise.
26 (Target_sparc::Relocate::relocate): Use addend when computing
27 symbol value for R_SPARC_GOTDATA_OP*.
28
3d4fde69
CC
292015-09-07 Cary Coutant <ccoutant@gmail.com>
30
31 PR gold/18930
32 PR gold/18886
33 * resolve.cc (Symbol::override_base): Don't convert IFUNC symbols here.
34 * symtab.cc (Symbol_table::add_from_dynobj): Convert them here instead.
35
358de988
L
362015-09-02 H.J. Lu <hongjiu.lu@intel.com>
37
38 PR gold/18886
39 * resolve.cc (Symbol::override_base): Turn IFUNC symbols from
40 shared libraries into normal FUNC symbols.
41 * symtab.cc (Symbol_table::sized_write_symbol): Assert IFUNC
42 symbols aren't from shared libraries.
43
d49044c7
AM
442015-09-02 Alan Modra <amodra@gmail.com>
45
46 PR 18878
47 * powerpc.cc (Target_powerpc): Add savres_section_ and accessor.
48 (Target_powerpc::Branch_info::make_stub): Determine whether long
49 branch stub is for save/restore function.
50 (Branch_stub_ent): Add save_res_, and extra parm to constructor.
51 (Stub_table): Add need_save_res_.
52 (Stub_table:clear_stubs): Clear need_save_res_.
53 (Stub_table:set_address_and_size): Add save/restore section size.
54 (Stub_table::add_long_branch_entry): Add save_res param. Set
55 need_save_res_, but don't add space for save/restore stubs.
56 (Stub_table::find_long_branch_entry): Return offset to local copy
57 of save/restore func.
58 (Stub_table::do_write): Don't output save/restore stubs. Instead
59 copy the save/restore functions.
60 (Output_data_save_res:contents): New accessor.
61 (Target_powerpc::define_save_restore_funcs): Set savres_section_.
62
7c61d651
CC
632015-08-25 Cary Coutant <ccoutant@gmail.com>
64
65 PR gold/18847
66 * script-sections.cc (Memory_region::set_address): New method.
67 (Script_sections::find_memory_region): Add explicit_only parameter.
68 (Output_section_definition::set_section_addresses): Handle case where
69 script specifies both address and vma region.
70 * script-sections.h (Script_sections::find_memory_region): Add
71 explicit_only parameter.
72
4bfacfd3
CC
732015-08-25 Cary Coutant <ccoutant@gmail.com>
74
75 PR gold/18859
76 * object.cc (Input_objects::add_object): Store objects in a map,
77 indexed by soname; update as-needed flag when necessary.
78 * object.h (Object::clear_as_needed): New method.
79 (Input_objects::so_names_): Change from set to map.
80
1757d35c
CC
812015-08-25 Cary Coutant <ccoutant@gmail.com>
82
83 PR gold/14746
84 * expression.cc (Expression::Expression_eval_info): Add
85 is_valid_pointer field.
86 (Expression::eval_maybe_dot): Add is_valid_pointer parameter.
87 Adjust all callers.
88 (Addr_expression::value_from_output_section): Check whether address
89 is valid.
90 * script.cc (Symbol_assignment::set_if_absolute): Defer assignment
91 if evaluation failed due to address that is not yet valid.
92 * script.h: (Expression::eval_maybe_dot): Add is_valid_pointer
93 parameter.
94
3ac0a36c
CC
952015-08-25 Cary Coutant <ccoutant@gmail.com>
96
97 PR gold/18866
98 PR gold/18703
99 * symtab.cc (Symbol_table): Reorder conditions to avoid internal error.
100
9215b98b
AM
1012015-08-20 Alan Modra <amodra@gmail.com>
102
103 PR gold/18846
104 * target-reloc.h (relocate_relocs <RELOC_ADJUST_FOR_SECTION_RELA>):
105 Subtract os->address() from addend.
106 * powerpc.cc (relocate_relocs): Likewise.
107
40fc1451
SD
1082015-08-12 Simon Dardis <simon.dardis@imgtec.com>
109
110 * mips.cc (plt0_entry_o32, plt0_entry_n32, plt0_entry_n64,
111 lazy_stub_normal_1, lazy_stub_normal_1_n64,
112 lazy_stub_normal_2, lazy_stub_normal_2_n64, lazy_stub_big,
113 lazy_stub_big_n64, lazy_stub_micromips32_normal_1_n64,
114 lazy_stub_micromips32_normal_2_n64, lazy_stub_micromips32_big,
115 lazy_stub_micromips32_big_n64): Update to use 'or' for move instead
116 of 'addu/daddu'.
117
37a42ee9
L
1182015-07-27 H.J. Lu <hongjiu.lu@intel.com>
119
120 * configure: Regenerated.
121
ab3b14b0
DK
1222015-07-26 Doug Kwan <dougkwan@google.com>
123
124 * testsuite/arm_unaligned_reloc.{s,sh}: Make test less sensitive to
125 disassembler output format.
126
cdb06167
HS
1272015-07-23 Ian Coolidge <icoolidge@google.com>
128 Plumb --pic-veneer option for gold.
129
130 * arm.cc (Reloc_stub::stub_type_for_reloc): Plumb to stub
131 generation.
132 * options.h (General_options): Add --pic-veneer option.
133
5b2af7dd
L
1342015-07-22 H.J. Lu <hongjiu.lu@intel.com>
135
136 PR gold/18663
137 * testsuite/Makefile.am (script_test_1_SOURCES): Set to
138 script_test_1a.cc script_test_1b.cc.
139 (script_test_11_r.o): Replace script_test_11.o with
140 script_test_11a.o script_test_11b.o.
141 (script_test_11.o): Removed.
142 (script_test_11a.o): New.
143 (script_test_11b.o): Likewise.
144 * testsuite/Makefile.in: Regenerated.
145 * testsuite/script_test_1.h: New file.
146 * testsuite/script_test_1b.cc: Likewise.
147 * testsuite/script_test_11.h: Likewise.
148 * testsuite/script_test_11b.c: Likewise.
149 * testsuite/script_test_1.cc: Renamed to ...
150 * testsuite/script_test_1a.cc: This.
151 Include "script_test_1.h".
152 (main): Call check_int and check_ptr.
153 * testsuite/script_test_11.c: Renamed to ...
154 * testsuite/script_test_11a.c: This.
155 Include "script_test_11.h".
156 (main): Call ptr_equal.
157
cd78ea77
L
1582015-07-22 H.J. Lu <hongjiu.lu@intel.com>
159
160 PR gold/18628
161 * testsuite/ifuncdep2.c (global): Change protected to hidden.
162 * testsuite/ifuncmod1.c (global): Likewise.
163 * testsuite/ifuncmod5.c (global): Likewise.
164
f945ba50
AM
1652015-07-22 Alan Modra <amodra@gmail.com>
166
167 * aarch64.cc (try_fix_erratum_843419_optimized): Warning fix.
168
5417c94d
CC
1692015-07-21 Cary Coutant <ccoutant@gmail.com>
170
171 PR gold/18548
172 * symtab.cc (Symbol_table::do_define_in_output_data): Check for
173 forced local symbol even when oldsym != NULL.
174 (Symbol_table::do_define_in_output_segment): Likewise.
175 (Symbol_table::do_define_as_constant): Likewise.
176
cb5cf5e2
CC
1772015-07-21 Cary Coutant <ccoutant@gmail.com>
178
b8c6c5ef 179 PR gold/18698
cb5cf5e2
CC
180 * archive.cc (Library_base::should_include_member): Don't use entry
181 point for relocatable links, or if target is not yet valid.
182 * parameters.cc (Parameters::entry): Check target_valid().
183
0ef3814f
HS
1842015-07-20 Han Shen <shenhan@google.com>
185
186 Optimize erratum 843419 fix.
187
188 * aarch64.cc (AArch64_insn_utilities::is_adr): New method.
189 (AArch64_insn_utilities::aarch64_adr_encode_imm): New method.
190 (AArch64_insn_utilities::aarch64_adrp_decode_imm): New method.
191 (E843419_stub): New sub-class of Erratum_stub.
192 (AArch64_relobj::try_fix_erratum_843419_optimized): New method.
193 (AArch64_relobj::section_needs_reloc_stub_scanning): Try optimized fix.
194 (AArch64_relobj::create_erratum_stub): Add 1 argument.
195 (Target_aarch64::scan_erratum_843419_span): Pass in adrp insn offset.
196
2bca0377
HS
1972015-07-20 Han Shen <shenhan@google.com>
198
199 Fix arm elf header flags wrt hardfp bit.
200
201 * arm.cc (Target_arm::do_adjust_elf_header): Set flags into view.
202
f54f5e31
L
2032015-07-20 H.J. Lu <hongjiu.lu@intel.com>
204
205 PR gold/18689
206 * layout.cc (Layout::layout): Clear the SHF_COMPRESSED flag bit
207 from input group section for relocatable link.
208 * testsuite/Makefile.am (check_SCRIPTS): Add pr18689.sh.
209 (check_DATA): Add pr18689.stdout.
210 (MOSTLYCLEANFILES): Add pr18689a.o pr18689b.o.
211 (pr18689.stdout): New rule.
212 (pr18689a.o): Likewise.
213 (pr18689b.o): Likewise.
214 (pr18689.o): Likewise.
215 * testsuite/pr18689.c: New file.
216 * testsuite/pr18689.sh: Likewise.
217 * testsuite/Makefile.in: Regenerated.
218
c20ceeb2
YW
2192015-07-20 Yiran Wang <yiran@google.com>
220 Cary Coutant <ccoutant@gmail.com>
221
222 PR gold/15574
223 * resolve.cc (Symbol_table): Remove warning about references
224 from shared objects to hidden symbols.
225 * testsuite/Makefile.am (hidden_test): Add hidden_test.syms.
226 * testsuite/Makefile.in: Regenerate.
227 * testsuite/hidden_test.sh: Check dynamic symbol table; update
228 expected error messages.
229
19a7fe52
L
2302015-07-14 H.J. Lu <hongjiu.lu@intel.com>
231
232 * compressed_output.cc (Output_compressed_section::set_final_data_size):
233 Make --compress-debug-sections=zlib the same as
234 --compress-debug-sections=zlib-gabi.
235 * testsuite/Makefile.am (flagstest_compress_debug_sections.check):
236 Expect ".debug_.*" with the SHF_COMPRESSED bit, instead of
237 ".zdebug_".
238 * testsuite/Makefile.in: Regenerated.
239
fb8b9dbc
L
2402015-07-12 H.J. Lu <hongjiu.lu@intel.com>
241
242 PR gold/18322
243 * compressed_output.cc (zlib_compress): Add argument for
244 compression header size. Set header size to compression header
245 size if it isn't 0. Don't write out the zlib header here.
246 (Output_compressed_section::set_final_data_size): Support
247 zlib-gnu and zlib-gabi compressions. Pass compression header
248 size to zlib_compress and write out compression header. Set
249 the SHF_COMPRESSED bit for zlib-gabi compression. Otherwise
250 clear the SHF_COMPRESSED bit
251 * options.h (compress_debug_sections): Add zlib-gnu and
252 zlib-gabi.
253 * output.h (Output_section::set_flags): New.
254 * testsuite/Makefile.am (check_PROGRAMS): Add
255 flagstest_compress_debug_sections_none,
256 flagstest_compress_debug_sections_gnu and
257 flagstest_compress_debug_sections_gabi.
258 (check_DATA): Add flagstest_compress_debug_sections_none.stdout.
259 flagstest_compress_debug_sections.stdout,
260 flagstest_compress_debug_sections.cmp,
261 flagstest_compress_debug_sections.check,
262 flagstest_compress_debug_sections_gnu.stdout,
263 flagstest_compress_debug_sections_gnu.cmp,
264 flagstest_compress_debug_sections_gnu.check,
265 flagstest_compress_debug_sections_gabi.stdout,
266 flagstest_compress_debug_sections_gabi.cmp and
267 flagstest_compress_debug_sections_gabi.check.
268 (flagstest_compress_debug_sections_none): New.
269 (flagstest_compress_debug_sections_none.stdout): Likewise.
270 (flagstest_compress_debug_sections.stdout): Likewise.
271 (flagstest_compress_debug_sections.check): Likewise.
272 (flagstest_compress_debug_sections.cmp): Likewise.
273 (flagstest_compress_debug_sections_gnu): Likewise.
274 (flagstest_compress_debug_sections_gnu.stdout): Likewise.
275 (flagstest_compress_debug_sections_gnu.check): Likewise.
276 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
277 (flagstest_compress_debug_sections_gabi): Likewise.
278 (flagstest_compress_debug_sections_gabi.stdout): Likewise.
279 (flagstest_compress_debug_sections_gnu.check): Likewise.
280 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
281 * testsuite/Makefile.in: Regenerated.
282
48058663
L
2832015-07-12 H.J. Lu <hongjiu.lu@intel.com>
284
285 PR gold/18321
286 * compressed_output.h (decompress_input_section): Add arguments
287 for ELF class, big endian and sh_flags.
288 * compressed_output.cc (decompress_input_section): Likewise.
289 Support the SHF_COMPRESSED section.
290 * dynobj.h (Dynobj): Add elfsize and is_big_endian member
291 functions.
292 * plugin.h (Pluginobj): Likewise.
293 * layout.cc (Layout::get_output_section_flags): Also clear the
294 SHF_COMPRESSED bit.
295 * object.h (Compressed_section_info): Add flag to store sh_flags.
296 (Object): Add pure virtual elfsize and is_big_endian member
297 functions.
298 * object.cc (need_decompressed_section): Don't skip the ".zdebug"
299 prefix here.
300 (build_compressed_section_map): Check SHF_COMPRESSED for
301 uncompressed size. Store sh_flags in Compressed_section_info.
302 Pass size, big_endian and sh_flags to decompress_input_section.
303 Skip the ".debug"/".zdebug" prefix when passing section name to
304 need_decompressed_section.
305 (Sized_relobj_file<size, big_endian>::do_find_special_section):
306 Don't check ".zdebug_*" sections.
307 (Object::decompressed_section_contents): Pass ELF class, big
308 endian and sh_flags to decompress_input_section.
309 * reloc.cc (Sized_relobj_file<size, big_endian>::write_sections):
310 Likewise.
311 * testsuite/Makefile.am (check_DATA): Add
312 debug_msg_cdebug_gabi.err and gdb_index_test_2_gabi.stdout.
313 (MOSTLYCLEANFILES): Add debug_msg_cdebug_gabi.err and
314 gdb_index_test_2_gabi.stdout.
315 (debug_msg_cdebug_gabi.o): New.
316 (odr_violation1_cdebug_gabi.o): Likewise.
317 (odr_violation2_cdebug_gabi.o): Likewise.
318 (debug_msg_cdebug_gabi.err): Likewise.
319 (check_SCRIPTS): Add gdb_index_test_2_gabi.sh.
320 (gdb_index_test_cdebug_gabi.o): Likewise.
321 (gdb_index_test_2_gabi): Likewise.
322 (gdb_index_test_2_gabi.stdout): Likewise.
323 * testsuite/gdb_index_test_2_gabi.sh: New file.
324 * testsuite/Makefile.in: Regenerated.
325
73854cdd
HS
3262015-07-09 Han Shen <shenhan@google.com>
327
328 Use "gold_info" instead of "gold_warning" for erratum fix.
329
330 * aarch64.cc (Target_aarch64::scan_erratum_843419_span): Use
331 'gold_info'.
332 (Target_aarch64::scan_erratum_835769_span): USe 'gold_info'.
333
61163dfa
HS
3342015-07-09 Han Shen <shenhan@google.com>
335
336 Drop missing symbol warning for arm/aarch64.
337
338 * aarch64.cc (AArch64_relobj::scan_errata): Drop missing symbol warning.
339 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Drop missing
340 symbol warning.
341
b91deca9
HS
3422015-07-07 Han Shen <shenhan@google.com>
343
344 Make gold aarch64 accept long form of mapping symbols.
345
346 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Make legal
347 of mapping symbols.
348
15162bef
DK
3492015-06-29 Doug Kwan <dougkwan@google.com>
350
351 * testsuite/arm_bl_out_of_range.s: Align stub table so that it appears
352 at address expected by test.
353 * testsuite/arm_cortex_a8_b.s: Ditto.
354 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
355 * testsuite/arm_cortex_a8_bl.s: Ditto.
356 * testsuite/arm_cortex_a8_blx.s: Ditto.
357 * testsuite/arm_cortex_a8_local.s: Ditto.
358 * testsuite/arm_fix_v4bx.s: Ditto.
359 * testsuite/arm_unaligned_reloc.s: Ditto.
360 * testsuite/thumb_bl_out_of_range.s: Ditto.
361 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
362 * testsuite/thumb_blx_out_of_range.s: Ditto.
b91deca9 363
56b06706
HS
3642015-06-29 Han Shen <shenhan@google.com>
365
366 Patch for erratum 843419 internal error.
367
72f4393d
L
368 * aarch64.cc (Erratum_stub::Insn_utilities): New typedef.
369 (Erratum_stub::update_erratum_insn): New method.
370 (Stub_table::relocate_stubs): Modified to place relocated insn.
371 (AArch64_relobj::fix_errata): Modified gold_assert.
56b06706 372
2f0c79aa
HS
3732015-06-12 Han Shen <shenhan@google.com>
374
375 Fix erratum 835769.
376
72f4393d
L
377 * aarch64.cc (AArch64_insn_utilities::BYTES_PER_INSN): Move
378 defintion outside class definition.
379 (AArch64_insn_utilities::AARCH64_ZR): New static constant.
380 (AArch64_insn_utilities::aarch64_op31): New member.
381 (AArch64_insn_utilities::aarch64_ra): New member.
382 (AArch64_insn_utilities::aarch64_mac): New member.
383 (AArch64_insn_utilities::aarch64_mlxl): New member.
384 (ST_E_835769): New global enum member.
385 (Stub_table::relocate_stubs): Add 835769 handler.
386 (Stub_template_repertoire::Stub_template_repertoire): Install new
387 stub type.
388 (AArch64_relobj::scan_errata): This func is renamed from
389 scan_erratum_843419.
390 (AArch64_relobj::do_count_local_symbols): Add 835769 handler.
391 (AArch64_relobj::do_relocate_sections): Add 835769 handler.
392 (AArch64_relobj::scan_sections_for_stubs): Add 835769 handler.
393 (Target_aarch64::scan_erratum_835769_span): New method.
394 (Target_aarch64::create_erratum_stub): New method.
395 (Target_aarch64::is_erratum_835769_sequence): New method.
396 (Target_aarch64::scan_erratum_843419_sequence): Move part of the
397 code into create_erratum_stub.
398 * options.h (fix_cortex_a53_835769): New option.
2f0c79aa 399
5d7908e0
CC
4002015-06-11 Cary Coutant <ccoutant@gmail.com>
401
402 * aarch64.cc (Erratum_stub::STUB_ADDR_ALIGN): Move initialization
403 outside class body.
404 (Reloc_stub::STUB_ADDR_ALIGN): Likewise.
405
dd68f8fa
CC
4062015-06-11 Cary Coutant <ccoutant@gmail.com>
407
408 PR gold/17731
409 * layout.cc (corresponding_uncompressed_section_name): New function.
410 (Layout::choose_output_section): Call it.
411 * layout.h (corresponding_uncompressed_section_name): New function.
412 * script-sections.cc (Input_section_info::set_section_name): Check
413 for compressed debug section (.zdebug style).
414
a3a0c391
JY
4152015-06-11 Jing Yu <jingyu@google.com>
416
417 * testsuite/Makefile.am: Add -O0 for script_test_12 test.
418 * testsuite/Makefile.in: Regenerate.
419
970cdef2
DI
4202015-06-11 Davide Italiano <dccitaliano@gmail.com>
421
422 * gold.h (is_cident): Correct typo.
423
a48d0c12
HS
4242015-06-10 Han Shen <shenhan@google.com>
425 Patch for erratum-843419 (2 of 2 - fix erratum occurrences).
426
427 Now fixing for 843419 is fully functional.
428
429 The first part of the erratum fix CL is here -
430 https://sourceware.org/ml/binutils/2015-04/msg00229.html
431
432 * aarch64.cc(global enum): New constants representing stub types.
433 (Stub_template): New POD struct.
434 (Stub_template_repertoire): New class.
435 (Stub_base): New class.
436 (Erratum_stub): New class.
437 (Reloc_stub): Refactored to be a subclass of Stub_base.
438 (Reloc_stub::Stub_type): Removed.
439 (Reloc_stub::offset): Moved to Stub_base.
440 (Reloc_stub::set_offset): Moved to Stub_base.
441 (Reloc_stub::destination_address): Moved to Stub_base.
442 (Reloc_stub::set_destination_address): Moved to Stub_base.
443 (Reloc_stub::reset_destination_address): Moved to Stub_base.
444 (Reloc_stub::stub_type): Renamed and moved to Stub_base.
445 (Reloc_stub::stub_size): Renamed and moved to Stub_base.
446 (Reloc_stub::stub_insns): Renamed and moved to Stub_base.
447 (Reloc_stub::write): Moved to Stub_base.
448 (Reloc_stub::invalid_offset): Moved to Stub_base.
449 (Reloc_stub::invalid_address): Moved to Stub_base.
450 (Reloc_stub::stub_type_): Renamed and moved to Stub_base.
451 (Reloc_stub::stub_insns_): Moved to Stub_base.
452 (Reloc_stub::offset_): Moved to Stub_base.
453 (Reloc_stub::destination_address_): Moved to Stub_base.
454 (Stub_table::The_aarch64_relobj): New typedef.
455 (Stub_table::The_erratum_stub): New typedef.
456 (Stub_table::The_erratum_stub_less): New typedef.
457 (Stub_table::The_erratum_stub_set): New typedef.
458 (Stub_table::The_erratum_stub_set_iter): New typedef.
459 (Stub_table::empty): Added emptiness testing for erratum stubs.
460 (Stub_table::add_erratum_stub): New method to add an erratum stub.
461 (Stub_table::find_erratum_stub): New method.
462 (Stub_table::find_erratum_stubs_for_input_section): New method.
463 (Stub_table::erratum_stub_address): New method.
464 (Stub_table::update_date_size_changed_p): Modified to handle erratum stubs.
465 (Stub_table::do_addralign): Modified to handle erratum stubs.
466 (Stub_table::erratum_stubs_): New member.
467 (Stub_table::erratum_stub_size_): New member.
468 (Stub_table::relocate_stubs): Modified to handle erratum stubs.
469 (Stub_table::do_write): Modified to handle erratum stubs.
470 (AArch64_relobj::The_erratum_stub): New typedef.
471 (AArch64_relobj::Erratum_stub_set_iter): New typedef.
472 (AArch64_relobj::fix_errata): New method.
473 (Target_aarch64::The_reloc_stub_type): Removed.
474 (Target_aarch64::The_erratum_stub): New typede.
475 (AArch64_relocate_functions::construct_b): New method.
476
1e1b2efc
NC
4772015-06-08 Nick Clifton <nickc@redhat.com>
478
479 * po/fr.po: New French Translation.
480
b8cf5075
CC
4812015-06-07 Cary Coutant <ccoutant@gmail.com>
482
483 PR gold/18288
484 * resolve.cc (symbol_to_bits): Remove type parameter; adjust all
485 callers. Don't use STT_COMMON to check for common symbols.
486 (Symbol_table::resolve): Warn if relocatable object has STT_COMMON
487 symbol that's not in a common section.
488 * symtab.h (Symbol::is_common): Don't use STT_COMMON to check for
489 common symbols.
490
bdd2d2b7
CC
4912015-06-04 Cary Coutant <ccoutant@gmail.com>
492
493 PR gold/18200
494 * Makefile.am (diststuff): Add target.
495 * Makefile.in: Regenerate.
496
cd3c333f
CC
4972015-06-04 Cary Coutant <ccoutant@gmail.com>
498
499 PR gold/17498
500 * object.cc (Sized_relobj_file::do_count_local_symbols): Discard
501 temporary locals in merge sections.
502 * options.cc (General_options::parse_discard_all): New method.
503 (General_options::parse_discard_locals): New method.
504 (General_options::parse_discard_none): New method.
505 (General_options::General_options): Initialize discard_locals_.
506 * options.h (--discard-all): Convert to special option.
507 (--discard-locals): Likewise.
508 (--discard-none): New option.
509 (General_options::discard_all): New method.
510 (General_options::discard_locals): New method.
511 (General_options::discard_sec_merge): New method.
512 (General_options::Discard_locals): New enum.
513 (General_options::discard_locals_): New data member.
514
8086551f
CC
5152015-06-03 Cary Coutant <cary@google.com>
516
517 * script-sections.cc (Script_sections::Script_sections): Initialize
518 segments_created_.
519 (Script_sections::create_note_and_tls_segments): Set flag when
520 segments are created.
521 (Script_sections::expected_segment_count): Count PT_INTERP.
522 (Script_sections::attach_sections_using_phdrs_clause): Set flag when
523 segments are created.
524 * script-sections.h (Script_sections::segments_created_): New data
525 member.
526
374082df
CC
5272015-06-03 Cary Coutant <ccoutant@gmail.com>
528
529 PR gold/15370
530 * script-sections.cc
531 (Output_section_element_input::set_section_addresses): When there
532 are several patterns with no sort spec, put all sections in the same
533 bin.
534 * testsuite/Makefile.am (script_test_12): New testcase.
535 (script_test_12i): New testcase.
536 * testsuite/Makefile.in: Regenerate.
537 * testsuite/script_test_12.t: New test linker script.
538 * testsuite/script_test_12i.t: New test linker script.
539 * testsuite/script_test_12a.c: New test source file.
540 * testsuite/script_test_12b.c: New test source file.
541
775ed62e
CC
5422015-06-02 Cary Coutant <ccoutant@gmail.com>
543
544 * nacl.h (Sniff_file): Switch parameters to get_view to get an
545 aligned view.
546
9c7fe3c5
CC
5472015-06-03 Cary Coutant <ccoutant@gmail.com>
548
72f4393d
L
549 PR gold/17819
550 * gold.cc (queue_final_tasks): When --build-id=tree, queue a
551 separate task to schedule the build id computation.
552 * layout.cc (Hash_task::Hash_task): Remove build_id_blocker,
553 add Output_file and offset.
554 (Hash_task::run): Get and release the input views.
555 (Hash_task::is_runnable): Always return NULL (always runnable).
556 (Layout::queue_build_id_tasks): Remove.
557 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
558 parameters; use them instead of class members.
559 (Build_id_task_runner::run): New function.
560 (Close_task_runner::run): Pass array_of_hashes and size_of_hashes
561 to write_build_id.
562 * layout.h (Layout::queue_build_id_tasks): Remove.
563 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
564 parameters.
565 (Layout::array_of_hashes_): Remove.
566 (Layout::size_of_array_of_hashes_): Remove.
567 (Layout::input_view_): Remove.
568 (Build_id_task_runner): New class.
569 (Close_task_runner::Close_task_runner): Add array_of_hashes and
570 size_of_hashes parameters.
571 (Close_task_runner::array_of_hashes_): New data member.
572 (Close_task_runner::size_of_hashes_): New data member.
573 * testsuite/Makefile.am
574 (flagstest_compress_debug_sections_and_build_id_tree): New test.
575 * testsuite/Makefile.in: Regenerate.
9c7fe3c5 576
400f8944
RÁE
5772015-06-01 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
578
579 * merge.cc (get_input_merge_map): Update for data structure change.
580 (get_or_make_input_merge_map): Update for data structure change.
581 * merge.h (Object_merge_map): Use a std::vector<std::pair>> instead of
582 a std::map. Remove first_shnum_, first_map_, second_shnum_, second_map_.
583
bbec1a5d
AM
5842015-05-16 Alan Modra <amodra@gmail.com>
585
586 * reloc.cc (Sized_relobj_file::find_functions): Use function_location.
587 * powerpc.cc (Target_powerpc::do_calls_non_split): New function.
588 (addi_12_1, addis_2_12, addis_12_1, cmpld_7_12_0): New constants.
589 (lis_0): Rename from lis_0_0.
590
efc6fa12
CC
5912015-04-29 Cary Coutant <cary@google.com>
592 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
593
594 * gc.h (Garbage_collection::is_section_garbage): Change Object*
595 to Relobj*.
596 (Garbage_collection::add_reference): Likewise.
597 (Garbage_collection::gc_process_relocs): Likewise. Don't push
598 object/shndx pair onto *secvec for dynamic objects. Don't follow
599 relocations pointing to dynamic objects for GC.
600 * icf.cc (Icf::find_identical_sections): Change Object* to Relobj*.
601 (Icf::unfold_section): Likewise.
602 (Icf::is_section_folded): Likewise.
603 (Icf::get_folded_section): Likewise.
604 * icf.h: (Icf::get_folded_section): Likewise.
605 (Icf::unfold_section): Likewise.
606 (Icf::is_section_folded): Likewise.
607 (Icf::section_has_function_pointers): Likewise.
608 (Icf::set_section_has_function_pointers): Likewise.
609 * object.h (Section_id): Likewise.
610 (Const_section_id): Likewise.
611 * output.cc (Output_section::update_section_layout): Likewise.
612 * output.h: (Output_section_lookup_maps::find_relaxed_input_section):
613 Likewise.
614 * plugin.cc (update_section_order): Likewise.
615 (unique_segment_for_sections): Likewise.
616 * powerpc.cc (Powerpc_relobj::add_reference): Likewise.
617 (Target_powerpc::do_gc_add_reference): Likewise.
618 (Target_powerpc::gc_process_relocs): Likewise.
619 (Target_powerpc::do_gc_add_reference): Likewise.
620 * symtab.cc (Symbol_table::is_section_folded): Likewise.
621 (Symbol_table::gc_mark_symbol): Likewise.
622 * symtab.h: (Symbol_table::is_section_folded): Likewise.
623 * target.h: (Sized_target::gc_add_reference): Likewise.
624 (Sized_target::do_gc_add_reference): Likewise.
625
f9d3ecaa
NC
6262015-04-29 Nick Clifton <nickc@redhat.com>
627
628 * po/fi.po: Updated Finnish translation.
629
faa2211d
AM
6302015-04-28 Alan Modra <amodra@gmail.com>
631
632 * powerpc.cc (Target_powerpc::do_dynsym_value): Use Address rather
633 than unsigned int for find_global_entry result temp. Compare
634 against invalid_address.
635 (Target_powerpc::do_plt_address_for_global): Likewise.
636 (Target_powerpc::Relocate::relocate): Likewise. Don't assert
637 on plt call stub existence for debug info. Do assert for plt
638 and global entry stub existence if an alloc section.
639
6ec65f28
AM
6402015-04-28 Alan Modra <amodra@gmail.com>
641
642 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't assert
643 on missing global entry stub due to bogus debug info.
644
7a2a1c79
HS
6452015-04-27 Han Shen <shenhan@google.com>
646
647 * options.h (--fix-cortex-a53-843419): Rename option.
648 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Use renamed
649 option.
650 (AArch64_relobj::scan_sections_for_stubs): Use renamed option.
651
cfbf0e3c
RÁE
6522015-04-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
653
654 PR gold/18327
655 * output.cc (Output_section::is_input_address_mapped): Assume a missing
656 entry is mapped.
657 * testsuite/Makefile.am: Add the eh_test test.
658 * testsuite/Makefile.in: Regenerate.
659 * testsuite/eh_test_a.cc: New test.
660 * testsuite/eh_test_b.cc: New test.
661
6ec65f28
AM
6622015-04-23 Sriraman Tallam <tmsriram@google.com>
663
a100d66f
ST
664 * options.h (--weak-unresolved-symbols): New option.
665 * symtab.cc (Symbol_table::sized_write_globals): Change symbol
666 binding to weak with new option.
667 * symtab.h (is_weak_undefined): Check for new option.
668 (is_strong_undefined): Check for new option.
669 * testsuite/Makefile.am (weak_unresolved_symbols_test): New test.
670 * testsuite/Makefile.in: Regenerate.
671 * testsuite/weak_unresolved_symbols_test.cc: New file.
672
4b889c30
IC
6732015-04-20 Ian Coolidge <icoolidge@google.com>
674
675 * symtab.cc (Symbol::should_add_dynsym_entry): Return true for
676 GNU_UNIQUE.
677
4277535c
RÁE
6782015-04-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
679
680 * gc.cc (Garbage_collection::do_transitive_closure): Use back and
681 push_back.
682 * gc.h (Garbage_collection): Use a std::vector instead of a std::queue.
683 * object.cc (Sized_relobj_file::do_layout): Use push_back.
684 * powerpc.cc (process_gc_mark): Use push_back.
685 (Target_powerpc::do_gc_mark_symbol): Use push_back.
686 * symtab.cc (Symbol_table::gc_mark_symbol): Use push_back.
687
7a2a1c79 6882015-04-16 Han Shen <shenhan@google.com>
5019d64a 689
6ec65f28
AM
690 * aarch64.cc (AArch64_insn_utilities): New utility class.
691 (AArch64_relobj::Mapping_symbol_position): New struct.
692 (AArch64_relobj::Mapping_symbol_info): New typedef.
693 (AArch64_relobj::do_count_local_symbols): New function overriding
694 parent's implementation.
695 (AArch64_relobj::mapping_symbol_info_): New member
696 (AArch64_relobj::scan_erratum_843419): New method.
697 (Target_aarch64::scan_erratum_843419_span): New method.
698 (Target_aarch64::is_erratum_843419_sequence): New method.
699 * options.h (fix_cortex_a53): New option.
5019d64a 700
a6a17750
CC
7012015-04-09 Cary Coutant <ccoutant@google.com>
702
703 * symtab.cc (Symbol::final_value_is_known): Check for TLS symbol
704 in a PIE link.
705 * testsuite/Makefile.am (tls_pie_test.sh): New test.
706 * testsuite/Makefile.in: Regenerate.
707 * testsuite/tls_pie_test.sh: New.
708
437ddf0c
CC
7092015-04-09 Cary Coutant <ccoutant@google.com>
710
711 * debug.h (DEBUG_LOCATION): New.
712 (DEBUG_ALL): Include DEBUG_LOCATION.
713 (debug_string_to_enum): Add DEBUG_LOCATION.
714 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Fix debug
715 output to print correct context.
716 (Sized_dwarf_line_info::do_addr2line): Add debug output. Return
717 up to 4 more locations at the beginning of the function.
718 * symtab.cc (Symbol_table::detect_odr_violations): Get canonical
719 result before sorting list of line numbers.
720 * testsuite/debug_msg.sh: Allow range of line numbers for
721 canonical results on optimized code.
722
24491327
HS
7232015-04-07 HC Yen <hc.yen@mediatek.com>
724
725 Add AArch32 support for gold linker.
726 gold/
727 * arm.cc: Add V8 arch combine table.
728
7fa5525f
RÁE
7292015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
730
731 * aarch64.cc (do_reloc_addend): Fix signature to match the parent one.
732
5368dcf2
RÁE
7332015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
734
735 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a call
736 to find by using the return value of insert.
737
9dbb4b02
RÁE
7382015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
739
740 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a copy
741 constructor call.
742
1fa29f10
IT
7432015-04-06 Ilya Tocar <ilya.tocar@intel.com>
744
745 PR gold/17641
746 * x86_64.cc (Target_x86_64::can_convert_mov_to_lea): New.
747 (Target_x86_64::Scan::local): Don't create GOT entry, when we
748 can convert mov to lea.
749 (Target_x86_64::Scan::global): Ditto.
750 (Target_x86_64::Relocate::relocate): Convert mov foo@GOTPCREL(%rip),
751 %reg to lea foo(%rip), %reg if possible.
752 * testsuite/Makefile.am (x86_64_mov_to_lea): New test.
753 * testsuite/x86_64_mov_to_lea1.s: New.
754 * testsuite/x86_64_mov_to_lea2.s: Ditto.
755 * testsuite/x86_64_mov_to_lea3.s: Ditto.
756 * testsuite/x86_64_mov_to_lea4.s: Ditto.
757 * testsuite/x86_64_mov_to_lea.sh: Ditto.
758
39f3de7c
L
7592015-04-02 H.J. Lu <hongjiu.lu@intel.com>
760
761 * configure: Regenerated.
762
c4fc4724
IT
7632015-04-01 Ilya Tocar <ilya.tocar@intel.com>
764
765 PR gold/17640
766 * i386.cc (Target_i386::can_convert_mov_to_lea): New.
767 (Target_i386::Scan::local): Don't create GOT entry, when we
768 can convert GOT to GOTOFF.
769 (Target_i386::Scan::global): Ditto.
770 (Target_i386::Relocate::relocate): Convert mov foo@GOT(%reg), %reg to
771 lea foo@GOTOFF(%reg), %reg if possible.
772 * testsuite/Makefile.am (i386_mov_to_lea): New test.
773 * testsuite/i386_mov_to_lea1.s: New.
774 * testsuite/i386_mov_to_lea2.s: Ditto.
775 * testsuite/i386_mov_to_lea3.s: Ditto.
776 * testsuite/i386_mov_to_lea4.s: Ditto.
777 * testsuite/i386_mov_to_lea5.s: Ditto.
778 * testsuite/i386_mov_to_lea.sh: Ditto.
779
918357b9
L
7802015-04-01 H.J. Lu <hongjiu.lu@intel.com>
781
782 * Makefile.am (ZLIB): New.
783 (ZLIBINC): Likewise.
784 (AM_CFLAGS): Add $(ZLIBINC).
785 (AM_CXXFLAGS): Likewise.
786 (ldadd_varldadd_var): Add $(ZLIB).
787 (incremental_dump_LDADD): Likewise.
788 (dwp_LDADD): Likewise.
789 * compressed_output.cc: Don't check HAVE_ZLIB_H to include
790 <zlib.h>.
791 (zlib_compress): Don't check HAVE_ZLIB_H.
792 (zlib_decompress): Likewise.
793 * options.h (compress_debug_sections): Likewise.
794 * configure.ac (AM_CONDITIONAL): Removed.
795 * testsuite/Makefile.am (ZLIB): New.
796 (LDADD): Add $(ZLIB).
797 Don't check HAVE_ZLIB.
798 * Makefile.in: Regenerated.
799 * config.in: Likewise.
800 * configure: Likewise.
801 * testsuite/Makefile.in: Likewise.
802
6b0ad2eb
JY
8032015-03-30 Jing Yu <jingyu@google.com>
804
805 * aarch64-reloc.def: New TLSLD_ADD_DTPREL_HI12,
806 TLSLD_ADD_DTPREL_LO12_NC.
807 * aarch64.cc (Target_aarch64::define_tls_base_symbol): Always let
808 _TLS_MODULE_BASE_ point to the start of tls segment.
809 (Target_aarch64::optimize_tls_reloc): Add cases for
810 R_AARCH64_TLSLD_ADD_DTPREL_HI12 and
811 R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
812 (Target_aarch64::Scan::local): Likewise.
813 (Target_aarch64::Scan::global): Likewise.
814 (Target_aarch64::Relocate::relocate): Likewise.
815 (Target_aarch64::Relocate::relocate_tls): Likewise. And remove
816 subtracting tls segment size from symbol value for TLSLD_*_DTPREL
817 relocations.
818
0916f9e7
RÁE
8192015-03-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
820
821 * merge.cc (Object_merge_map::add_mapping): call
822 Object_merge_map::Input_merge_map::add_mapping.
823 (Object_merge_map::Input_merge_map::add_mapping): New.
824 (Output_merge_data::do_add_input_section): Call
825 get_or_make_input_merge_map before a loop.
826 (Output_merge_string<Char_type>::finalize_merged_data): Call
827 get_or_make_input_merge_map before a loop.
828 * merge.h (Object_merge_map): Make Input_merge_map public.
829 * object.cc (Relobj::add_merge_mapping): Use get_or_create_merge_map.
830 (Relobj::get_or_create_merge_map): New.
831 * object.h (Relobj::get_or_create_merge_map): New.
832
282c9750
AM
8332015-03-24 Alan Modra <amodra@gmail.com>
834
835 PR 18147
836 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't report
837 relocation errors for branches to strong undefined symbols.
838
67f95b96
RÁE
8392015-03-23 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
840
841 * merge.cc (Object_merge_map::get_input_merge_map): Make it const.
842 (Object_merge_map::is_merge_section_for): Remove.
843 (Object_merge_map::find_merge_section): New.
844 * merge.h (Object_merge_map::is_merge_section_for): Remove.
845 (Object_merge_map::find_merge_section): New.
846 (Object_merge_map::get_input_merge_map): Add a const version.
847 * object.cc (Relobj::is_merge_section_for): Remove.
848 (Relobj::find_merge_section): New.
849 * object.h (Relobj::is_merge_section_for): Remove.
850 (Relobj::find_merge_section): New.
851 * output.cc
852 (Output_section::Input_section::is_merge_section_for): Remove.
853 (Output_section::add_merge_input_section): Don't call
854 add_merge_input_section.
855 (Output_section::find_merge_section): Return const. Use
856 object->find_merge_section.
857 (Output_section::build_lookup_maps): Don't build a map for
858 merge sections.
859 (Output_section::is_input_address_mapped): Return false if
860 section is not found.
861 (Output_section::find_starting_output_address): Use
862 find_merge_section instead of is_merge_section_for.
863 (Output_section::add_script_input_section): Don't build a map for
864 merge sections.
865 * output.h (Output_section_lookup_maps::merge_sections_by_id_): Remove.
866 (Output_section_lookup_maps::find_merge_section): Remove.
867 (Output_section_lookup_maps::add_merge_input_section) Remove.
868 (Output_section::find_merge_section): Return const.
869
152f7024
CC
8702015-03-22 Cary Coutant <cary@google.com>
871
872 PR gold/18106
873 * i386.cc (Target_i386::Relocate::tls_gd_to_ie): Fix support for
874 non-SIB form of lea, with nop after the call.
875
bccffdfd
CC
8762015-03-21 Cary Coutant <cary@google.com>
877
878 PR gold/14217
879 * output.cc (Output_segment::is_first_section_relro): Don't ignore
880 .tdata section.
881 (Output_segment::set_section_addresses): Don't align size of relro
882 segment for .tbss.
883
1c582fe7
CC
8842015-03-21 Cary Coutant <cary@google.com>
885
886 PR gold/18010
887 * stringpool.cc (Stringpool_template): Don't optimize if section
888 alignment is greater than sizeof(char).
889
410da591
CC
8902015-03-21 Cary Coutant <cary@google.com>
891
892 PR gold/18048
893 * script-c.h (script_include_directive): Add first_token parameter.
894 * script.cc (script_include_directive): Add first_token parameter, and
895 pass it to read_script_file.
896 * yyscript.y (PARSING_SECTIONS_BLOCK, PARSING_SECTION_CMDS)
897 (PARSING_MEMORY_DEF): New tokens.
898 (top): Add new productions for INCLUDE files.
899 (file_cmd): Replace file_or_sections_cmd with copy of its productions.
900 Pass PARSING_LINKER_SCRIPT to script_include_directive.
901 (section_block_cmd): Likewise; pass PARSING_SECTIONS_BLOCK.
902 (section_cmd): Pass PARSING_SECTION_CMDS.
903 (file_or_sections_cmd): Remove.
904 (memory_def): Pass PARSING_MEMORY_DEF.
905 * testsuite/Makefile.am (memory_test_2): New test.
906 * testsuite/Makefile.in: Regenerate.
907 * testsuite/memory_test_inc.t: New script file.
908 * testsuite/memory_test_inc_1.t.src: New script file.
909 * testsuite/memory_test_inc_2.t.src: New script file.
910 * testsuite/memory_test_inc_3.t.src: New script file.
911
0d5bbdb0
CC
9122015-03-21 Cary Coutant <cary@google.com>
913
914 * dwp.cc (Sized_relobj_dwo::do_section_contents): Delete.
915 (Sized_relobj_dwo::setup): Build compressed section map.
916 (Sized_relobj_dwo::do_decompressed_section_contents): Delete.
917 * dynobj.cc (Sized_dynobj::base_read_symbols): Build compressed
918 section map.
919 * object.cc (Sized_relobj_file::Sized_relobj_file): Remove
920 compressed_sections_ field.
921 (build_compressed_section_map): Take Object instead of
922 Sized_relobj_file parameter; add decompress_if_needed parameter.
923 (Sized_relobj_file::do_find_special_sections): Store compressed
924 section map in parent Object.
925 (Sized_relobj_file::do_decompressed_section_contents): Move
926 implementation to Object::decompressed_section_contents.
927 (Sized_relobj_file::do_discard_decompressed_sections): Move
928 implementation to Object::discard_decompressed_sections.
929 * object.h (build_compressed_section_map): Declare.
930 (Object::Object): Add compressed_sections_ field.
931 (Object::section_is_compressed): Move implementation here.
932 (Object::decompressed_section_contents): De-virtualize.
933 (Object::discard_decompressed_sections): De-virtualize.
934 (Object::do_section_is_compressed): Delete.
935 (Object::do_decompressed_section_contents): Delete.
936 (Object::set_compressed_sections): New method.
937 (Object::compressed_sections): New method.
938 (Object::compressed_sections_): New data member.
939 (Compressed_section_info, Compressed_section_map): Move to top of file.
940 (Sized_relobj_file::do_section_is_compressed): Delete.
941 (Sized_relobj_file::do_decompressed_section_contents): Delete.
942 (Sized_relobj_file::do_discard_decompressed_sections): Delete.
943 (Sized_relobj_file::compressed_sections_): Move to Object class.
944
bd9e0d46
CC
9452015-03-21 Cary Coutant <ccoutant@google.com>
946
947 PR gold/18152
948 * gold.cc (queue_middle_tasks): Finalize .eh_frame after laying out
949 deferred objects.
950
943c8b43
CC
9512015-03-11 Cary Coutant <ccoutant@google.com>
952
953 * options.cc (General_options::finalize): Don't allow -z relro
954 with incremental linking.
955 * testsuite/Makefile.am (incremental_test): Add -z norelro.
956 (incremental_test_2): Likewise.
957 (incremental_test_3): Likewise.
958 (incremental_test_4): Likewise.
959 (incremental_test_5): Likewise.
960 (incremental_test_6): Likewise.
961 (incremental_copy_test): Likewise.
962 (incremental_common_test_1): Likewise.
963 (incremental_comdat_test_1): Likewise.
964 * testsuite/Makefile.in: Regenerate.
965
e1663197
CC
9662015-03-09 Cary Coutant <ccoutant@google.com>
967
968 PR gold/14675
969 * ehframe.cc (Eh_frame::add_ehframe_input_section): Change return type;
970 return enum indicating whether .eh_frame section is empty, optimizable,
971 unrecognized, or an end marker. Adjust explicit instantiations.
972 * ehframe.h (Eh_frame::Eh_frame_section_disposition): New enum type.
973 (Eh_frame::add_ehframe_input_section): Change return type.
974 * gold.cc (queue_middle_tasks): Call Layout::finalize_eh_frame_section.
975 * layout.cc (Layout::layout_eh_frame): Don't add optimized sections
976 to the .eh_frame output section until we see the end marker.
977 (Layout::finalize_eh_frame_section): New.
978 * layout.h: (Layout::finalize_eh_frame_section): New.
979
beb8418f
L
9802015-03-05 H.J. Lu <hongjiu.lu@intel.com>
981
982 * output.cc (Relobj::initialize_input_to_output_map<size>):
983 Remove typename on elfcpp::Elf_types<size>::Elf_Addr.
984
48c73428
CC
9852015-03-04 Cary Coutant <ccoutant@google.com>
986
987 * parameters.cc (Parameters::set_target_once): Call
988 Target::select_as_default_target just once from here...
989 (set_parameters_target): ...instead of from here.
990
9912015-03-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
dbe40a88
RÁE
992
993 * ehframe.cc (Cie::set_output_offset): Pass in and use a
994 Output_section_data instead of a Merge_map.
995 (Eh_frame::Eh_frame): Don't initialize merge_map_.
996 (Eh_frame::read_cie): Use add_merge_mapping instead of
997 Merge_map::add_mapping.
998 (Eh_frame::read_fde): Ditto.
999 (Eh_frame::set_final_data_size): Use this instead of this->merge_map_.
1000 (Eh_frame::do_output_offset): Use merge_output_offset istead of
1001 merge_map_->get_output_offset.
1002 (Eh_frame::do_is_merge_section_for): Delete.
1003 * ehframe.h (Fde::add_mapping): Pass in and use a Output_section_data
1004 instead of a Merge_map.
1005 (Cie::set_output_offset): Pass in a Output_section_data instead of a
1006 Merge_map.
1007 (Eh_frame::do_is_merge_section_for): Delete.
1008 (Eh_frame::merge_map_): Delete.
1009 * merge.cc (Object_merge_map::get_or_make_input_merge_map): Pass in
1010 and use a Output_section_data instead of a Merge_map.
1011 (Object_merge_map::add_mapping): Ditto.
1012 (Object_merge_map::get_output_offset): Remove the merge_map argument.
1013 (Object_merge_map::is_merge_section_for): Pass in and use a
1014 Output_section_data instead of a Merge_map.
1015 (Merge_map): Delete.
1016 (Output_merge_base::do_output_offset): Use merge_output_offset instead
1017 of merge_map_.get_output_offset.
1018 (Output_merge_base::do_is_merge_section_for): Delete.
1019 (Output_merge_data::do_add_input_section): Use
1020 object->add_merge_mapping instead of add_mapping.
1021 (Output_merge_string<Char_type>::finalize_merged_data): Ditto.
1022 * merge.h (Merge_map): Delete forward declaration.
1023 (Object_merge_map::add_mapping): Pass in and use a Output_section_data
1024 instead of a Merge_map.
1025 (Object_merge_map::get_output_offset): Remove the merge_map argument.
1026 (Object_merge_map::is_merge_section_for): Pass in and use a
1027 Output_section_data instead of a Merge_map.
1028 (Input_merge_map::Object_merge_map::merge_map): Replace with
1029 output_data.
1030 (Object_merge_map::get_or_make_input_merge_map): Pass in and use a
1031 Output_section_data instead of a Merge_map.
1032 (Merge_map): Delete.
1033 (Output_merge_base::Output_merge_base): Don't initialize merge_map_.
1034 (Output_merge_base::do_is_merge_section_for): Delete.
1035 (Output_merge_base::add_mapping): Delete.
1036 (Output_merge_base::merge_map_): Delete.
1037 * object.cc (Relobj::initialize_input_to_output_map): New.
1038 (Relobj::initialize_input_to_output_map): New.
1039 (Relobj::merge_output_offset): New.
1040 (Relobj::is_merge_section_for): New.
1041 (Relobj::initialize_input_to_output_map): Instantiate for 32 and 64
1042 bits.
1043 * object.h (Relobj::merge_map): Delete.
1044 (initialize_input_to_output_map): New.
1045 (set_merge_map): Delete.
1046 (add_merge_mapping): New.
1047 (merge_output_offset): New.
1048 (is_merge_section_for): New.
1049 * output.cc (Output_section::Input_section::is_merge_section_for):
1050 Use object->is_merge_section_for.
1051 * output.h (Output_section_data::is_merge_section_for): Delete.
1052 (Output_section_data::do_is_merge_section_for): Delete.
1053 * reloc.cc (Merged_symbol_value<size>::initialize_input_to_output_map):
1054 Use object->initialize_input_to_output_map.
1055 (Merged_symbol_value<size>::value_from_output_section): Use
1056 object->merge_output_offset.
1057
48c73428 10582015-03-02 Peter Collingbourne <pcc@google.com>
72f4393d 1059 Cary Coutant <ccoutant@google.com>
2c7b626c
CC
1060
1061 * output.cc (Output_section::add_merge_input_section): Do not
1062 attempt to merge sections with an entsize of 0.
1063
48c73428 10642015-03-02 Khem Raj <raj.khem@gmail.com>
5b07cd84
CC
1065
1066 * attributes.h (class Output_attributes_section_data ): Add
1067 do_print_to_mapfile function.
1068
ec86f434
AM
10692015-02-24 Alan Modra <amodra@gmail.com>
1070
1071 PR 18010
1072 * powerpc.cc (Powerpc_relocate_functions::addr16_ds): Always
1073 complain if value is not a multiple of four.
1074 (Target_powerpc::Relocate::relocate): Correct handling of
1075 R_POWERPC_GOT_TPREL16 and R_POWERPC_GOT_TPREL16_LO for ppc64.
1076
be66981e
L
10772015-02-21 H.J. Lu <hongjiu.lu@intel.com>
1078
1079 * configure.ac (default_size): Set to 32 for x32.
1080 * configure: Regenerated.
1081
e3ee8ed4
AM
10822015-02-18 Alan Modra <amodra@gmail.com>
1083
1084 PR 17954
1085 * powerpc.cc (Global_symbol_visitor_opd::operator()): Set default
1086 visibility.
1087
3a935c6c
RÁE
10882015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1089
1090 * gc.h (Garbage_collection::add_reference): Don't use find.
1091
e0a1e121
RÁE
10922015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1093
1094 * object.cc (write_local_symbols): avoid std::vector copy.
1095
45a4fb1a
RÁE
10962015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1097
1098 * merge.cc (get_output_offset): Use upper_bound instead of lower_bound.
1099
2d9afefe
MW
11002015-02-09 Mark Wielaard <mjw@redhat.com>
1101
1102 * gdb-index.cc (Gdb_index_info_reader::visit_top_die): Recognize
1103 DW_LANG_Fortran03 and DW_LANG_Fortran08.
1104
e9c1bdad
CC
11052015-02-16 Cary Coutant <ccoutant@google.com>
1106
1107 PR gold/13577
1108 PR gold/16992
1109 * layout.cc (Layout::finish_dynamic_section): Don't set DT_SYMBOLIC or
1110 DF_SYMBOLIC if --dynamic-list option is used.
1111 * options.cc (General_options::finalize): --dynamic-list is not
1112 mutually exclusive with -Bsymbolic.
1113 * symtab.h (Symbol::is_preemptible): Don't exclude dynamic symbols not
1114 listed in --dynamic-list.
1115 * testsuite/Makefile.am (dynamic_list_lib2.so): Add
1116 -Bsymbolic-functions.
1117 * testsuite/Makefile.in: Regenerate.
1118
0ed4b0bf
CC
11192015-02-16 Cary Coutant <ccoutant@google.com>
1120
1121 PR gold/17971
1122 * incremental.cc: Remove redundant include of "output.h".
1123
1a920511
JY
11242015-02-12 Jing Yu <jingyu@google.com>
1125
1126 * aarch64-reloc.def (TLSLE_MOVW_TPREL_G2, TLSLE_MOVW_TPREL_G1,
1127 TLSLE_MOVW_TPREL_G1_NC, TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC,):
1128 New relocation.
1129 * aarch64.cc (Target_aarch64::Scan::local): Add cases for new
1130 TLSLE_MOVW_* relocations.
1131 (Target_aarch64::Scan::global): Likewise.
1132 (Target_aarch64::Relocate::relocate): Likewise.
1133 (Target_aarch64::Relocate::relocate_tls): Add cases and handlings
1134 for new TLSLE_MOVW_* relocations.
1135
07f107f3
WN
11362015-02-11 Will Newton <will.newton@linaro.org>
1137
1138 PR gold/13321
1139 * arm.cc (Target_arm::make_plt_section): Create an ARM
1140 state mapping symbol at the start of the PLT.
1141
e051a5b5
L
11422015-02-09 H.J. Lu <hongjiu.lu@intel.com>
1143
1144 * testsuite/Makefile.am (two_file_shared_2_pic_1_test_DEPENDENCIES):
1145 Replace two_file_shared_2.so with two_file_shared_1.so.
1146 * testsuite/Makefile.in: Regenerated.
1147
dddcc5b9
AM
11482015-02-09 Alan Modra <amodra@gmail.com>
1149
1150 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add libweak_undef_2.a,
1151 plugin_test_thin.a and defsym_test.
1152 * testsuite/Makefile.in: Regenerate.
1153
b39b8b9d
RÁE
11542015-02-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1155
1156 * merge.cc (do_add_input_section): Combine loop epilogue into main loop
1157 body.
1158
b66d1c52
CC
11592015-02-04 Peter Collingbourne <pcc@google.com>
1160
1161 * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve
1162 forwarding symbols when computing symbol resolution info for plugins.
1163 * plugin.h (Plugin_manager::symtab): New method.
1164 (Pluginobj::get_symbol_resolution_info): Add symtab parameter.
1165
23081de0
CC
11662015-02-03 Cary Coutant <ccoutant@google.com>
1167 Peter Collingbourne <pcc@google.com>
1168
1169 PR gold/15660
1170 * archive.cc (Thin_archive_object_unlocker): New class.
1171 (Archive::include_member): Unlock external members of thin archives.
1172 * testsuite/Makefile.am (plugin_test_1): Rename .syms files.
1173 (plugin_test_2): Likewise.
1174 (plugin_test_3): Likewise.
1175 (plugin_test_4): Likewise.
1176 (plugin_test_5): Likewise.
1177 (plugin_test_6): Likewise.
1178 (plugin_test_7): Likewise.
1179 (plugin_test_8): Likewise.
1180 (plugin_test_9): Likewise.
1181 (plugin_test_10): Likewise.
1182 (plugin_test_11): New test case.
1183 * testsuite/Makefile.in: Regenerate.
1184 * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms
1185 file to decide whether to claim file.
1186 (all_symbols_read_hook): Likewise.
1187 * testsuite/plugin_test_1.sh: Adjust expected output.
1188 * testsuite/plugin_test_2.sh: Likewise.
1189 * testsuite/plugin_test_3.sh: Likewise.
1190 * testsuite/plugin_test_6.sh: Likewise.
1191 * testsuite/plugin_test_tls.sh: Likewise.
1192 * testsuite/plugin_test_11.sh: New testcase.
1193
11942015-02-03 Cary Coutant <ccoutant@google.com>
1195
1196 * descriptors.cc (Descriptors::open): Set artificially-low limit for
1197 file descriptors when debugging enabled. Add debug output.
1198 (Descriptors::release): Add debug output.
1199 (Descriptors::close_some_descriptor): Likewise.
1200 (Descriptors::close_all): Likewise.
1201 * fileread.cc (File_read::lock): Likewise.
1202 (File_read::unlock): Likewise.
1203
24dd5808
CC
12042015-02-02 Cary Coutant <ccoutant@google.com>
1205
1206 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
1207 executable output file.
1208
fa89cc82
HS
12092015-01-22 Han Shen <shenhan@google.com>
1210
1211 * arm.cc (Target_arm::Target_arm): Add initialization for new members.
1212 (Target_arm::do_plt_address_for_global): New method.
1213 (Target_arm::do_plt_address_for_local): New method.
1214 (Target_arm::rel_irelative_section): New method.
1215 (Target_arm::make_data_plt): Add more parameters for plt ctor.
1216 (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
1217 (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
1218 (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
1219 (Target_arm::Scan::check_non_pic): Add ifunc support.
1220 (Target_arm::Scan::local): Add ifunc support.
1221 (Target_arm::Scan::global): Add ifunc support.
1222 (Target_arm::make_plt_section): New method.
1223 (Target_arm::make_plt_entry): Change to call to make_plt_section.
1224 (Target_arm::make_local_ifunc_plt_entry): New method.
1225 (Target_arm::got_irelative_): New member.
1226 (Target_arm::rel_irelative_): New member.
1227 (Target_arm::got_section): Add creation for got_irelative_.
1228 (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
1229 (Target_arm::Relocate::relocate): Properly set local ifunc address.
1230 (Target_arm::do_dynsym_value): Properly set global ifunc address.
1231 (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
1232 (Output_data_plt_arm::IRelative_data): New type.
1233 (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
1234 (Output_data_plt_arm::add_entry): Add more parameters.
1235 (Output_data_plt_arm::add_relocation): New method.
1236 (Output_data_plt_arm::add_local_ifunc_entry): New method.
1237 (Output_data_plt_arm::rel_irelative): New method.
1238 (Output_data_plt_arm::entry_count): Modified.
1239 (Output_data_plt_arm::address_for_global): New method.
1240 (Output_data_plt_arm::address_for_local): New method.
23081de0 1241gold/
fa89cc82
HS
1242 (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
1243 (Output_data_plt_arm::insert_irelative_data): New method.
1244 (Output_data_plt_arm::irelative_rel_): New member.
1245 (Output_data_plt_arm::got_): New member.
1246 (Output_data_plt_arm::got_irelative_): New member.
1247 (Output_data_plt_arm::irelative_count_): New member.
1248 (Output_data_plt_arm::IRelative_data_vec): New typedef.
1249 (Output_data_plt_arm::irelative_data_vec_): New member.
1250 (Output_data_plt_arm::do_write): Write out irelative entries.
1251 (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
1252 more parameters to ctor.
1253 (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
1254 more parameters to ctor.
1255 * output.h (Output_data_reloc::add_local_relative): New method.
1256 * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
1257
0f81d3f0
AM
12582015-01-29 Alan Modra <amodra@gmail.com>
1259
1260 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
1261 and GOT_TLSGD to LE optimization.
1262
65d92137
CC
12632015-01-28 Cary Coutant <ccoutant@google.com>
1264
1265 * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
1266 for undef TLS symbols.
1267 (Target_x86_64::Relocate::relocate_tls): Likewise.
1268 (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
1269
5485698a
CC
12702015-01-25 Cary Coutant <ccoutant@google.com>
1271
1272 * output.cc (Output_segment::set_section_addresses): Fix calculation
1273 of size of relro segment.
1274
b01a4b04
AM
12752015-01-22 Alan Modra <amodra@gmail.com>
1276
1277 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
1278 condition for need of ifunc plt entry.
1279 (Target_powerpc::Scan::global <got relocs>): Likewise.
1280
3d0064a9
CC
12812015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1282
1283 * mips.cc (reloc_high): Add r_sym.
1284 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
1285 reloc_high constructor.
1286 (Mips_relocate_functions::relgot16_local): Likewise.
1287 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
1288 r_type to decide whether LO16 matches HI16.
1289 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
1290 rello16 and relgot16_local.
1291
a5cd8f05
CC
12922015-01-09 Cary Coutant <ccoutant@google.com>
1293
1294 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
1295 unless alignment is larger than page size.
1296
4fc1b9d4
L
12972015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1298 Cary Coutant <ccoutant@google.com>
1299
1300 PR gold/17729
1301 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
1302 (DEFAULT_TARGET_X32): Set for x32.
1303 * x86_64.cc (cmp_insn_32): New.
1304 (lea_r10_insn_32): Likewise.
1305 (lea_r11_insn_32): Likewise.
1306 (cmp_insn_64): Likewise.
1307 (lea_r10_insn_64): Likewise.
1308 (lea_r11_insn_64): Likewise.
1309 (Target_x86_64<size>::do_calls_non_split): Handle x32.
1310 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
1311 (check_DATA): Add split_x32 files.
1312 (split_x32_[1234n].o): New targets.
1313 (split_x32_[124]): New targets.
1314 (split_x32_[1234r].stdout): New targets.
1315 * testsuite/split_x32.sh: New file.
1316 * testsuite/split_x32_1.s: Likewise.
1317 * testsuite/split_x32_2.s: Likewise.
1318 * testsuite/split_x32_3.s: Likewise.
1319 * testsuite/split_x32_4.s: Likewise.
1320 * testsuite/split_x32_n.s: Likewise.
1321 * configure: Regenerated.
1322 * testsuite/Makefile.in: Likewise.
1323
e749cab8
L
13242015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1325
1326 PR gold/17809
1327 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
1328 x32.
1329
af759df0
AM
13302015-01-02 Alan Modra <amodra@gmail.com>
1331
1332 * version.cc (print_version): Just print current year.
1333 * dwp.cc (print_version): Likewise.
1334
b90efa5b
AM
13352015-01-01 Alan Modra <amodra@gmail.com>
1336
1337 Update year range in copyright notice of all files.
1338
f12d1e8a
AM
13392014-12-25 Alan Modra <amodra@gmail.com>
1340
1341 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
1342 new enums.
1343 (Target_arm::merge_object_attributes, ): Likewise.
1344
5c294fee
TG
13452014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
1346
1347 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
1348 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
1349 AEABI_VFP_args_vfp to check that.
1350 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
1351 value and replace hardcoded values by enum values.
1352
e30880c2
CC
13532014-12-22 Cary Coutant <ccoutant@google.com>
1354
1355 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
1356
bd040da1
L
13572014-12-20 H.J. Lu <hongjiu.lu@intel.com>
1358
1359 PR gold/14608
1360 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
1361 to "return i * i * 3;".
1362
e02a4046
CC
13632014-12-16 Cary Coutant <ccoutant@google.com>
1364
1365 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
1366 (Mapfile::print_output_data): Use current_data_size() to avoid
1367 assert for sections requiring postprocessing; if address is not valid,
1368 print 0.
1369 (Mapfile::print_output_section): Use current_data_size(); print note
1370 that addresses and sizes are before compression.
1371
add6016b
L
13722014-12-14 H.J. Lu <hongjiu.lu@intel.com>
1373
1374 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1375 Cast current_group_size to unsigned long when reporting error.
1376
0bf32ea9
JY
13772014-12-10 Jing Yu <jingyu@google.com>
1378
1379 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
1380 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
1381 Update error message.
1382 (Target_aarch64::do_relax): Use absolute value of option
1383 stub_group_size. Replace local variable with class member
1384 stub_group_size_.
1385
cbcb23fa
AM
13862014-12-04 Alan Modra <amodra@gmail.com>
1387
1388 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
1389 addend of PLTREL24 reloc when not generating a plt stub. Make
1390 max_branch_offset an "Address".
fbad6518 1391 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
cbcb23fa
AM
1392 (Target_powerpc::Relocate::relocate): Likewise.
1393
1611bc4a
AM
13942014-12-04 Alan Modra <amodra@gmail.com>
1395
1396 PR 17670
1397 * symtab.cc (Symbol::set_undefined): Remove assertion.
1398 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1399 on symbols defined in discarded sections, instead return false.
1400 Rearrange params, update all callers.
1401 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
1402 branches to syms in discarded sections.
1403 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
1404 undefined and flag as discarded.
1405 (Target_powerpc::Relocate::relocate): Localize variable.
1406
4759c34e
L
14072014-12-03 H.J. Lu <hongjiu.lu@intel.com>
1408
1409 PR gold/17675
1410 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
1411 * testsuite/Makefile.in: Regenerated.
1412
1f98a074
AM
14132014-12-03 Alan Modra <amodra@gmail.com>
1414
1415 PR 17566
1416 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
1417 when adding dynamic relocations against section symbols.
1418
fb257835
DI
14192014-12-01 Dimitry Ivanov <dimitry@google.com>
1420
1421 * layout.cc (Layout::finish_dynamic_section): When '-z global'
1422 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
1423 * options.h (General_options): New -z option (global).
1424
d8e60314
CC
14252014-12-01 Cary Coutant <ccoutant@google.com>
1426
1427 PR gold/17578
1428 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
1429 is given.
1430 (Layout::create_executable_stack_info): Warn when -z noexecstack is
1431 given but some inputs require executable stack.
1432
982bbd97
CC
14332014-11-26 Cary Coutant <ccoutant@google.com>
1434
1435 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
1436 .debug_str_offsets; strip .debug_gnu_pubnames and
1437 .debug_gnu_pubtypes.
1438 (lines_only_debug_sections): Strip all four new sections.
1439
bb779192
HS
14402014-11-26 Jing Yu <jingyu@google.com>
1441
1442 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
1443 register to be x0 when to relax TLSDESC_LD64_LO12.
1444
a3e60ddb
AM
14452014-11-26 Alan Modra <amodra@gmail.com>
1446
1447 * powerpc.cc (struct Stub_table_owner): New.
1448 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
1449 unsigned int vector. Update all references.
1450 (powerpc_relobj::set_stub_table): Take an unsigned int param
1451 rather than a Stub_table. Update callers.
1452 (Powerpc_relobj::clear_stub_table): New function.
1453 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
1454 stub_group_size_ vars.
1455 (Target_powerpc::new_stub_table): Delete.
1456 (max_branch_delta): New function, extracted from..
1457 (Target_powerpc::Relocate::relocate): ..here..
1458 (Target_powerpc::Branch_info::make_stub): ..and here. Return
1459 status on whether stub created successfully.
1460 (Stub_control::Stub_control): Add "no_size_errors" param. Move
1461 default sizing to..
1462 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
1463 reduce on relax failure.
1464 (Target_powerpc::group_sections): Add "no_size_errors" param.
1465 Use stub_group_size_. Set up group info in a temp vector,
1466 before building Stub_table vector. Account for input sections
1467 possibly already converted to relaxed sections.
1468 (Stub_table::init): Delete. Merge into..
1469 (Stub_table::Stub_table): ..here.
1470 (Stub_table::can_reach_stub): New function.
1471 (Stub_table::add_plt_call_entry): Add "from" parameter and
1472 return true iff stub could be reached.
1473 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
1474 param too.
1475 (Stub_table::clear_stubs): Add "all" param.
1476
a20605cf
AM
14772014-11-26 Alan Modra <amodra@gmail.com>
1478
1479 * powerpc.cc (Stub_control::set_output_and_owner): New function.
1480 (Target_powerpc::group_sections): Use it.
1481
43b64deb
CC
14822014-11-25 Cary Coutant <ccoutant@google.com>
1483
1484 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
1485 (Binary_to_elf::write_symbol): Add st_size parameter.
1486 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
1487
c924eb67
CC
14882014-11-25 Cary Coutant <ccoutant@google.com>
1489
1490 PR gold/17639
1491 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
1492 (Sized_relobj_file::do_layout): Handle deferred sections properly
1493 during GC pass 1. Don't add reloc sections to deferred list twice.
1494 * object.h (Sized_relobj_file::is_deferred_layout): New function.
1495 (Sized_relobj_file::is_deferred_layout_): New data member.
1496
9d585188
L
14972014-11-21 H.J. Lu <hongjiu.lu@intel.com>
1498
1499 PR gold/17619
1500 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
1501 Check PC-relative offset overflow in PLT entry.
1502
3ffaac20
AM
15032014-11-21 Alan Modra <amodra@gmail.com>
1504
1505 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
1506 for undefined weaks.
1507
0cfb0717
AM
15082014-11-20 Alan Modra <amodra@gmail.com>
1509
1510 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
1511 from --stub-group-size parameter divided by 1024.
1512 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
1513 template parameter. Update all uses.
1514 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
1515 has_stub_value. Set for long branches. Don't report overflow for
1516 branch to undefined weak symbols. Print info message on
1517 overflowing branch to stub.
1518
f9dffbf0
AM
15192014-11-20 Alan Modra <amodra@gmail.com>
1520
1521 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
1522
e88ba8d5
L
15232014-11-13 H.J. Lu <hongjiu.lu@intel.com>
1524
1525 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
1526 entry for R_X86_64_GOTPLT64.
1527 (Target_x86_64<size>::Relocate::relocate): Update comments for
1528 R_X86_64_GOTPLT64.
1529
d37ffe25
ED
15302014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
1531
1532 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
1533 * plugin.h: add lock definition
1534
9726c3c1
HS
15352014-10-29 Han Shen <shenhan@google.com>
1536 Jing Yu <jingyu@google.com>
1537
1538 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
1539 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1540 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
1541 Symbol::TLS_REF.
1542 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
1543 method.
1544 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
1545 (Target_aarch64::tls_ld_to_le): New method.
1546 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
1547 for 64bit targets.
1548 (Output_data_plt_aarch64::irelative_rel_): New data member.
1549 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
1550 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
1551 (Output_data_plt_aarch64::add_relocation): New method.
1552 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
1553 offset. Add got_irelative size to got size.
1554 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
1555 type string with the new typename.
1556 (AArch64_relocate_functions::update_adr): Replace parameter x with
1557 immed.
1558 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
1559 (AArch64_relocate_functions::reloc_common): New method.
1560 (AArch64_relocate_funcsions::rela_general): Extract common part out
1561 into reloc_common method.
1562 (AArch64_relocate_functions::rela_general): Likewise.
1563 (AArch64_relocate_functions::pcrela_general): Likewise.
1564 (AArch64_relocate_functions::adr): New method.
1565 (AArch64_relocate_functions::adrp): Calculate immed before calling
1566 update_adr.
1567 (AArch64_relocate_functions::adrp): Likewise.
1568 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
1569 comparing x to 0. Calculate immed from ~x when x < 0.
1570 (Target_aarch64::optimize_tls_reloc): Add new cases for
1571 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1572 TLSLD_MOVW_DTPREL_G0_NC.
1573 (Target_aarch64::possible_function_pointer_reloc): Implement this
1574 method.
1575 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
1576 comment.
1577 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
1578 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1579 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1580 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
1581 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1582 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1583 (Target_aarch64::make_plt_entry): Call add_entry with two more
1584 parameters.
1585 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1586 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
1587 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1588 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1589 (Target_aarch64::Relocate::relocate_tls): Add cases for
1590 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1591 TLSLD_MOVW_DTPREL_G0_NC.
1592 * testsuite/icf_safe_so_test.cc: Correct test comment.
1593 * testsuite/icf_safe_test.sh: Add AArch64 arch.
1594
80272b8c
AM
15952014-10-22 Alan Modra <amodra@gmail.com>
1596
1597 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
1598 thread_starter.
1599
998a69f4
AS
16002014-10-18 Andreas Schwab <schwab@linux-m68k.org>
1601
1602 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
1603
aed56ec5
CC
16042014-10-17 Cary Coutant <ccoutant@google.com>
1605
1606 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1607 Add "typename" keyword.
1608
bb779192 16092014-10-15 Han Shen <shenhan@google.com>
72f4393d 1610 Jing Yu <jingyu@google.com>
83a01957
HS
1611
1612 Patch for gold aarch64 backend to support relaxation.
1613 * aarch64-reloc.def: Change format.
1614 * aarch64.cc (class Reloc_stub): New class.
1615 (class Stub_table): New class.
1616 (class AArch64_relobj): New class.
1617 (class AArch64_input_section): New class.
1618 (class AArch64_output_section): New class.
1619 (Target_aarch64::new_stub_table): New method.
1620 (Target_aarch64::new_aarch64_input_section): New method.
1621 (Target_aarch64::find_aarch64_input_section): New method.
1622 (Target_aarch64::scan_section_for_stubs): New method.
1623 (Target_aarch64::scan_reloc_section_for_stubs): New method.
1624 (Target_aarch64::relocate_stub): New method.
1625 (Target_aarch64::current_target): New method.
1626 (Target_aarch64::do_make_elf_object): New method.
1627 (Target_aarch64::do_may_relax): New method.
1628 (Target_aarch64::do_relax): New method.
1629 (Target_aarch64::group_sections): New method.
1630 (Target_aarch64::scan_reloc_for_stub): New method.
1631 (Target_aarch64::do_make_output_section): New method.
1632 (Target_aarch64::stub_tables_): New data member.
1633 (Target_aarch64::aarch64_input_section_map_): New data member.
1634 (AArch64_relocate_functions::maybe_apply_stub): New method.
1635
db4c9594
CC
16362014-09-30 Cary Coutant <ccoutant@google.com>
1637
1638 PR gold/17432
1639 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
1640
cd6da036
KC
16412014-09-30 Kito Cheng <kito@0xlab.org>
1642
1643 PR gold/13597
1644 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
1645 hash table before sysv-style hash table.
1646
5f772412
ST
16472014-09-29 Sriraman Tallam <tmsriram@google.com>
1648
1649 * options.h (--pic-executable): Add negative to alias to -no-pie.
1650
5efeedf6
CC
16512014-09-26 Cary Coutant <ccoutant@google.com>
1652
1653 PR gold/16773
1654 * object.cc (Sized_relobj_file): Compute value of section symbols
1655 for TLS sections the same as TLS symbols.
1656
1707f183
CC
16572014-09-25 Cary Coutant <ccoutant@google.com>
1658
1659 PR gold/17432
1660 * resolve.cc (Symbol_table::resolve): Override common placeholder
1661 symbols, but adjust sizes.
1662 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
1663 symbols to common lists.
1664
00cac886
AM
16652014-09-24 Alan Modra <amodra@gmail.com>
1666
1667 * po/POTFILES.in: Regenerate.
1668
635aa30e 16692014-09-23 Taiju Tsuiki <tzik@google.com>
72f4393d 1670 Cary Coutant <ccoutant@google.com>
635aa30e 1671
71b9b91b 1672 PR gold/14860
635aa30e
CC
1673 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
1674 on input_sections_blocker.
1675 * layout.cc (Write_sections_task::locks): Unblock
1676 input_sections_blocker_.
1677 * layout.h (Write_sections_task::Write_sections_task): Add
1678 input_sections_blocker.
1679 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
1680 to DEPENDENCIES.
1681 * testsuite/Makefile.in: Regenerate.
1682
c0c71592
RÁE
16832014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1684
1685 * testsuite/Makefile.am (plugin_test_10): New test.
1686 * testsuite/Makefile.in: Regenerate
1687 * testsuite/plugin_common_test_2.c (c1): Align to 8.
1688 * testsuite/plugin_test_10.sh: New file.
1689
6168c2a1
RÁE
16902014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1691
1692 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
1693 * resolve.cc (Symbol_table::resolve): Don't override common symbols
1694 during the replacement phase.
1695
3a531937
JY
16962014-09-17 Han Shen <shenhan@google.com>
1697 Jing Yu <jingyu@google.com>
1698
1699 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
1700 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
1701 * aarch64.cc (Target_aarch64): Add data members
1702 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
1703 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
1704 constructor.
1705 (Target_aarch64::do_reloc_symbol_index): New method.
1706 (Target_aarch64::do_reloc_addend): New method.
1707 (Target_aarch64::add_tlsdesc_info): New method.
1708 (Target_aarch64::do_dynsym_value): New method.
1709 (Target_aarch64::do_make_data_plt): Add new parameters: got,
1710 got_irelative. Pass them to Output_data_plt_aarch64_standard.
1711 (Target_aarch64::make_data_plt): Add new parameters: got,
1712 got_irelative. Pass them to do_make_data_plt.
1713 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
1714 (Target_aarch64::Relocate:tls_gd_to_le): New method.
1715 (Target_aarch64::Relocate:tls_ie_to_le): New method.
1716 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
1717 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
1718 (Target_aarch64::got_tlsdesc_section): New method.
1719 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1720 (Target_aarch64::define_tls_base_symbol): New method.
1721 (Target_aarch64::reserve_tlsdesc_entries): New method.
1722 (Target_aarch64::got_mod_index_entry): New method.
1723 (Target_aarch64::rela_tlsdesc_section): New method.
1724 (Target_aarch64::rela_irelative_section): New method.
1725 (Target_aarch64::Tlsdesc_info): New struct.
1726 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
1727 relocations and tlsdesc relocations.
1728 (Target_aarch64::optimize_tls_reloc): Implement method.
1729 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
1730 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
1731 in constructor.
1732 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
1733 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
1734 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
1735 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
1736 (Output_data_plt_aarch64::rela_tlsdesc): New method.
1737 (Output_data_plt_aarch64::rela_irelative): New method.
1738 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
1739 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
1740 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
1741 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
1742 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
1743 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
1744 (Output_data_plt_aarch64_standard): New member variables:
1745 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
1746 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
1747 New parameter: got, got_irelative.
1748 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
1749 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
1750 (Output_data_plt_aarch64::do_write): Replace got_address with
1751 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
1752 (AArch64_relocate_functions::update_movnz): New method.
1753 (AArch64_relocate_functions): Correct format.
1754 (AArch64_relocate_functions::movnz): New method.
1755 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
1756 before the switch. Add new cases to switch.
00cac886 1757 Check ie_to_le relaxation on tlsie relocations. Add code handling
3a531937
JY
1758 tlsgd tlsdesc cases.
1759 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
1760 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
1761 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
1762 Call reloc_name_in_error_message to print unsupported reloc.
1763 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
1764 make_data_plt.
1765 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
1766 relocs. Fill in some more dynamic tags.
1767 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
1768 Skip call tls_get_addr when tlsgd is relaxed.
1769 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
1770 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
1771 tlsdesc->ie relaxation.
1772
62661c93
SS
17732014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1774
1775 * mips.cc (Target_mips_nacl): New class.
1776 (Target_selector_mips_nacl): New class.
1777 (target_selector_mips32): Rename from target_selector_mips32be and use
1778 Target_selector_mips_nacl instead of Target_selector_mips.
1779 (target_selector_mips32el): Rename from target_selector_mips32 and use
1780 Target_selector_mips_nacl instead of Target_selector_mips.
1781 (target_selector_mips64): Rename from target_selector_mips64be and use
1782 Target_selector_mips_nacl instead of Target_selector_mips.
1783 (target_selector_mips64el): Rename from target_selector_mips64 and use
1784 Target_selector_mips_nacl instead of Target_selector_mips.
1785 (Target_mips::mips_info): Add const attribute.
1786
54674d38
CC
17872014-09-02 Cary Coutant <ccoutant@google.com>
1788
1789 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
1790 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
1791 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
1792 (Sized_incr_dynobj::do_section_name): Likewise.
1793 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
1794 (Sized_incr_dynobj::do_section_name): Likewise.
1795 * object.h (Object::section_name): Likewise.
1796 (Object::do_section_name): Likewise.
1797 (Sized_relobj_file::do_section_name): Likewise.
1798 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
1799 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
1800
9860cbcf
CC
18012014-09-02 Cary Coutant <ccoutant@google.com>
1802
1803 PR gold/17005
1804 * ehframe.cc (Fde::write): Add output_offset parameter.
1805 (Cie::write): Likewise.
1806 (Eh_frame::set_final_data_size): Account for offset within output
1807 section.
1808 (Eh_frame::do_sized_write): Likewise.
1809 * ehframe.h (Fde::write): Add output_offset parameter.
1810 (Cie::write): Likewise.
1811 * output.cc (Output_section::Input_section_sort_entry): Remove
1812 section_has_name_; add output_section_name parameter. Use
1813 output section name for non-input sections.
1814 (Output_section::Input_section_sort_entry::section_has_name): Remove.
1815 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
1816 (Output_section::Input_section_sort_compare): Remove logic for
1817 sections without names.
1818 (Output_section::Input_section_sort_init_fini_compare): Likewise.
1819 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
1820 Likewise.
1821 (Output_section::Input_section_sort_section_name_compare): Likewise.
1822
8e33481e
HS
18232014-08-29 Han Shen <shenhan@google.com>
1824 Jing Yu <jingyu@google.com>
1825
1826 * aarch64-reloc-property.cc
1827 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
1828 reference reloc property in the table.
1829 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
1830 3 other entries.
1831 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
1832 2 new overloaded methods.
1833 (Output_data_got_aarch64::do_write): Add code to write out
1834 static relocs.
1835 (class Output_data_got_aarch64::Static_reloc): New class to wrap
1836 static relocs.
1837 (Output_data_got_aarch64::static_relocs): New vector to
1838 hold static relocs.
1839 (Target_aarch64::TCB_SIZE): New const static memeber.
1840 (Target_aarch64::tcb_size): New method.
1841 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
1842 (Target_aarch64::Relocate::relocate_tls): New method.
1843 (Target_aarch64::Scan::local): Add code handling new reloc types.
1844 (Target_aarch64::Scan::global): Add code handling new reloc types.
1845
81233653
ST
18462014-08-13 Sriraman Tallam <tmsriram@google.com>
1847
1848 * options.h (-no-pie): Add option.
1849
9363c7c3
JY
18502014-08-08 Jing Yu <jingyu@google.com>
1851 Han Shen <shenhan@google.com>
1852
1853 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
1854 (DEFFILES): add aarch64-reloc.def.
1855 (TARGETSOURCES): Add aarch64-reloc-property.cc.
1856 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
1857 * Makefile.in: Regenerate.
1858 * aarch64-reloc-property.cc: New file.
1859 * aarch64-reloc-property.h: New file.
1860 * aarch64-reloc.def: New file.
1861 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
1862 with tab to make the format consistent.
1863 (Output_data_got_aarch64::symbol_table_): New method.
1864 (Target_aarch64::do_plt_address_for_global): New method.
1865 (Target_aarch64::do_plt_address_for_local): New method.
1866 (Target_aarch64::do_select_as_default_target): New method.
1867 (Target_aarch64::do_make_data_plt): New method.
1868 (Target_aarch64::make_data_plt): New method.
1869 (Output_data_plt_aarch64::has_irelative_section): New method.
1870 (Output_data_plt_aarch64::address_for_global): New method.
1871 (Output_data_plt_aarch64::address_for_local): New method.
1872 (Output_data_plt_aarch64::irelative_rel_): New parameter.
1873 (Output_data_plt_aarch64::add_entry): Implement contents.
1874 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
1875 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
1876 the got_pov entry to plt0.
1877 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
1878 Implement contents.
1879 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
1880 (AArch64_howto): New struct.
1881 (aarch64_howto[]): New static const array.
1882 (AArch64_relocate_functions): New class.
1883 (Target_aarch64::Scan::get_reference_flags): Remove method.
1884 (Target_aarch64::Scan::local): Implement to support a few relocations.
1885 (Target_aarch64::Scan::global): Implement to support a few relocations.
1886 (Target_aarch64::make_plt_section): Implement contents.
1887 (Target_aarch64::make_plt_entry): Implement contents.
1888 (Target_aarch64::do_finalize_sections): Implement contents.
1889 (Target_aarch64::Relocate::relocate): Implement a few relocations.
1890 (Target_aarch64::relocate_section): Implement contents.
1891
ad9fe6c1
AM
18922014-08-06 Alan Modra <amodra@gmail.com>
1893
1894 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
1895
7cd4e5b7
AM
18962014-08-06 Alan Modra <amodra@gmail.com>
1897
1898 PR 13227
1899 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
1900
5ad9b0a7
ST
19012014-07-21 Sriraman Tallam <tmsriram@google.com>
1902
1903 * object.cc (Relobj::is_section_name_included): Add
7c16d96e 1904 ".rodata.nptl_version" to not garbage collect this section.
5ad9b0a7 1905
e051745c
CC
19062014-07-08 Cary Coutant <ccoutant@google.com>
1907
1908 * expression.cc (struct Expression::Expression_eval_info): Add
1909 new fields type_pointer, vis_pointer, and nonvis_pointer.
1910 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
1911 nonvis_pointer parameters. Adjust all calls.
1912 (Symbol_expression::value): Update type, visibility, and nonvis bits
1913 in caller.
1914 * script.cc (Symbol_assignment::sized_finalize): Update type,
1915 visibility, and remaining st_other bits for new symbol.
1916 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
1917 vis_pointer, and nonvis_pointer parameters.
1918 * symtab.h (Symbol::set_type): New method.
1919
1920 * testsuite/Makefile.am (defsym_test): New test.
1921 * testsuite/Makefile.in: Regenerate.
1922 * testsuite/defsym_test.c: New file.
1923 * testsuite/defsym_test.sh: New file.
1924
f35c4853
CC
19252014-07-08 Cary Coutant <ccoutant@google.com>
1926
1927 PR gold/15639
1928 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
1929 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
1930 (Sized_dynobj::base_read_symbols): ...new method.
1931 * object.h (Sized_relobj_file::base_read_symbols): New method.
1932 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
1933 (Sized_relobj_file::base_read_symbols): ...new method.
1934 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
1935 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
1936 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
1937
2900af2d
AM
19382014-07-04 Alan Modra <amodra@gmail.com>
1939
1940 * po/POTFILES.in: Regenerate.
1941
053a4d68
JY
19422014-07-02 Jing Yu <jingyu@google.com>
1943
1944 * aarch64.cc: New file
1945 * Makefile.am (TARGETSOURCES): Add aarch64.cc
1946 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
1947 * Makefile.in: Regenerate.
1948 * configure.tgt: Add entries for aarch64*.
1949 * configure.ac: Likewise.
1950 * configure: Likewise.
1951
7b549045
AM
19522014-06-27 Alan Modra <amodra@gmail.com>
1953
1954 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
1955
cb818dbf
CC
19562014-06-24 Cary Coutant <ccoutant@google.com>
1957
1958 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
1959 sections.
1960 (Dwo_file::sized_read_unit_index): Likewise.
1961
9810d34d
SS
19622014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1963
1964 * mips.cc: New file.
1965 * Makefile.am (TARGETSOURCES): Add mips.cc
1966 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
1967 * configure.tgt: Add entries for mips*.
1968 * configure.ac: Likewise.
1969 * Makefile.in: Regenerate.
1970 * configure: Likewise.
1971
9baa787b
CC
19722014-06-09 Cary Coutant <ccoutant@google.com>
1973
1974 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
1975 unit_length is within section bounds.
1976
8f89af0a
CC
19772014-06-09 Cary Coutant <ccoutant@google.com>
1978
1979 PR gold/16980
1980 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
1981 map.
1982
a47622ac
AM
19832014-06-07 Alan Modra <amodra@gmail.com>
1984
1985 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
1986
4320c691
CC
19872014-06-06 Cary Coutant <ccoutant@google.com>
1988
1989 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
1990 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
1991 (Dwarf_pubnames_table::read_header): Likewise.
1992 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
1993 .debug_gnu_pubtypes.
1994
270c9937
JB
19952014-06-05 Joel Brobecker <brobecker@adacore.com>
1996
1997 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
1998 * Makefile.in, configure: Regenerate.
1999
397998fc
AM
20002014-06-03 Alan Modra <amodra@gmail.com>
2001
2002 * powerpc.cc (addis_12_2): Define.
2003 (Stub_table::do_write): Support fusion on ELFv2 stubs.
2004
61f5c66f
AM
20052014-06-03 Alan Modra <amodra@gmail.com>
2006
2007 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
2008 st_other output.
2009
f6971787
AM
20102014-06-02 Alan Modra <amodra@gmail.com>
2011
2012 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
2013 Only ignore relocs on ELFv1.
2014 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
2015
f6fb8322
CC
20162014-05-30 Cary Coutant <ccoutant@google.com>
2017
2018 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
2019 * testsuite/Makefile.in: Regenerate.
2020 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
2021
c23dd342
L
20222014-05-27 H.J. Lu <hongjiu.lu@intel.com>
2023
2024 PR gold/16945
2025 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
2026 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
2027
5fe7ffdc
AM
20282014-05-15 Alan Modra <amodra@gmail.com>
2029
2030 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
2031 Compare FDE contents with DW_CFA_nop rather than 0.
2032
a82bef93
ST
20332014-05-13 Sriraman Tallam <tmsriram@google.com>
2034
2035 * symtab.h (may_need_copy_reloc): Remove check for position independent
2036 code.
2037 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
2038 position independence before pc absolute may_need_copy_reloc call.
2039 Add check for executable output befor pc relative may_need_copy_reloc
2040 call.
2041 * i386.cc: Ditto.
2042 * arm.cc: Ditto.
2043 * sparc.cc: Ditto.
2044 * tilegx.cc: Ditto.
2045 * powerpc.cc: Add check for no position independence before
2046 may_need_copy_reloc calls.
2047 * testsuite/pie_copyrelocs_test.cc: New file.
2048 * testsuite/pie_copyrelocs_shared_test.cc: New file.
2049 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 2050 * Makefile.in: Regenerate.
a82bef93 2051
53c66605
ML
20522014-05-08 Martin Liška <mliska@suse.cz>
2053
2054 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
2055
57b2284c
CC
20562014-05-06 Cary Coutant <ccoutant@google.com>
2057
2058 PR gold/16900
2059 * i386.cc (Output_data_got_plt_i386): New class.
2060 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
2061 parameter. Change all callers.
2062 (Output_data_plt_i386::layout_): Remove.
2063 (Output_data_plt_i386::got_plt_): Change type.
2064 (Target_i386::got_plt_): Change type. Change all references.
2065 (Target_i386::got_section): Create instance of new class.
2066 (Output_data_got_plt_i386::do_write): New function.
2067 * x86_64.cc (Output_data_got_plt_x86_64): New class.
2068 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
2069 parameter. Change all callers.
2070 (Output_data_plt_x86_64::layout_): Remove.
2071 (Output_data_plt_x86_64::got_plt_): Change type.
2072 (Target_x86_64::got_plt_): Change type. Change all references.
2073 (Target_x86_64::got_section): Create instance of new class.
2074 (Output_data_got_plt_x86_64::do_write): New function.
2075 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
2076 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
2077 class.
2078
6b97515d 20792014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 2080
6b97515d
CC
2081 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
2082 if we have pubnames/pubtypes.
2083
d1bddd3c
CC
20842014-05-02 Cary Coutant <ccoutant@google.com>
2085
5fe7ffdc
AM
2086 * defstd.cc (in_segment): Define __ehdr_start here...
2087 * layout.cc (Layout::finalize): ...Instead of here. Set the
2088 output segment when known.
2089 * resolve.cc (Symbol::override_base_with_special): Remember
2090 the original binding.
2091 * symtab.cc (Symbol::set_output_segment): New function.
2092 (Symbol::set_undefined): New function.
2093 * symtab.h (Symbol::is_weak_undefined): Check original undef
2094 binding.
2095 (Symbol::is_strong_undefined): New function.
2096 (Symbol::set_output_segment): New function.
2097 (Symbol::set_undefined): New function.
2098 * target-reloc.h (is_strong_undefined): Remove.
2099 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
2100 Check for hidden undefs.
2101 (relocate_section): Call Symbol::is_strong_undefined.
2102
2103 * testsuite/Makefile.am (ehdr_start_test_1)
2104 (ehdr_start_test_2, ehdr_start_test_3)
2105 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
2106 * testsuite/Makefile.in: Regenerate.
2107 * testsuite/ehdr_start_def.cc: New source file.
2108 * testsuite/ehdr_start_test.cc: New source file.
2109 * testsuite/ehdr_start_test.t: New linker script.
2110 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 2111
7849f6d8
CC
21122014-04-23 Cary Coutant <ccoutant@google.com>
2113
bf2cc635 2114 PR gold/16870
7849f6d8
CC
2115 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
2116
99fd8cff
CC
21172014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2118
2119 * layout.cc (Layout::include_section): Allow a target to decide
2120 whether to include a section.
2121 * target.h (Target::should_include_section): New function.
2122 (Target::do_should_include_section): New function.
2123
91f43acd
CC
21242014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2125
2126 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
2127 inline into ...
2128 (Copy_relocs::emit): ... here.
2129 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
2130 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
2131 (Copy_reloc_entry::entries_): Change from private to protected.
2132
c4eb27e1
ST
21332014-04-02 Sriraman Tallam <tmsriram@google.com>
2134
2135 * icf.cc (get_section_contents): Replace copies of reloc
2136 vectors with const references.
2137
ae447ddd
CC
21382014-04-02 Cary Coutant <ccoutant@google.com>
2139
2140 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
2141 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
2142 * configure: Regenerate.
2143 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
2144 -fno-use-linker-plugin.
2145 (LINK1, CXXLINK1): Add it to the link command.
2146 * testsuite/Makefile.in: Regenerate.
2147
fa47fa92
AM
21482014-03-12 Alan Modra <amodra@gmail.com>
2149
2150 * Makefile.in: Regenerate.
2151
9b12c500
CC
21522014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2153
2154 * symtab.h (Symbol::set_nonvis): New function.
2155
beacaa96
CC
21562014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2157
2158 * symtab.cc (Sized_symbol<32>::init_output_data):
2159 Instantiate the template.
2160 (Sized_symbol<64>::init_output_data): Likewise.
2161
800d9823
CC
21622014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2163
2164 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
2165 adjust dynamic symbol value.
2166 * target.h (Target::adjust_dyn_symbol): New function.
2167 (Target::do_adjust_dyn_symbol): New function.
2168
918fc1f8 21692014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 2170
918fc1f8
CC
2171 * output.cc (Output_data_dynamic::Dynamic_entry::write):
2172 Get the value of DYNAMIC_CUSTOM dynamic entry.
2173 * output.h (Output_data_dynamic::add_custom): New function.
2174 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
2175 dynamic entry.
2176 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
2177 * target.h (Target::dynamic_tag_custom_value): New function.
2178 (Target::do_dynamic_tag_custom_value): New function.
2179
98ff9231
CC
21802014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2181
2182 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
2183 dynsym indexes.
2184 * target.h (Target::has_custom_set_dynsym_indexes): New function.
2185 (Target::do_has_custom_set_dynsym_indexes): New function.
2186 (Target::set_dynsym_indexes): New function.
2187 (Target::do_set_dynsym_indexes): New function.
2188
b80eed39
AM
21892014-03-07 Alan Modra <amodra@gmail.com>
2190
2191 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
2192 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
2193 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
2194 (Powerpc_relocate_functions::has_overflow_bitfield,
2195 overflowed): Use the above.
2196 (Target_powerpc::Relocate::relocate): Correct overflow checking
2197 for a number of relocations. Modify overflow test for 16-bit
2198 fields in instructions to signed/unsigned according to whether
2199 the field takes a signed or unsigned value.
2200
4b95cf5c
AM
22012014-03-05 Alan Modra <amodra@gmail.com>
2202
2203 Update copyright years.
2204
45965137
AM
22052014-03-05 Alan Modra <amodra@gmail.com>
2206
2207 * powerpc.cc (Target_powerpc::Scan::local, global): Support
2208 R_PPC64_ADDR64_LOCAL.
2209 (Target_powerpc::Relocate::relocate): Likewise.
2210
2c80b753
AM
22112014-03-03 Alan Modra <amodra@gmail.com>
2212
2213 * dwp.cc (print_version): Update copyright year to current.
2214
c1c69e83
AM
22152014-02-10 Alan Modra <amodra@gmail.com>
2216
2217 * po/gold.pot: Regenerate.
2218
dd0c4e70
CC
22192014-02-06 Cary Coutant <ccoutant@google.com>
2220
2221 Fix problem where -u is ignored when a weak undef is seen.
2222
2223 * archive.cc (Library_base::should_include_member): Reorder
2224 code to check for -u option if a weak undef has already been seen.
2225 * testsuite/Makefile.am (weak_undef_test_2): New test case.
2226 * testsuite/Makefile.in: Regenerate.
2227 * testsuite/weak_undef_file3.cc: New file.
2228 * testsuite/weak_undef_file4.cc: New file.
2229 * testsuite/weak_undef_test_2.cc: New file.
2230
1a221d3d
CC
22312014-02-05 Cary Coutant <ccoutant@google.com>
2232
2233 Fix issues with gold undefined symbol diagnostics.
2234
2235 PR binutils/15435
2236 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
2237 check to here.
2238 * target-reloc.h (is_strong_undefined): New function.
2239 (relocate_section): Move undef vtable symbol check from here.
2240 Check for is_strong_undefined.
2241
e889f0a4 22422014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 2243
e889f0a4
CC
2244 Fix problems with the --dynamic-list option.
2245
2246 PR gold/13577
2247 * options.cc (General_options::parse_dynamic_list):
2248 Set have_dynamic_list_.
2249 (General_options::General_options): Initialize have_dynamic_list_.
2250 (General_options::finalize): Turn off -Bsymbolic and
2251 -Bsymbolic-functions if --dynamic-list provided.
2252 * options.h (General_options::have_dynamic_list): New function.
2253 (General_options::have_dynamic_list_): New data member.
2254 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
2255 correctly.
5fe7ffdc 2256
e889f0a4
CC
2257 PR gold/16530
2258 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
2259 in --dynamic-list, mark it.
5fe7ffdc 2260
e889f0a4
CC
2261 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
2262 (dynamic_list_2): New test case.
2263 * testsuite/Makefile.in: Regenerate.
2264 * testsuite/dynamic_list_2.cc: New file.
2265 * testsuite/dynamic_list_2.t: New file.
2266 * testsuite/dynamic_list_lib1.cc: New file.
2267 * testsuite/dynamic_list_lib2.cc: New file.
2268 * testsuite/gc_dynamic_list_test.c: New file.
2269 * testsuite/gc_dynamic_list_test.sh: New file.
2270 * testsuite/gc_dynamic_list_test.t: New file.
2271
ec673e64
CC
22722014-01-28 Cary Coutant <ccoutant@google.com>
2273
2274 Add .gdb_index version 7 support.
2275
2276 * gold/dwarf_reader.cc: include <utility> (for make_pair).
2277 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
2278 debug sections.
2279 (Dwarf_ranges_table::read_ranges_table): Likewise.
2280 (Dwarf_pubnames_table::read_section): Check for GNU-style
2281 sections, and for compressed debug sections.
2282 (Dwarf_pubnames_table::read_header): Compute end address of table.
2283 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
2284 for end of list by offset, not by offset == 0.
2285 (Dwarf_info_reader::do_read_string_table): Check for compressed
2286 debug sections.
2287 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2288 Initialize new data members.
2289 (Dwarf_pubnames_table::next_name): return flag_byte.
2290 (Dwarf_pubnames_table::end_of_table_): New data member.
2291 (Dwarf_pubnames_table::is_gnu_style_): New data member.
2292 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
2293 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
2294 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
2295 read skeleton type unit DIEs.
2296 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
2297 (Gdb_index::do_write): Write flag_byte.
2298 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
2299 (Gdb_index::Cu_vector): Store flags along with cu indexes.
2300 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
2301 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
2302
221fd5d5
L
23032014-01-08 H.J. Lu <hongjiu.lu@intel.com>
2304
2305 * version.cc (print_version): Update copyright year to 2014.
2306
6c09fb0b
ILT
23072013-12-19 Dimitry Andric <dimitry@andric.com>
2308
2309 * stringpool.cc (Stringpool_template::reserve): Add
2310 HAVE_UNORDERED_MAP case.
2311 * stringpool.cc (Stringpool_template::print_stats): Likewise.
2312
8356f2d0
CC
23132013-12-18 Cary Coutant <ccoutant@google.com>
2314
2315 * configure.ac: Check for <unordered_set> and <unordered_map>.
2316 * config.in: Regenerate.
2317 * configure: Regenerate.
2318 * system.h: Use <unordered_set> and <unordered_map> if available.
2319
f2c7d7ee
RM
23202013-12-10 Roland McGrath <mcgrathr@google.com>
2321
2322 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
2323 with $(INSTALL_PROGRAM_ENV).
2324 * Makefile.in: Regenerate.
2325
6632e8cc
CC
23262013-11-22 Cary Coutant <ccoutant@google.com>
2327
2328 * configure.ac: Add check for which library is needed for
2329 dlopen.
2330 * configure: Regenerate.
2331
0c075858
CC
23322013-11-22 Cary Coutant <ccoutant@google.com>
2333
2334 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
2335 assembler.
2336 * testsuite/Makefile.in: Regenerate.
2337
f49fe902
L
23382013-11-17 H.J. Lu <hongjiu.lu@intel.com>
2339
2340 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
2341 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
2342 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
2343 (Target_x86_64<size>::Scan::local): Likewise.
2344 (Target_x86_64<size>::Scan::global): Likewise.
2345 (Target_x86_64<size>::Relocate::relocate): Likewise.
2346 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
2347 Likewise.
2348 (Target_x86_64<size>::Scan::check_non_pic(): Handle
2349 R_X86_64_PC32_BND.
2350
2351 * testsuite/Makefile.am (check_PROGRAMS): Add
2352 exception_x86_64_bnd_test.
2353 (exception_x86_64_bnd_test_SOURCES): New macro.
2354 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
2355 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
2356 (exception_x86_64_bnd_test_LDADD): Likewise.
2357 (exception_x86_64_bnd_1.o): New rule.
2358 (exception_x86_64_bnd_2.o): Likewise.
2359 * testsuite/Makefile.in: Regenerated.
2360
9055360d
AM
23612013-11-15 Alan Modra <amodra@gmail.com>
2362
2363 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
2364 accessor.
2365 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
2366 Only call ppc64_local_entry_offset for 64-bit. Restrict
2367 symval_for_branch lookup to ELFv1.
2368 (Stub_table::add_plt_call_entry): Use unsigned int off.
2369 (Output_data_glink::Address, invalid_address): New.
2370 (Output_data_glink::add_eh_frame): Move out of line. Add
2371 support for ELFv2.
2372 (Output_data_glink::add_global_entry, find_global_entry,
2373 global_entry_address): New functions.
2374 (Output_data_glink::global_entry_stubs_, end_branch_table_,
2375 ge_size): New variables.
2376 (Output_data_glink::set_final_data_size): Add global entry
2377 stub sizing.
2378 (Output_data_glink::do_write): Write global entry stubs.
2379 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
2380 parameter. Return true for ELFv2. Adjust callers.
2381 (Target_powerpc::Scan::local, global): Restrict opd lookup to
2382 ELFv1. Similarly for ifunc and dynamic relocation processing
2383 specific to ELFv1. Recognize that symbols are defined on
2384 their plt entries for ELFv2.
2385 (Target_powerpc::symval_for_branch): Assert if called for
2386 ELFv2 or ppc32.
2387 (Target_powerpc::Relocate::relocate): Use global entry plt
2388 stub for symbol value if such exists on ELFv2.
2389 (Target_powerpc::Relocate::relocate): Don't call
2390 symval_for_branch when ELFv2. Do adjust for local entry
2391 offset when ELFv2.
2392 (Target_powerpc::do_dynsym_value): Set symbols to global entry
2393 plt stub for ELFv2.
2394 (Target_powerpc::do_plt_address_for_global): Similarly.
2395
cafdd569
CC
23962013-11-14 Cary Coutant <ccoutant@google.com>
2397
2398 Revert patch -- this did not fix the problem, and there is
2399 no race there.
2400
2401 2013-11-14 Cary Coutant <ccoutant@google.com>
2402
2403 PR gold/14860
2404 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2405 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2406 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2407 updating fde_offsets_.
2408 (Eh_frame_hdr::lock_): New data member.
2409
94e49e16
CC
24102013-11-14 Cary Coutant <ccoutant@google.com>
2411
2412 * dwp.cc (Dwo_file_entry): New type.
2413 (File_list): Use Dwo_file_entry.
2414 (Dwo_file::verify): New function.
2415 (Dwo_file::verify_dwo_list): New function.
2416 (Dwo_file::sized_verify_dwo_list): New function.
2417 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
2418 list.
2419 (Dwp_options): New enum type.
2420 (dwp_options): Add --verify-only.
2421 (usage): Likewise.
2422 (main): Likewise.
2423 * dwp.h (gold_info): Add declaration.
2424
7cdd7d57
CC
24252013-11-14 Cary Coutant <ccoutant@google.com>
2426
2427 PR gold/14860
2428 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2429 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2430 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2431 updating fde_offsets_.
2432 (Eh_frame_hdr::lock_): New data member.
2433
1d946cb3
CC
24342013-11-06 Cary Coutant <ccoutant@google.com>
2435
2436 PR gold/15758
2437 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
2438 before reloc sections.
2439
4f65b40e
AM
24402013-11-04 Alan Modra <amodra@gmail.com>
2441
2442 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
2443 (Symbol::needs_dynamic_reloc): Test new flag.
2444 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
2445 (Target_powerpc::Scan::get_reference_flags): Add target param.
2446 Return FUNC_DESC_ABI for 64-bit ELFv1.
2447 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
2448 call.
2449 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
2450 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
2451
908794a9
CC
24522013-10-31 Cary Coutant <ccoutant@google.com>
2453
2454 Restore support for dwp v2 DWARF package file format.
2455
2456 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2457 tu_length parameter. Adjust all callers.
2458 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2459 * dwp.cc: Include dwarf.h.
2460 (Section_bounds): New struct type.
2461 (Unit_set): New struct type.
2462 (Dwo_file::Dwo_file): Initialize new data member.
2463 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2464 Combine and rename to...
2465 (Dwo_file::read_unit_index): ...this.
2466 (Dwo_file::sized_read_compunit_index)
2467 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2468 (Dwo_file::sized_read_unit_index): ...this.
2469 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2470 parameters; add section_id parameter.
2471 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2472 (Dwo_file::add_unit_set): ...this.
2473 (Dwo_file::shndx_map_): Remove.
2474 (Dwo_file::sect_offsets_): New data member.
2475 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2476 (Dwp_output_file::add_section): Rename to...
2477 (Dwp_output_file::add_contribution): ...this.
2478 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2479 (Dwp_output_file::add_tu_set): Likewise.
2480 (Dwp_output_file::Contribution): New type.
2481 (Dwp_output_file::Section::contributions): New data member.
2482 (Dwp_output_file::Cu_or_tu_set): Remove.
2483 (Dwp_output_file::Section::Section): New ctor.
2484 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2485 (Dwp_output_file::Dwp_index::Section_table): New type.
2486 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2487 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2488 parameter.
2489 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2490 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2491 (Dwp_output_file::Dwp_index::section_table): New member function.
2492 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2493 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2494 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2495 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2496 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2497 (Dwp_output_file::Dwp_index::section_table_): New data member.
2498 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2499 (Dwp_output_file::add_output_section): New member function.
2500 (Dwp_output_file::write_new_section): New member function.
2501 (Dwp_output_file::write_contributions): New member function.
2502 (Dwp_output_file::section_id_map_): New data member.
2503 (class Dwo_id_info_reader): Remove.
2504 (class Unit_reader): New class.
2505 (get_dwarf_section_name): New function.
2506 (Dwo_file::read_executable): Adjust initializations of class data.
2507 (Dwo_file::read): Add support for v2 package file format.
2508 (Dwo_file::read_unit_index): Likewise.
2509 (Dwo_file::sized_read_unit_index): Likewise.
2510 (Dwo_file::copy_section): Likewise.
2511 (Dwo_file::add_unit_set): Likewise.
2512 (Dwp_output_file::add_output_section): Likewise.
2513 (Dwp_output_file::add_contribution): Likewise.
2514 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2515 for empty slot.
2516 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2517 file format.
2518 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2519 slot.
2520 (Dwp_output_file::initialize): Remove unused function.
2521 (Dwp_output_file::finalize): Add support for v2 package file format.
2522 (Dwp_output_file::write_index): Likewise.
2523 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2524 function prototype.
2525
2500c017
CC
25262013-10-31 Cary Coutant <ccoutant@google.com>
2527
2528 * configure.ac: Fix check for -fmerge-constants.
2529 * configure.ac: Regenerate.
2530
dd0845d7
RM
25312013-10-30 Roland McGrath <mcgrathr@google.com>
2532
2533 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
2534 Correct 9-byte nop sequence to match what the assembler generates.
2535
b4f7960d
AM
25362013-10-30 Alan Modra <amodra@gmail.com>
2537
2538 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
2539 ppc64_local_entry_offset, ppc64_local_entry_offset,
2540 do_read_symbols): New functions.
2541 (Powerpc_relobj::e_flags_, st_other_): New vars.
2542 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
2543 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
2544 (Powerpc_relobj::e_flags_): New var.
2545 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
2546 and adjust for ELFv2.
2547 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
2548 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
2549 (Powerpc_dynobj::do_find_special_sections): Likewise.
2550 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
2551 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
2552 to ELFv2 local entry.
2553 (Target_powerpc::do_relax): No thread safe barriers needed for
2554 ELFv2.
2555 (Output_data_plt_powerpc::initial_plt_entry_size_,
2556 plt_entry_size): Delete. Replace all uses with
2557 first_plt_entry_offset() and plt_entry_size().
2558 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
2559 reserved_size parm. Update callers.
2560 (Output_data_plt_powerpc::entry_count): Update.
2561 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
2562 and use Target_powerpc::first_plt_entry_offset().
2563 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
2564 rename to plt_entry_size.
2565 (Output_data_plt_powerpc::add_ifunc_entry,
2566 add_local_ifunc_entry): Adjust reloc for ELFv2.
2567 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
2568 (glink_eh_frame_fde_64v2): New.
2569 (Stub_table::plt_call_size): Support ELFv2 sizing.
2570 (Output_data_glink::add_eh_frame): Use the new FDE.
2571 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
2572 (Stub_table::do_write): Write ELFv2 stubs and glink.
2573 (Target_powerpc::Relocate::relocate): Replaces nop after call
2574 with ld 2,24(1) and adjust local offset destination for ELFv2.
2575
f9c6b907
AM
25762013-10-30 Alan Modra <amodra@gmail.com>
2577
2578 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
2579 (Target_powerpc::Scan::global, local): Likewise.
2580 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
2581 on all ppc64 @h and @ha relocs.
2582
e84fe78f
AM
25832013-10-14 Alan Modra <amodra@gmail.com>
2584
2585 * output.h (Output_data_got::add_constant): Tidy.
2586 (Output_data_got::add_constant_pair): New function.
2587 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
2588 methods used so as to first call reserve_ent().
2589
679e4abf
RM
25902013-10-11 Roland McGrath <mcgrathr@google.com>
2591
44dcb735
RM
2592 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
2593 add_got_entry and add_got_entry_pair.
2594
13323c49
RM
2595 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
2596 (HAVE_PUBNAMES): Likewise.
2597 * configure: Regenerate.
2598
1496b446
RM
2599 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
2600 * testsuite/Makefile.in: Regenerate.
2601
cc84c10b
RM
2602 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
2603 Remove const from declaration.
2604 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
2605 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
2606 * output.h (Output_file_header): Remove const from member target_
2607 and corresponding constructor argument.
2608 * output.cc (Output_file_header::Output_file_header): Update prototype.
2609 (Output_file_header::do_sized_write): Use this->target_ in place
2610 of parameters()->target().
2611
52f66a2c
RM
2612 * testsuite/undef_symbol.cc (Foo::get_a): New method.
2613
2b64b551
RM
2614 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
2615 * configure: Regenerate.
2616 * Makefile.in: Regenerate.
2617 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
2618 * testsuite/merge_string_literals_2.c: Likewise.
2619 * testsuite/Makefile.am
2620 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
2621 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
2622 literal -fmerge-constants.
2623 * testsuite/Makefile.in: Regenerate.
2624
43819297
RM
2625 * i386.cc (Target_i386): Remove unused member dynbss_.
2626 * arm.cc (Target_arm): Likewise.
2627 * powerpc.cc (Target_powerpc): Likewise.
2628 * sparc.cc (Target_sparc): Likewise.
2629 * tilegx.cc (Target_tilegx): Likewise.
2630 * x86_64.cc (Target_x86_64): Likewise.
2631 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
2632 type_signature_, type_offset_.
2633 * plugin.h (Plugin_hook): Remove unused member layout_.
2634 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
2635 mapfile_.
2636 (Read_member): Remove unused members input_objects_, symtab_,
2637 mapfile_, layout_.
2638 (Check_library): Remove unused member symtab_.
2639 * archive.h (Lib_group): Remove unused member lib_.
2640 * archive.cc (Lib_group::Lib_group): Update initializer.
2641 * incremental.h (Incremental_binary): Remove unused member target_.
2642 (Incremental_script_entry): Removed unused member script_.
2643 * layout.h (Write_symbols_task): Remove unused member input_objects_.
2644 * icf.h (Icf): Remove unused member num_tracked_relocs.
2645
39d9ead7
RM
2646 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
2647 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
2648 its only use.
2649 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
2650
679e4abf
RM
2651 * archive.h: Use struct rather than class for forward declaration
2652 of Read_symbols_data.
2653
54de2ea6
CC
26542013-10-07 Cary Coutant <ccoutant@google.com>
2655
2656 PR gold/16010
2657 * testsuite/Makefile.am (icf_test): Fix dependencies.
2658 (icf_safe_test): Likewise.
2659 (icf_safe_so_test): Likewise.
2660 (large_symbol_alignment): Add empty _LDADD rule.
2661 * testsuite/Makefile.in: Regenerate.
2662
b14016f0
L
26632013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
2664
2665 PR gold/15927
2666 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
2667 relocation for R_X86_64_32 on x32.
2668
eb426534
RM
26692013-08-27 Roland McGrath <mcgrathr@google.com>
2670
2671 * output.cc (Output_segment::set_section_addresses): Take new
2672 Target* argument. If target->isolate_execinstr() and the segment
2673 is executable and starts at a target->abi_pagesize() boundary,
2674 pad its end out to a target->abi_pagesize() boundary with code fill.
2675 * output.h (Output_segment::set_section_addresses): Update decl.
2676 * layout.h (Layout::check_output_data_for_reset_values): Take new
2677 argument RELAX_OUTPUTS.
2678 (Layout): New member relax_output_list_.
2679 (Layout::add_relax_output): New method.
2680 * layout.cc (Layout::Layout): Update constructor.
2681 (Layout::reset_relax_output): New method.
2682 (Layout::clean_up_after_relaxation): Call it.
2683 (Layout::prepare_for_relaxation): Update caller.
2684 (Layout::set_segment_offsets): Update callers of set_section_addresses.
2685 Call reset_relax_output before re-processing segments for
2686 isolate_execinstr case.
2687 (Layout::write_data): Handle relax_output_list_.
2688 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
2689 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
2690
9aff4b7a
NC
26912013-08-23 Yuri Chornoivan <yurchor@ukr.net>
2692
2693 PR binutils/15834
2694 * object.h: Fix typos.
2695
93f8221c
RM
26962013-08-16 Roland McGrath <mcgrathr@google.com>
2697
2698 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
2699 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
2700
e44c3715
CC
27012013-08-07 Cary Coutant <ccoutant@google.com>
2702
2703 Revert support for v2 DWP files:
2704
2705 2013-03-01 Cary Coutant <ccoutant@google.com>
2706
2707 Add dwp support for v2 DWARF package file format.
2708 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2709 tu_length parameter. Adjust all callers.
2710 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2711 * dwp.cc: Include dwarf.h.
2712 (Section_bounds): New struct type.
2713 (Unit_set): New struct type.
2714 (Dwo_file::Dwo_file): Initialize new data member.
2715 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2716 Combine and rename to...
2717 (Dwo_file::read_unit_index): ...this.
2718 (Dwo_file::sized_read_compunit_index)
2719 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2720 (Dwo_file::sized_read_unit_index): ...this.
2721 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2722 parameters; add section_id parameter.
2723 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2724 (Dwo_file::add_unit_set): ...this.
2725 (Dwo_file::shndx_map_): Remove.
2726 (Dwo_file::sect_offsets_): New data member.
2727 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2728 (Dwp_output_file::add_section): Rename to...
2729 (Dwp_output_file::add_contribution): ...this.
2730 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2731 (Dwp_output_file::add_tu_set): Likewise.
2732 (Dwp_output_file::Contribution): New type.
2733 (Dwp_output_file::Section::contributions): New data member.
2734 (Dwp_output_file::Cu_or_tu_set): Remove.
2735 (Dwp_output_file::Section::Section): New ctor.
2736 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2737 (Dwp_output_file::Dwp_index::Section_table): New type.
2738 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2739 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2740 parameter.
2741 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2742 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2743 (Dwp_output_file::Dwp_index::section_table): New member function.
2744 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2745 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2746 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2747 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2748 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2749 (Dwp_output_file::Dwp_index::section_table_): New data member.
2750 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2751 (Dwp_output_file::add_output_section): New member function.
2752 (Dwp_output_file::write_new_section): New member function.
2753 (Dwp_output_file::write_contributions): New member function.
2754 (Dwp_output_file::section_id_map_): New data member.
2755 (class Dwo_id_info_reader): Remove.
2756 (class Unit_reader): New class.
2757 (get_dwarf_section_name): New function.
2758 (Dwo_file::read_executable): Adjust initializations of class data.
2759 (Dwo_file::read): Add support for v2 package file format.
2760 (Dwo_file::read_unit_index): Likewise.
2761 (Dwo_file::sized_read_unit_index): Likewise.
2762 (Dwo_file::copy_section): Likewise.
2763 (Dwo_file::add_unit_set): Likewise.
2764 (Dwp_output_file::add_output_section): Likewise.
2765 (Dwp_output_file::add_contribution): Likewise.
2766 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2767 for empty slot.
2768 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2769 file format.
2770 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2771 slot.
2772 (Dwp_output_file::initialize): Remove unused function.
2773 (Dwp_output_file::finalize): Add support for v2 package file format.
2774 (Dwp_output_file::write_index): Likewise.
2775 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2776 function prototype.
2777
c6905c28
CC
27782013-07-31 Cary Coutant <ccoutant@google.com>
2779
2780 * object.cc (Sized_relobj::do_output_section_address): New function.
2781 (Sized_relobj): Instantiate explicitly.
2782 * object.h (Object::output_section_address): New function.
2783 (Object::do_output_section_address): New function.
2784 (Sized_relobj::do_output_section_address): New function.
2785 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
2786
27872013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 2788 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
2789
2790 * parameters.cc (Parameters::entry): Return target-specific entry
2791 symbol name.
2792 * target.h (Target::entry_symbol_name): New function.
2793 (Target_info::entry_symbol_name): New data member.
2794
2795 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
2796 * i386.cc (Target_i386::i386_info): Likewise.
2797 (Target_i386_nacl::i386_nacl_info): Likewise.
2798 * sparc.cc (Target_sparc::sparc_info): Likewise.
2799 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
2800 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
2801 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
2802 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
2803
234d4ab8
SA
28042013-07-22 Sterling Augustine <saugustine@google.com>
2805
2806 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
2807 Convert parameter shndx to local variable. Add parameters symtab
2808 and symtab_size. Scan over section names. Find relocation
2809 section corresponding to current section. Create and initialize
2810 reloc_mapper_ and reloc_type_.
2811 (Dwarf_pubnames_table::read_header): Add assertion. Change
2812 unit_length to off_t. Initialize member unit_length_. Fill in field
2813 cu_offset_.
2814 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2815 Initialize new fields unit_length_ and cu_offset_.
2816 (Dwarf_pubnames_table::read_section): Update prototype.
2817 (Dwarf_pubnames_table::cu_offset): New member function.
2818 (Dwarf_pubnames_table::subsection_size): Likewise.
2819 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
2820 New fields.
2821 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
2822 member functions public.
2823 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
2824 Update comment. Rework logic. Move repeated parts to...
2825 (Gdb_index_info_reader::read_pubtable): ...here. New function.
2826 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
2827 pubtypes_table_, and stmt_list_offset.
2828 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2829 Gdb_index::find_pubtype_offset,
2830 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
2831 (Gdb_index::pubnames_read): Update prototype and rework logic.
2832 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
2833 Forward declare.
2834 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2835 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
2836 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
2837 Gdb_index::map_pubtable_to_dies):
2838 Declare functions.
2839 (Gdb_index::pubnames_read): Update declaration.
2840 (Gdb_index::Pubname_offset_map): New type.
2841 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
2842 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
2843 Gdb_index::stmt_list_offset): Declare.
2844 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
2845 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
2846 Gdb_index::pubtypes_offset_): Remove.
2847
a3ed37d8
RM
28482013-07-19 Roland McGrath <mcgrathr@google.com>
2849
2850 * options.h (General_options): Add -Trodata-segment option.
2851 * parameters.cc (Parameters::check_rodata_segment): New function.
2852 (Parameters::set_target_once): Call it.
2853 * parameters.h (Parameters): Declare it (private member function).
2854 * layout.cc (load_seg_unusable_for_headers): New function, broken
2855 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
2856 then validate rodata segment rather than text segment.
2857 (relaxation_loop_body): Call that.
2858 (is_text_segment): New function. Don't admit a non-executable
2859 segment if TARGET->isolate_execinstr().
2860 (set_segment_offsets): Call it. Honor -Trodata-segment option.
2861
eb5b4ded
CC
28622013-07-15 Shawn Landden <shawnlandden@gmail.com>
2863
2864 PR gold/15070
2865 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
2866 * nacl.h (Sniff_file::View::View): Request aligned view.
2867
4d5effb9
CC
28682013-07-11 Cary Coutant <ccoutant@google.com>
2869
2870 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
2871 correct BRLT entry size.
2872
ba8ca3e7
AM
28732013-07-03 Alan Modra <amodra@gmail.com>
2874
2875 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
2876 comment.
2877
267257d2
CC
28782013-07-01 Cary Coutant <ccoutant@google.com>
2879
2880 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
2881 reloc_type_.
2882 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
2883 (Dwarf_ranges_table::lookup_reloc): New function.
2884 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
2885 reloc_type_.
2886 (Dwarf_ranges_table::lookup_reloc): New function.
2887 (Dwarf_ranges_table::reloc_type_): New data member.
2888
06f30c9d
CC
28892013-06-27 Jing Yu <jingyu@google.com>
2890
2891 PR gold/15662
2892 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
2893 function.
2894 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
2895 (Target_powerpc::do_relax): Call the above.
2896
a2d7bf59
AM
28972013-06-27 Cary Coutant <ccoutant@google.com>
2898
2899 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
2900 on garbage collected .opd section.
2901
29022013-06-27 Alan Modra <amodra@gmail.com>
2903
2904 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
2905 is non-zero.
2906 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
2907 (Target_powerpc::do_function_location): Likewise for loc->shndx.
2908
32364e50
CC
29092013-06-14 Cary Coutant <ccoutant@google.com>
2910
2911 * resolve.cc (Symbol::override_base): Don't override st_type
2912 from plugin placeholder symbols.
2913 (Symbol_table::resolve): Likewise.
2914 (Symbol_table::should_override): Don't complain about TLS mismatch
2915 if the TO symbol is a plugin placeholder.
2916 * testsuite/Makefile.am (plugin_test_tls): New test.
2917 * testsuite/Makefile.in: Regenerate.
2918 * testsuite/plugin_test_tls.sh: New test script.
2919 * testsuite/two_file_test_2_tls.cc: New test source.
2920 * testsuite/two_file_test_tls.cc: New test source.
2921
7fb47cc9
CC
29222013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
2923
2924 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
2925 the maximum segment alignment is larger than the page size.
2926 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
2927 correctly aligns the symbols with large alignemnt.
2928 * testsuite/Makefile.in: Regenerate.
2929 * testsuite/large_symbol_alignment.cc: New file.
2930
6934001a
CC
29312013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
2932 Sriraman Tallam <tmsriram@google.com>
2933
2934 * options.h (sort_section): New option.
2935 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
2936 Rename from Input_section_sort_section_name_special_ordering_compare.
2937 (Input_section_sort_section_name_compare): New struct.
2938 * output.cc (Output_section::Input_section_sort_section_name_compare::
2939 operator()): New function.
2940 (Output_section::sort_attached_input_sections): Use new sort function
2941 for .text if --sort-section=name is specified.
2942 * layout.cc (Layout::make_output_section):
2943 Add sorting by name when --sort-section=name is specified.
2944 * testsuite/Makefile.am (text_section_grouping): Test option
2945 --sort-section=name.
2946 * testsuite/Makefile.in: Regenerate.
2947 * testsuite/section_sorting_name.cc: New file.
2948 * testsuite/section_sorting_name.sh: New file.
2949
93acabad
CC
29502013-05-21 Cary Coutant <ccoutant@google.com>
2951
2952 * symtab.h (Symbol::is_cxx_vtable): New function.
2953 * target-reloc.h (relocate_section): Check for vtable symbol.
2954 * testsuite/Makefile.am (missing_key_func.sh): New test case.
2955 * testsuite/Makefile.in: Regenerate.
2956 * testsuite/missing_key_func.cc: New test source.
2957 * testsuite/missing_key_func.sh: New test script.
2958
60e8b3fc
CC
29592013-05-21 Cary Coutant <ccoutant@google.com>
2960
2b64b551
RM
2961 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
2962 type of enclosing symbol.
2963 (Relocate_info::location): Check symbol type when describing symbol.
2964 * object.h (Symbol_location_info): Remove unused line_number;
2965 add enclosing_symbol_type.
2966 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 2967
9df9de2c
CC
29682013-05-13 Cary Coutant <ccoutant@google.com>
2969
2b64b551
RM
2970 * configure.ac: Export DEFAULT_TARGET.
2971 * configure: Regenerate.
2972 * Makefile.in: Regenerate.
2973 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
2974 * testsuite/Makefile.in: Regenerate.
2975 * testsuite/debug_msg.sh: Delete duplicate tests.
2976 Don't check undef_int error message match for powerpc where the
2977 source file and line number aren't available.
9df9de2c 2978
bbc5ae17
RM
29792013-05-10 Roland McGrath <mcgrathr@google.com>
2980
2981 * options.h (General_options): Add --rosegment-gap option.
2982 * options.cc (finalize): --rosegment-gap implies --rosegment.
2983 * layout.cc (set_segment_offsets): Let user option override
2984 target->rosegment_gap().
2985
0c6e6c39
RM
29862013-05-10 Roland McGrath <mcgrathr@google.com>
2987
2988 * options.h (General_options): Remove leading space from help
2989 messages for -nostdlib and --rosegment.
2990
cde7cb01
MR
29912013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
2992
2993 PR ld/15365
2994 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
2995
f31ae5b8
AM
29962013-05-03 Alan Modra <amodra@gmail.com>
2997
2998 * merge.cc (Output_merge_string::do_add_input_section): Correct
2999 scan for number of strings. Rename vars to avoid shadowing.
3000 Include missing terminator in input_size_.
3001
d3a7cd45
L
30022013-05-01 H.J. Lu <hongjiu.lu@intel.com>
3003
3004 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
3005 Restore empty string handling.
3006
6ad3daba
CC
30072013-05-01 Cary Coutant <ccoutant@google.com>
3008
3009 * stringpool.cc (Stringpool_template::new_key_offset): Fix
3010 uninitialized warning.
3011
e31908b6
CC
30122013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
3013
3014 * output.cc (Output_section::add_merge_input_section): Allow
3015 to merge sections if the alignment is more than character size.
3016 * merge.h (Output_merge_string::Output_merge_string): Remove
3017 assert.
3018 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
3019 only not-null strings. Check the alignment of strings.
3020 * stringpool.h
3021 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
3022 alignment as the argument.
3023 (Stringpool_template<Stringpool_char>::addralign_): New class member.
3024 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
3025 Align non-zero length strings according to the addralign_.
3026 (Stringpool_template<Stringpool_char>::set_string_offsets):
3027 Updating offsets according to the given alignment.
3028 * testsuite/Makefile.am (text_section_grouping): Test if string
3029 literals are getting merged.
3030 * testsuite/Makefile.in: Regenerate.
3031 * testsuite/merge_string_literals_1.c: New file.
3032 * testsuite/merge_string_literals_2.c: Ditto.
3033 * testsuite/merge_string_literals.sh: Ditto.
3034
0e804863
ILT
30352013-04-26 Ian Lance Taylor <iant@google.com>
3036
3037 * target-reloc.h (relocate_section): If the reloc offset is out of
3038 range, pass VIEW as NULL to relocate.relocate.
3039 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
3040 * i386.cc (Target_i386::Relocate::relocate): Likewise.
3041 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
3042 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
3043 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
3044 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
3045
e7c5ea40
CC
30462013-04-26 Geoff Pike <gpike@chromium.org>
3047
3048 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
3049 * layout.cc (Hash_task): New class.
3050 (Layout::queue_build_id_tasks): New function.
3051 (Layout::write_build_id): Handle single-thread portion of build ID
3052 computation. (In some cases, all of it is single-threaded.) Replace
3053 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
3054 functionality in fewer lines of code.
3055 * layout.h (Layout::queue_build_id_tasks): New function declaration.
3056 * options.h (General_options): make "--build-id" default to tree
3057 rather than sha1. Add two new options related to --build-id=tree:
3058 --build-id-chunk-size-for-treehash and
3059 --build-id-min-file-size-for-treehash.
3060 * Makefile.am: add testing of --build-id=tree and related new options
3061 (these tests will be invoked by "make check").
3062 * Makefile.in: Regenerate.
3063
49926cd0
AM
30642013-04-25 Alan Modra <amodra@gmail.com>
3065
3066 * configure.tgt: Add powerpcle and powerpc64le.
3067
a4034750
AM
30682013-04-22 Alan Modra <amodra@gmail.com>
3069
3070 PR gold/15355
3071 * layout.cc (Layout::segment_precedes): Allow more than one
3072 segment with the same type and flags.
3073
e79c84aa
CC
30742013-04-15 Cary Coutant <ccoutant@google.com>
3075
3076 * layout.cc (Layout::set_relocatable_section_offsets): Don't
3077 allocate space in file for BSS sections.
3078
2199fbe7
CC
30792013-04-15 Cary Coutant <ccoutant@google.com>
3080
3081 * script-sections.cc (Orphan_output_section): Reset address
3082 to zero after each orphaned section for relocatable links.
3083
502e8a84
CC
30842013-04-15 Cary Coutant <ccoutant@google.com>
3085
a4034750
AM
3086 * symtab.cc (Symbol_table::sized_write_globals): Subtract
3087 section starting address for relocatable link.
3088 * testsuite/Makefile.am (script_test_11): New test.
3089 * testsuite/Makefile.in: Regenerate.
3090 * testsuite/script_test_11.c: New source file.
3091 * testsuite/script_test_11.t: New linker script.
502e8a84 3092
0cfdc767
AM
30932013-04-13 Alan Modra <amodra@gmail.com>
3094
3095 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
3096 owner when sections are not adjacent and exceed group size.
3097 (Target_powerpc::group_sections): Handle corner case.
3098 (Target_powerpc::Branch_info::make_stub): Handle case where
3099 stub table doesn't exist due to branches in non-exec sections.
3100 (Target_powerpc::Relocate::relocate): Likewise.
3101
6830ee24
AM
31022013-04-11 Alan Modra <amodra@gmail.com>
3103
3104 PR gold/15354
3105 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
3106 .branch_lt to match bfd ld. Adjust comments throughout file.
3107
54a3d865
ILT
31082013-04-04 Ian Lance Taylor <iant@google.com>
3109
3110 GCC PR c++/56840
3111 * object.cc (do_layout_deferred_sections): Handle .eh_frame
3112 sections before checking whether they are included in the link.
3113
9993ba11
ST
31142013-03-29 Sriraman Tallam <tmsriram@google.com>
3115
3116 * archive.cc (Archive::get_elf_object_for_member): Create the elf
3117 object before calling the plugin claim_file handler. Pass the elf
3118 object of the archive to the plugin. Delete the elf object if the
3119 plugin claims the file.
3120
ebacd51e
AM
31212013-03-21 Alan Modra <amodra@gmail.com>
3122
3123 * layout.cc (Layout::set_segment_offsets): Accept writable .text
3124 segment when omagic.
3125
117be58f
AM
31262013-03-21 Alan Modra <amodra@gmail.com>
3127
3128 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
3129 comparison warning.
3130 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
3131 uninitialized" warning.
3132
32e2b61d
AM
31332013-03-20 Alan Modra <amodra@gmail.com>
3134
3135 * symtab.h (Symbol::clear_version): New function.
3136 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
3137 is_needed by weak references. Clear version for symbols defined
3138 in as-needed objects that are not needed.
3139
b3ccdeb5
AM
31402013-03-15 Alan Modra <amodra@gmail.com>
3141
3142 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
3143 static and public. Add report_err param. Return false for data refs.
3144 (Target_powerpc::rela_dyn_section): New overloaded function.
3145 (Target_powerpc::plt_, iplt_): Elucidate.
3146 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
3147 (Output_data_plt_powerpc::do_write): Don't write .iplt.
3148 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
3149 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
3150 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
3151 push_branch and make_plt_entry for ifunc syms when
3152 reloc_needs_plt_for_ifunc.
3153 (Target_powerpc::Relocate::relocate): Don't use plt entry value
3154 for ifunc unless reloc_needs_plt_for_ifunc.
3155
ad3d8a2f
AM
31562013-03-15 Alan Modra <amodra@gmail.com>
3157
3158 * gc.h (gc_process_relocs): Don't look through function descriptors.
3159 * icf.cc (get_section_contents): Do so here instead.
3160
4d9aa155
AM
31612013-03-13 Alan Modra <amodra@gmail.com>
3162
3163 * powerpc.cc (is_branch_reloc): Forward declare.
3164 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
3165 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
3166 false for 64-bit, true for 32-bit non-branch relocs.
3167 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
3168 * testsuite/Makefile.am (icf_test): Use linker map file instead of
3169 nm output.
3170 (icf_safe_test): Generate linker map file as well as nm output.
3171 (icf_safe_so_test): Likewise.
3172 * testsuite/Makefile.in: Regenerate.
3173 * testsuite/icf_test.sh: Parse linker map file to determine
3174 section folding.
3175 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
3176 * testsuite/icf_safe_so_test.sh: Likewise.
3177 (X86_32_or_ARM_specific_safe_fold): Merge into..
3178 (arch_specific_safe_fold): ..this.
3179 (X86_64_specific_safe_fold): Delete unused function.
3180
57420c20
AM
31812013-03-12 Alan Modra <amodra@gmail.com>
3182
3183 * gc.h (gc_process_relocs): Look through function descriptors
3184 to determine shndx, symvalue and addend used by ICF. Tidy
3185 variable duplication.
3186
dc3714f3
AM
31872013-03-11 Alan Modra <amodra@gmail.com>
3188
3189 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
3190 * layout.cc (Layout_task_runner::run): ..to here.
3191 * symtab.h (struct Symbol_location): Extract from..
3192 (class Symbol_table): ..here.
3193 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
3194 * target.h (class Target): Add function_location and
3195 do_function_location functions.
3196 (class Sized_target): Add do_function_location.
3197 * object.h (class Sized_relobj_file): Move find_shdr..
3198 (class Object): ..to here.
3199 * object.cc: Likewise. Update to suit. Instantiate.
3200 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
3201 * powerpc.cc (class Powerpc_dynobj): New.
3202 (Target_powerpc::do_function_location): New function.
3203 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
3204 (Powerpc_dynobj::do_read_symbols): New function.
3205 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
3206
956b03bb
ILT
32072013-03-08 Ian Lance Taylor <iant@google.com>
3208
3209 * options.cc (General_options::string_to_object_format): Accept
3210 "default".
3211
4bead2d5
AM
32122013-03-08 Alan Modra <amodra@gmail.com>
3213
3214 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
3215 pointer to Post_fde.
3216 (struct Post_fde): Move definition to here..
3217 * ehframe.cc (struct Post_fde): ..from here.
3218 (Cie::write): Don't alloc Post_fde.
3219 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
3220
02e60bf7
AM
32212013-03-07 Alan Modra <amodra@gmail.com>
3222
3223 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
3224 relocation referencing .LC0.
3225 * testsuite/discard_locals_test.sh: Remove FIXMEs.
3226
8343f03a
AM
32272013-03-07 Alan Modra <amodra@gmail.com>
3228
3229 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
3230 always_inline. Add assembly for powerpc to avoid GOT.
3231
3366d57c
AM
32322013-03-07 Alan Modra <amodra@gmail.com>
3233
3234 * testsuite/script_test_10.sh: Don't test .bss section
3235 header number.
3236
6c77229c
AM
32372013-03-06 Alan Modra <amodra@gmail.com>
3238
3239 * powerpc.cc (class Powerpc_relobj): Move some member functions.
3240 (Target_powerpc::symval_for_branch): Add symtab param. Update
3241 all callers. Handle folded sections.
3242 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
3243 to Powerpc_relobj.
3244 (Global_symbol_visitor_opd::operator()): Likewise.
3245
a39e4af6
AM
32462013-03-04 Alan Modra <amodra@gmail.com>
3247
3248 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
3249 * testsuite/Makefile.in: Regenerate.
3250
d5834edb
CC
32512013-03-01 Cary Coutant <ccoutant@google.com>
3252
3253 Add dwp support for v2 DWARF package file format.
3254 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
3255 tu_length parameter. Adjust all callers.
3256 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
3257 * dwp.cc: Include dwarf.h.
3258 (Section_bounds): New struct type.
3259 (Unit_set): New struct type.
3260 (Dwo_file::Dwo_file): Initialize new data member.
3261 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
3262 Combine and rename to...
3263 (Dwo_file::read_unit_index): ...this.
3264 (Dwo_file::sized_read_compunit_index)
3265 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
3266 (Dwo_file::sized_read_unit_index): ...this.
3267 (Dwo_file::copy_section): Remove section_name, is_str_offsets
3268 parameters; add section_id parameter.
3269 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
3270 (Dwo_file::add_unit_set): ...this.
3271 (Dwo_file::shndx_map_): Remove.
3272 (Dwo_file::sect_offsets_): New data member.
3273 (Dwp_output_file::Dwp_output_file): Initialize new data members.
3274 (Dwp_output_file::add_section): Rename to...
3275 (Dwp_output_file::add_contribution): ...this.
3276 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
3277 (Dwp_output_file::add_tu_set): Likewise.
3278 (Dwp_output_file::Contribution): New type.
3279 (Dwp_output_file::Section::contributions): New data member.
3280 (Dwp_output_file::Cu_or_tu_set): Remove.
3281 (Dwp_output_file::Section::Section): New ctor.
3282 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
3283 (Dwp_output_file::Dwp_index::Section_table): New type.
3284 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
3285 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
3286 parameter.
3287 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
3288 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
3289 (Dwp_output_file::Dwp_index::section_table): New member function.
3290 (Dwp_output_file::Dwp_index::section_table_end): New member function.
3291 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
3292 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
3293 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
3294 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
3295 (Dwp_output_file::Dwp_index::section_table_): New data member.
3296 (Dwp_output_file::Dwp_index::section_mask_): New data member.
3297 (Dwp_output_file::add_output_section): New member function.
3298 (Dwp_output_file::write_new_section): New member function.
3299 (Dwp_output_file::write_contributions): New member function.
3300 (Dwp_output_file::section_id_map_): New data member.
3301 (class Dwo_id_info_reader): Remove.
3302 (class Unit_reader): New class.
3303 (get_dwarf_section_name): New function.
3304 (Dwo_file::read_executable): Adjust initializations of class data.
3305 (Dwo_file::read): Add support for v2 package file format.
3306 (Dwo_file::read_unit_index): Likewise.
3307 (Dwo_file::sized_read_unit_index): Likewise.
3308 (Dwo_file::copy_section): Likewise.
3309 (Dwo_file::add_unit_set): Likewise.
3310 (Dwp_output_file::add_output_section): Likewise.
3311 (Dwp_output_file::add_contribution): Likewise.
3312 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
3313 for empty slot.
3314 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
3315 file format.
3316 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
3317 slot.
3318 (Dwp_output_file::initialize): Remove unused function.
3319 (Dwp_output_file::finalize): Add support for v2 package file format.
3320 (Dwp_output_file::write_index): Likewise.
3321 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
3322 function prototype.
3323
a68a081d
CC
33242013-03-01 Cary Coutant <ccoutant@google.com>
3325
3326 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
3327 function into class definition in header file.
3328 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
3329 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
3330 New function.
3331 (Dwarf_info_reader::check_buffer): Move here from .cc file.
3332
9d5781f8
AM
33332013-02-28 Alan Modra <amodra@gmail.com>
3334
3335 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
3336 * target.cc (Target::do_plt_fde_location): New function.
3337 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
3338 accessor function, and constructor param.
3339 (struct Post_fde, Post_fdes): Declare.
3340 (Cie::write): Add post_fdes param.
3341 * ehframe.cc (Fde::write): Use plt_fde_location.
3342 (struct Post_fde): Define.
3343 (Cie::write): Stash FDEs added post merge mapping.
3344 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
3345 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
3346 (Eh_frame::do_sized_write): Arrange to write post map FDES after
3347 other FDEs.
3348 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
3349 (Target_powerpc::has_glink): New function.
3350 (Target_powerpc::do_relax): Add eh_frame info for stubs.
3351 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
3352 glink_eh_frame_fde_32, default_fde): New data.
3353 (Stub_table::eh_frame_added_): New var.
3354 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
3355 Make const.
3356 (Stub_table::add_eh_frame): New function.
3357 (Output_data_glink::add_eh_frame): New function.
3358 (Target_powerpc::make_glink_section): Call add_eh_frame.
3359
214383dd
ILT
33602013-02-15 Ian Lance Taylor <iant@google.com>
3361
3362 * options.h (DEFINE_uint64_alias): Define.
3363 (class General_options): Add -Ttext-segment as an alias for
3364 -Ttext.
3365
91c2b899
AM
33662013-02-15 Alan Modra <amodra@gmail.com>
3367
3368 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
3369 (Stub_table::do_write): ..here, two places.
3370 (Stub_table::plt_call_size): Use it here too.
3371
20e2a8aa
ILT
33722013-02-11 Ian Lance Taylor <iant@google.com>
3373
3374 * descriptors.cc (Descriptors::close_all): New function.
3375 * descriptors.h (class Descriptors): Declare close_all.
3376 (close_all_descriptors): New inline function.
3377 * plugin.cc: Include "descriptors.h".
3378 (Plugin_manager::cleanup): Call close_all_descriptors.
3379
8952bc69
AM
33802013-02-06 Alan Modra <amodra@gmail.com>
3381
3382 * README: Update coding style link.
3383
29bd8b6b
CC
33842013-01-28 Cary Coutant <ccoutant@google.com>
3385
a4034750
AM
3386 * dwp.cc (File_list): New typedef.
3387 (Dwo_name_info_reader): New class.
3388 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
3389 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
3390 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
3391 (Dwo_file::read_executable): New function.
3392 (Dwo_file::read): Move common setup code to ...
3393 (Dwo_file::make_object): ... here.
3394 (dwp_options): Add --exec/-e.
3395 (usage): Likewise.
3396 (main): Likewise.
29bd8b6b 3397
c6ac678d
ST
33982013-01-24 Sriraman Tallam <tmsriram@google.com>
3399
3400 * layout.cc (Layout::layout): Check for option text_reorder.
3401 (Layout::make_output_section): Ditto.
3402 * options.h (text_reorder): New option.
3403 * output.cc (Input_section_sort_compare): Remove special ordering
3404 of section names.
3405 (Output_section::
3406 Input_section_sort_section_name_special_ordering_compare::
3407 operator()): New function.
3408 (Output_section::sort_attached_input_sections): Use new sort function
3409 for .text.
3410 * output.h (Input_section_sort_section_name_special_ordering_compare):
3411 New struct.
3412 * testsuite/Makefile.am (text_section_grouping): Test option
3413 --no-text-reorder
3414 * testsuite/Makefile.in: Regenerate.
3415 * testsuite/text_section_grouping.sh: Check order of functions without
3416 default text reordering.
3417
50701cc1
MF
34182013-01-18 Mike Frysinger <vapier@gentoo.org>
3419
3420 * options.h (General_options): Change default to true for new_dtags.
3421
b1b00fcc
MF
34222013-01-18 Mike Frysinger <vapier@gentoo.org>
3423
3424 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
3425 when enable_new_dtags is false. Only add DT_RUNPATH when
3426 enable_new_dtags is true.
3427
ec5b8187
AM
34282013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
3429
3430 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
3431 used in declaration and definition consistent.
3432 (Target_powerpc::symval_for_branch): Ditto.
3433
a880d4c4
ST
34342013-01-16 Sriraman Tallam <tmsriram@google.com>
3435
3436 * testsuite/plugin_final_layout.cc: Fix comment.
3437
7c381248
ST
34382013-01-16 Sriraman Tallam <tmsriram@google.com>
3439
3440 * layout.cc (Layout::layout): Do not do default sorting for
3441 text sections when section ordering is specified.
3442 (make_output_section): Ditto.
3443 * testsuite/plugin_final_layout.cc: Name the function sections
3444 to catch reordering issues.
3445
e2458743
AM
34462013-01-15 Alan Modra <amodra@gmail.com>
3447
3448 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
3449 plt-thread-safe.
3450
431ed302
AM
34512013-01-15 Alan Modra <amodra@gmail.com>
3452
3453 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
3454 * testsuite/Makefile.in: Regenerate.
3455
0ec6429b
AM
34562013-01-14 Alan Modra <amodra@gmail.com>
3457
3458 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
3459 * testsuite/Makefile.in: Regenerate.
3460
0bf402d5
ILT
34612013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
3462
36af3926 3463 PR bfd/14430
0bf402d5
ILT
3464 Fix mingw gold build with plugins enabled
3465 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
3466 * configure.ac: Export DLOPEN_LIBS and add headers check.
3467 * plugin.cc: Handle non-dlfcn case.
3468 * Makefile.in: Regenerate.
3469 * config.in: Regenerate.
3470 * configure: Regenerate.
3471 * testsuite/Makefile.in: Regenerate.
3472
9e9143bc
ST
34732013-01-09 Sriraman Tallam <tmsriram@google.com>
3474
3475 * output.h (sort_attached_input_sections): Change to be public.
3476 * script-sections.cc
3477 (Output_section_definition::set_section_addresses): Sort
3478 attached input sections according to section order before linker
3479 script assigns section addresses.
3480 (Orphan_output_section::set_section_addresses): Sort
3481 attached input sections according to section order before linker
3482 script assigns section addresses.
3483 * Makefile.am (final_layout.sh): Use a simple linker script to
3484 check if section ordering still works.
3485 * Makefile.in: Regenerate.
3486
679af368
ILT
34872013-01-09 Ben Cheng <bccheng@google.com>
3488
3489 * arm.cc (Target_arm::attributes_accept_div): New function.
3490 (Target_arm::attributes_forbid_div): New function.
3491 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
3492 attribute using the same new functions as what bfd/elf32_arm.c
3493 does.
3494
3136a00e
CC
34952013-01-07 Cary Coutant <ccoutant@google.com>
3496
3497 PR gold/14993
3498 * output.cc (Output_section::add_input_section): For incremental
3499 updates, don't track input sections that are allocated from patch
3500 space.
3501
f2a6224b
L
35022013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3503 Ian Lance Taylor <iant@google.com>
3504
3505 PR gold/14897
3506 * configure.ac (--enable-ld): Removed.
3507 (install_as_default): Set to yes only for --enable-gold=default
3508 or --disable-ld.
3509 * configure: Regenerated.
3510
4f46f626
L
35112013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3512
3513 * options.h (General_options): Add -fuse-ld= for GCC linker
3514 option compatibility.
3515
26e4ef59
CC
35162013-01-04 Cary Coutant <ccoutant@google.com>
3517
3518 * configure.ac: Fix typo restoring CXXFLAGS.
3519 * configure: Regenerate.
3520
3d587466
CC
35212013-01-04 Cary Coutant <ccoutant@google.com>
3522
4f46f626
L
3523 * testsuite/Makefile.am (CXXLINK_S): New macro.
3524 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
3525 * testsuite/Makefile.in: Regenerate.
3d587466 3526
44db6695
L
35272013-01-02 H.J. Lu <hongjiu.lu@intel.com>
3528
3529 * version.cc (print_version): Update copyright year to 2013.
3530
edcac0c1
ILT
35312012-12-20 Ian Lance Taylor <iant@google.com>
3532
3533 * layout.cc (Layout::special_ordering_of_input_section): New
3534 function.
3535 (Layout::layout): If input section requires special ordering, must
3536 sort input sections.
3537 (Layout::make_output_section): May sort .text input sections.
3538 (Layout::is_section_name_prefix_grouped): Remove.
3539 * layout.h (class Layout): Declare
3540 special_ordering_of_input_section. Don't declare
3541 is_section_name_prefix_grouped.
3542 * output.cc (Output_section::add_input_section): Revert last
3543 change.
3544 (Output_section::Input_section_sort::match_file_name): Don't crash
3545 if called on output section data.
3546 (Output_section::Input_section_sort_compare): Sort based on
3547 special ordering.
3548 (Output_section::Input_section_sort_section_order_index_compare):
3549 Revert last patch.
3550 (Output_section::sort_attached_input_sections): Likewise.
3551
28f2a4ac
ST
35522012-12-18 Sriraman Tallam <tmsriram@google.com>
3553
edcac0c1 3554 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
3555 * layout.h (Layout::is_section_name_prefix_grouped): New function.
3556 * output.cc (Output_section::add_input_section): Check if section
3557 name contains special prefix. Keep input sections to sort such
3558 sections.
3559 (Output_section::Input_section_sort_section_order_index_compare
3560 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
3561 (Output_section::sort_attached_input_sections): Add condition to
3562 Input_section_entry constructor call.
28f2a4ac
ST
3563 * testsuite/Makefile.am (text_section_grouping): New test.
3564 * testsuite/Makefile.in: Regenerate.
3565 * testsuite/text_section_grouping.cc: New file.
3566 * testsuite/text_section_grouping.sh: New file.
3567
5bf135a7
NC
35682012-12-17 Nick Clifton <nickc@redhat.com>
3569
3570 * Makefile.am: Add copyright notice.
3571 * NEWS: Likewise.
3572 * README: Likewise.
3573 * configure.ac: Likewise.
3574 * ftruncate.c: Likewise.
3575 * Makefile.in: Regenerate.
3576
59965708
CC
35772012-12-14 Cary Coutant <ccoutant@google.com>
3578
a4034750
AM
3579 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
3580 --no-as-needed flag.
3581 (exception_separate_shared_12_test): Likewise.
3582 (incremental_copy_test): Likewise.
3583 * testsuite/Makefile.in: Regenerate.
59965708 3584
2a77e2ab
CC
35852012-12-14 Cary Coutant <ccoutant@google.com>
3586
3587 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
3588 (Dwp_output_file::Dwp_index::enter_set): Add assert.
3589
e3deeb9c
AM
35902012-12-12 Alan Modra <amodra@gmail.com>
3591
3592 * powerpc.cc (class Track_tls): New.
3593 (class Relocate, class Scan): Inherit Track_tls.
3594 (Target_powerpc::Scan::local, global): Track tls optimization
3595 and avoid creating plt entry for __tls_get_addr if all uses
3596 are optimized away.
3597 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
3598
d8f5a274
AM
35992012-12-12 Alan Modra <amodra@gmail.com>
3600
3601 * options.h (General_options): Add --toc-sort/--no-toc-sort.
3602 Replace no_toc_optimize with toc_optimize.
3603 * output.h (Output_section::input_sections): Provide non-const variant.
3604 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
3605 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
3606 accessors.
3607 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
3608 (class Sort_toc_sections): New.
3609 (Target_powerpc::do_finalize_sections): Sort toc sections.
3610 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
3611
4c8a1de1
RM
36122012-12-10 Roland McGrath <mcgrathr@google.com>
3613
3614 * testsuite/binary_unittest.cc (read_all): New function.
3615 (Sized_binary_test): Use it instead of ::read.
3616 * fileread.cc (do_read): Don't assume pread always reads the whole
3617 amount in a single call.
3618
edc27beb
AM
36192012-12-10 Alan Modra <amodra@gmail.com>
3620
3621 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
3622 Set EM_PPC64 or EM_PPC here.
3623 (Target_selector_powerpc::do_recognize): Delete.
3624
906b9150
AM
36252012-12-10 Alan Modra <amodra@gmail.com>
3626
3627 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
3628 stub_table_.
3629 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
3630
418c15ae
RM
36312012-12-07 Roland McGrath <mcgrathr@google.com>
3632
3633 * testsuite/binary_unittest.cc (Sized_binary_test):
3634 Use open_descriptor rather than ::open.
3635
decdd3bc
AM
36362012-12-07 Alan Modra <amodra@gmail.com>
3637
3638 * powerpc.cc (Stub_table::do_write): Delete redundant Address
3639 typedef and invalid_address constant.
3640 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
3641 instantiate constants.
3642
db399005
ILT
36432012-12-06 Roland McGrath <mcgrathr@google.com>
3644
3645 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
3646 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
3647 * aclocal.m4: Regenerate.
3648 * configure: Regenerate.
3649 * Makefile.in: Regenerate.
3650 * testsuite/Makefile.in: Regenerate.
3651
aba6bc71
AM
36522012-12-07 Alan Modra <amodra@gmail.com>
3653
3654 * options.h (General_options): Add no_toc_optimize.
3655 * powerpc.cc (ok_lo_toc_insn): New function.
3656 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
3657
9e69ed50
AM
36582012-12-06 Alan Modra <amodra@gmail.com>
3659
3660 * options.h (General_options): Add plt_align, plt_static_chain,
3661 plt_thread_safe. Update stub_group_size help text.
3662 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
3663 for new plt_thread_safe_ var.
3664 (use_plt_offset): Correct comments.
3665 (Target_powerpc::do_relax): Look for thread creation symbols to
3666 determine default plt_thread_safe value. Clear plt call stubs
3667 as well as branch stubs each iteration.
3668 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
3669 insn constants.
3670 (l, hi, ha, write_insn): Move earlier.
3671 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
3672 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
3673 plt stubs too.
3674 (Stub_table::update_size): Adjust.
3675 (Stub_table::prev_size, set_prev_size): Delete.
3676 (Stub_table::stub_align): Let --plt-align affect result.
3677 (Stub_table::plt_call_size): Calculate sizes for various stubs.
3678 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
3679 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
3680 (Stub_table::do_write): Support more stub variants.
3681
f43ba157
AM
36822012-12-04 Alan Modra <amodra@gmail.com>
3683
3684 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
3685 (Target_powerpc::do_define_standard_symbols): New function.
3686
34171bc5
AM
36872012-12-03 Alan Modra <amodra@gmail.com>
3688
3689 * output.h: Formatting, whitespace.
3690
dc9589e9 36912012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
3692
3693 * layout.h (Layout::get_executable_sections): Declare.
3694 * layout.cc (Layout::get_executable_sections): New function.
3695 * arm.cc (Target_arm::group_sections): Use it.
3696 (Arm_output_section::group_sections): Delete now redundant test.
3697 * output.cc (Output_reloc::Output_reloc): Add is_relative.
3698 param to handle relative relocs.
3699 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
3700 (Output_data_reloc::add_absolute): Adjust.
3701 (Output_data_reloc::add_relative): New function.
3702 (Output_data::reset_data_size): New function.
3703 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
3704 (Output_section::set_addralign): New function.
3705 (Output_section::checkpoint_set_addralign): New function.
3706 (Output_section::clear_section_offsets_need_adjustment): New function.
3707 (Output_section::input_sections): Make public.
3708 * powerpc.cc (class Output_data_brlt_powerpc): New.
3709 (class Stub_table, class Stub_control): New.
3710 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
3711 stub_table_, set_stub_table, stub_table): New vectors and accessor
3712 functions.
3713 (Target_powerpc::do_may_relax, do_relax, push_branch,
3714 new_stub_table, stub_tables, brlt_section, group_sections,
3715 add_branch_lookup_table, find_branch_lookup_table,
3716 write_branch_lookup_table, make_brlt_section): New functions.
3717 (Target_powerpc::struct Sort_sections, class Branch_info): New.
3718 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
3719 branch_info_): New vars.
3720 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
3721 make call stubs here.
3722 (Output_data_glink): Remove all call stub handling from this class.
3723 (Target_powerpc::Scan::local, global): Save interesting branch
3724 relocs and relocs for ifunc. Adjust calls to plt entry functions.
3725 (Target_powerpc::do_finalize_sections): Only make reg save/restore
3726 functions on final link.
3727 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
3728 Handle long branch destinations too.
3729 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
3730 do_plt_address_for_local): Adjust lookup of plt call stubs.
3731
627b30b7
AM
37322012-11-30 Alan Modra <amodra@gmail.com>
3733
3734 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
3735 relocs against protected symbols when building 32-bit shared libs.
3736
40b469d7
AM
37372012-11-30 Alan Modra <amodra@gmail.com>
3738
3739 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
3740 param. Call got_section() to make .got. Update all callers
3741 and their callers and so on.
3742
bb66a627
AM
37432012-11-30 Alan Modra <amodra@gmail.com>
3744
3745 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
3746 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
3747 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
3748 value if it already exists.
3749
d2cf1c6c
L
37502012-11-19 H.J. Lu <hongjiu.lu@intel.com>
3751
3752 PR gold/14858
3753 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
3754
edccdf7c
RM
37552012-11-14 Roland McGrath <mcgrathr@google.com>
3756
3757 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
3758 than bfc instruction for data sandboxing.
3759
6febeb74
AM
37602012-11-08 Alan Modra <amodra@gmail.com>
3761
3762 * po/POTFILES.in: Regenerate.
3763
0a6f1bf2
AM
37642012-11-05 Alan Modra <amodra@gmail.com>
3765
3766 * configure.ac: Apply 2012-09-10 change to config.in here.
3767 * configure: Regenerate.
3768
26a4e9cb
AM
37692012-11-05 Alan Modra <amodra@gmail.com>
3770
3771 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
3772 (struct Opd_ent): Use "Address" rather than "Offset".
3773 (Output_data_got_powerpc::got_base_offset): Return Valtype.
3774 (Target_powerpc::got_section): Make public.
3775 (Target_powerpc::scan_relocs): Move code setting symbols..
3776 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
3777 Create _SDA_BASE_ only when referenced.
3778
cc928013
RM
37792012-11-02 Roland McGrath <mcgrathr@google.com>
3780
3781 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
3782 from last change.
3783
50ed5eb1
RM
37842012-11-01 Roland McGrath <mcgrathr@google.com>
3785
62fe925a
RM
3786 * target.h (Sized_target::relocate_relocs): Use Elf_Off
3787 for offset_in_output_section parameter.
3788 (Sized_target::relocate_special_relocatable): Likewise.
3789 * arm.cc (Target_arm::relocate_relocs): Likewise.
3790 (Target_arm::relocate_special_relocatable): Likewise.
3791 * i386.cc (Target_i386::relocate_relocs): Likewise.
3792 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
3793 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
3794 * target-reloc.h (relocate_relocs): Likewise.
3795 * testsuite/testfile.cc (Target_test): Likewise.
3796 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
3797 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
3798
3799 * system.h: Move inclusion of <clocale> to after <libintl.h> in
3800 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
3801
3802 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
3803 parameter, which is unused in the [!F_SETFD] case.
3804
50ed5eb1
RM
3805 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
3806 SYMNDX to off_t before comparing it to this->data_size().
3807 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
3808 * incremental.cc (Output_section_incremental_inputs::do_write):
3809 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
3810
2cadc0bf
RM
3811 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
3812
3bfcb652
NC
38132012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
3814
3815 * gold.cc (Target_arm::do_adjust_elf_header): Add the
3816 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
3817 in EABI_VER5.
3818
c1a8d56e
CC
38192012-10-29 Cary Coutant <ccoutant@google.com>
3820
3821 * dwp.cc (usage): Add file and exit status parameters;
3822 add --help and --version options.
3823 (print_version): New function.
3824 (main): Add --help and --version options.
3825
b2490a7b
L
38262012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3827
3828 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
3829 final_layout_sequence.txt.
3830 * testsuite/Makefile.in: Regenerated.
3831
aa543512
L
38322012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3833
3834 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
3835 COMPILE generated by automake.
3836 (LINK1): Likewise.
3837 (CXXCOMPILE1): Likewise.
3838 (CXXLINK1): Likewise.
3839 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
3840 (LINK): Likewise.
3841 (CXXCOMPILE): Likewise.
3842 (CXXLINK): Likewise.
3843 * testsuite/Makefile.in: Regenerated.
3844
d361fafb
L
38452012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3846
3847 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
3848 on bad fwrite return.
3849
598c7410
L
38502012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3851
3852 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
3853 on val.
3854
35c813e2
CC
38552012-10-23 Cary Coutant <ccoutant@google.com>
3856
3857 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
3858 * testsuite/Makefile.in: Regenerate.
3859 * testsuite/dwp_test.h: New source file.
3860 * testsuite/dwp_test_1.cc: New source file.
3861 * testsuite/dwp_test_1.s: New source file.
3862 * testsuite/dwp_test_1.sh: New source file.
3863 * testsuite/dwp_test_1b.cc: New source file.
3864 * testsuite/dwp_test_1b.s: New source file.
3865 * testsuite/dwp_test_2.cc: New source file.
3866 * testsuite/dwp_test_2.s: New source file.
3867 * testsuite/dwp_test_2.sh: New source file.
3868 * testsuite/dwp_test_main.cc: New source file.
3869 * testsuite/dwp_test_main.s: New source file.
3870
77429909
CC
38712012-10-23 Cary Coutant <ccoutant@google.com>
3872
3873 * dwp.h: New header file.
3874 * dwp.cc: New source file.
3875 * gold.h: Move shared declarations to system.h.
3876 * system.h: New header file.
3877 * Makefile.am: Add dwp.
3878 * Makefile.in: Regenerate.
3879
ed5d6712
CC
38802012-10-23 Cary Coutant <ccoutant@google.com>
3881
3882 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
3883 Dwarf_info_reader::read_from_pointer.
3884 (Dwarf_pubnames_table::read_header): Likewise.
3885 (Dwarf_pubnames_table::next_name): Likewise.
3886 (Dwarf_die::read_attributes): Likewise.
3887 (Dwarf_die::skip_attributes): Likewise.
3888 (Dwarf_info_reader::read_from_pointer): New function template.
3889 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
3890 (Dwarf_pubnames_table): Likewise.
3891 (Dwarf_info_reader::read_from_pointer): New function template.
3892 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
3893 Dwarf_pubnames_table ctor.
3894
8787852d
CC
38952012-10-23 Cary Coutant <ccoutant@google.com>
3896
3897 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
3898 abbrev_shndx.
3899 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
3900 abbrev_shndx_.
3901 (Dwarf_info_reader::set_abbrev_shndx): New method.
3902 (Dwarf_info_reader::abbrev_shndx_): New data member.
3903
9fc236f3
CC
39042012-10-23 Cary Coutant <ccoutant@google.com>
3905
3906 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
3907 from object, not parameters.
3908 (Dwarf_info_reader::parse): Likewise.
3909 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
3910 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
3911 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
3912 methods.
3913
effe8365
CC
39142012-10-23 Cary Coutant <ccoutant@google.com>
3915
3916 * fileread.cc (Input_file::Input_file): New constructor.
3917 * fileread.h (class Input_file): Add new constructor.
3918
1698990d
AM
39192012-10-18 Alan Modra <amodra@gmail.com>
3920
3921 PR gold/14727
3922 * object.cc (Relobj::is_section_name_included): Also match
3923 .sdata personality section.
3924
168a4726
AM
39252012-10-18 Alan Modra <amodra@gmail.com>
3926
3927 * target-reloc.h (class Default_comdat_behavior): New, package up..
3928 (get_comdat_behaviour): ..this.
3929 (relocate_section): Add Relocate_comdat_behavior template arg,
3930 adjust code to suit.
3931 * arm.cc (Target_arm::relocate_section): Adjust to suit.
3932 (Target_arm::scan_reloc_section): Likewise.
3933 * i386.cc (Target_i386::relocate_section): Likewise.
3934 * sparc.cc (Target_sparc::relocate_section): Likewise.
3935 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
3936 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
3937 * powerpc.cc (class Relocate_comdat_behavior): New.
3938 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
3939 gold::relocate_section with new template arg.
3940
acc276d8
AM
39412012-10-18 Alan Modra <amodra@gmail.com>
3942
3943 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
3944 dynamic relocs for GOT_TPREL got entries, without symbol if
3945 resolving locally.
3946 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
3947 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
3948 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
3949
e10f9870
AM
39502012-10-17 Alan Modra <amodra@gmail.com>
3951
3952 PR gold/14726
3953 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
3954
ae034989
ST
39552012-10-16 Sriraman Tallam <tmsriram@google.com>
3956
3957 * layout.cc (Layout::include_section): Keep sections marked
3958 SHF_EXCLUDE when doing relocatable links.
3959
f3a0ed29
AM
39602012-10-16 Alan Modra <amodra@gmail.com>
3961
3962 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
3963 (Target_powerpc::do_finalize_sections): Call it.
3964 (Output_data_save_res): New class and supporting functions.
3965 (Target_powerpc::symval_for_branch): Only look up .opd entry for
3966 normal symbols defined in object files.
3967
c6de8ed4
AM
39682012-10-12 Alan Modra <amodra@gmail.com>
3969
3970 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
3971 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
3972 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
3973 section if scan_opd_relocs not yet called.
3974 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
3975
03e25981
AM
39762012-10-12 Alan Modra <amodra@gmail.com>
3977
3978 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
3979 add_local_ifunc_entry): Revert last change.
3980 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
3981
c9824451
AM
39822012-10-05 Alan Modra <amodra@gmail.com>
3983
3984 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
3985 do_plt_address_for_global): New functions.
3986 (Output_data_got_powerpc::do_write): Don't segfault when linking
3987 statically.
3988 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
3989 add_local_ifunc_entry): Return true on adding entry..
3990 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
3991 glink->add_entry call. Remove unused symtab param. Adjust calls.
3992 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
3993 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
3994 set up symbols here.
3995 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
3996 syms here. Do so even when no .iplt. Don't segfault when linking
3997 statically.
3998 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
3999 new variants without reloc param.
4000 (Glink_sym_ent::Glink_sym_ent): Likewise.
4001 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
4002 reloc when refs will resolve to plt call stub.
4003 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
4004 R_PPC_PLTREL24 to resolve locally.
4005 (Target_powerpc::Scan::global): Correct ifunc handling.
4006 (Target_powerpc::Relocate::relocate): Correct local sym glink
4007 lookup. Don't destroy "value" when we have a plt call stub,
4008 and when checking plt call validity.
4009 (Target_powerpc::do_dynsym_value): Simplify.
4010
19fec8c1
AM
40112012-10-05 Alan Modra <amodra@gmail.com>
4012
4013 * i386.cc (Output_data_plt_i386::address_for_global,
4014 address_for_local): Add plt offset to returned value. Adjust uses.
4015 * sparc.cc (Output_data_plt_sparc::address_for_global,
4016 address_for_local): Likewise.
4017 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
4018 address_for_local): Likewise.
4019 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
4020 address_for_local): Likewise.
4021 * target.h (Target::plt_address_for_global, plt_address_for_local):
4022 Update comment.
4023 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
4024 (Output_data_got::Got_entry::write): Nor here.
4025 * output.h: Comment fix.
4026
e867b647
WL
40272012-10-02 Jiong Wang <jiwang@tilera.com>
4028
4029 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
4030 global_offset_table_ value for larget got.
4031 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
4032
e5d5f5ed
AM
40332012-09-29 Alan Modra <amodra@gmail.com>
4034
4035 * powerpc.cc (Target_powerpc::iplt_): New output section.
4036 (Target_powerpc::iplt_section, make_iplt_section,
4037 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
4038 (Target_powerpc::make_plt_entry): Handle ifunc syms.
4039 Target_powerpc::plt_entry_count): Count iplt entries too.
4040 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
4041 reloc section in constructor. New params.
4042 (Target_powerpc::make_plt_section): Create reloc section here instead.
4043 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
4044 functions.
4045 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
4046 (Output_data_glink::add_entry, find_entry): New functions to
4047 deal with local syms.
4048 (Glink_sym_ent): Add support for local syms.
4049 (Output_data_glink::do_write): Handle ifunc plt entries.
4050 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4051 (Target_powerpc::Scan::local, global): Handle ifunc syms.
4052 (Target_powerpc::Relocate::relocate): Likewise.
4053 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
4054
ec4dbad3
AM
40552012-09-25 Alan Modra <amodra@gmail.com>
4056
4057 * object.h (Sized_relobj_file::adjust_local_symbol,
4058 do_adjust_local_symbol): New functions.
4059 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
4060 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
4061 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
4062 and irregular opd entry spacing.
4063 (Powerpc_relobj::do_read_relocs): Add opd size checks.
4064 (Global_symbol_visitor_opd): New functor.
4065 (Target_powerpc::do_finalize_sections): Omit global symbols defined
4066 on deleted opd entries.
4067
5c0b3823
WL
40682012-09-15 Jiong Wang <jiwang@tilera.com>
4069
4070 * tilegx.cc: New file.
4071 * Makefile.am (TARGETSOURCES): Add tilegx.cc
4072 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
4073 * configure.tgt: Add entries for tilegx*.
4074 * configure.ac: Likewise.
4075 * Makefile.in: Rebuild.
4076 * configure: Likewise.
4077 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
4078 tilegx.
4079
bfdfa4cd
AM
40802012-09-13 Alan Modra <amodra@gmail.com>
4081
4082 * target-reloc.h (scan_relocs): Call scan.local for relocs
4083 against symbols in discarded sections. Pass is_discarded
4084 param.
4085 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
4086 Add is_discarded param.
4087 * powerpc (Target_powerpc::Scan::local): Likewise. Use
4088 is_discarded to flag opd entry as discarded. Don't emit dyn
4089 relocs on such entries.
4090 (Target_powerpc::Scan::global): Similarly detect and handle
4091 such opd entries.
4092 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
4093 opd_ent_. Update all uses.
4094 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
4095 (Target_powerpc::relocate_section): Zero out discarded opd
4096 entry relocs.
4097
d77a0555
ILT
40982012-09-12 Ian Lance Taylor <iant@google.com>
4099
4100 PR gold/14570
4101 * output.cc: Rename Output_data_got template parameter from size
4102 to got_size for all functions. Compile all variants of
4103 Output_data_got.
4104 (Output_data_got::Got_entry::write): Correct use of size for
4105 symbol value. Use local_is_tls rather than casting to
4106 Sized_relobj_file.
4107 * object.h (class Object): Add local_is_tls and do_local_is_tls.
4108 (class Sized_relobj_file): Add do_local_is_tls.
4109 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
4110
815a1205
AM
41112012-09-11 Alan Modra <amodra@gmail.com>
4112
4113 PR gold/14566
4114 * layout.cc (Layout::set_segment_offsets): When using
4115 common-page-size alignment, ensure we are on a new max-page-size
4116 page.
4117 * output.cc (Output_segment::set_section_addresses): Use
4118 abi_pagesize, not common_pagesize for relro boundary.
4119 (Output_segment::set_offset): Likewise.
4120
bd73a62d
AM
41212012-09-11 Alan Modra <amodra@gmail.com>
4122
4123 * output.h (Output_data_got::add_global_tls, add_local_tls,
4124 add_local_tls_pair): New functions.
4125 (Output_data_got::add_local_pair_with_rel): Remove second
4126 reloc param. Expand comment.
4127 (Output_data_got::Got_entry): Rename use_plt_offset_ to
4128 use_plt_or_tls_offset_, similarly for constructor param.
4129 (Output_data_got::Got_entry::write): Add got_index param.
4130 * output.cc (Output_data_got::add_global_tls, add_local_tls,
4131 add_local_tls_pair): New functions.
4132 (Output_data_got::Got_entry::write): Handle tls symbols
4133 with use_plt_or_tls_offset_ set specially.
4134 (Output_data_got::add_local_pair_with_rel): Only one reloc.
4135 (Output_data_got::do_write): Replace iterator with index, pass
4136 index to entry write function.
4137 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
4138 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
4139 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
4140 call.
4141 * i386.cc (Target_i386::Scan::local): Likewise.
4142 * sparc.cc (Target_sparc::Scan::local): Likewise.
4143 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
4144 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
4145 do_tls_offset_for_global): New functions.
4146 (Target_powerpc::Scan::local): Correct TLS relocations and got
4147 entry values.
4148 (Target_powerpc::Scan::global): Don't emit unnecessary
4149 dynamic relocations on TLS GOT entries.
4150
00716ab1
AM
41512012-09-10 Matthias Klose <doko@ubuntu.com>
4152
4153 * config.in: Disable sanity check for kfreebsd.
4154
c891b3f9
SA
41552012-09-10 Sterling Augustine <saugustine@google.com>
4156
4157 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
4158 (Gdb_index::pubtypes_read): New parameter.
4159 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
4160 to calls.
4161 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
4162 pubtypes_object_.
4163
e81fea4d
AM
41642012-09-09 Alan Modra <amodra@gmail.com>
4165
4166 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
4167 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
4168 * gc.h (gc_process_relocs): Call target gc_add_reference.
4169 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
4170 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
4171 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
4172 unnecessary cast.
4173 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
4174 to cater for when we don't need code offset. Update use.
4175 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
4176 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
4177 set_opd_valid): New functions.
4178 (Target_powerpc::do_gc_add_reference): New function.
4179 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
4180 stashed refs.
4181 (Target_powerpc::do_gc_mark_symbol): New function.
4182
d2d60eef
CC
41832012-09-06 Cary Coutant <ccoutant@google.com>
4184
4185 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
4186 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
4187 (Dwarf_die::skip_attributes): Likewise.
4188 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
4189 * testsuite/gdb_index_test.cc (inline_func_1): New function.
4190 (main): Call it.
4191 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
4192
32ed4573
L
41932012-09-05 H.J. Lu <hongjiu.lu@intel.com>
4194
4195 * testsuite/script_test_3.t: Add .got.plt output section
4196 statement.
4197 * testsuite/script_test_4.t: Likewise.
4198
f4baf0d4
AM
41992012-09-05 Alan Modra <amodra@gmail.com>
4200
4201 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
4202 update all uses and lose "enum" when using type.
4203
864a1b56
AM
42042012-09-05 Alan Modra <amodra@gmail.com>
4205
4206 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
4207 * configure: Regenerate.
4208 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
4209 (plugin_final_layout.stdout): Likewise.
4210 (memory_test): Set page sizes to 0x1000.
4211 * testsuite/Makefile.in: Regenerate.
4212 * testsuite/discard_locals_test.sh: Add FIXME comment.
4213 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
4214 * testsuite/pr14265.t: Add .got output section statement.
4215 * testsuite/script_test_2.t: Likewise.
4216 * testsuite/script_test_3.t: Likewise.
4217 * testsuite/script_test_4.t: Likewise.
4218 * testsuite/script_test_5.t: Likewise.
4219 * testsuite/script_test_6.t: Likewise.
4220 * testsuite/script_test_7.t: Likewise.
4221 * testsuite/script_test_9.t: Likewise.
4222
3ea0a085
AM
42232012-09-05 Alan Modra <amodra@gmail.com>
4224
4225 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
4226 (Powerpc_relocate_functions::Status): New typedef.
4227 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4228 (Target_powerpc::Scan::local): Handle REL64.
4229 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
4230 for REL32 and REL64.
4231 (Target_powerpc::symval_for_branch): New function, extracted from..
4232 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
4233 checks. Report overflow errors.
4234
7404fe1b
AM
42352012-09-05 Alan Modra <amodra@gmail.com>
4236
4237 * object.h (Sized_relobj_file::emit_relocs): Delete.
4238 (Sized_relobj_file::emit_relocs_reltype): Delete.
4239 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
4240 relocate_relocs for --emit-relocs.
4241 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
4242 * output.h: Update comment.
4243 (Output_segment::first_section): New function.
4244 (Output_segment::first_section_load_address): Use first_section.
4245 * output.cc (Output_segment::first_section): New function extracted..
4246 (Output_segment::first_section_load_address): ..from here. Delete.
4247 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
4248 * target.h (Sized_target::relocate_for_relocatable): Likewise.
4249 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
4250 adjust call to target.h function.
4251 * i386.cc (Target_i386): Likewise.
4252 * sparc.cc (Target_sparc): Likewise.
4253 * x86_64.cc (Target_x86_64): Likewise.
4254 * powerpc.cc (Target_powerpc): Likewise.
4255 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
4256 first tls section has section symbol for optimised local dynamic
4257 output relocs.
4258 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
4259 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
4260 optimised tls code.
4261 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
4262 Rename to relocate_relocs. Update error message.
4263
957564c9
AS
42642012-09-04 Andreas Schwab <schwab@linux-m68k.org>
4265
4266 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
4267 --just-symbols.
4268
dd93cd0a
AM
42692012-08-31 Alan Modra <amodra@gmail.com>
4270
4271 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
4272 (Powerpc_relobj::toc_base_offset): New stub function.
4273 (Target_powerpc): Add tp_offset, dtp_offset. Rename
4274 got_mod_index_offset to tlsld_got_offset. Update all refs.
4275 (Target_powerpc::Relocate::enum skip_tls): New.
4276 (Target_powerpc::call_tls_get_addr_): New var.
4277 (Target_powerpc::is_branch_reloc): Move to file scope.
4278 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
4279 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
4280 New functions.
4281 (Target_powerpc::enum Got_type): Delete old values, add new ones.
4282 (powerpc_info): Correct common_pagesize for ppc64.
4283 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
4284 (Powerpc_relocate_functions): Add overflow check enums and functions.
4285 Add non-shift version of rela, rela_ua. Delete all rel public
4286 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
4287 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
4288 addr16_ha3, addr14 functions.
4289 (Output_data_got_powerpc::add_constant_pair): New function.
4290 (Output_data_got_powerpc::got_base_offset): Likewise.
4291 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
4292 (instruction constants): Sort, add some more.
4293 (Output_data_glink::do_write): Add and use Address typedef. Use
4294 object->toc_base_offset() stub for 64-bit.
4295 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
4296 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4297 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
4298 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
4299 Always treat .opd relocs as against locally defined symbol.
4300 Correct condition for RELATIVE relocs.
4301 (Target_powerpc::do_finalize_sections): Test for NULL sections.
4302 (Target_powerpc::Relocate::relocate): Use plt call stub as value
4303 for 32-bit syms with a plt entry. Correct ppc64 toc base
4304 calculations. Handle TLS relocs, and more. Add overflow
4305 checking and adjust for Powerpc_relocate_functions changes.
4306 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
4307 Reinstate --emit-relocs code with FIXME.
4308
a1373b60
AM
43092012-08-30 Alan Modra <amodra@gmail.com>
4310
4311 * layout.cc (Layout::set_segment_offsets): Set p_align to
4312 abi_pagesize, not common_pagesize.
4313 (Layout::relaxation_loop_body): Similarly use abi_pagesize
4314 to determine whether file header can go in segment.
4315
703d02da
AM
43162012-08-30 Alan Modra <amodra@gmail.com>
4317
4318 * output.h (Output_reloc::Output_reloc <output section>): Add
4319 is_relative param. Adjust calls.
4320 (Output_reloc::add_output_section_relative): New functions.
4321 * output.cc (Output_reloc::Output_reloc <output section>): Handle
4322 is_relative.
4323 (Output_reloc::symbol_value): Handle SECTION_CODE.
4324
16164a6b
ST
43252012-08-24 Sriraman Tallam <tmsriram@google.com>
4326
4327 * gold.cc (queue_middle_tasks): Call layout again when unique
4328 segments for sections is desired.
4329 * layout.cc (Layout::Layout): Initialize new members.
4330 (Layout::get_output_section_flags): New function.
4331 (Layout::choose_output_section): Call get_output_section_flags.
4332 (Layout::layout): Make output section for mapping to a unique segment.
4333 (Layout::insert_section_segment_map): New function.
4334 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 4335 output sections marked so.
16164a6b
ST
4336 (Layout::segment_precedes): Check for unique segments when sorting.
4337 * layout.h (Layout::Unique_segment_info): New struct.
4338 (Layout::Section_segment_map): New typedef.
4339 (Layout::insert_section_segment_map): New function.
4340 (Layout::get_output_section_flags): New function.
4341 (Layout::is_unique_segment_for_sections_specified): New function.
4342 (Layout::set_unique_segment_for_sections_specified): New function.
4343 (Layout::unique_segment_for_sections_specified_): New member.
4344 (Layout::section_segment_map_): New member.
4345 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
4346 Rename is_gc_pass_one to is_pass_one.
4347 Rename is_gc_pass_two to is_pass_two.
4348 Rename is_gc_or_icf to is_two_pass.
4349 Check for which pass based on whether symbols data is present.
4350 Make it two pass when unique segments for sections is desired.
4351 * output.cc (Output_section::Output_section): Initialize new
4352 members.
4353 * output.h (Output_section::is_unique_segment): New function.
4354 (Output_section::set_is_unique_segment): New function.
4355 (Output_section::is_unique_segment_): New member.
4356 (Output_section::extra_segment_flags): New function.
4357 (Output_section::set_extra_segment_flags): New function.
4358 (Output_section::extra_segment_flags_): New member.
4359 (Output_section::segment_alignment): New function.
4360 (Output_section::set_segment_alignment): New function.
4361 (Output_section::segment_alignment_): New member.
4362 (Output_segment::Output_segment): Initialize is_unique_segment_.
4363 (Output_segment::is_unique_segment): New function.
4364 (Output_segment::set_is_unique_segment): New function.
4365 (Output_segment::is_unique_segment_): New member.
4366 * plugin.cc (allow_unique_segment_for_sections): New function.
4367 (unique_segment_for_sections): New function.
4368 (Plugin::load): Add new functions to transfer vector.
4369 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
4370 * Makefile.in: Regenerate.
4371 * testsuite/plugin_final_layout.sh: Check if unique segment
4372 functionality works.
4373 * testsuite/plugin_section_order.c (onload): Check if new interfaces
4374 are available.
4375 (allow_unique_segment_for_sections): New global.
4376 (unique_segment_for_sections): New global.
4377 (claim_file_hook): Call allow_unique_segment_for_sections.
4378 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 4379
1e2bee4f
CC
43802012-08-22 Cary Coutant <ccoutant@google.com>
4381
4382 * layout.cc (Layout::include_section): Don't assert on GROUP
4383 sections with --emit-relocs.
4384
1d5dfe78
CC
43852012-08-21 Cary Coutant <ccoutant@google.com>
4386
4387 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
4388 if --export-dynamic-symbol names an undef symbol.
4389
c9269dff
AM
43902012-08-18 Alan Modra <amodra@gmail.com>
4391
4392 * powerpc.cc: Formatting and white space.
4393 (Powerpc_relobj): Rename got2_section_ to special_.
4394 Add opd_ent_shndx_ and opd_ent_off_ vectors.
4395 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
4396 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
4397 (Target_powerpc): Add Address typedef and invalid_address. Use
4398 throughout.
4399 (Target_powerpc::is_branch_reloc): New function.
4400 (Powerpc_relocate_functions): Add Address typedef, use throughout.
4401 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
4402 for dst_mask, value and addend.
4403 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
4404 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
4405 (Output_data_glink::do_write): Correct toc base. Don't try to use
4406 uint16_t for 24-bit offset. Use get_output_section_offset and
4407 check return.
4408 (Target_powerpc::Scan::local): Handle more relocs.
4409 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
4410 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
4411 Plug in toc restoring insn after plt calls. Translate branches
4412 to function descriptor symbols to corresponding entry point.
4413 (Target_powerpc::relocate_for_relocatable): Check return from
4414 get_output_section_offset.
4415 * symtab.h: Comment typo.
4416
b1759dce
ILT
44172012-08-14 Ian Lance Taylor <iant@google.com>
4418
4419 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
4420 unsupported_relocal_local to call unsupported_reloc_global.
4421
b9b2ae8b
NC
44222012-08-14 Nick Clifton <nickc@redhat.com>
4423
4424 PR ld/14265
4425 * script-sections.cc (Sections_element::output_section_name): Add
4426 keep return parameter.
4427 (Output_section_element::match_name): Add keep return parameter.
4428 Return the value of the keep_ member.
4429 * script-sections.h (class Output_section): Update
4430 output_section_name prototype.
4431 * layout.cc (Layout::keep_input_section): New public member
4432 function.
4433 (Layout::choose_output_section): Pass keep parameter to
4434 output_section_name.
4435 * layout.h (class Layout): Add keep_input_section.
4436 * object.cc (Sized_relobj_file::do_layout): Check for kept input
4437 sections.
4438 * testsuite/Makefile.am: Add a test.
4439 * testsuite/Makefile.in: Regenerate.
4440 * testsuite/pr14265.c: Source file for the test.
4441 * testsuite/pr14265.t: Linker script for the test.
4442 * testsuite/pr14265.sh: Shell script for the test.
4443
921b5322
AM
44442012-08-14 Alan Modra <amodra@gmail.com>
4445
4446 * target.h (Target::output_section_name): New function.
4447 (Target::do_output_section_name): New function.
4448 * layout.cc (Layout::choose_output_section): Call the above.
4449 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
4450
6ce78956
AM
44512012-08-14 Alan Modra <amodra@gmail.com>
4452
4453 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
4454 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
4455 for replace_constant call.
4456 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
4457 (Output_data_glink::do_print_to_mapfile): New function.
4458 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
4459 (Target_powerpc::Relocate::relocate): Likewise.
4460
d1a8cabd
AM
44612012-08-14 Alan Modra <amodra@gmail.com>
4462
4463 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
4464 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
4465 (Output_data_glink::add_entry,find_entry): Remove shndx param.
4466 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
4467 all references to shndx_. Handle special case for R_PPC_PLTREL24
4468 here.
4469 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
4470 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
4471 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
4472 here.
4473 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
4474 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
4475
d83ce4e3
AM
44762012-08-12 Alan Modra <amodra@gmail.com>
4477
4478 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
4479 (glink insn constants): Use uint32_t.
4480 (Output_data_glink::add_entry): Use insert, not [] operator.
4481
cf43a2fe
AM
44822012-08-11 Alan Modra <amodra@gmail.com>
4483
4484 * object.h (Sized_relobj_file::find_shdr): New function.
4485 (Sized_relobj_file::find_special_sections): New function.
4486 * object.cc (Sized_relobj_file::find_shdr): New function.
4487 (Sized_relobj_file::find_eh_frame): Use find_shdr.
4488 (Sized_relobj_file::find_special_sections): New function, split out..
4489 (Sized_relobj_file::do_read_symbols): ..from here.
4490 * output.h (Output_data_got::replace_constant): New function.
4491 (Output_data_got::num_entries): New function.
4492 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
4493 (Output_data_got::got_offset): Protected rather than private.
4494 (Output_data_got::replace_got_entry): New function.
4495 * output.cc (Output_data_got::replace_got_entry): New function.
4496 * powerpc.cc (class Powerpc_relobj): New.
4497 (class Powerpc_relocate_functions): Delete all psymval variants or
4498 convert to value,addend type. Delete pcrela, pcrela_unaligned.
4499 Implement _ha functions using corresponding _hi function.
4500 (Powerpc_relobj::find_special_sections): New function.
4501 (Target_powerpc::do_make_elf_object): New function.
4502 (class Output_data_got_powerpc): New.
4503 (class Output_data_glink): New.
4504 (class Powerpc_scan_relocatable_reloc): New.
4505 Many more changes througout file.
4506
3c892704
NC
45072012-08-09 Nick Clifton <nickc@redhat.com>
4508
4509 * po/vi.po: Updated Vietnamese translation.
4510
82435b3b
ILT
45112012-08-07 Ian Lance Taylor <iant@google.com>
4512
4513 * layout.cc (Layout::add_target_dynamic_tags): If
4514 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
4515 plt_rel.
4516
a6dc81d2
NC
45172012-07-30 Nick Clifton <nickc@redhat.com>
4518
4519 * po/gold.pot: Updated template.
4520 * po/es.po: Updated Spanish translation.
4521
f1415016
CC
45222012-07-18 Cary Coutant <ccoutant@google.com>
4523
4524 PR gold/14344
4525 * configure.ac: Add check for -gpubnames support.
4526 * configure: Regenerate.
4527 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
4528 support; force -gno-pubnames.
4529 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
4530 support.
4531 (gdb_index_test_4): New test.
4532 * testsuite/Makefile.in: Regenerate.
4533 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
4534 * testsuite/gdb_index_test_2.sh: Likewise.
4535 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
4536 * testsuite/gdb_index_test_4.sh: New script.
4537 * testsuite/gdb_index_test_comm.sh: New script with common code;
4538 don't look for space after colon.
4539
b7fd7c37
ST
45402012-07-16 Sriraman Tallam <tmsriram@google.com>
4541
4542 * gold.cc (queue_middle_tasks): Update function order only after
4543 deferred objects due to plugins are processed.
4544
1f3212db
ILT
45452012-07-11 Ian Lance Taylor <iant@google.com>
4546
4547 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
4548 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
4549 (Target_arm::scan_reloc_for_stub): Likewise.
4550 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
4551 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
4552 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
4553 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
4554 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
4555
81c82a68
ILT
45562012-07-10 Dodji Seketeli <dodji@redhat.com>
4557 Ian Lance Taylor <iant@google.com>
4558
4559 PR gold/14309
4560 * configure.ac: Test whether std::tr1::hash<off_t> works.
4561 * gold.h: Add a specialization for std::tr1::hash<off_t> if
4562 needed.
4563 * output.h (class Output_fill): Add virtual destructor.
4564 * configure, config.in: Rebuild.
4565
eabc84f4
RM
45662012-06-22 Roland McGrath <mcgrathr@google.com>
4567
4568 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
4569
370e30b6
RÁE
45702012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
4571
4572 * plugin.cc (Plugin::load): Handle position independent executables.
4573
fb1b895d
CC
45742012-06-06 Cary Coutant <ccoutant@google.com>
4575
4576 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
4577 add .debug_macro.
4578 (lines_only_debug_sections): Likewise.
4579 (gdb_fast_lookup_sections): New static array.
4580 (is_gdb_debug_section): Rename formal parameter.
4581 (is_lines_only_debug_section): Likewise.
4582 (is_gdb_fast_lookup_section): New function.
4583 (Layout::include_section): Check for ".zdebug_" prefix; pass
4584 section name suffix to is_gdb_debug_section, et al.; check for
4585 fast-lookup sections when building .gdb_index.
4586 * options.h (--strip-debug-gdb): Update GDB version number.
4587
7c0640fa
CC
45882012-06-06 Cary Coutant <ccoutant@google.com>
4589
4590 * configure.ac: Add check for fallocate.
4591 * configure: Regenerate.
4592 * config.in: Regenerate.
4593
4594 * options.h (class General_options): Add --mmap-output-file and
4595 --posix-fallocate options.
4596 * output.cc: (posix_fallocate): Remove; replace with...
4597 (gold_fallocate): New function.
4598 (Output_file::map_no_anonymous): Call gold_fallocate.
4599 (Output_file::map): Check --mmap-output-file option.
4600
2a49eb69
DK
46012012-06-05 Jing Yu <jingyu@google.com>
4602
4603 * gold.h (textdomain): Add do {} to empty while(0).
4604 (bindtextdomain): Likewise.
4605
fad072ac
CC
46062012-06-04 Cary Coutant <ccoutant@google.com>
4607
4608 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
4609 has_dynsym_index.
4610
8cc69fb6
ST
46112012-05-25 Sriraman Tallam <tmsriram@google.com>
4612
4613 * symtab.cc (Symbol_table::define_special_symbol):
4614 Initialize *poldsym to prevent uninitialized variable errors.
4615
1be75daa
CC
46162012-05-23 Cary Coutant <ccoutant@google.com>
4617
4618 * layout.cc (Layout::section_name_mapping): Add rules to handle
4619 exact match on .data.rel.ro.local or .data.rel.ro.
4620 (Layout::output_section_name): Check for exact matches.
4621
9b689de0
CC
46222012-05-23 Cary Coutant <ccoutant@google.com>
4623
4624 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
4625 more carefully.
4626
b24fdbf5
CC
46272012-05-22 Cary Coutant <ccoutant@google.com>
4628
4629 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
4630 object before exporting symbol.
4631
e550e1a2
L
46322012-05-21 H.J. Lu <hongjiu.lu@intel.com>
4633
4634 * testsuite/tls_test.cc: Include "config.h" first.
4635 * testsuite/tls_test_c.c: Likewise.
4636
df7b86aa
NC
46372012-05-17 Daniel Richard G. <skunk@iskunk.org>
4638 Nick Clifton <nickc@redhat.com>
4639
4640 PR 14072
4641 * configure.in: Add check that sysdep.h has been included before
4642 any system header files.
4643 * configure: Regenerate.
4644 * config.in: Regenerate.
4645
1007b503
CC
46462012-05-14 Cary Coutant <ccoutant@google.com>
4647
4648 * layout.cc (Layout::make_output_section): Mark .tdata section
4649 as RELRO.
4650 * testsuite/relro_test.cc: Add a TLS variable.
4651
fd885f3a
L
46522012-05-10 H.J. Lu <hongjiu.lu@intel.com>
4653
4654 PR gold/14091
4655 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
4656 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
4657 R_X86_64_64.
4658
80f5885c
CC
46592012-05-08 Cary Coutant <ccoutant@google.com>
4660
4661 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
4662 (lines_only_debug_sections): Likewise.
4663
2e702c99
RM
46642012-05-02 Roland McGrath <mcgrathr@google.com>
4665
4666 * nacl.cc: New file.
4667 * nacl.h: New file.
4668 * Makefile.am (CCFILES, HFILES): Add them.
4669 * Makefile.in: Regenerate.
4670 * i386.cc (Output_data_plt_i386_nacl): New class.
4671 (Output_data_plt_i386_nacl_exec): New class.
4672 (Output_data_plt_i386_nacl_dyn): New class.
4673 (Target_i386_nacl): New class.
4674 (Target_selector_i386_nacl): New class.
4675 (target_selector_i386): Use it instead of Target_selector_i386.
4676 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
4677 (Target_x86_64_nacl): New class.
4678 (Target_selector_x86_64_nacl): New class.
4679 (target_selector_x86_64, target_selector_x32): Use it instead of
4680 Target_selector_x86_64.
4681 * arm.cc (Output_data_plt_arm_nacl): New class.
4682 (Target_arm_nacl): New class.
4683 (Target_selector_arm_nacl): New class.
4684 (target_selector_arm, target_selector_armbe): Use it instead of
4685 Target_selector_arm.
4686
4687 * target-select.cc (select_target): Take new Input_file* and off_t
4688 arguments, pass them on to recognize method of selector.
4689 * object.cc (make_elf_sized_object): Update caller.
4690 * parameters.cc (parameters_force_valid_target): Likewise.
4691 * incremental.cc (make_sized_incremental_binary): Likewise.
4692 * target-select.h: Update decl.
4693 (Target_selector::recognize): Take new Input_file* argument,
4694 pass it on to do_recognize.
4695 (Target_selector::do_recognize): Take new Input_file* argument.
4696 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
4697 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
4698 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
4699 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
4700
4701 * target.h (Target::Target_info): New members isolate_execinstr
4702 and rosegment_gap.
4703 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
4704 * arm.cc (Target_arm::arm_info): Update initializer.
4705 * i386.cc (Target_i386::i386_info): Likewise.
4706 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
4707 * sparc.cc (Target_sparc::sparc_info): Likewise.
4708 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
4709 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
4710 * layout.cc (Layout::attach_allocated_section_to_segment):
4711 Take new const Target* argument. If target->isolate_execinstr(), act
4712 like --rosegment.
4713 (Layout::find_first_load_seg): Take new const Target* argument;
4714 if target->isolate_execinstr(), reject PF_X segments.
4715 (Layout::relaxation_loop_body): Update caller.
4716 (Layout::set_segment_offsets): If target->isolate_execinstr(),
4717 reset file offset to zero when we hit LOAD_SEG, and then do a second
4718 loop over the segments before LOAD_SEG to reassign offsets after
4719 addresses have been determined. Handle target->rosegment_gap().
4720 (Layout::attach_section_to_segment): Take new const Target* argument;
4721 pass it to attach_allocated_section_to_segment.
4722 (Layout::make_output_section): Update caller.
4723 (Layout::attach_sections_to_segments): Take new const Target* argument;
4724 pass it to attach_section_to_segment.
4725 * gold.cc (queue_middle_tasks): Update caller.
4726 * layout.h (Layout): Update method decls with new arguments.
4727
4728 * arm.cc (Target_arm::Target_arm): Take optional argument for the
4729 Target_info pointer to use.
4730 (Target_arm::do_make_data_plt): New virtual method.
4731 (Target_arm::make_data_plt): New method that calls it.
4732 (Target_arm::make_plt_entry): Use it.
4733 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
4734 for the section alignment.
4735 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
4736 method.
4737 (Output_data_plt_arm::first_plt_entry_offset): Call it.
4738 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
4739 method.
4740 (Output_data_plt_arm::get_plt_entry_size): Call it.
4741 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
4742 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
4743 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
4744 method.
4745 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
4746 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
4747 method instead of sizeof(plt_entry).
4748 (Output_data_plt_arm::add_entry): Likewise.
4749 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
4750 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
4751 than static method.
4752 (Target_arm::plt_entry_size): Likewise.
4753 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
4754 Move to ...
4755 (Output_data_plt_arm_standard): ... here, new class.
4756 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
4757 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
4758 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
4759
4760 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
4761 Take additional argument for the PLT entry size.
4762 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
4763 Use get_plt_entry_size method rather than plt_entry_size variable.
4764 (Output_data_plt_x86_64::reserve_slot): Likewise.
4765 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
4766 (Output_data_plt_x86_64::add_entry): Likewise.
4767 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
4768 (Output_data_plt_x86_64::address_for_global): Likewise.
4769 (Output_data_plt_x86_64::address_for_local): Likewise.
4770 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4771 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
4772 Make method non-static.
4773 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
4774 method.
4775 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
4776 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
4777 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
4778 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
4779 virtual method.
4780 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
4781 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
4782 virtual method.
4783 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
4784 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
4785 virtual method.
4786 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
4787 (Output_data_plt_x86_64::plt_entry_size)
4788 (Output_data_plt_x86_64::first_plt_entry)
4789 (Output_data_plt_x86_64::plt_entry)
4790 (Output_data_plt_x86_64::tlsdesc_plt_entry)
4791 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
4792 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
4793 (Output_data_plt_x86_64_standard): ... here, new class.
4794 (Target_x86_64::Target_x86_64): Take optional argument for the
4795 Target_info pointer to use.
4796 (Target_x86_64::do_make_data_plt): New virtual method.
4797 (Target_x86_64::make_data_plt): New method to call it.
4798 (Target_x86_64::init_got_plt_for_update): Use that.
4799 Call this->plt_->add_eh_frame method here.
4800 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
4801 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
4802 rather than static method.
4803 (Target_x86_64::plt_entry_size): Likewise.
4804 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
4805 rather than plt_entry_size variable. Move guts of PLT filling to...
4806 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
4807 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
4808 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
4809
4810 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
4811 additional argument for the section alignment.
4812 Don't do add_eh_frame_for_plt here.
4813 (Output_data_plt_i386::first_plt_entry_offset): Make the method
4814 non-static. Use get_plt_entry_size method rather than plt_entry_size
4815 variable.
4816 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
4817 method.
4818 (Output_data_plt_i386::get_plt_entry_size): Call it.
4819 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
4820 (Output_data_plt_i386::add_eh_frame): New method to call it.
4821 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
4822 method.
4823 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
4824 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
4825 method.
4826 (Output_data_plt_i386::fill_plt_entry): New method to call it.
4827 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
4828 method instead of plt_entry_size.
4829 (Output_data_plt_i386::plt_entry_size)
4830 (Output_data_plt_i386::plt_eh_frame_fde_size)
4831 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
4832 (Output_data_plt_i386_standard): ... here, new class.
4833 (Output_data_plt_i386_exec): New class.
4834 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
4835 (Output_data_plt_i386_exec::first_plt_entry): ... here.
4836 (Output_data_plt_i386::exec_plt_entry): Move to ...
4837 (Output_data_plt_i386_exec::plt_entry): ... here.
4838 (Output_data_plt_i386_dyn): New class.
4839 (Output_data_plt_i386::first_plt_entry): Move to ...
4840 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
4841 (Output_data_plt_i386::dyn_plt_entry): Move to ...
4842 (Output_data_plt_i386_dyn::plt_entry): ... here.
4843 (Target_i386::Target_i386): Take optional argument for the Target_info
4844 pointer to use.
4845 (Target_i386::do_make_data_plt): New virtual method.
4846 (Target_i386::make_data_plt): New method to call it.
4847 (Target_i386::make_plt_section): Use that.
4848 Call this->plt_->add_eh_frame method here.
4849 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
4850 rather than plt_entry_size variable.
4851 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
4852 (Output_data_plt_i386::address_for_local): Likewise.
4853 (Output_data_plt_i386::do_write): Likewise.
4854 Move guts of PLT filling to...
4855 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
4856 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
4857 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
4858 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
4859
b9b9f2ee
CC
48602012-05-01 Cary Coutant <ccoutant@google.com>
4861
4862 * dwarf_reader.cc (Dwarf_die::read_attributes)
4863 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
4864 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
4865 * reduced_debug_output.cc
4866 (Output_reduced_debug_info_section::get_die_end): Remove
4867 DW_FORM_GNU_ref_index. Add default case.
4868
57923f48
MW
48692012-04-26 Mark Wielaard <mjw@redhat.com>
4870
4871 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
4872 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
4873 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
4874 DW_AT_high_pc as offset from DW_AT_low_pc.
4875
4876 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
4877 * testsuite/Makefile.in: Regenerate.
4878 * testsuite/gdb_index_test_3.c: New test source file.
4879 * testsuite/gdb_index_test_3.sh: New test source file.
4880
2c54b4f4
ILT
48812012-04-25 Ian Lance Taylor <iant@google.com>
4882
4883 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
4884 pointer.
4885 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
4886 as a class, not a struct.
4887 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
4888 (Target_arm::apply_cortex_a8_workaround): Likewise.
4889 * gc.h: Declare Reloc_types as a struct, not a class.
4890 * object.h: Declare Symbols_data as a struct.
4891 * reloc.h: Declare Read_relocs_data as a struct.
4892 * target.h: Declare Relocate_info as a struct.
4893
a5a5f7a3
DM
48942012-04-24 David S. Miller <davem@davemloft.net>
4895
4896 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
4897 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
4898 and R_SPARC_WPLT30.
4899
f038d496
CC
49002012-04-24 Cary Coutant <ccoutant@google.com>
4901
4902 * incremental-dump.cc (find_input_containing_global): Replace
4903 magic number with symbolic constant.
4904 (dump_incremental_inputs): Update version number.
4905 * incremental.cc (Output_section_incremental_inputs): Update version
4906 number; import symbolic constants from Incremental_inputs_reader.
4907 (Incremental_inputs::create_data_sections): Align relocations
4908 section correctly for 64-bit targets.
4909 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
4910 constants; add padding.
4911 (Output_section_incremental_inputs::write_header): Add assert for
4912 header_size.
4913 (Output_section_incremental_inputs::write_input_files): Add assert
4914 for input_entry_size.
4915 (Output_section_incremental_inputs::write_info_blocks): Add padding;
4916 add assert for object_info_size, input_section_entry_size,
4917 global_sym_entry_size.
4918 * incremental.h (Incremental_inputs_reader): Add symbolic constants
4919 for data structure sizes; use them.
4920 (Incremental_input_entry_reader): Import symbolic constants from
4921 Incremental_inputs_reader; use them.
4922
a4d85145
DM
49232012-04-23 David S. Miller <davem@davemloft.net>
4924
4925 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
4926 and elf_flags_set_.
4927 (Target_sparc::Target_sparc): Initialize new fields.
4928 (Target_sparc::do_make_elf_object): New function.
4929 (Target_sparc::do_adjust_elf_header): New function.
4930
1d509098
CC
49312012-04-23 Cary Coutant <ccoutant@google.com>
4932
4933 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
4934 CU range table of gdb index.
4935
7ebeff7f
DM
49362012-04-20 David S. Miller <davem@davemloft.net>
4937
4938 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
4939 instead of false.
4940
13cf9988
DM
49412012-04-16 David S. Miller <davem@davemloft.net>
4942
2a1079e8
DM
4943 * sparc.cc (Target_sparc::got_address): New function.
4944 (Sparc_relocate_functions::gdop_hix22): New function.
4945 (Sparc_relocate_functions::gdop_lox10): New function.
4946 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
4947 relocs.
4948 (Target_sparc::Scan::local): Likewise if the global symbol is not
4949 preemptible and is not IFUNC.
4950 (Target_sparc::Relocate::relocate): Perform GOTDATA code
4951 transformations for local and non-preemptible non-IFUNC global
4952 symbols.
4953
0bc964fc
DM
4954 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
4955 writing out 64-bit part of ranges.
4956
661d7a80
DM
4957 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
4958 -fpic and -fpie respectively.
4959 * Makefile.in: Regenerate.
4960
8c2bf391
DM
4961 * sparc.cc (class Target_sparc): Add rela_ifunc_.
4962 (Target_sparc::Target_sparc): Initialize new field.
4963 (Target_sparc::do_plt_section_for_global): New function.
4964 (Target_sparc::do_plt_section_for_local): New function.
4965 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
4966 (Target_sparc::make_plt_section): New function, broken out of
4967 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
4968 (Target_sparc::make_plt_entry): Call make_plt_section.
4969 (Target_sparc::make_local_ifunc_plt_entry): New function.
4970 (Target_sparc::rela_ifunc_section): New function.
4971 (Target_sparc::plt_section): Remove const.
4972 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
4973 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
4974 and ifunc_count_ fields.
4975 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
4976 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
4977 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
4978 (Output_data_plt_sparc::rela_ifunc): New function.
4979 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
4980 (Output_data_plt_sparc::has_ifunc_section): New function.
4981 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
4982 (Output_data_plt_sparc::address_for_global): New function.
4983 (Output_data_plt_sparc::address_for_local): New function.
4984 (Output_data_plt_sparc::plt_index_to_offset): New function.
4985 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
4986 and entry_count.
4987 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
4988 entry_count.
4989 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
4990 R_SPARC_JMP_IREL to switch.
4991 (Target_sparc::Scan::check_non_pic): Likewise.
4992 (Target_sparc::Scan::local): Handle IFUNC symbols.
4993 (Target_sparc::Scan::local): Likewise.
4994 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
4995 and plt_address_for_local.
4996 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
4997 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
4998
13cf9988
DM
4999 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
5000 (class Output_data_reloc): Adjust calls to Output_reloc_type.
5001 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
5002 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
5003 global relocs too.
5004 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
5005 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
5006 calls.
5007 * sparc.cc (Target_sparc::Scan::global): Likewise.
5008 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
5009
31821be0
CC
50102012-04-16 Cary Coutant <ccoutant@google.com>
5011
5012 * archive.cc (Library_base::should_include_member): Check for
5013 --export-dynamic-symbol.
5014 * options.h (class General_options): Add --export-dynamic-symbol.
5015 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
5016 --export-dynamic-symbol.
5017 (Symbol_table::gc_mark_undef_symbols): Likewise.
5018 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
5019
2615994e
DM
50202012-04-12 David S. Miller <davem@davemloft.net>
5021
5022 * sparc.cc (Reloc::wdisp10): New relocation method.
5023 (Reloc::h34): Likewise.
5024 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
5025 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
5026 R_SPARC_WDISP10.
5027 (Target_sparc::Scan::local): Likewise.
5028 (Target_sparc::Scan::global): Likewise.
5029 (Target_sparc::Relocate::relocate): Likewise.
5030
6782735d
CC
50312012-04-09 Cary Coutant <ccoutant@google.com>
5032
5033 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
5034 low_pc == 0.
5035
8c7a0b00
ILT
50362012-04-06 Ian Lance Taylor <iant@google.com>
5037
5038 * timer.cc: #include <unistd.h>.
5039
58797674
RM
50402012-04-06 Roland McGrath <mcgrathr@google.com>
5041
5042 * configure.in (AC_CHECK_HEADERS): Add locale.h.
5043 * config.in: Regenerate.
5044 * configure: Regenerate.
5045
44350750
NC
50462012-04-05 Nick Clifton <nickc@redhat.com>
5047
5048 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
5049 (AM_LC_MESSAGES): Add.
5050 * aclocal.m4: Regenerate.
5051 * config.in: Regenerate.
5052 * configure: Regenerate.
5053
c1027032
CC
50542012-03-21 Cary Coutant <ccoutant@google.com>
5055
5056 * Makefile.am: Add gdb-index.cc, gdb-index.h.
5057 * Makefile.in: Regenerate.
5058 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
5059 (Sized_elf_reloc_mapper::symbol_section): New function.
5060 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
5061 (make_elf_reloc_mapper): New function.
5062 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
5063 (Dwarf_abbrev_table::do_read_abbrevs): New function.
5064 (Dwarf_abbrev_table::do_get_abbrev): New function.
5065 (Dwarf_ranges_table::read_ranges_table): New function.
5066 (Dwarf_ranges_table::read_range_list): New function.
5067 (Dwarf_pubnames_table::read_section): New function.
5068 (Dwarf_pubnames_table::read_header): New function.
5069 (Dwarf_pubnames_table::next_name): New function.
5070 (Dwarf_die::Dwarf_die): New function.
5071 (Dwarf_die::read_attributes): New function.
5072 (Dwarf_die::skip_attributes): New function.
5073 (Dwarf_die::set_name): New function.
5074 (Dwarf_die::set_linkage_name): New function.
5075 (Dwarf_die::attribute): New function.
5076 (Dwarf_die::string_attribute): New function.
5077 (Dwarf_die::int_attribute): New function.
5078 (Dwarf_die::uint_attribute): New function.
5079 (Dwarf_die::ref_attribute): New function.
5080 (Dwarf_die::child_offset): New function.
5081 (Dwarf_die::sibling_offset): New function.
5082 (Dwarf_info_reader::check_buffer): New function.
5083 (Dwarf_info_reader::parse): New function.
5084 (Dwarf_info_reader::do_parse): New function.
5085 (Dwarf_info_reader::do_read_string_table): New function.
5086 (Dwarf_info_reader::lookup_reloc): New function.
5087 (Dwarf_info_reader::get_string): New function.
5088 (Dwarf_info_reader::visit_compilation_unit): New function.
5089 (Dwarf_info_reader::visit_type_unit): New function.
5090 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
5091 Sized_elf_reloc_mapper.
5092 (Sized_dwarf_line_info::symbol_section): Remove function.
5093 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
5094 (Sized_dwarf_line_info::read_line_mappings): Remove object
5095 parameter, adjust callers.
5096 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
5097 * dwarf_reader.h: Include <sys/types.h>.
5098 (class Track_relocs): Remove forward declaration.
5099 (class Elf_reloc_mapper): New class.
5100 (class Sized_elf_reloc_mapper): New class.
5101 (class Dwarf_abbrev_table): New class.
5102 (class Dwarf_range_list): New class.
5103 (class Dwarf_ranges_table): New class.
5104 (class Dwarf_pubnames_table): New class.
5105 (class Dwarf_die): New class.
5106 (class Dwarf_info_reader): New class.
5107 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
5108 (Sized_dwarf_line_info::symbol_section): Remove member function.
5109 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
5110 base class.
5111 * gdb-index.cc: New source file.
5112 * gdb-index.h: New source file.
5113 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
5114 and .debug_types sections, call Layout::add_to_gdb_index.
5115 (Sized_relobj_incr::do_section_name): Implement.
5116 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
5117 return type; Implement.
5118 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
5119 return type.
5120 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
5121 parameter list and return type.
5122 (Sized_incr_dynobj::do_section_contents): Likewise.
5123 * layout.cc: Include gdb-index.h.
5124 (Layout::Layout): Initialize gdb_index_data_.
5125 (Layout::init_fixed_output_section): Check for .gdb_index section.
5126 (Layout::add_to_gdb_index): New function. Instantiate.
5127 * layout.h: Add forward declaration for class Gdb_index.
5128 (Layout::add_to_gdb_index): New member function.
5129 (Layout::gdb_index_data_): New data member.
5130 * main.cc: Include gdb-index.h.
5131 (main): Print statistics for gdb index.
5132 * object.cc (Object::section_contents): Move code into
5133 do_section_contents.
5134 (need_decompressed_section): Check for sections needed when building
5135 gdb index.
5136 (build_compressed_section_map): Likewise.
5137 (Sized_relobj_file::do_read_symbols): Need local symbols when building
5138 gdb index.
5139 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
5140 sections; call Layout::add_to_gdb_index.
5141 (Sized_relobj_file::do_decompressed_section_contents): Call
5142 do_section_contents directly.
5143 * object.h (Object::do_section_contents): Adjust parameter list and
5144 return type.
5145 (Object::do_decompressed_section_contents): Call do_section_contents
5146 directly.
5147 (Sized_relobj_file::do_section_contents): Adjust parameter list and
5148 return type.
5149 * options.h (class General_options): Add --gdb-index option.
5150 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
5151 list and return type.
5152 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
5153 * reloc.h (Track_relocs::checkpoint): New function.
5154 (Track_relocs::reset): New function.
5155
5156 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
5157 New test cases.
5158 * testsuite/Makefile.in: Regenerate.
5159 * testsuite/gdb_index_test.cc: New test source file.
5160 * testsuite/gdb_index_test_1.sh: New test source file.
5161 * testsuite/gdb_index_test_2.sh: New test source file.
5162
647f1574
DK
51632012-03-19 Doug Kwan <dougkwan@google.com>
5164
5165 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 5166 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
5167 __exidx_start and __exidx_end. Make symbol table parameter
5168 anonymous as it is not used.
5169 * gold.cc (queue_middle_tasks): Call target hook to define any
5170 target-specific symbols.
5171 * target.h (Target::define_standard_symbols): New method.
5172 (Target::do_define_standard_symbols): Same.
5173 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
5174 * testsuite/Makefile.in: Regenerate.
5175 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
5176 and __exidx_end.
5177 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
5178 relocations are generated for __exidx_start and __exidx_end.
5179
7c6109da
DK
51802012-03-16 Doug Kwan <dougkwan@google.com>
5181
5182 * testsuite/Makefile.am: Disable test initpri3b.
5183 * testsuite/Makefile.in: Regenerate.
5184
7b8957f8
DK
51852012-03-15 Doug Kwan <dougkwan@google.com>
5186
5187 * arm.cc (Target_arm::got_section): Make .got section read-only
5188 if -z now is given.
5189
14dc9ef7
ILT
51902012-03-15 Ian Lance Taylor <iant@google.com>
5191
5192 PR gold/13850
5193 * layout.cc (Layout::make_output_section): Correctly mark
5194 SHT_INIT_ARRAY, et. al., as relro.
5195
fa40b62a
DK
51962012-03-14 Doug Kwan <dougkwan@google.com>
5197
5198 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
5199 dynamic relocations for protected symbols in shared objects.
5200
fd325007
ILT
52012012-03-13 Ian Lance Taylor <iant@google.com>
5202
5203 * resolve.cc (Symbol_table::resolve): When merging common symbols,
5204 keep the larger alignment.
5205
e8dd54e1
CC
52062012-03-12 Cary Coutant <ccoutant@google.com>
5207
5208 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
5209 handling of DW_LNE_define_file.
5210
feb5f3b0
CC
52112012-03-12 Cary Coutant <ccoutant@google.com>
5212
5213 * reduced_debug_output.cc
5214 (Output_reduced_debug_info_section::get_die_end): Add new FORM
5215 codes to switch.
5216
a1fb4256
CC
52172012-02-29 Cary Coutant <ccoutant@google.com>
5218
5219 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
5220
5dd8762a
CC
52212012-02-29 Cary Coutant <ccoutant@google.com>
5222
5223 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
5224 Call Object::decompressed_section_contents.
5225 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
5226 New dtor.
5227 (Sized_dwarf_line_info::buffer_start_): New data member.
5228 * merge.cc (Output_merge_data::do_add_input_section): Call
5229 Object::decompressed_section_contents.
5230 (Output_merge_string::do_add_input_section): Likewise.
5231 * object.cc (need_decompressed_section): New function.
5232 (build_compressed_section_map): Decompress sections needed later.
5233 (Sized_relobj_file::do_decompressed_section_contents): New function.
5234 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5235 * object.h (Object::decompressed_section_contents): New function.
5236 (Object::discard_decompressed_sections): New function.
5237 (Object::do_decompressed_section_contents): New function.
5238 (Object::do_discard_decompressed_sections): New function.
5239 (Compressed_section_info): New type.
5240 (Compressed_section_map): Include decompressed section contents.
5241 (Sized_relobj_file::do_decompressed_section_contents): New function.
5242 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5243
7b5de7ee
CC
52442012-02-16 Cary Coutant <ccoutant@google.com>
5245
5246 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
5247 * testsuite/Makefile.in: Regenerate.
5248
f9fa4a63
CC
52492012-02-14 Cary Coutant <ccoutant@google.com>
5250
5251 * options.cc (General_options::finalize): Disallow -pie and -static.
5252
2c175ebc
DK
52532012-02-03 Doug Kwan <dougkwan@google.com>
5254
5255 * arm.cc (Arm_relocate_functions::abs8,
5256 Arm_relocate_functions::abs16): Use
5257 Bits::has_signed_unsigned_overflow32.
5258 (Arm_relocate_functions::thm_abs8): Correct range of
5259 overflow check.
5260 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
5261 in assertions.
5262
90cff06f
DK
52632012-02-02 Doug Kwan <dougkwan@google.com>
5264
5265 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
5266 position independent outputs, not just shared objects.
5267
63887f3d
L
52682012-01-30 H.J. Lu <hongjiu.lu@intel.com>
5269
5270 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
5271 * configure: Regenerated.
5272
bef2b434
ILT
52732012-01-27 Ian Lance Taylor <iant@google.com>
5274
5275 * reloc.h (Bits): New class with static functions, copied from
5276 namespace utils in arm.cc.
5277 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
5278 instead.
5279
c335b55d
L
52802012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5281
5282 * incremental.cc (write_info_blocks): Correct relocation offset.
5283
41194d9f
L
52842012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5285
5286 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
5287 (Relocate::tls_gd_to_le): Likewise.
5288
1bae613c
L
52892012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5290
5291 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
5292
24482ca0
L
52932012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5294
5295 * configure.ac: Check if -mcmodel=medium works.
5296 * configure: Regenerated.
5297
c2c7840a
CC
52982012-01-24 Cary Coutant <ccoutant@google.com>
5299
5300 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
5301 definition and ...
5302 (read_unsigned_LEB_128_x): ... this new function.
5303 (read_signed_LEB_128): Replaced with inline definition and ...
5304 (read_signed_LEB_128_x): ... this new function.
5305 * int_encoding.h (read_unsigned_LEB_128_x): New function.
5306 (read_unsigned_LEB_128): Add inline definition.
5307 (read_signed_LEB_128_x): New function.
5308 (read_signed_LEB_128): Add inline definition.
5309 * testsuite/Makefile.am (leb128_unittest): New unit test.
5310 * testsuite/Makefile.in: Regenerate.
5311 * testsuite/leb128_unittest.cc: New unit test.
5312
833de760 53132012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
5314
5315 PR gold/13617
5316 * i386.cc (Target_i386::do_code_fill): When using a jmp
5317 instruction, pad with nop instructions.
5318 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5319
618d6666
L
53202012-01-22 H.J. Lu <hongjiu.lu@intel.com>
5321
5322 * x86_64.cc (gc_process_relocs): Add typename on types used in
5323 template.
5324 (scan_relocs): Likewise.
5325 (relocate_section): Likewise.
5326 (apply_relocation): Likewise.
5327
3660ff06
L
53282012-01-10 H.J. Lu <hongjiu.lu@intel.com>
5329
5330 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
5331 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
5332 under x32.
5333
fc51264f
L
53342012-01-09 H.J. Lu <hongjiu.lu@intel.com>
5335
5336 * x86_64.cc: Initial support for x32.
5337
dd74ae06
CC
53382012-01-03 Cary Coutant <ccoutant@google.com>
5339
5340 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
5341 Use abstract base class for GOT.
5342 * gold/output.h (class Output_data_got_base): New abstract base class.
5343 (class Output_data_got): Derive from new base class, adjust ctors.
5344 (Output_data_got::reserve_slot): Make virtual; rename to
5345 do_reserve_slot; Adjust callers.
5346 * gold/target.h (Sized_target::init_got_plt_for_update): Return
5347 pointer to abstract base class.
5348 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
5349
83896202
ILT
53502011-12-18 Ian Lance Taylor <iant@google.com>
5351
5352 * object.h (Relobj::local_symbol_value): New function.
5353 (Relobj::local_plt_offset): New function.
5354 (Relobj::local_has_got_offset): New function.
5355 (Relobj::local_got_offset): New function.
5356 (Relobj::set_local_got_offset): New function.
5357 (Relobj::do_local_symbol_value): New pure virtual function.
5358 (Relobj::do_local_plt_offset): Likewise.
5359 (Relobj::do_local_has_got_offset): Likewise.
5360 (Relobj::do_local_got_offset): Likewise.
5361 (Relobj::do_set_local_got_offset): Likewise.
5362 (Sized_relobj::do_local_has_got_offset): Rename from
5363 local_has_got_offset.
5364 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
5365 (Sized_relobj::do_set_local_got_offset): Rename from
5366 set_local_got_offset.
5367 (Sized_relobj_file::do_local_plt_offset): Rename from
5368 local_plt_offset.
5369 (Sized_relobj_file::do_local_symbol_value): New function.
5370 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
5371 local_plt_offset.
5372 * output.cc (Output_data_got::Got_entry::write): Change object to
5373 Relobj. Use local_symbol_value.
5374 (Output_data_got::add_global_with_rel): Change rel_dyn to
5375 Output_data_reloc_generic*. Use add_global_generic.
5376 (Output_data_got::add_global_with_rela): Remove. Change all
5377 callers to use add_global_with_rel.
5378 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
5379 Output_data_reloc_generic*. Use add_global_generic.
5380 (Output_data_got::add_global_pair_with_rela): Remove. Change all
5381 callers to use add_global_pair_with_rel.
5382 (Output_data_got::add_local): Change object to Relobj*.
5383 (Output_data_got::add_local_plt): Likewise.
5384 (Output_data_got::add_local_with_rel): Change object to Relobj*,
5385 change rel_dyn to Output_data_reloc_generic*. Use
5386 add_local_generic.
5387 (Output_data_got::add_local_with_rela): Remove. Change all
5388 callers to use all_local_with_rel.
5389 (Output_data_got::add_local_pair_with_rel): Change object to
5390 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
5391 add_output_section_generic.
5392 (Output_data_got::add_local_pair_with_rela): Remove. Change all
5393 callers to use add_local_pair_with_rel.
5394 (Output_data_got::reserve_local): Change object to Relobj*.
5395 * output.h: (class Output_data_reloc_generic): Add pure virtual
5396 declarations for add_global_generic, add_local_generic,
5397 add_output_section_generic.
5398 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
5399 functions for Output_data_reloc_generic. Update declarations for
5400 changes listed in output.cc.
5401 (class Output_data_got): Change template parameter to got_size.
5402 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
5403 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
5404 function.
5405 (Sized_relobj_incr::do_local_plt_offset): New function.
5406 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
5407 add_global_generic.
5408
76677ad0
CC
54092011-12-17 Cary Coutant <ccoutant@google.com>
5410
5411 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
5412 * resolve.cc (Symbol_table::resolve): Likewise.
5413 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
5414 arrays.
5415 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5416
8b8dd8d5
ILT
54172011-12-16 Ian Lance Taylor <iant@google.com>
5418
5419 * output.h (Output_data_reloc_generic::add): Only call
5420 add_dynamic_reloc if this is a dynamic reloc section.
5421
d55525b9
L
54222011-12-15 H.J. Lu <hongjiu.lu@intel.com>
5423
5424 PR gold/13505
5425 * target-reloc.h (apply_relocation): Replace <64, false> with
5426 <size, big_endian>.
5427
ff81c7c1
NC
54282011-11-25 Nick Clifton <nickc@redhat.com>
5429
5430 * po/it.po: New Italian translation.
5431
628f39be
SA
54322011-11-17 Sterling Augustine <saugustine@google.com>
5433
5434 * script.cc (script_include_directive): Implement.
5435 (read_script_file): New local variables name and search_path. Update
5436 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
5437 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
5438 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
5439
98ef3ea4
SA
54402011-11-11 Sterling Augustine <saugustine@google.com>
5441
5442 * yyscript.y (section_cmd): Add support for INCLUDE directive.
5443 (file_or_sections_cmd): Likewise.
5444
f4a8b6d7
DK
54452011-11-11 Doug Kwan <dougkwan@google.com>
5446
5447 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
5448 if --just-symbols is given.
5449
29ab395d
DK
54502011-11-10 Doug Kwan <dougkwan@google.com>
5451
5452 PR gold/13362
5453 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
5454 when processing data relocs.
5455 * reloc.h (Relocate_functions::rel_unaligned): New method.
5456 (Relocate_functions::pcrel_unaligned): Ditto.
5457 (Relocate_functions::rel32_unaligned): Ditto.
5458 (Relocate_functions::pcrel32_unaligned): Ditto.
5459
2c339f71
DK
54602011-11-09 Doug Kwan <dougkwan@google.com>
5461
5462 PR gold/13362
5463 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
5464 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
5465 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
5466 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5467 (Relocate_functions::rel_unaligned): New.
5468 (Relocate_functions::rel32_unaligned): New.
5469 * target-reloc.h (relocate_for_relocatable): Add code to handle
5470 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5471 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
5472 arm_unaligned_reloc_r): New targets.
5473 * testsuite/Makefile.in: Regenerate.
5474 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
5475 linking.
5476
3f3cddf1
ILT
54772011-11-02 Ian Lance Taylor <iant@google.com>
5478
5479 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
5480 NATIVE_LINKER.
5481 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
5482 * options.cc (General_options::finalize): Use library search path
5483 from configure script if specified. If not native and no sysroot,
5484 only search TOOLLIBDIR.
5485 * options.h (Search_directory::Search_directory): Change name to
5486 const std::string&.
5487 (General_options::add_to_library_path_with_sysroot): Change arg to
5488 const std::string&.
5489 * configure, Makefile.in, config.in: Rebuild.
5490
a8e2273b
ILT
54912011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5492
5493 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
5494 we are working around the ARM1176 Erratum.
5495 * options.h (General_options::fix_arm1176): Add option.
5496 * testsuite/Makefile.am: Add testcases, and keep current ones
5497 working.
5498 * testsuite/Makefile.in: Regenerate.
5499 * testsuite/arm_fix_1176.s: New file.
5500 * testsuite/arm_fix_1176.sh: Likewise.
5501
cd6eab1c
ILT
55022011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5503
5504 * arm.cc (Target_arm::Target_arm): Remove initialisation of
5505 may_use_blx_.
5506 (Target_arm::may_use_blx): Remove method.
5507 (Target_arm::set_may_use_blx): Likewise.
5508 (Target_arm::may_use_v4t_interworking): New method.
5509 (Target_arm::may_use_v5t_interworking): Likewise.
5510 (Target_arm::may_use_blx_): Remove member variable.
5511 (Arm_relocate_functions::arm_branch_common): Check for v5T
5512 interworking.
5513 (Arm_relocate_functions::thumb_branch_common): Likewise.
5514 (Reloc_stub::stub_type_for_reloc): Likewise.
5515 (Target_arm::do_finalize_sections): Correct interworking checks.
5516 * testsuite/Makefile.am: Add new tests.
5517 * testsuite/Makefile.in: Regenerate.
5518 * testsuite/arm_farcall_arm_arm.s: New test.
5519 * testsuite/arm_farcall_arm_arm.sh: Likewise.
5520 * testsuite/arm_farcall_arm_thumb.s: Likewise.
5521 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
5522 * testsuite/arm_farcall_thumb_arm.s: Likewise.
5523 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
5524 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
5525 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
5526
286adcf4
CC
55272011-10-31 Cary Coutant <ccoutant@google.com>
5528
5529 PR gold/13023
5530 * expression.cc (Expression::eval_with_dot): Add
5531 is_section_dot_assignment parameter.
5532 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
5533 absolute and assigning to dot within a section.
5534 * script-sections.cc
5535 (Output_section_element_assignment::set_section_addresses): Pass
5536 dot_section to set_if_absolute.
5537 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
5538 as is_section_dot_assignment flag to eval_with_dot.
5539 (Output_section_element_dot_assignment::set_section_addresses):
5540 Likewise.
5541 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
5542 parameter. Also set value if relative to dot_section; set the
5543 symbol's output_section.
5544 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
5545 parameter. Adjust all callers.
5546 (Expression::eval_maybe_dot): Likewise.
5547 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
5548 Adjust all callers.
5549 * testsuite/script_test_2.t: Test assignment of an absolute value
5550 to dot within an output section element.
5551
9634ed06
CC
55522011-10-31 Cary Coutant <ccoutant@google.com>
5553
5554 * options.h (class General_options): Add --[no-]gnu-unique options.
5555 * symtab.cc (Symbol_table::sized_write_globals): Convert
5556 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
5557
de4101c7
CC
55582011-10-31 Cary Coutant <ccoutant@google.com>
5559
5560 PR gold/13359
5561 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
5562 unnecessary assertion.
5563 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
5564
7257cc92
ST
55652011-10-31 Sriraman Tallam <tmsriram@google.com>
5566
5567 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5568 gc_mark_symbol.
5569 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5570 gc_mark_symbol.
5571 Change to just keep the section associated with symbol.
5572 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
5573 they are externally visible and --export-dynamic is turned on.
5574 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
5575
bfc34b3f
ILT
55762011-10-19 Ian Lance Taylor <iant@google.com>
5577
5578 PR gold/13163
5579 * script-sections.cc
5580 (Output_section_element_dot_assignment::needs_output_section): New
5581 function.
5582
ea0d8c47
ILT
55832011-10-19 Ian Lance Taylor <iant@google.com>
5584
5585 PR gold/13204
5586 * layout.cc (Layout::segment_precedes): Don't assert failure if a
5587 --section-start option was seen.
5588 * options.h (General_options::any_section_start): New function.
5589
abd242a9
DM
55902011-10-18 David S. Miller <davem@davemloft.net>
5591
5592 PR binutils/13301
5593 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
5594 member to track relocation locations that have moved during TLS
5595 reloc optimizations.
5596 (Target_sparc::Relocate::Relocate): Initialize to NULL.
5597 (Target_sparc::Relocate::relocate): Adjust view down by 4
5598 bytes if it matches reloc_adjust_addr_.
5599 (Target_sparc::Relocate::relocate_tls): Always move the
5600 __tls_get_addr call delay slot instruction forward 4 bytes when
5601 performing relaxation.
5602
bab9090f
CC
56032011-10-18 Cary Coutant <ccoutant@google.com>
5604
5605 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
5606 (Output_file::map_no_anonymous): Check for non-zero
5607 return code from posix_fallocate.
5608
f7c5b166
CC
56092011-10-17 Cary Coutant <ccoutant@google.com>
5610
5611 PR gold/13245
5612 * plugin.cc (is_visible_from_outside): Check for symbols
5613 referenced from dynamic objects.
5614 * resolve.cc (Symbol_table::resolve): Don't count references
5615 from dynamic objects as references from real ELF files.
5616 * testsuite/plugin_test_2.sh: Adjust expected result.
5617
b490c0bb
CC
56182011-10-17 Cary Coutant <ccoutant@google.com>
5619
5620 * gold.cc: Include timer.h.
5621 (queue_middle_tasks): Stamp time.
5622 (queue_final_tasks): Likewise.
5623 * main.cc (main): Store timer in parameters. Print timers
5624 for each pass.
5625 * parameters.cc (Parameters::Parameters): Initialize timer_.
5626 (Parameters::set_timer): New function.
5627 (set_parameters_timer): New function.
5628 * parameters.h (Parameters::set_timer): New function.
5629 (Parameters::timer): New function.
5630 (Parameters::timer_): New data member.
5631 (set_parameters_timer): New function.
5632 * timer.cc (Timer::stamp): New function.
5633 (Timer::get_pass_time): New function.
5634 * timer.h (Timer::stamp): New function.
5635 (Timer::get_pass_time): New function.
5636 (Timer::pass_times_): New data member.
5637
f475cf7b
CC
56382011-10-17 Cary Coutant <ccoutant@google.com>
5639
5640 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
5641 task for members of lib groups.
5642
cdd7e244
CC
56432011-10-17 Cary Coutant <ccoutant@google.com>
5644
5645 PR gold/13288
4f95c8b4 5646 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
5647 (File_read::make_view): Move bounds check (replace with assert)...
5648 (File_read::find_or_make_view): ... to here.
5649
dfb45471
CC
56502011-10-12 Cary Coutant <ccoutant@google.com>
5651
4f95c8b4 5652 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
5653 ::read returns less than requested size.
5654
53bbcc1b
CC
56552011-10-10 Cary Coutant <ccoutant@google.com>
5656
4f95c8b4 5657 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
5658 Initialize defined_count_.
5659 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
5660 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
5661 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
5662 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
5663 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 5664 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
5665 member.
5666 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 5667 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
5668 Return zeroes instead of internal error.
5669
397b129b
CC
56702011-10-10 Cary Coutant <ccoutant@google.com>
5671
5672 PR gold/13249
4f95c8b4 5673 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 5674 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 5675 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
5676 (Output_reloc::type_): Adjust size of bit field.
5677 (Output_reloc::use_plt_offset_): New bit field.
5678 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
5679 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
5680 flag. Adjust all callers.
4f95c8b4 5681 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
5682 creating RELATIVE relocations.
5683
d5698657
NC
56842011-10-10 Nick Clifton <nickc@redhat.com>
5685
5686 * po/es.po: Updated Spanish translation.
5687 * po/fi.po: Updated Finnish translation.
5688
6a59a5c2
DN
56892011-10-03 Diego Novillo <dnovillo@google.com>
5690
5691 * options.cc (parse_uint): Fix dereference of RETVAL.
5692
f0558624
ST
56932011-09-29 Sriraman Tallam <tmsriram@google.com>
5694
5695 * layout.h (section_order_map_): New member.
5696 (get_section_order_map): New member function.
5697 * output.cc (Output_section::add_input_section): Check for patterns
5698 only when --section-ordering-file is specified.
5699 * gold.cc (queue_middle_tasks): Delay updating order of sections till
5700 output_sections have been formed.
5701 * layout.cc (Layout_Layout): Initialize section_order_map_.
5702 * plugin.cc (update_section_order): Store order in order_map. Do not
5703 update the order.
5704 * testsuite/Makefile.am: Add test case for plugin_final_layout.
5705 * testsuite/Makefile.in: Regenerate.
5706 * testsuite/plugin_section_order.c: New file.
5707 * testsuite/plugin_final_layout.cc: New file.
5708 * testsuite/plugin_final_layout.sh: New file.
5709
a7dac153
CC
57102011-09-29 Cary Coutant <ccoutant@google.com>
5711
4f95c8b4 5712 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 5713 Check for NULL.
4f95c8b4 5714 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
5715 symbols during incremental update.
5716 (Symbol_table::add_from_dynobj): Likewise.
5717
eebd87a5
ILT
57182011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5719 Ian Lance Taylor <iant@google.com>
5720
5721 * symtab.cc (Symbol_table::define_special_symbol): Always
5722 canonicalize version string.
5723
403a3331
CC
57242011-09-26 Cary Coutant <ccoutant@google.com>
5725
4f95c8b4
CC
5726 * gold.cc (queue_initial_tasks): Move option checks ...
5727 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
5728 some options; make others fatal.
5729
235061c2
CC
57302011-09-26 Cary Coutant <ccoutant@google.com>
5731
5732 gcc PR lto/47247
5733 * plugin.cc (get_symbols_v2): New function.
5734 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
5735 (is_referenced_from_outside): New function.
5736 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
5737 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
5738 (get_symbols): Pass version parameter.
5739 (get_symbols_v2): New function.
5740 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
5741 parameter.
5742 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
5743 (onload): Add LDPT_GET_SYMBOLS_V2.
5744 (all_symbols_read_hook): Use get_symbols_v2; check for
5745 LDPR_PREVAILING_DEF_IRONLY_EXP.
5746 * testsuite/plugin_test_3.sh: Update expected results.
5747
dc87f620
ILT
57482011-09-23 Simon Baldwin <simonb@google.com>
5749
5750 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
5751 configuration options.
5752 * configure: Regenerate.
5753 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
5754 * Makefile.in: Regenerate.
5755 * testsuite/Makefile.in: Regenerate.
5756
a8279f82
ST
57572011-09-19 Sriraman Tallam <tmsriram@google.com>
5758
5759 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
5760
0c9350c8
CC
57612011-09-19 Cary Coutant <ccoutant@google.com>
5762
5763 * incremental.cc (can_incremental_update): Fix typo in comment.
5764 * incremental.h (can_incremental_update): Likewise.
5765
aa06ae28
CC
57662011-09-18 Cary Coutant <ccoutant@google.com>
5767
5768 * incremental.cc (can_incremental_update): New function.
5769 * incremental.h (can_incremental_update): New function.
5770 * layout.cc (Layout::init_fixed_output_section): Call it.
5771 (Layout::make_output_section): Don't allow patch space in .eh_frame.
5772 * object.cc (Sized_relobj_file::do_layout): Call
5773 can_incremental_update.
5774
ebb300b2
CC
57752011-09-13 Cary Coutant <ccoutant@google.com>
5776
5777 * configure.ac: Check for glibc support for gnu_indirect_function
5778 support with static linking, setting automake conditional
5779 IFUNC_STATIC.
5780 * Makefile.in: Regenerate.
5781 * configure: Regenerate.
5782
5783 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
5784 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
5785 for IFUNC_STATIC.
5786 * testsuite/Makefile.in: Regenerate.
5787
1206d0d5
CC
57882011-09-13 Cary Coutant <ccoutant@google.com>
5789
5790 * incremental.cc (Sized_relobj_incr::do_layout): Call
5791 report_comdat_group for kept comdat sections.
5792 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
5793 * testsuite/Makefile.in: Regenerate.
5794 * testsuite/incr_comdat_test_1.cc: New source file.
5795 * testsuite/incr_comdat_test_2_v1.cc: New source file.
5796 * testsuite/incr_comdat_test_2_v2.cc: New source file.
5797 * testsuite/incr_comdat_test_2_v3.cc: New source file.
5798
40b29874
ILT
57992011-09-13 Ian Lance Taylor <iant@google.com>
5800
5801 * object.cc (Sized_relobj_file::do_layout): Remove unused local
5802 variable external_symbols_offset.
5803
1b045aac
ILT
58042011-09-12 Ian Lance Taylor <iant@google.com>
5805
5806 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
5807 triggered if object has no symbols.
5808
24c6c55a
DM
58092011-09-09 David S. Miller <davem@davemloft.net>
5810
5811 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
5812 (Output_fill_debug_line::do_write): Likewise.
5813
66570254
CC
58142011-08-29 Cary Coutant <ccoutant@google.com>
5815
5816 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
5817 casts to match formatting specs.
5818 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
5819
8ea8cd50
CC
58202011-08-26 Cary Coutant <ccoutant@google.com>
5821
5822 * layout.cc (Free_list::allocate): Provide guarantee of minimum
5823 remaining hole size when allocating.
5824 (Layout::make_output_section): Set fill methods for debug sections.
5825 * layout.h (Free_list::Free_list_node): Move from private to
5826 public.
5827 (Free_list::set_min_hole_size): New function.
5828 (Free_list::begin, Free_list::end): New functions.
5829 (Free_list::min_hole_): New data member.
5830 * output.cc: Include dwarf.h.
5831 (Output_fill_debug_info::do_minimum_hole_size): New function.
5832 (Output_fill_debug_info::do_write): New function.
5833 (Output_fill_debug_line::do_minimum_hole_size): New function.
5834 (Output_fill_debug_line::do_write): New function.
5835 (Output_section::Output_section): Initialize new data member.
5836 (Output_section::set_final_data_size): Ensure patch space is larger
5837 than minimum hole size.
5838 (Output_section::do_write): Fill holes in debug sections.
5839 * output.h (Output_fill): New class.
5840 (Output_fill_debug_info): New class.
5841 (Output_fill_debug_line): New class.
5842 (Output_section::set_free_space_fill): New function.
5843 (Output_section::free_space_fill_): New data member.
5844 * testsuite/Makefile.am (incremental_test_3): Add
5845 --incremental-patch option.
5846 (incremental_test_4): Likewise.
5847 (incremental_test_5): Likewise.
5848 (incremental_test_6): Likewise.
5849 (incremental_copy_test): Likewise.
5850 (incremental_common_test_1): Likewise.
5851 * testsuite/Makefile.in: Regenerate.
5852
7cf80422
NC
58532011-08-26 Nick Clifton <nickc@redhat.com>
5854
5855 * po/es.po: Updated Spanish translation.
5856
c3f7b0e5
CC
58572011-08-01 Cary Coutant <ccoutant@google.com>
5858
5859 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
5860 * gold/testsuite/Makefile.in: Regenerate.
5861 * gold/testsuite/justsyms_exec.c: New source file.
5862 * gold/testsuite/justsyms_lib.c: New source file.
5863
9590bf25
CC
58642011-08-01 Cary Coutant <ccoutant@google.com>
5865
5866 * layout.cc (Layout::set_segment_offsets): Don't realign text
5867 segment if -Ttext was specified.
5868 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
5869 file type.
5870 * object.h (Sized_relobj_file::e_type): New function.
5871 (Sized_relobj_file::e_type_): New data member.
5872 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
5873 base address for ET_EXEC files.
5874 * target.cc (Target::do_make_elf_object_implementation): Allow
5875 ET_EXEC files with --just-symbols option.
5876
dcd8d12e
CC
58772011-07-28 Cary Coutant <ccoutant@google.com>
5878
5879 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
5880 Add thread_number parameter.
5881 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
5882 * workqueue-threads.cc
5883 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
5884 current thread if its thread number is greater than desired thread
5885 count.
5886 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
5887 Add thread_number parameter.
5888 (Workqueue::should_cancel_thread): Likewise.
5889 (Workqueue::find_runnable_or_wait): Pass thread_number to
5890 should_cancel_thread.
5891 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
5892 parameter.
5893
804eb480
ST
58942011-07-22 Sriraman Tallam <tmsriram@google.com>
5895
5896 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
5897 only after checking if it cannot be forced local.
5898 * symtab.h (is_externally_visible): Check if the symbol is not forced
5899 local.
5900
f1ddb600
ILT
59012011-07-15 Ian Lance Taylor <iant@google.com>
5902
5903 * options.h (class General_options): Add --print-output-format.
5904 Move -EL next to -EB, for better --help output.
5905 * target-select.cc: Include <cstdio>, "options.h", and
5906 "parameters.h".
5907 (Target_selector::do_target_bfd_name): New function.
5908 (print_output_format): New function.
5909 * target-select.h (class Target_selector): Update declarations.
5910 (Target_selector::target_bfd_name): New function.
5911 (print_output_format): Declare.
5912 * main.cc: Include "target-select.h".
5913 (main): Handle --print-output-format.
5914 * gold.cc: Include "target-select.h".
5915 (queue_initial_tasks): Handle --print-output-format when there are
5916 no input files.
5917 * parameters.cc (parameters_force_valid_target): Give a better
5918 error message if -EB/-EL does not match target.
5919 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
5920 function.
5921
7d172687
ILT
59222011-07-15 Ian Lance Taylor <iant@google.com>
5923
5924 * i386.cc (class Output_data_plt_i386): Add layout_ field.
5925 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
5926 (Output_data_plt_i386::do_write): Write address of .dynamic
5927 section to first entry in .got.plt section.
5928 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
5929 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
5930 Initialize layout_.
5931 (Output_data_plt_x86_64::do_write): Write address of .dynamic
5932 section to first entry in .got.plt section.
5933 * layout.h (Layout::dynamic_section): New function.
5934
e9552f7e
ST
59352011-07-13 Sriraman Tallam <tmsriram@google.com>
5936
5937 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
5938 to claim_file call.
5939 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
5940 input_section_position_, and input_section_glob_.
5941 (read_layout_from_file): Call function section_ordering_specified.
5942 * layout.h (is_section_ordering_specified): New function.
5943 (section_ordering_specified): New function.
5944 (section_ordering_specified_): New boolean member.
5945 * main.cc(main): Call load_plugins after layout object is defined.
5946 * output.cc (Output_section::add_input_section): Use
5947 function section_ordering_specified to check if section ordering is
5948 needed.
5949 * output.cc (Output_section::add_relaxed_input_section): Use
5950 function section_ordering_specified to check if section ordering is
5951 needed.
5952 (Output_section::update_section_layout): New function.
5953 (Output_section::sort_attached_input_sections): Check if input section
5954 must be reordered.
5955 * output.h (Output_section::update_section_layout): New function.
5956 * plugin.cc (get_section_count): New function.
5957 (get_section_type): New function.
5958 (get_section_name): New function.
5959 (get_section_contents): New function.
5960 (update_section_order): New function.
58797674 5961 (allow_section_ordering): New function.
e9552f7e
ST
5962 (Plugin::load): Add the new interfaces to the transfer vector.
5963 (Plugin_manager::load_plugins): New parameter.
5964 (Plugin_manager::all_symbols_read): New parameter.
5965 (Plugin_manager::claim_file): New parameter. Save the elf object for
5966 unclaimed objects.
5967 (Plugin_manager::get_elf_object): New function.
5968 (Plugin_manager::get_view): Change to directly use the bool to check
5969 if get_view is called from claim_file_hook.
5970 * plugin.h (input_objects): New function
5971 (Plugin__manager::load_plugins): New parameter.
5972 (Plugin_manager::claim_file): New parameter.
5973 (Plugin_manager::get_elf_object): New function.
5974 (Plugin_manager::in_claim_file_handler): New function.
5975 (Plugin_manager::in_claim_file_handler_): New member.
5976 (layout): New function.
5977 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
5978 handler with an extra parameter. Make the elf object before calling
5979 claim_file handler.
5980 * testsuite/plugin_test.c (get_section_count): New function pointer.
5981 (get_section_type): New function pointer.
5982 (get_section_name): New function pointer.
5983 (get_section_contents): New function pointer.
5984 (update_section_order): New function pointer.
5985 (allow_section_ordering): New function pointer.
5986 (onload): Check if the new interfaces exist.
5987
9446efde
ILT
59882011-07-13 Ian Lance Taylor <iant@google.com>
5989
5990 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
5991 relro section.
5992 * x86_64.cc (Target_x86_64::got_section): Likewise.
5993 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
5994 (relro_now_test_SOURCES): New variable.
5995 (relro_now_test_DEPENDENCIES): New variable.
5996 (relro_now_test_LDFLAGS): New variable.
5997 (relro_now_test_LDADD): New variable.
5998 (relro_now_test.so): New target.
5999 * testsuite/Makefile.in: Rebuild.
6000
07aa62f2
ILT
60012011-07-12 Ian Lance Taylor <iant@google.com>
6002
6003 PR gold/12980
6004 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
6005 GLOB_DAT relocation rather than a RELATIVE relocation for a
6006 protected symbol when creating a shared library.
6007 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
6008 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
6009 * testsuite/protected_main_1.cc (main): Test that protected
6010 function has same address.
6011
e2153196
ILT
60122011-07-11 Ian Lance Taylor <iant@google.com>
6013
6014 PR gold/12979
6015 * options.h (class General_options): Add -Bgroup.
6016 * options.cc (General_options::finalize): If -Bgroup is set,
6017 default to --unresolved-symbols=report-all.
6018 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
6019 * target-reloc.h (issue_undefined_symbol_error): Handle
6020 --unresolved-symbols=report-all.
6021
6daf5215
ILT
60222011-07-08 Ian Lance Taylor <iant@google.com>
6023
6024 PR gold/11985
6025 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
6026 if linker script discards key sections.
6027 (Layout::create_dynamic_symtab): Likewise.
6028 (Layout::assign_local_dynsym_offsets): Likewise.
6029 (Layout::sized_create_version_sections): Likewise.
6030 (Layout::create_interp): Likewise.
6031 (Layout::finish_dynamic_section): Likewise.
6032 (Layout::set_dynamic_symbol_size): Likewise.
6033
beabb2c6
ILT
60342011-07-08 Ian Lance Taylor <iant@google.com>
6035
6036 PR gold/12386
6037 * options.h (class General_options): Add --unresolved-symbols.
6038 * target-reloc.h (issue_undefined_symbol_error): Check
6039 --unresolved-symbols. Add comments.
6040
9c16daf1
ILT
60412011-07-08 Ian Lance Taylor <iant@google.com>
6042
6043 * testsuite/odr_violation2.cc (Ordering::operator()): Make
6044 expression more complex.
6045
191f1a2d
ILT
60462011-07-08 Ian Lance Taylor <iant@google.com>
6047
6048 PR gold/11317
6049 * target-reloc.h (issue_undefined_symbol_error): New inline
6050 function, broken out of relocate_section.
6051 (relocate_section): Call issue_undefined_symbol_error.
6052 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
6053 there is no TLS segment if we are about to issue an undefined
6054 symbol error.
6055 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
6056
62855347
ILT
60572011-07-08 Ian Lance Taylor <iant@google.com>
6058
6059 PR gold/12279
6060 * resolve.cc (Symbol_table::should_override): Add fromtype
6061 parameter. Change all callers. Give error when linking together
6062 TLS and non-TLS symbol.
6063 (Symbol_table::should_override_with_special): Add fromtype
6064 parameter. Change all callers.
6065 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
6066 there is no TLS segment if we have reported some errors.
6067 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
6068
67181c72
ILT
60692011-07-08 Ian Lance Taylor <iant@google.com>
6070
6071 PR gold/12372
6072 * target.h (Target::plt_address_for_global): New function.
6073 (Target::plt_address_for_local): New function.
6074 (Target::plt_section_for_global): Remove.
6075 (Target::plt_section_for_local): Remove.
6076 (Target::do_plt_address_for_global): New virtual function.
6077 (Target::do_plt_address_for_local): New virtual function.
6078 (Target::do_plt_section_for_global): Remove.
6079 (Target::do_plt_section_for_local): Remove.
6080 (Target::register_global_plt_entry): Add Symbol_table and Layout
6081 parameters.
6082 * output.cc (Output_data_got::Got_entry::write): Use
6083 plt_address_for_global and plt_address_for_local.
6084 * layout.cc (Layout::add_target_dynamic_tags): Use size and
6085 address of output section.
6086 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
6087 got_irelative_, and irelative_count_ fields. Update
6088 declarations.
6089 (Output_data_plt_i386::has_irelative_section): New function.
6090 (Output_data_plt_i386::entry_count): Add irelative_count_.
6091 (Output_data_plt_i386::set_final_data_size): Likewise.
6092 (class Target_i386): Add got_irelative_ and rel_irelative_
6093 fields. Update declarations.
6094 (Target_i386::Target_i386): Initialize new fields.
6095 (Target_i386::do_plt_address_for_global): New function replacing
6096 do_plt_section_for_global.
6097 (Target_i386::do_plt_address_for_local): New function replacing
6098 do_plt_section_for_local.
6099 (Target_i386::got_section): Create got_irelative_.
6100 (Target_i386::rel_irelative_section): New function.
6101 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
6102 fields. Don't define __rel_iplt_{start,end}.
6103 (Output_data_plt_i386::add_entry): Add symtab and layout
6104 parameters. Change all callers. Use different PLT and GOT for
6105 IFUNC symbols.
6106 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
6107 layout parameters. Change all callers. Use different PLT and
6108 GOT.
6109 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
6110 (Output_data_plt_i386::rel_irelative): New function.
6111 (Output_data_plt_i386::address_for_global): New function.
6112 (Output_data_plt_i386::address_for_local): New function.
6113 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
6114 IRELATIVE GOT when changing IFUNC GOT entries.
6115 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
6116 reloc.
6117 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
6118 if we didn't create an IRELATIVE GOT.
6119 (Target_i386::Relocate::relocate): Use plt_address_for_global and
6120 plt_address_for_local.
6121 (Target_i386::do_dynsym_value): Use plt_address_for_global.
6122 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
6123 got_irelative_, and irelative_count_ fields. Update
6124 declarations.
6125 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
6126 Initialize new fields. Remove symtab parameter. Change all
6127 callers.
6128 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
6129 irelative_count_.
6130 (Output_data_plt_x86_64::has_irelative_section): New function.
6131 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
6132 (class Target_x86_64): Add got_irelative_ and rel_irelative_
6133 fields. Update declarations.
6134 (Target_x86_64::Target_x86_64): Initialize new fields.
6135 (Target_x86_64::do_plt_address_for_global): New function replacing
6136 do_plt_section_for_global.
6137 (Target_x86_64::do_plt_address_for_local): New function replacing
6138 do_plt_section_for_local.
6139 (Target_x86_64::got_section): Create got_irelative_.
6140 (Target_x86_64::rela_irelative_section): New function.
6141 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
6142 all callers. Don't create __rel_iplt_{start,end}.
6143 (Output_data_plt_x86_64::add_entry): Add symtab and layout
6144 parameters. Change all callers. Use different PLT and GOT for
6145 IFUNC symbols.
6146 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
6147 layout parameters. Change all callers. Use different PLT and
6148 GOT.
6149 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
6150 parameters. Change all callers. Use different PLT and GOT for
6151 IFUNC symbols.
6152 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
6153 (Output_data_plt_x86_64::rela_irelative): New function.
6154 (Output_data_plt_x86_64::address_for_global): New function.
6155 (Output_data_plt_x86_64::address_for_local): New function.
6156 (Output_data_plt_x86_64::set_final_data_size): Likewise.
6157 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
6158 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
6159 (Target_x86_64::register_global_plt_entry): Add symtab and layout
6160 parameters.
6161 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
6162 reloc.
6163 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
6164 symbols if we didn't create an IRELATIVE GOT.
6165 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
6166 plt_address_for_local.
6167 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
6168 * testsuite/ifuncvar1.c: New test file.
6169 * testsuite/ifuncvar2.c: New test file.
6170 * testsuite/ifuncvar3.c: New test file.
6171 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
6172 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
6173 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
6174 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
6175 * testsuite/Makefile.in: Rebuild.
6176
33c15b45
CC
61772011-07-07 Cary Coutant <ccoutant@google.com>
6178
6179 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
6180 (two_file_test_1_ndebug.o): Likewise.
6181 (two_file_test_1b_ndebug.o): Likewise.
6182 (two_file_test_2_ndebug.o): Likewise.
6183 (two_file_test_main_ndebug.o): Likewise.
6184 (incremental_test_2): Link with no-debug versions.
6185
f48b5fb7
CC
61862011-07-06 Cary Coutant <ccoutant@google.com>
6187
6188 * gold/incremental.cc
6189 (Output_section_incremental_inputs::write_info_blocks): Check for
6190 hidden and internal symbols.
6191
221597a5
CC
61922011-07-06 Cary Coutant <ccoutant@google.com>
6193
6194 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
6195 Check disposition for startup file.
6196 (Incremental_inputs::report_command_line): Ignore
6197 --incremental-startup-unchanged option.
6198 * options.cc (General_options::parse_incremental_startup_unchanged):
6199 New function.
6200 (General_options::General_options): Initialize new data member.
6201 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
6202 (General_options): Add --incremental-startup-unchanged option.
6203 (General_options::incremental_startup_disposition): New function.
6204 (General_options::incremental_startup_disposition_): New data member.
6205
e24719f6
CC
62062011-07-06 Cary Coutant <ccoutant@google.com>
6207
6208 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
6209 input file index to Script_info ctor.
6210 (Sized_incremental_binary::do_file_has_changed): Find the
6211 command-line argument for files named in scripts.
6212 * incremental.h (Script_info::Script_info): New ctor
6213 with input file index.
6214 (Script_info::input_file_index): New function.
6215 (Script_info::input_file_index_): New data member.
6216 (Incremental_binary::get_library): Add const.
6217 (Incremental_binary::get_script_info): Add const.
6218 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
6219 * testsuite/Makefile.am (incremental_test_5): New test case.
6220 (incremental_test_6): New test case.
6221 * testsuite/Makefile.in: Regenerate.
6222
8f7c81e8
CC
62232011-07-06 Cary Coutant <ccoutant@google.com>
6224
6225 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
6226 debug output when command lines differ.
6227
9fbd3822
CC
62282011-07-06 Cary Coutant <ccoutant@google.com>
6229
6230 * incremental.cc (Incremental_inputs::report_command_line): Ignore
6231 --incremental-patch option.
6232 * layout.cc (Free_list::allocate): Extend allocation beyond original
6233 end if enabled.
6234 (Layout::make_output_section): Mark sections that should get
6235 patch space.
6236 * options.cc (parse_percent): New function.
6237 * options.h (parse_percent): New function.
6238 (DEFINE_percent): New macro.
6239 (General_options): Add --incremental-patch option.
6240 * output.cc (Output_section::Output_section): Initialize new data
6241 members.
6242 (Output_section::add_input_section): Print section name when out
6243 of patch space.
6244 (Output_section::add_output_section_data): Likewise.
6245 (Output_section::set_final_data_size): Add patch space when
6246 doing --incremental-full.
6247 (Output_section::do_reset_address_and_file_offset): Remove patch
6248 space.
6249 (Output_segment::set_section_list_addresses): Print debug output
6250 only if --incremental-update.
6251 * output.h (Output_section::set_is_patch_space_allowed): New function.
6252 (Output_section::is_patch_space_allowed_): New data member.
6253 (Output_section::patch_space_): New data member.
6254 * parameters.cc (Parameters::incremental_full): New function.
6255 * parameters.h (Parameters::incremental_full): New function
6256 * testsuite/Makefile.am (incremental_test_2): Add test for
6257 --incremental-patch option.
6258 * testsuite/Makefile.in: Regenerate.
6259 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
6260 (t18): Remove function body.
6261
f6cccc2c
DK
62622011-07-05 Doug Kwan <dougkwan@google.com>
6263
6264 PR gold/12771
6265 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
6266 Arm_Address type for relocation result.
6267 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
6268 overflow check.
6269 (Arm_relocate_functions::abs32): Use unaligned access.
6270 (Arm_relocate_functions::rel32): Ditto.
6271 (Arm_relocate_functions::prel31): Ditto.
6272 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
6273 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
6274 static data relocations.
6275 * testsuite/Makefile.in: Regnerate.
6276 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
6277
28a13fec
ILT
62782011-07-05 Ian Lance Taylor <iant@google.com>
6279
6280 PR gold/12392
6281 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
6282 symbols if necessary.
6283 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6284
24d47b34
ILT
62852011-07-05 Ian Lance Taylor <iant@google.com>
6286
6287 PR gold/12952
6288 * resolve.cc (Symbol::override_base_with_special): Simply override
6289 version with special symbol version, ignoring previous version.
6290
41f9cbbe
ILT
62912011-07-05 Ian Lance Taylor <iant@google.com>
6292
6293 * object.cc (Sized_relobj_file::include_section_group): Add
6294 information to comment about signature location.
6295
886288f1
ILT
62962011-07-02 Ian Lance Taylor <iant@google.com>
6297
6298 PR gold/12957
6299 * options.h (class General_options): Add -f and -F.
6300 * options.cc (General_options::finalize): Fatal error if -f/-F
6301 are used without -shared.
6302 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
6303
ae3a6d4f
ILT
63042011-07-02 Ian Lance Taylor <iant@google.com>
6305
6306 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
6307
21131061
ILT
63082011-07-01 Ian Lance Taylor <iant@google.com>
6309
6310 PR gold/12525
6311 PR gold/12952
6312 * resolve.cc (Symbol::override_base_with_special): Don't override
6313 the version if the overriding symbol has a different name.
6314 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
6315 all callers. If we give an error about an undefined version,
6316 define the base version if necessary.
6317 * dynobj.h (class Versions): Update declaration.
6318 * testsuite/weak_alias_test_5.cc: New file.
6319 * testsuite/weak_alias_test.script: New file.
6320 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
6321 and versioned_alias have the right value, and call t2.
6322 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
6323 weak_alias_test_5.so.
6324 (weak_alias_test_LDADD): Likewise.
6325 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
6326 * testsuite/Makefile.in: Rebuild.
6327
611062c0
ILT
63282011-07-01 Ian Lance Taylor <iant@google.com>
6329
6330 PR gold/12525
6331 * options.h (class General_options): Support -z notext.
6332 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
6333 -Wl,-z,notext.
6334 (two_file_shared_nonpic.so): Likewise.
6335 (two_file_shared_mixed.so): Likewise.
6336 (two_file_shared_mixed_1.so): Likewise.
6337 (weak_undef_lib_nonpic.so): Likewise.
6338 (alt/weak_undef_lib_nonpic.so): Likewise.
6339 (tls_test_shared_nonpic.so): Likewise.
6340 * testsuite/Makefile.in: Rebuild.
6341
328c7c2f
ILT
63422011-07-01 Ian Lance Taylor <iant@google.com>
6343
6344 PR gold/12525
6345 * configure.ac: Test whether static linking works, setting
6346 the automake conditional HAVE_STATIC.
6347 * testsuite/Makefile.am: Disable tests using -static if
6348 HAVE_STATIC is not true.
6349 * configure, testsuite/Makefile.in: Rebuild.
6350
02d7cd44
ILT
63512011-07-01 Ian Lance Taylor <iant@google.com>
6352
6353 PR gold/12525
6354 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
6355 Assert if we see DW_EH_PE_indirect.
6356 * target.h (Target::ehframe_datarel_base): New function.
6357 (Target::do_ehframe_datarel_base): New target function.
6358 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
6359 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
6360 function.
6361
07a60597
ILT
63622011-07-01 Ian Lance Taylor <iant@google.com>
6363
6364 PR gold/12571
6365 * options.h (class General_options): Add
6366 --ld-generated-unwind-info.
6367 * ehframe.cc (Fde::write): Add address parameter. Change all
6368 callers. If associated with PLT, fill in address and size.
6369 (Cie::set_output_offset): Only add merge mapping if there is an
6370 object.
6371 (Cie::write): Add address parameter. Change all callers.
6372 (Eh_frame::add_ehframe_for_plt): New function.
6373 * ehframe.h (class Fde): Update declarations. Move shndx_ and
6374 input_offset_ fields into union u_, with new plt field.
6375 (Fde::Fde): Adjust for new union field.
6376 (Fde::Fde) [Output_data version]: New constructor.
6377 (Fde::add_mapping): Only add merge mapping if there is an object.
6378 (class Cie): Update declarations.
6379 (class Eh_frame): Declare add_ehframe_for_plt.
6380 * layout.cc (Layout::layout_eh_frame): Break out code into
6381 make_eh_frame_section, and call it.
6382 (Layout::make_eh_frame_section): New function.
6383 (Layout::add_eh_frame_for_plt): New function.
6384 * layout.h (class Layout): Update declarations.
6385 * merge.cc (Merge_map::add_mapping): Add assertion.
6386 * i386.cc: Include "dwarf.h".
6387 (class Output_data_plt_i386): Make first_plt_entry,
6388 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
6389 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6390 and plt_eh_frame_fde.
6391 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
6392 boundary. Call add_eh_frame_for_plt if appropriate.
6393 * x86_64.cc: Include "dwarf.h".
6394 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
6395 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
6396 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6397 and plt_eh_frame_fde.
6398 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
6399 appropriate.
6400
14788a3f
ILT
64012011-06-29 Ian Lance Taylor <iant@google.com>
6402
6403 PR gold/12629
6404 * object.cc (Sized_relobj_file::layout_section): Change shdr
6405 parameter to be const.
6406 (Sized_relobj_file::layout_eh_frame_section): New function, broken
6407 out of do_layout.
6408 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
6409 appropriate. Call layout_eh_frame_section.
6410 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
6411 sections.
6412 * object.h (class Sized_relobj_file): Update declarations.
6413
6c21fce1
ILT
64142011-06-29 Ian Lance Taylor <iant@google.com>
6415
37e41b03 6416 PR gold/12652
6c21fce1
ILT
6417 * script.cc (Token::integer_value): Accept trailing M/m/K/k
6418 modifier.
6419 (Lex::gather_token): Accept trailing M/m/K/k for integers.
6420
4d5e4e62
ILT
64212011-06-29 Ian Lance Taylor <iant@google.com>
6422
6423 PR gold/12675
6424 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
6425 SHT_X86_64_UNWIND.
6426 * layout.cc (Layout::layout_eh_frame): Likewise.
6427
886f533a
ILT
64282011-06-29 Ian Lance Taylor <iant@google.com>
6429
6430 PR gold/12695
6431 * layout.cc (Layout::symtab_section_shndx): New function.
6432 * layout.h (class Layout): Declare symtab_section_shndx.
6433 * output.cc (Output_section::write_header): Call it.
6434
f3ae1b28
ILT
64352011-06-29 Ian Lance Taylor <iant@google.com>
6436
6437 PR gold/12818
6438 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
6439 symbols which are not used in a relocation.
6440
aecf301f
ILT
64412011-06-28 Ian Lance Taylor <iant@google.com>
6442
6443 PR gold/12898
6444 * layout.cc (Layout::segment_precedes): Don't crash if a linker
6445 script create indistinguishable segments.
6446 (Layout::set_segment_offsets): Use stable_sort when sorting
6447 segments. Pass this to Compare_segments constructor.
6448 * layout.h (class Layout): Make segment_precedes non-static.
6449 (class Compare_segments): Change from struct to class. Add
6450 layout_ field. Add constructor.
6451 * script-sections.cc
6452 (Script_sections::attach_sections_using_phdrs_clause): Rename
6453 local orphan to is_orphan. Don't report failure to put empty
6454 section in segment. On attachment failure, report name of
6455 section, and attach to first PT_LOAD segment.
6456
03ef7571
ILT
64572011-06-28 Ian Lance Taylor <iant@google.com>
6458
6459 PR gold/12934
6460 * target-select.cc (Target_selector::Target_selector): Add
6461 emulation parameter. Change all callers.
6462 (select_target_by_bfd_name): Rename from select_target_by_name.
6463 Change all callers.
6464 (select_target_by_emulation): New function.
6465 (supported_emulation_names): New function.
6466 * target-select.h (class Target_selector): Add emulation_ field.
6467 Update declarations.
6468 (Target_selector::recognize_by_bfd_name): Rename from
6469 recognize_by_name. Change all callers.
6470 (Target_selector::supported_bfd_names): Rename from
6471 supported_names. Change all callers.
6472 (Target_selector::recognize_by_emulation): New function.
6473 (Target_selector::supported_emulations): New function.
6474 (Target_selector::emulation): New function.
6475 (Target_selector::do_recognize_by_bfd_name): Rename from
6476 do_recognize_by_name. Change all callers.
6477 (Target_selector::do_supported_bfd_names): Rename from
6478 do_supported_names. Change all callers.
6479 (Target_selector::do_recognize_by_emulation): New function.
6480 (Target_selector::do_supported_emulations): New function.
6481 (select_target_by_bfd_name): Change name in declaration.
6482 (select_target_by_emulation): Declare.
6483 (supported_emulation_names): Declare.
6484 * parameters.cc (parameters_force_valid_target): Try to find
6485 target based on emulation from -m option.
6486 * options.h (class General_options): Change doc string for -m.
6487 * options.cc (help): Print emulations.
6488 (General_options::parse_V): Likewise.
6489 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
6490 Add emulation parameter. Change all callers.
6491
200b2bb9
ILT
64922011-06-28 Ian Lance Taylor <iant@google.com>
6493
6494 * target.h (class Target): Add osabi_ field.
6495 (Target::osabi): New function.
6496 (Target::set_osabi): New function.
6497 (Target::Target): Initialize osabi_.
6498 (Target::do_adjust_elf_header): Make pure virtual.
6499 (Sized_target::do_adjust_elf_header): Declare.
6500 * target.cc (Sized_target::do_adjust_elf_header): New function.
6501 (class Sized_target): Instantiate all versions.
6502 * freebsd.h (class Target_freebsd): Remove.
6503 (Target_selector_freebsd::do_recognize): Call set_osabi on
6504 Target.
6505 (Target_selector_freebsd::do_recognize_by_name): Likewise.
6506 (Target_selector_freebsd::set_osabi): Remove.
6507 * i386.cc (class Target_i386): Inherit from Sized_target rather
6508 than Target_freebsd.
6509 * x86_64.cc (class Target_x86_64): Likewise.
6510
b3ce541e
ILT
65112011-06-28 Ian Lance Taylor <iant@google.com>
6512
6513 * target.h (Target::can_check_for_function_pointers): Rewrite.
6514 Make non-virtual.
6515 (Target::can_icf_inline_merge_sections): Likewise.
6516 (Target::section_may_have_icf_unsafe_poineters): Likewise.
6517 (Target::Target_info): Add can_icf_inline_merge_sections field.
6518 (Target::do_can_check_for_function_pointers): New virtual
6519 function.
6520 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
6521 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
6522 from can_check_for_function_pointers, move in file.
6523 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
6524 section_may_have_icf_unsafe_poineters, move in file.
6525 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
6526 * i386.cc (Target_i386::do_can_check_for_function_pointers):
6527 Rename from can_check_for_function_pointers, move in file.
6528 (Target_i386::can_icf_inline_merge_sections): Remove.
6529 (Target_i386::i386_info): Initialize
6530 can_icf_inline_merge_sections.
6531 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
6532 Initialize can_icf_inline_merge_sections.
6533 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
6534 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
6535 Rename from can_check_for_function_pointers, move in file.
6536 (Target_x86_64::can_icf_inline_merge_sections): Remove.
6537 (Target_x86_64::x86_64_info): Initialize
6538 can_icf_inline_merge_sections.
6539 * testsuite/testfile.cc (Target_test::test_target_info):
6540 Likewise.
6541 * icf.cc (get_section_contents): Correct formatting.
6542
6d1c4efb
ILT
65432011-06-27 Ian Lance Taylor <iant@google.com>
6544
6545 * symtab.cc (Symbol::versioned_name): New function.
6546 (Symbol_table::add_to_final_symtab): Use versioned_name when
6547 appropriate.
6548 (Symbol_table::sized_write_symbol): Likewise.
6549 * symtab.h (class Symbol): Declare versioned_name.
6550 * stringpool.h (class Stringpool_template): Add variant of add
6551 which takes a std::basic_string.
6552 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
6553 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
6554 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
6555 (ver_test_12.o): New target.
6556 * testsuite/Makefile.in: Rebuild.
6557
57eb9b50
DK
65582011-06-27 Doug Kwan <dougkwan@google.com>
6559
6560 * arm.cc (Arm_relocate_functions::thm_jump8,
6561 Arm_relocate_functions::thm_jump11): Use a wider signed
6562 type to compute offset.
6563 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
6564 arm_thm_jump8.
6565 * testsuite/Makefile.in: Regenerate.
6566 * testsuite/arm_branch_in_range.sh: Check test results of
6567 arm_thm_jump11 and arm_thm_jump8.
6568 * testsuite/arm_thm_jump11.s: New test source file.
6569 * testsuite/arm_thm_jump11.t: New linker script.
6570 * testsuite/arm_thm_jump8.s: New test source file.
6571 * testsuite/arm_thm_jump8.t: New linker script.
6572
487b39df
ILT
65732011-06-24 Ian Lance Taylor <iant@google.com>
6574
6575 * layout.cc: Include "object.h".
6576 (ctors_sections_in_init_array): New static variable.
6577 (Layout::is_ctors_in_init_array): New function.
6578 (Layout::layout): Add entry to ctors_sections_in_init_array if
6579 appropriate.
6580 * layout.h (class Layout): Declare is_ctors_in_init_array.
6581 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
6582 is_ctors_reverse_view is set.
6583 (Sized_relobj_file::write_sections): Add layout parameter. Change
6584 all callers. Set is_ctors_reverse_view field of View_size.
6585 (Sized_relobj_file::reverse_words): New function.
6586 * object.h (Sized_relobj_file::View_size): Add
6587 is_ctors_reverse_view field.
6588 (class Sized_relobj_file): Update declarations.
6589 * testsuite/initpri3.c: New test.
6590 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
6591 initpri3b.
6592 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
6593 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
6594 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
6595 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
6596 * testsuite/Makefile.in: Rebuild.
6597
472076e4
CC
65982011-06-24 Cary Coutant <ccoutant@google.com>
6599
6600 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
6601 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
6602 (debug_msg_cdebug.err): New targets.
6603 * testsuite/Makefile.in: Regenerate.
6604 * testsuite/debug_msg.sh: Check output of link with compressed debug.
6605 Fix checks for link with shared library.
6606
a60af0db
DK
66072011-06-24 Doug Kwan <dougkwan@google.com>
6608
6609 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
6610 skip empty text sections.
6611 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
6612
5393d741
ILT
66132011-06-22 Ian Lance Taylor <iant@google.com>
6614
6615 PR gold/12910
6616 * options.h (class General_options): Add --ctors-in-init-array.
6617 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
6618 friends as SHT_PROGBITS for merging sections.
6619 (Layout::layout): Remove special handling of .init_array and
6620 friends. Don't sort if doing relocatable link. Sort for .ctors
6621 and .dtors if ctors_in_init_array.
6622 (Layout::make_output_section): Force correct section types for
6623 .init_array and friends. Don't sort if doing relocatable link,
6624 Don't sort .ctors and .dtors if ctors_in_init_array.
6625 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
6626 (Layout::output_section_name): Add relobj parameter. Change all
6627 callers. Handle .ctors. and .dtors. in code rather than table.
6628 Handle .ctors and .dtors if ctors_in_init_array.
6629 (Layout::match_file_name): New function, moved from output.cc.
6630 * layout.h (class Layout): Update declarations.
6631 * output.cc: Include "layout.h".
6632 (Input_section_sort_entry::get_priority): New function.
6633 (Input_section_sort_entry::match_file_name): Just call
6634 Layout::match_file_name.
6635 (Output_section::Input_section_sort_init_fini_compare::operator()):
6636 Handle .ctors and .dtors. Sort by explicit priority rather than
6637 by name.
6638 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
6639 * testsuite/initpri2.c: New test.
6640 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
6641 (check_PROGRAMS): Add initpri2.
6642 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
6643 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
6644 * configure, testsuite/Makefile.in: Rebuild.
6645
e1f74f98
ILT
66462011-06-19 Ian Lance Taylor <iant@google.com>
6647
6648 PR gold/12880
6649 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
6650 .interp section to a PT_INTERP segment even if we have seen a
6651 --dynamic-linker option. Don't do it if we have seen a PHDRS
6652 clause in a linker script.
6653 (Layout::finalize): Don't create a .interp section if we've
6654 already create a PT_INTERP segment.
6655 (Layout::create_interp): Always call choose_output_section (revert
6656 patch of 2011-06-17). Don't create PT_INTERP segment.
6657 * script-sections.cc
6658 (Script_sections::create_note_and_tls_segments): Add a .interp
6659 section to a PT_INTERP segment even if we have seen a
6660 --dynamic-linker option.
6661
766f91bb
ILT
66622011-06-18 Ian Lance Taylor <iant@google.com>
6663
6664 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
6665 merely because a non-PT_LOAD segment has a dynamic reloc.
6666
0d212c3a
ILT
66672011-06-18 Ian Lance Taylor <iant@google.com>
6668
6669 * layout.cc (Layout::finish_dynamic_section): Don't create
6670 DT_FLAGS entry if not needed.
6671
911a5072
ILT
66722011-06-18 Ian Lance Taylor <iant@google.com>
6673
6674 PR gold/12745
6675 * layout.cc (Layout::layout_eh_frame): Correct handling of
6676 writable .eh_frame section.
6677
534b4e5f
ILT
66782011-06-17 Ian Lance Taylor <iant@google.com>
6679
6680 PR gold/12893
6681 * resolve.cc (Symbol_table::resolve): Don't give an error if a
6682 symbol is redefined with the exact same object and value.
6683
10b4f102
ILT
66842011-06-17 Ian Lance Taylor <iant@google.com>
6685
6686 PR gold/12880
6687 * layout.h (class Layout): Add interp_segment_ field.
6688 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
6689 (Layout::attach_allocated_section_to_segment): If making shared
6690 library, put .interp section in PT_INTERP segment.
6691 (Layout::finalize): Also call create_interp if -dynamic-linker
6692 option was used.
6693 (Layout::create_interp): Assert that there is no PT_INTERP
6694 segment. If not using a SECTIONS clause, use make_output_section.
6695 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
6696 * script-sections.cc
6697 (Script_sections::create_note_and_tls_segments): If making shared
6698 library, put .interp section in PT_INTERP segment.
6699
a29b0dad
ILT
67002011-06-17 Ian Lance Taylor <iant@google.com>
6701
e588ea8d
ILT
6702 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
6703 when making a shared library.
6704
67052011-06-17 Ian Lance Taylor <iant@google.com>
6706
6707 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
6708 parameter. Change all callers. Don't issue warning about PC32
6709 against locally defined symbol.
a29b0dad 6710
9d3b0698
ILT
67112011-06-16 Ian Lance Taylor <iant@google.com>
6712
6713 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
6714 occurs in same object.
6715
85b0f90c
AM
67162011-06-14 Alan Modra <amodra@gmail.com>
6717
6718 * po/POTFILES.in: Regenerate.
6719
a94907d9
ILT
67202011-06-09 Ian Lance Taylor <iant@google.com>
6721
6722 * script-sections.cc
6723 (Orphan_output_section::set_section_addresses): For a relocatable
6724 link set address to 0.
6725
4fb3a1c3
CC
67262011-06-09 Cary Coutant <ccoutant@google.com>
6727
6728 PR gold/12804
6729 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
6730 used with --compress-debug-sections.
6731 * gold/object.cc (Sized_relobj_file::do_layout): Report
6732 uncompressed size of compressed input sections.
6733
61220854
CC
67342011-06-08 Cary Coutant <ccoutant@google.com>
6735
6736 PR gold/12804
6737 * testsuite/two_file_test_2_v1.cc: Change initialization of
6738 v2 to keep it in .data.
6739
e6455dfb
CC
67402011-06-07 Cary Coutant <ccoutant@google.com>
6741
6742 * common.cc (Symbol_table::do_allocate_commons_list): Call
6743 gold_fallback.
6744 * errors.cc (Errors::fatal): Adjust call to gold_exit.
6745 (Errors::fallback): New function.
6746 (gold_fallback): New function.
6747 * errors.h (Errors::fallback): New function.
6748 * gold.cc (gold_exit): Change status parameter to enum; adjust
6749 all callers.
6750 (queue_initial_tasks): Call gold_fallback.
6751 * gold.h: Include cstdlib.
6752 (Exit_status): New enum type.
6753 (gold_exit): Change status parameter to enum.
6754 (gold_fallback): New function.
6755 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
6756 (Layout::create_symtab_sections): Likewise.
6757 (Layout::create_shdrs): Likewise.
6758 * main.cc (main): Adjust call to gold_exit.
6759 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
6760 (Output_data_got::add_got_entry_pair): Likewise.
6761 (Output_section::add_input_section): Likewise.
6762 (Output_section::add_output_section_data): Likewise.
6763 (Output_segment::set_section_list_addresses): Likewise.
6764 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
6765
fb0e076f
CC
67662011-06-07 Cary Coutant <ccoutant@google.com>
6767
6768 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
6769 for incremental links.
6770 * output.cc (Output_segment::set_section_list_addresses): Remove
6771 FIXME and test for TLS or BSS.
6772
a5ee4d5d
CC
67732011-06-07 Cary Coutant <ccoutant@google.com>
6774
6775 * testsuite/Makefile.am: Add incremental_copy_test,
6776 incremental_common_test_1.
6777 * testsuite/Makefile.in: Regenerate.
6778 * testsuite/common_test_1_v1.c: New source file.
6779 * testsuite/common_test_1_v2.c: New source file.
6780 * testsuite/copy_test_v1.cc: New source file.
6781
5146f448
CC
67822011-06-07 Cary Coutant <ccoutant@google.com>
6783
6784 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
6785 update, allocate common from bss section's free list.
6786 * incremental-dump.cc (dump_incremental_inputs): Print flag for
6787 linker-defined symbols.
6788 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
6789 Skip GOT and PLT entries that are no longer referenced.
6790 (Output_section_incremental_inputs::write_info_blocks): Mark
6791 linker-defined symbols.
6792 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
6793 * output.cc (Output_section::allocate): New function.
6794 * output.h (Output_section::allocate): New function.
6795 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
6796 linker-defined symbols.
6797 (Symbol::override_base_with_special): Copy is_predefined_ flag.
6798 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
6799 (Symbol::init_base_output_data): Likewise.
6800 (Symbol::init_base_output_segment): Likewise.
6801 (Symbol::init_base_constant): Likewise.
6802 (Sized_symbol::init_output_data): Likewise.
6803 (Sized_symbol::init_output_segment): Likewise.
6804 (Sized_symbol::init_constant): Likewise.
6805 (Symbol_table::do_define_in_output_data): Likewise.
6806 (Symbol_table::do_define_in_output_segment): Likewise.
6807 (Symbol_table::do_define_as_constant): Likewise.
6808 * symtab.h (Symbol::is_predefined): New function.
6809 (Symbol::init_base_output_data): Add is_predefined parameter.
6810 (Symbol::init_base_output_segment): Likewise.
6811 (Symbol::init_base_constant): Likewise.
6812 (Symbol::is_predefined_): New data member.
6813 (Sized_symbol::init_output_data): Add is_predefined parameter.
6814 (Sized_symbol::init_output_segment): Likewise.
6815 (Sized_symbol::init_constant): Likewise.
6816 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
6817
26d3c67d
CC
68182011-06-07 Cary Coutant <ccoutant@google.com>
6819
6820 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
6821 instead of emit_copy_reloc.
6822 (Copy_relocs::emit_copy_reloc): Refactor.
6823 (Copy_relocs::make_copy_reloc): New function.
6824 (Copy_relocs::add_copy_reloc): Remove.
6825 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
6826 section.
6827 (Copy_relocs::make_copy_reloc): New function.
6828 (Copy_relocs::add_copy_reloc): Remove.
6829 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
6830 unchanged input files.
6831 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
6832 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
6833 Reserve BSS space for COPY relocations.
6834 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6835 (Output_section_incremental_inputs::write_info_blocks): Record
6836 whether a symbol is copied from a shared object.
6837 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
6838 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
6839 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
6840 (Incremental_input_entry_reader::get_output_symbol_index): Add
6841 is_copy parameter.
6842 (Incremental_binary::emit_copy_relocs): New function.
6843 (Incremental_binary::do_emit_copy_relocs): New function.
6844 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6845 new data member.
6846 (Sized_incremental_binary::add_copy_reloc): New function.
6847 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6848 (Sized_incremental_binary::Copy_reloc): New struct.
6849 (Sized_incremental_binary::Copy_relocs): New typedef.
6850 (Sized_incremental_binary::copy_relocs_): New data member.
6851 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
6852 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
6853 * target.h (Sized_target::emit_copy_reloc): New function.
6854 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
6855
7cdb37d9
CC
68562011-06-02 Cary Coutant <ccoutant@google.com>
6857
6858 PR gold/12163
6859 * gold/archive.cc (Archive::Archive): Initialize new data member.
6860 (Archive::include_all_members): Return if archive has already been
6861 included.
6862 * gold/archive.h (Archive::include_all_members_): New data member.
6863
cc643b88
NC
68642011-06-02 Nick Clifton <nickc@redhat.com>
6865
6866 * dynobj.h: Fix spelling mistake in comment.
6867 * output.cc: Likewise.
6868
f62a3ca7 68692011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 6870 Asier Llano
f62a3ca7
DK
6871
6872 PR gold/12826
cc643b88 6873 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
6874 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
6875 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
6876 redundant arm_exidx_test.so.
6877 * testsuite/Makefile.in: Regenerate.
6878 (check_SCRIPTS): Add pr12826.sh
6879 (check_DATA): Add pr12826.stdout
6880 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
6881 * testsuite/pr12826.sh: New file.
6882 * testsuite/pr12826_1.s: Ditto.
6883 * testsuite/pr12826_1.s: Ditto.
6884
8dbe1edc
ILT
68852011-05-30 Ian Lance Taylor <iant@google.com>
6886
6887 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
6888 sections.
6889
c49875be
ILT
68902011-05-29 Ian Lance Taylor <iant@google.com>
6891
6892 PR gold/12804
6893 * testsuite/Makefile.am: Use different file name for two_file_test
6894 temporary file for each incremental test.
6895 * testsuite/Makefile.in: Rebuild.
6896
69d53f7a
ILT
68972011-05-29 Ian Lance Taylor <iant@google.com>
6898
6899 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
6900 binary input file is empty.
6901
41d0ab5f
ILT
69022011-05-27 Ian Lance Taylor <iant@google.com>
6903
6904 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
6905 (ver_test_9.so): Likewise.
6906 * testsuite/Makefile.in: Rebuild.
6907
89d8a36b
CC
69082011-05-26 Cary Coutant <ccoutant@google.com>
6909
6910 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
6911 * incremental.cc (Incremental_inputs::report_input_section): Fix
6912 comment, indentation.
6913 (Incremental_inputs::report_comdat_group): New function.
6914 (Output_section_incremental_inputs::set_final_data_size): Adjust size
6915 of data for incremental input file entry.
6916 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
6917 group count, COMDAT group signatures.
6918 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
6919 an unchanged input file.
6920 * incremental.h (Incremental_object_entry::Incremental_object_entry):
6921 Initialize new data member.
6922 (Incremental_object_entry::add_comdat_group): New function.
6923 (Incremental_object_entry::get_comdat_group_count): New function.
6924 (Incremental_object_entry::get_comdat_signature_key): New function.
6925 (Incremental_object_entry::groups_): New data member.
6926 (Incremental_inputs::report_comdat_group): New function.
6927 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
6928 data for incremental input file entry.
6929 (Incremental_input_entry_reader::get_comdat_group_count): New function.
6930 (Incremental_input_entry_reader::get_input_section): Adjust size of
6931 data for incremental input file entry.
6932 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
6933 (Incremental_input_entry_reader::get_comdat_group_signature): New
6934 function.
6935 * object.cc (Sized_relobj::include_section_group): Report kept
6936 COMDAT groups for incremental links.
6937
1706a06f
ILT
69382011-05-24 David Meyer <pdox@google.com>
6939
6940 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
6941 with name parameter. Add found_name parameter.
6942 * fileread.cc (Input_file::find_file): Adjust code accordingly.
6943 * dirsearch.h (class Dirsearch): Update declaration.
6944
a10ae760
ILT
69452011-05-24 Ian Lance Taylor <iant@google.com>
6946
6947 * archive.cc (Library_base::should_include_member): Pull in object
6948 from archive if it defines the entry symbol.
6949 * parameters.cc (Parameters::entry): New function.
6950 * parameters.h (class Parameters): Declare entry.
6951 * output.h (class Output_file_header): Remove entry_ field.
6952 * output.cc (Output_file_header::Output_file_header): Remove entry
6953 parameter. Change all callers.
6954 (Output_file_header::entry): Use parameters->entry.
6955 * gold.cc (queue_middle_tasks): Likewise.
6956 * plugin.cc (Plugin_hook::run): Likewise.
6957
aa92d6ed
CC
69582011-05-24 Cary Coutant <ccoutant@google.com>
6959
6960 * gold.cc (queue_initial_tasks): Pass incremental base filename
6961 to Output_file::open_base_file; don't print error message.
6962 * incremental-dump.cc (main): Adjust call to
6963 Output_file::open_for_modification.
6964 * incremental-dump.cc (main): Likewise.
6965 * incremental.cc (Incremental_inputs::report_command_line):
6966 Ignore --incremental-base option when comparing command lines.
6967 Ignore parameter when given as separate argument.
6968 * options.h (class General_options): Add --incremental-base.
6969 * output.cc (Output_file::Output_file):
6970 (Output_file::open_base_file): Add base_name and writable parameters;
6971 read base file into new file; print error message here.
6972 (Output_file::map_no_anonymous): Add writable parameter; adjust all
6973 callers.
6974 * output.h (Output_file::open_for_modification): Rename to...
6975 (Output_file::open_base_file): ...this; add base_name and
6976 writable parameters; adjust all callers.
6977 (Output_file::map_no_anonymous): Add writable parameter; adjust all
6978 callers.
6979 * testsuite/Makefile.am (incremental_test_4): Test
6980 --incremental-base.
6981 * testsuite/Makefile.in: Regenerate.
6982
2eedd706
CC
69832011-05-24 Cary Coutant <ccoutant@google.com>
6984
6985 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
6986 incremental_test_4.
6987 * testsuite/Makefile.in: Regenerate.
6988 * testsuite/two_file_test_1_v1.cc: New test source file.
6989 * testsuite/two_file_test_1b_v1.cc: New test source file.
6990 * testsuite/two_file_test_2_v1.cc: New test source file.
6991
0f1c85a6
CC
69922011-05-24 Cary Coutant <ccoutant@google.com>
6993
6994 * dynobj.h (Dynobj::do_dynobj): New function.
6995 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
6996 flag and soname for shared objects.
6997 * incremental.cc (Incremental_inputs::report_object): Make
6998 either Incremental_object_entry or Incremental_dynobj_entry; add
6999 soname to string table.
7000 (Incremental_inputs::report_input_section): Add assertion.
7001 (Output_section_incremental_inputs::set_final_data_size): Adjust
7002 type of input file entry for shared libraries; adjust size of
7003 shared library info entry.
7004 (Output_section_incremental_inputs::write_input_files): Write
7005 as_needed flag for shared libraries.
7006 (Output_section_incremental_inputs::write_info_blocks): Adjust type
7007 of input file entry for shared libraries; write soname.
7008 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
7009 soname from incremental info.
7010 * incremental.h (enum Incremental_input_flags): Add
7011 INCREMENTAL_INPUT_AS_NEEDED.
7012 (Incremental_input_entry::Incremental_input_entry): Initialize new
7013 data member.
7014 (Incremental_input_entry::set_as_needed): New function.
7015 (Incremental_input_entry::as_needed): New function.
7016 (Incremental_input_entry::do_dynobj_entry): New function.
7017 (Incremental_input_entry::as_needed_): New data member.
7018 (Incremental_object_entry::Incremental_object_entry): Don't check
7019 for shared library.
7020 (Incremental_object_entry::do_type): Likewise.
7021 (class Incremental_dynobj_entry): New class.
7022 (Incremental_input_entry_reader::as_needed): New function.
7023 (Incremental_input_entry_reader::get_soname): New function.
7024 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
7025 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
7026 size of shared library info entry.
58797674 7027 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
7028 incremental link when adding DT_NEEDED entries.
7029 * object.h (Object::Object): Initialize new data member.
7030 (Object::dynobj): New function.
7031 (Object::set_as_needed): New function.
7032 (Object::as_needed): New function.
7033 (Object::do_dynobj): New function.
7034 (Object::as_needed_): New data member.
7035
6fa2a40b
CC
70362011-05-24 Cary Coutant <ccoutant@google.com>
7037
7038 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
7039 info; adjust display of GOT entries.
7040 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
7041 vector of input objects; remove file_status_.
7042 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
7043 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
7044 got_plt reader; call target hooks to reserve GOT entries.
7045 (Output_section_incremental_inputs::set_final_data_size): Adjust size
7046 of input file info header and GOT info entry.
7047 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
7048 relocation info.
7049 (Got_plt_view_info::got_descriptor): Remove.
7050 (Got_plt_view_info::sym_index): New data member.
7051 (Got_plt_view_info::input_index): New data member.
7052 (Local_got_offset_visitor::visit): Write input file index.
7053 (Global_got_offset_visitor::visit): Write 0 for input file index.
7054 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
7055 with sym_index and input_index.
7056 (Output_section_incremental_inputs::write_got_plt): Adjust size of
7057 incremental info GOT entry; replace got_descriptor with input_index.
7058 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
7059 map from input file index to object.
7060 (Sized_relobj_incr::do_layout): Replace direct data member reference
7061 with accessor function.
7062 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
7063 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
7064 Adjust size of input file info header.
7065 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
7066 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
7067 (Incremental_input_entry_reader::get_input_section): Adjust size of
7068 input file info header.
7069 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
7070 of incremental info GOT entry.
7071 (Incremental_got_plt_reader::get_got_desc): Remove.
7072 (Incremental_got_plt_reader::get_got_symndx): New function.
7073 (Incremental_got_plt_reader::get_got_input_index): New function.
7074 (Sized_incremental_binary::Sized_incremental_binary): Remove
7075 file_status_; add input_objects_.
7076 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
7077 (Sized_incremental_binary::set_file_is_unchanged): Remove.
7078 (Sized_incremental_binary::file_is_unchanged): Remove.
7079 (Sized_incremental_binary::set_input_object): New function.
7080 (Sized_incremental_binary::input_object): New function.
7081 (Sized_incremental_binary::file_status_): Remove.
7082 (Sized_incremental_binary::input_objects_): New data member.
7083 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
7084 references.
7085 (Sized_relobj_incr::invalid_address): Move to base class.
7086 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
7087 class.
7088 (Sized_relobj_incr::do_output_section_offset): Likewise.
7089 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
7090 (Sized_relobj_incr::section_offsets_): Likewise.
7091 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
7092 function.
7093 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
7094 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
7095 with accessor function.
7096 (Sized_relobj_file::do_layout): Likewise.
7097 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
7098 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
7099 (Sized_relobj_file::compute_final_local_value): Replace refs to
7100 section_offsets_ with accessor function.
7101 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
7102 * object.h (Relobj::Relobj): Initialize new data members.
7103 (Relobj::add_dyn_reloc): New function.
7104 (Relobj::first_dyn_reloc): New function.
7105 (Relobj::dyn_reloc_count): New function.
7106 (Relobj::first_dyn_reloc_): New data member.
7107 (Relobj::dyn_reloc_count_): New data member.
7108 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
7109 references.
7110 (Sized_relobj::Address): New typedef.
7111 (Sized_relobj::invalid_address): Move here from child class.
7112 (Sized_relobj::Sized_relobj): Initialize new data members.
7113 (Sized_relobj::sized_relobj): New function.
7114 (Sized_relobj::is_output_section_offset_invalid): Move here from
7115 child class.
7116 (Sized_relobj::get_output_section_offset): Likewise.
7117 (Sized_relobj::local_has_got_offset): Likewise.
7118 (Sized_relobj::local_got_offset): Likewise.
7119 (Sized_relobj::set_local_got_offset): Likewise.
7120 (Sized_relobj::do_for_all_local_got_entries): Likewise.
7121 (Sized_relobj::clear_got_offsets): New function.
7122 (Sized_relobj::section_offsets): Move here from child class.
7123 (Sized_relobj::do_output_section_offset): Likewise.
7124 (Sized_relobj::do_set_section_offset): Likewise.
7125 (Sized_relobj::Local_got_offsets): Likewise.
7126 (Sized_relobj::local_got_offsets_): Likewise.
7127 (Sized_relobj::section_offsets_): Likewise.
7128 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
7129 references.
7130 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
7131 class.
7132 (Sized_relobj_file::sized_relobj): New function
7133 (Sized_relobj_file::local_has_got_offset): Move to base class.
7134 (Sized_relobj_file::local_got_offset): Likewise.
7135 (Sized_relobj_file::set_local_got_offset): Likewise.
7136 (Sized_relobj_file::get_output_section_offset): Likewise.
7137 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
7138 (Sized_relobj_file::do_output_section_offset): Likewise.
7139 (Sized_relobj_file::do_set_section_offset): Likewise.
7140 (Sized_relobj_file::Local_got_offsets): Likewise.
7141 (Sized_relobj_file::local_got_offsets_): Likewise.
7142 (Sized_relobj_file::section_offsets_): Likewise.
7143 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
7144 (all constructors).
7145 (set_needs_dynsym_index): Convert relobj to derived class pointer.
7146 (Output_reloc::get_symbol_index): Likewise.
7147 (Output_reloc::local_section_offset): Likewise.
7148 (Output_reloc::get_address): Likewise.
7149 (Output_reloc::symbol_value): Likewise.
7150 (Output_data_got::reserve_slot): Move to class definition.
7151 (Output_data_got::reserve_local): New function.
7152 (Output_data_got::reserve_slot_for_global): Remove.
7153 (Output_data_got::reserve_global): New function.
7154 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
7155 (all constructors, two instantiations).
7156 (Output_reloc::get_relobj): New function (two instantiations).
7157 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
7158 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
7159 (Output_data_reloc::add_global): Adjust type of relobj.
7160 (Output_data_reloc::add_global_relative): Likewise.
7161 (Output_data_reloc::add_symbolless_global_addend): Likewise.
7162 (Output_data_reloc::add_local): Likewise.
7163 (Output_data_reloc::add_local_relative): Likewise.
7164 (Output_data_reloc::add_symbolless_local_addend): Likewise.
7165 (Output_data_reloc::add_local_section): Likewise.
7166 (Output_data_reloc::add_output_section): Likewise.
7167 (Output_data_reloc::add_absolute): Likewise.
7168 (Output_data_reloc::add_target_specific): Likewise.
7169 (Output_data_got::reserve_slot): Move definition here.
7170 (Output_data_got::reserve_local): New function.
7171 (Output_data_got::reserve_global): New function.
7172 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
7173 section_offsets_ with accessor function.
7174 (Sized_relobj_file::write_sections): Likewise.
7175 (Sized_relobj_file::do_relocate_sections): Likewise.
7176 * target.h (Sized_target::reserve_local_got_entry): New function.
7177 (Sized_target::reserve_global_got_entry): New function.
7178 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
7179 (Target_x86_64::reserve_global_got_entry): New function.
7180 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
7181
4829d394
CC
71822011-05-23 Cary Coutant <ccoutant@google.com>
7183
7184 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
7185 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
7186 bit when checking got_type.
7187 * incremental.cc (Sized_incremental_binary::setup_readers):
7188 Store symbol table and string table locations; initialize bit vector
7189 of file status flags.
7190 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
7191 unchanged files.
7192 (Sized_incremental_binary::do_process_got_plt): New function.
7193 (Sized_incremental_binary::get_symtab_view): Use stored locations.
7194 (Output_section_incremental_inputs::set_final_data_size): Record
7195 file index for each input file.
7196 (Output_section_incremental_inputs::write_got_plt): Store file index
7197 instead of input entry offset for each GOT entry.
7198 * incremental.h
7199 (Incremental_input_entry::Incremental_input_entry): Initialize new
7200 data member.
7201 (Incremental_input_entry::set_offset): Store file index.
7202 (Incremental_input_entry::get_file_index): New function.
7203 (Incremental_input_entry::file_index_): New data member.
7204 (Incremental_binary::process_got_plt): New function.
7205 (Incremental_binary::do_process_got_plt): New function.
7206 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7207 data members.
7208 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
7209 (Sized_incremental_binary::set_file_is_unchanged): New function.
7210 (Sized_incremental_binary::file_is_unchanged): New function.
7211 (Sized_incremental_binary::do_process_got_plt): New function.
7212 (Sized_incremental_binary::file_status_): New data member.
7213 (Sized_incremental_binary::main_symtab_loc_): New data member.
7214 (Sized_incremental_binary::main_strtab_loc_): New data member.
7215 * output.cc (Output_data_got::Got_entry::write): Add case
7216 RESERVED_CODE.
7217 (Output_data_got::add_global): Call add_got_entry.
7218 (Output_data_got::add_global_plt): Likewise.
7219 (Output_data_got::add_global_with_rel): Likewise.
7220 (Output_data_got::add_global_with_rela): Likewise.
7221 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
7222 (Output_data_got::add_global_pair_with_rela): Likewise.
7223 (Output_data_got::add_local): Call add_got_entry.
7224 (Output_data_got::add_local_plt): Likewise.
7225 (Output_data_got::add_local_with_rel): Likewise.
7226 (Output_data_got::add_local_with_rela): Likewise.
7227 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
7228 (Output_data_got::add_local_pair_with_rela): Likewise.
7229 (Output_data_got::reserve_slot): New function.
7230 (Output_data_got::reserve_slot_for_global): New function.
7231 (Output_data_got::add_got_entry): New function.
7232 (Output_data_got::add_got_entry_pair): New function.
7233 (Output_section::add_output_section_data): Edit FIXME.
7234 * output.h
7235 (Output_section_data_build::Output_section_data_build): New
7236 constructor with size parameter.
7237 (Output_data_space::Output_data_space): Likewise.
7238 (Output_data_got::Output_data_got): Initialize new data member; new
7239 constructor with size parameter.
7240 (Output_data_got::add_constant): Call add_got_entry.
7241 (Output_data_got::reserve_slot): New function.
7242 (Output_data_got::reserve_slot_for_global): New function.
7243 (class Output_data_got::Got_entry): Add RESERVED_CODE.
7244 (Output_data_got::add_got_entry): New function.
7245 (Output_data_got::add_got_entry_pair): New function.
7246 (Output_data_got::free_list_): New data member.
7247 * target.h (Sized_target::init_got_plt_for_update): New function.
7248 (Sized_target::register_global_plt_entry): New function.
7249 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
7250 Initialize new data member; call init; add constructor with PLT count.
7251 (Output_data_plt_x86_64::init): New function.
7252 (Output_data_plt_x86_64::add_relocation): New function.
7253 (Output_data_plt_x86_64::reserve_slot): New function.
7254 (Output_data_plt_x86_64::free_list_): New data member.
7255 (Target_x86_64::init_got_plt_for_update): New function.
7256 (Target_x86_64::register_global_plt_entry): New function.
7257 (Output_data_plt_x86_64::add_entry): Allocate from free list for
7258 incremental updates.
7259 (Output_data_plt_x86_64::add_relocation): New function.
7260 * testsuite/object_unittest.cc (Object_test): Set default options.
7261
ec69d6da
ILT
72622011-05-16 Ian Lance Taylor <iant@google.com>
7263
7264 * options.h (class General_options): Make -i a synonym for -r.
7265
732e31de
ILT
72662011-05-16 Ian Lance Taylor <iant@google.com>
7267
7268 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
7269
403676b5
CC
72702011-05-10 Cary Coutant <ccoutant@google.com>
7271
7272 * object.cc (Sized_relobj::do_count_local_symbols): Check for
7273 strip_all (-s).
7274
5b7b7d6e
ILT
72752011-05-06 Ian Lance Taylor <iant@google.com>
7276
7277 * layout.cc (Layout::layout): If the output section flags change,
7278 update the ordering.
7279
f0f9babf
CC
72802011-04-25 Cary Coutant <ccoutant@google.com>
7281
7282 * incremental-dump.cc (dump_incremental_inputs): Print local
7283 symbol info for each input file.
7284 * incremental.cc
7285 (Output_section_incremental_inputs::set_final_data_size): Add local
7286 symbol info to input file entries in incremental info.
7287 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7288 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
7289 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
7290 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
7291 implementation.
7292 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
7293 (Sized_incr_relobj::do_relocate): Write the local symbols.
7294 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
7295 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
7296 Adjust size of input file header.
7297 (Incremental_inputs_reader::get_local_symbol_offset): New function.
7298 (Incremental_inputs_reader::get_local_symbol_count): New function.
7299 (Incremental_inputs_reader::get_input_section): Adjust size of input
7300 file header.
7301 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
7302 (Sized_incr_relobj::This): New typedef.
7303 (Sized_incr_relobj::sym_size): New const data member.
7304 (Sized_incr_relobj::Local_symbol): New struct.
7305 (Sized_incr_relobj::do_output_local_symbol_count): New function.
7306 (Sized_incr_relobj::do_local_symbol_offset): New function.
7307 (Sized_incr_relobj::local_symbol_count_): New data member.
7308 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
7309 (Sized_incr_relobj::local_symbol_index_): New data member.
7310 (Sized_incr_relobj::local_symbol_offset_): New data member.
7311 (Sized_incr_relobj::local_dynsym_offset_): New data member.
7312 (Sized_incr_relobj::local_symbols_): New data member.
7313 * object.h (Relobj::output_local_symbol_count): New function.
7314 (Relobj::local_symbol_offset): New function.
7315 (Relobj::do_output_local_symbol_count): New function.
7316 (Relobj::do_local_symbol_offset): New function.
7317 (Sized_relobj::do_output_local_symbol_count): New function.
7318 (Sized_relobj::do_local_symbol_offset): New function.
7319
d0a9ace3
ILT
73202011-04-22 Vladimir Simonov <sv@sw.ru>
7321
7322 * descriptors.cc (set_close_on_exec): New function.
7323 (Descriptors::open): Use set_close_on_exec.
7324 * output.cc (S_ISLNK): Define if not defined.
7325
94a3fc8b
CC
73262011-04-22 Cary Coutant <ccoutant@google.com>
7327
7328 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
7329 global symbol map.
7330 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7331 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
7332 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
7333 relocations.
7334 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
7335 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
7336 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
7337 * incremental.h
7338 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
7339 function.
7340 (Incremental_binary::apply_incremental_relocs): New function.
7341 (Incremental_binary::do_apply_incremental_relocs): New function.
7342 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7343 data member.
7344 (Sized_incremental_binary::add_global_symbol): New function.
7345 (Sized_incremental_binary::global_symbol): New function.
7346 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7347 (Sized_incremental_binary::symbol_map_): New data member.
7348 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
7349 * target.h (Sized_target::apply_relocation): New function.
7350 * target-reloc.h (apply_relocation): New function.
7351 * x86_64.cc (Target_x86_64::apply_relocation): New function.
7352
c87e4302
DK
73532011-04-22 Doug Kwan <dougkwan@google.com>
7354
7355 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
7356 flag of a SHT_ARM_EXIDX section.
2e702c99 7357 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
7358 * testsuite/Makefile.in: Regenerate.
7359 * testsuite/arm_exidx_test.s: New file.
7360 * testsuite/arm_exidx_test.sh: Same.
7361
e7782cf6
CC
73622011-04-20 Cary Coutant <ccoutant@google.com>
7363
7364 PR gold/12689
7365 * archive.h (Incremental_archive_entry::Archive_member):
7366 Initialize arg_serial_ (second constructor).
7367
308ecdc7
ILT
73682011-04-17 Ian Lance Taylor <iant@google.com>
7369
7370 * object.cc (Relocate_info::location): Simplify location string.
7371 * errors.cc (Errors::error_at_location): Don't print program
7372 name.
7373 (Errors::warning_at_location): Likewise.
7374 (Errors::undefined_symbol): Likewise.
7375 * testsuite/debug_msg.sh: Update accordingly.
7376
bec5b579
CC
73772011-04-14 Cary Coutant <ccoutant@google.com>
7378
7379 * gold/layout.cc (Layout::symtab_section_offset): New function.
7380 * gold/layout.h (Layout::symtab_section_offset): New function.
7381 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
7382
88597d34
ILT
73832011-04-12 Ian Lance Taylor <iant@google.com>
7384
7385 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
7386 with MREMAP_MAYMOVE.
7387 * output.h (class Output_file): Add map_is_allocated_ field.
7388 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
7389 not available, provide stubs. If mremap is not available, #define
7390 it to gold_mremap.
7391 (MREMAP_MAYMOVE): Define if not defined.
7392 (Output_file::Output_file): Initialize map_is_allocated_.
7393 (Output_file::resize): Check map_is_allocated_.
7394 (Output_file::map_anonymous): If mmap fails, use malloc.
7395 (Output_file::unmap): Don't do anything for an anonymous map.
7396 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
7397 is not available, provide stubs.
7398 (File_read::View::~View): Use free rather than delete[].
7399 (File_read::make_view): Use malloc rather than new[]. If mmap
7400 fails, use malloc.
7401 (File_read::find_or_make_view): Use malloc rather than new[].
7402 * gold.h: Remove HAVE_REMAP code.
7403 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
7404 exists. Rename mremap to gold_mremap. If mmap is not available
7405 don't do anything.
7406 * configure, config.in: Rebuild.
7407
11e361bc
ILT
74082011-04-11 Ian Lance Taylor <iant@google.com>
7409
7410 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
7411 initialize local variable v.
7412
cdc29364
CC
74132011-04-11 Cary Coutant <ccoutant@google.com>
7414
7415 * archive.cc (Archive::include_member): Adjust call to
7416 report_object.
7417 (Add_archive_symbols::run): Track argument serial numbers.
7418 (Lib_group::include_member): Likewise.
7419 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
7420 * archive.h (Incremental_archive_entry::Archive_member):
7421 Initialize arg_serial_.
7422 (Archive_member::arg_serial_): New data member.
7423 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
7424 (Sized_dynobj::do_add_symbols): Track symbols when doing an
7425 incremental link.
7426 (Sized_dynobj::do_for_all_local_got_entries): New function.
7427 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
7428 function.
7429 * fileread.cc (get_mtime): New function.
7430 * fileread.h (get_mtime): New function.
7431 * gold.cc (queue_initial_tasks): Check for incremental update.
7432 (process_incremental_input): New function.
7433 (queue_middle_tasks): Don't force valid target for incremental
7434 update.
7435 * incremental-dump.cc (find_input_containing_global): Adjust
7436 size of symbol info entry.
7437 (dump_incremental_inputs): Dump argument serial number and
7438 in_system_directory flag; bias shndx by 1; print symbol names
7439 when dumping per-file symbol lists; use new symbol info readers.
7440 * incremental.cc
7441 (Output_section_incremental_inputs:update_data_size): New function.
7442 (Sized_incremental_binary::setup_readers): Setup input readers
7443 for each input file; build maps for files added from libraries
7444 and scripts.
7445 (Sized_incremental_binary::check_input_args): New function.
7446 (Sized_incremental_binary::do_check_inputs): Build map of argument
7447 serial numbers to input arguments.
7448 (Sized_incremental_binary::do_file_has_changed): Rename
7449 do_file_is_unchanged to this; compare file modification times.
7450 (Sized_incremental_binary::do_init_layout): New function.
7451 (Sized_incremental_binary::do_reserve_layout): New function.
7452 (Sized_incremental_binary::do_get_input_reader): Remove.
7453 (Sized_incremental_binary::get_symtab_view): New function.
7454 (Incremental_checker::can_incrementally_link_output_file): Remove.
7455 (Incremental_inputs::report_command_line): Exclude --debug options.
7456 (Incremental_inputs::report_archive_begin): Add parameter; track
7457 argument serial numbers; don't put input file entry for archive
7458 before archive members.
7459 (Incremental_inputs::report_archive_end): Put input file entry
7460 for archive after archive members.
7461 (Incremental_inputs::report_object): Add parameter; track argument
7462 serial numbers and in_system_directory flag.
7463 (Incremental_inputs::report_script): Add parameter; track argument
7464 serial numbers.
7465 (Output_section_incremental_inputs::set_final_data_size): Adjust
7466 size of symbol info entry; check for forwarding symbols.
7467 (Output_section_incremental_inputs::write_input_files): Write
7468 in_system_directory flag and argument serial number.
7469 (Output_section_incremental_inputs::write_info_blocks): Map section
7470 indices between incremental info and original input file; store
7471 input section index for each symbol.
7472 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
7473 change operator() to visit().
7474 (class Global_got_offset_visitor): Likewise.
7475 (class Global_symbol_visitor_got_plt):
7476 (Output_section_incremental_inputs::write_got_plt): Use new visitor
7477 classes.
7478 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
7479 (Sized_incr_relobj::do_read_symbols): New function.
7480 (Sized_incr_relobj::do_layout): New function.
7481 (Sized_incr_relobj::do_layout_deferred_sections): New function.
7482 (Sized_incr_relobj::do_add_symbols): New function.
7483 (Sized_incr_relobj::do_should_include_member): New function.
7484 (Sized_incr_relobj::do_for_all_global_symbols): New function.
7485 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
7486 (Sized_incr_relobj::do_section_size): New function.
7487 (Sized_incr_relobj::do_section_name): New function.
7488 (Sized_incr_relobj::do_section_contents): New function.
7489 (Sized_incr_relobj::do_section_flags): New function.
7490 (Sized_incr_relobj::do_section_entsize): New function.
7491 (Sized_incr_relobj::do_section_address): New function.
7492 (Sized_incr_relobj::do_section_type): New function.
7493 (Sized_incr_relobj::do_section_link): New function.
7494 (Sized_incr_relobj::do_section_info): New function.
7495 (Sized_incr_relobj::do_section_addralign): New function.
7496 (Sized_incr_relobj::do_initialize_xindex): New function.
7497 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
7498 (Sized_incr_relobj::do_read_relocs): New function.
7499 (Sized_incr_relobj::do_gc_process_relocs): New function.
7500 (Sized_incr_relobj::do_scan_relocs): New function.
7501 (Sized_incr_relobj::do_count_local_symbols): New function.
7502 (Sized_incr_relobj::do_finalize_local_symbols): New function.
7503 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
7504 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
7505 (Sized_incr_relobj::do_relocate): New function.
7506 (Sized_incr_relobj::do_set_section_offset): New function.
7507 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
7508 (Sized_incr_dynobj::do_read_symbols): New function.
7509 (Sized_incr_dynobj::do_layout): New function.
7510 (Sized_incr_dynobj::do_add_symbols): New function.
7511 (Sized_incr_dynobj::do_should_include_member): New function.
7512 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
7513 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
7514 (Sized_incr_dynobj::do_section_size): New function.
7515 (Sized_incr_dynobj::do_section_name): New function.
7516 (Sized_incr_dynobj::do_section_contents): New function.
7517 (Sized_incr_dynobj::do_section_flags): New function.
7518 (Sized_incr_dynobj::do_section_entsize): New function.
7519 (Sized_incr_dynobj::do_section_address): New function.
7520 (Sized_incr_dynobj::do_section_type): New function.
7521 (Sized_incr_dynobj::do_section_link): New function.
7522 (Sized_incr_dynobj::do_section_info): New function.
7523 (Sized_incr_dynobj::do_section_addralign): New function.
7524 (Sized_incr_dynobj::do_initialize_xindex): New function.
7525 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
7526 (make_sized_incremental_object): New function.
7527 (Incremental_library::copy_unused_symbols): New function.
7528 (Incremental_library::do_for_all_unused_symbols): New function.
7529 * incremental.h (enum Incremental_input_flags): New type.
7530 (class Incremental_checker): Remove.
7531 (Incremental_input_entry::Incremental_input_entry): Add argument
7532 serial number.
7533 (Incremental_input_entry::arg_serial): New function.
7534 (Incremental_input_entry::set_is_in_system_directory): New function.
7535 (Incremental_input_entry::is_in_system_directory): New function.
7536 (Incremental_input_entry::arg_serial_): New data member.
7537 (Incremental_input_entry::is_in_system_directory_): New data member.
7538 (class Script_info): Move here from script.h.
7539 (Script_info::Script_info): Add filename parameter.
7540 (Script_info::filename): New function.
7541 (Script_info::filename_): New data member.
7542 (Incremental_script_entry::Incremental_script_entry): Add argument
7543 serial number.
7544 (Incremental_object_entry::Incremental_object_entry): Likewise.
7545 (Incremental_object_entry::add_input_section): Build list of input
7546 sections with map to original shndx.
7547 (Incremental_object_entry::get_input_section_index): New function.
7548 (Incremental_object_entry::shndx_): New data member.
7549 (Incremental_object_entry::name_key_): Rename; adjust all refs.
7550 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
7551 (Incremental_archive_entry::Incremental_archive_entry): Add argument
7552 serial number.
7553 (Incremental_inputs::report_archive_begin): Likewise.
7554 (Incremental_inputs::report_object): Likewise.
7555 (Incremental_inputs::report_script): Likewise.
7556 (class Incremental_global_symbol_reader): New class.
7557 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
7558 and store flags and input file type.
7559 (Incremental_input_entry_reader::arg_serial): New function.
7560 (Incremental_input_entry_reader::type): Extract type from flags.
7561 (Incremental_input_entry_reader::is_in_system_directory): New function.
7562 (Incremental_input_entry_reader::get_input_section_count): Call
7563 accessor function for type.
7564 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
7565 function for type; adjust size of global symbol entry.
7566 (Incremental_input_entry_reader::get_global_symbol_count): Call
7567 accessor function for type.
7568 (Incremental_input_entry_reader::get_object_count): Likewise.
7569 (Incremental_input_entry_reader::get_object_offset): Likewise.
7570 (Incremental_input_entry_reader::get_member_count): Likewise.
7571 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
7572 (Incremental_input_entry_reader::get_member_offset): Likewise.
7573 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
7574 (Incremental_input_entry_reader::Global_symbol_info): Remove.
7575 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
7576 (Incremental_input_entry_reader::get_global_symbol_reader): New
7577 function.
7578 (Incremental_input_entry_reader::get_output_symbol_index): New
7579 function.
7580 (Incremental_input_entry_reader::type_): Remove.
7581 (Incremental_input_entry_reader::flags_): New data member.
7582 (Incremental_inputs_reader::input_file_offset): New function.
7583 (Incremental_inputs_reader::input_file_index): New function.
7584 (Incremental_inputs_reader::input_file): Call input_file_offset.
7585 (Incremental_inputs_reader::input_file_at_offset): New function.
7586 (Incremental_relocs_reader::get_r_type): Reformat.
7587 (Incremental_relocs_reader::get_r_shndx): Reformat.
7588 (Incremental_relocs_reader::get_r_offset): Reformat.
7589 (Incremental_relocs_reader::data): New function.
7590 (Incremental_binary::Incremental_binary): Initialize new data members.
7591 (Incremental_binary::check_inputs): Add cmdline parameter.
7592 (Incremental_binary::file_is_unchanged): Remove.
7593 (Input_reader::arg_serial): New function.
7594 (Input_reader::get_unused_symbol_count): New function.
7595 (Input_reader::get_unused_symbol): New function.
7596 (Input_reader::do_arg_serial): New function.
7597 (Input_reader::do_get_unused_symbol_count): New function.
7598 (Input_reader::do_get_unused_symbol): New function.
7599 (Incremental_binary::input_file_count): New function.
7600 (Incremental_binary::get_input_reader): Change signature to use
7601 index instead of filename.
7602 (Incremental_binary::file_has_changed): New function.
7603 (Incremental_binary::get_input_argument): New function.
7604 (Incremental_binary::get_library): New function.
7605 (Incremental_binary::get_script_info): New function.
7606 (Incremental_binary::init_layout): New function.
7607 (Incremental_binary::reserve_layout): New function.
7608 (Incremental_binary::output_file): New function.
7609 (Incremental_binary::do_check_inputs): New function.
7610 (Incremental_binary::do_file_is_unchanged): Remove.
7611 (Incremental_binary::do_file_has_changed): New function.
7612 (Incremental_binary::do_init_layout): New function.
7613 (Incremental_binary::do_reserve_layout): New function.
7614 (Incremental_binary::do_input_file_count): New function.
7615 (Incremental_binary::do_get_input_reader): Change signature.
7616 (Incremental_binary::input_args_map_): New data member.
7617 (Incremental_binary::library_map_): New data member.
7618 (Incremental_binary::script_map_): New data member.
7619 (Sized_incremental_binary::Sized_incremental_binary): Initialize
7620 new data members.
7621 (Sized_incremental_binary::output_section): New function.
7622 (Sized_incremental_binary::inputs_reader): Add const.
7623 (Sized_incremental_binary::symtab_reader): Add const.
7624 (Sized_incremental_binary::relocs_reader): Add const.
7625 (Sized_incremental_binary::got_plt_reader): Add const.
7626 (Sized_incremental_binary::get_symtab_view): New function.
7627 (Sized_incremental_binary::Inputs_reader): New typedef.
7628 (Sized_incremental_binary::Input_entry_reader): New typedef.
7629 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
7630 (Sized_incremental_binary::do_file_is_unchanged): Remove.
7631 (Sized_incremental_binary::do_file_has_changed): New function.
7632 (Sized_incremental_binary::do_init_layout): New function.
7633 (Sized_incremental_binary::do_reserve_layout): New function.
7634 (Sized_input_reader::Inputs_reader): Remove.
7635 (Sized_input_reader::Input_entry_reader): Remove.
7636 (Sized_input_reader::do_arg_serial): New function.
7637 (Sized_input_reader::do_get_unused_symbol_count): New function.
7638 (Sized_input_reader::do_get_unused_symbol): New function.
7639 (Sized_incremental_binary::do_input_file_count): New function.
7640 (Sized_incremental_binary::do_get_input_reader): Change signature;
7641 use index instead of filename.
7642 (Sized_incremental_binary::section_map_): New data member.
7643 (Sized_incremental_binary::input_entry_readers_): New data member.
7644 (class Sized_incr_relobj): New class.
7645 (class Sized_incr_dynobj): New class.
7646 (make_sized_incremental_object): New function.
7647 (class Incremental_library): New class.
7648 * layout.cc (Free_list::num_lists): New static data member.
7649 (Free_list::num_nodes): New static data member.
7650 (Free_list::num_removes): New static data member.
7651 (Free_list::num_remove_visits): New static data member.
7652 (Free_list::num_allocates): New static data member.
7653 (Free_list::num_allocate_visits): New static data member.
7654 (Free_list::init): New function.
7655 (Free_list::remove): New function.
7656 (Free_list::allocate): New function.
7657 (Free_list::dump): New function.
7658 (Free_list::print_stats): New function.
7659 (Layout_task_runner::run): Resize output file for incremental updates.
7660 (Layout::Layout): Initialize new data members.
7661 (Layout::set_incremental_base): New function.
7662 (Layout::init_fixed_output_section): New function.
7663 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
7664 incremental updates.
7665 (Layout::create_gold_note): Do not create gold note section for
7666 incremental updates.
7667 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
7668 for incremental updates.
7669 (Layout::set_section_offsets): For incremental updates, allocate space
7670 from free list.
7671 (Layout::create_symtab_sections): Layout with offsets relative to
7672 start of section; for incremental updates, allocate space from free
7673 list.
7674 (Layout::create_shdrs): For incremental updates, allocate space from
7675 free list.
7676 (Layout::finish_dynamic_section): For incremental updates, do not
7677 check --as-needed (fixed in subsequent patch).
7678 * layout.h (class Free_list): New class.
7679 (Layout::set_incremental_base): New function.
7680 (Layout::incremental_base): New function.
7681 (Layout::init_fixed_output_section): New function.
7682 (Layout::allocate): New function.
7683 (Layout::incremental_base_): New data member.
7684 (Layout::free_list_): New data member.
7685 * main.cc (main): Print Free_list statistics.
7686 * object.cc (Relobj::finalize_incremental_relocs): Add
7687 clear_counts parameter; clear counts only when clear_counts is set.
7688 (Sized_relobj::Sized_relobj): Initialize new base class.
7689 (Sized_relobj::do_layout): Don't report special sections.
7690 (Sized_relobj::do_for_all_local_got_entries): New function.
7691 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
7692 symtab_off to all symbol table offsets.
7693 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
7694 * object.h (class Got_offset_list): Move to top of file.
7695 (Object::Object): Allow case where input_file == NULL.
7696 (Object::~Object): Likewise.
7697 (Object::input_file): Assert that input_file != NULL.
7698 (Object::lock): Allow case where input_file == NULL.
7699 (Object::unlock): Likewise.
7700 (Object::is_locked): Likewise.
7701 (Object::token): Likewise.
7702 (Object::release): Likewise.
7703 (Object::is_incremental): New function.
7704 (Object::get_mtime): New function.
7705 (Object::for_all_local_got_entries): New function.
7706 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
7707 (Object::set_is_in_system_directory): New function.
7708 (Object::is_in_system_directory): New function.
7709 (Object::do_is_incremental): New function.
7710 (Object::do_get_mtime): New function.
7711 (Object::do_for_all_local_got_entries): New function.
7712 (Object::is_in_system_directory_): New data member.
7713 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
7714 (class Sized_relobj_base): New class.
7715 (class Sized_relobj): Derive from Sized_relobj_base.
7716 (class Sized_relobj::Symbols): Redeclare from base class.
7717 (class Sized_relobj::local_got_offset_list): Remove.
7718 (class Sized_relobj::Output_sections): Redeclare from base class.
7719 (class Sized_relobj::do_for_all_local_got_entries): New function.
7720 (class Sized_relobj::write_local_symbols): Add offset parameter.
7721 (class Sized_relobj::local_symbol_offset_): Update comment.
7722 (class Sized_relobj::local_dynsym_offset_): Update comment.
7723 * options.cc (Input_arguments::add_file): Remove const.
7724 * options.h (Input_file_argument::Input_file_argument):
7725 Initialize arg_serial_ (all constructors).
7726 (Input_file_argument::set_arg_serial): New function.
7727 (Input_file_argument::arg_serial): New function.
7728 (Input_file_argument::arg_serial_): New data member.
7729 (Input_arguments::Input_arguments): Initialize file_count_.
7730 (Input_arguments::add_file): Remove const.
7731 (Input_arguments::number_of_input_files): New function.
7732 (Input_arguments::file_count_): New data member.
7733 (Command_line::number_of_input_files): Call
7734 Input_arguments::number_of_input_files.
7735 * output.cc (Output_segment_headers::Output_segment_headers):
7736 Set current size.
7737 (Output_section::Input_section::current_data_size): New function.
7738 (Output_section::Output_section): Initialize new data members.
7739 (Output_section::add_input_section): Don't do merge sections for
7740 an incremental link; allocate space from free list for an
7741 incremental update.
7742 (Output_section::add_output_section_data): Allocate space from
7743 free list for an incremental update.
7744 (Output_section::update_data_size): New function.
7745 (Output_section::set_fixed_layout): New function.
7746 (Output_section::reserve): New function.
7747 (Output_segment::set_section_addresses): Remove const.
7748 (Output_segment::set_section_list_addresses): Remove const; allocate
7749 space from free list for an incremental update.
7750 (Output_segment::set_offset): Adjust size of RELRO segment for an
7751 incremental update.
7752 * output.h (Output_data::current_data_size): Move here from
7753 child classes.
7754 (Output_data::pre_finalize_data_size): New function.
7755 (Output_data::update_data_size): New function.
7756 (Output_section_headers::update_data_size): new function.
7757 (Output_section_data_build::current_data_size): Move to Output_data.
7758 (Output_data_strtab::update_data_size): New function.
7759 (Output_section::current_data_size): Move to Output_data.
7760 (Output_section::set_fixed_layout): New function.
7761 (Output_section::has_fixed_layout): New function.
7762 (Output_section::reserve): New function.
7763 (Output_section::update_data_size): New function.
7764 (Output_section::has_fixed_layout_): New data member.
7765 (Output_section::free_list_): New data member.
7766 (Output_segment::set_section_addresses): Remove const.
7767 (Output_segment::set_section_list_addresses): Remove const.
7768 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
7769 New function.
7770 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
7771 New function.
7772 * readsyms.cc (Read_symbols::do_read_symbols): Add library
7773 parameter when calling Add_symbols constructor; store argument
7774 serial number for members of a lib group.
7775 (Add_symbols::locks): Allow case where token == NULL.
7776 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
7777 (Read_member::~Read_member): New function.
7778 (Read_member::is_runnable): New function.
7779 (Read_member::locks): New function.
7780 (Read_member::run): New function.
7781 (Check_script::~Check_script): New function.
7782 (Check_script::is_runnable): New function.
7783 (Check_script::locks): New function.
7784 (Check_script::run): New function.
7785 (Check_library::~Check_library): New function.
7786 (Check_library::is_runnable): New function.
7787 (Check_library::locks): New function.
7788 (Check_library::run): New function.
7789 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
7790 (Add_symbols::library_): New data member.
7791 (class Read_member): New class.
7792 (class Check_script): New class.
7793 (class Check_library): New class.
7794 * reloc.cc (Read_relocs::is_runnable): Allow case where
7795 token == NULL.
7796 (Read_relocs::locks): Likewise.
7797 (Scan_relocs::locks): Likewise.
7798 (Relocate_task::locks): Likewise.
7799 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
7800 to clear counters.
7801 (Sized_relobj::incremental_relocs_scan): Fix comment.
7802 (Sized_relobj::do_relocate): Pass output file offset to
7803 write_local_symbols.
7804 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
7805 from class declaration.
7806 * script.cc (read_input_script): Allocate Script_info; pass
7807 argument serial number to report_script.
7808 * script.h (class Script_info): Move to incremental.h.
7809 * symtab.cc (Symbol_table::add_from_incrobj): New function.
7810 * symtab.h (Symbol_table::add_from_incrobj): New function.
7811 (Symbol_table::set_file_offset): New function.
7812
b961d0d7
CC
78132011-04-05 Cary Coutant <ccoutant@google.com>
7814
7815 * incremental-dump.cc (dump_incremental_inputs): Change signature
7816 to take a Sized_incremental_binary; change caller. Use readers
7817 in Sized_incremental_binary.
7818 * incremental.cc
7819 (Sized_incremental_binary::find_incremental_inputs_sections):
7820 Rename do_find_incremental_inputs_sections to this.
7821 (Sized_incremental_binary::setup_readers): New function.
7822 (Sized_incremental_binary::do_check_inputs): Check
7823 has_incremental_info_ flag; move setup code to setup_readers;
7824 use input readers.
7825 (Sized_incremental_binary::do_file_is_unchanged): New function.
7826 (Sized_incremental_binary::do_get_input_reader): New function.
7827 * incremental.h (class Incremental_binary): Move to end of file.
7828 (Incremental_binary::file_is_unchanged): New function.
7829 (Incremental_binary::do_file_is_unchanged): New function.
7830 (Incremental_binary::Input_reader): New class.
7831 (Incremental_binary::get_input_reader): New function.
7832 (class Sized_incremental_binary): Move to end of file.
7833 (Sized_incremental_binary::Sized_incremental_binary): Setup the
7834 input section reader classes.
7835 (Sized_incremental_binary::has_incremental_info): New function.
7836 (Sized_incremental_binary::inputs_reader): New function.
7837 (Sized_incremental_binary::symtab_reader): New function.
7838 (Sized_incremental_binary::relocs_reader): New function.
7839 (Sized_incremental_binary::got_plt_reader): New function.
7840 (Sized_incremental_binary::do_file_is_unchanged): New function.
7841 (Sized_incremental_binary::Sized_input_reader): New class.
7842 (Sized_incremental_binary::get_input_reader): New function.
7843 (Sized_incremental_binary::find_incremental_inputs_sections):
7844 Rename do_find_incremental_inputs_sections to this.
7845 (Sized_incremental_binary::setup_readers): New function.
7846 (Sized_incremental_binary::has_incremental_info_): New data member.
7847 (Sized_incremental_binary::inputs_reader_): New data member.
7848 (Sized_incremental_binary::symtab_reader_): New data member.
7849 (Sized_incremental_binary::relocs_reader_): New data member.
7850 (Sized_incremental_binary::got_plt_reader_): New data member.
7851 (Sized_incremental_binary::current_input_file_): New data member.
7852
a869183f
PP
78532011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
7854
7855 PR gold/12640
7856 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
7857 violation.
7858
78592011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
7860
7861 * archive.cc (Archive::include_member): Adjust call to report_object.
7862 (Add_archive_symbols::run): Add script_info to call to
7863 report_archive_begin.
7864 (Lib_group::include_member): Adjust call to report_object.
7865 (Add_lib_group_symbols::run): Adjust call to report_object.
7866 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
7867 blocks. Add object count for script input files.
7868 * incremental.cc (Incremental_inputs::report_archive_begin): Add
7869 script_info parameter; change all callers.
7870 (Incremental_inputs::report_object): Add script_info parameter;
7871 change all callers.
7872 (Incremental_inputs::report_script): Store backpointer to
7873 incremental info entry.
7874 (Output_section_incremental_inputs::set_final_data_size): Record
7875 additional information for scripts.
7876 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7877 * incremental.h (Incremental_script_entry::add_object): New function.
7878 (Incremental_script_entry::get_object_count): New function.
7879 (Incremental_script_entry::get_object): New function.
7880 (Incremental_script_entry::objects_): New data member; adjust
7881 constructor.
7882 (Incremental_inputs::report_archive_begin): Add script_info parameter.
7883 (Incremental_inputs::report_object): Add script_info parameter.
7884 (Incremental_inputs_reader::get_object_count): New function.
7885 (Incremental_inputs_reader::get_object_offset): New function.
7886 * options.cc (Input_arguments::add_file): Return reference to
7887 new input argument.
7888 * options.h (Input_argument::set_script_info): New function.
7889 (Input_argument::script_info): New function.
7890 (Input_argument::script_info_): New data member; adjust all
7891 constructors.
7892 (Input_file_group::add_file): Return reference to new input argument.
7893 (Input_file_lib::add_file): Likewise.
7894 (Input_arguments::add_file): Likewise.
7895 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
7896 * script.cc (Parser_closure::Parser_closure): Add script_info
7897 parameter; adjust all callers.
7898 (Parser_closure::script_info): New function.
7899 (Parser_closure::script_info_): New data member.
7900 (read_input_script): Report scripts earlier to incremental info.
7901 (script_add_file): Set script_info in Input_argument.
7902 (script_add_library): Likewise.
7903 * script.h (Script_options::Script_info): Rewrite class.
7904
a869183f 79052011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
7906
7907 * archive.cc (Library_base::should_include_member): Move
7908 method here from class Archive.
7909 (Archive::Archive): Initialize base class.
7910 (Archive::should_include_member): Move to base class.
7911 (Archive::do_for_all_unused_symbols): New function.
7912 (Add_archive_symbols::run): Remove redundant access to
7913 incremental_inputs.
7914 (Lib_group::Lib_group): Initialize base class.
7915 (Lib_group::do_filename): New function.
7916 (Lib_group::include_member): Pass pointer to Lib_group to
7917 report_object.
7918 (Lib_group::do_for_all_unused_symbols): New function.
7919 (Add_lib_group_symbols::run): Report archive information for
7920 incremental links.
7921 * archive.h (class Library_base): New base class.
7922 (class Archive): Derive from Library_base.
7923 (Archive::filename): Move to base class.
7924 (Archive::set_incremental_info): Likewise.
7925 (Archive::incremental_info): Likewise.
7926 (Archive::Should_include): Likewise.
7927 (Archive::should_include_member): Likewise.
7928 (Archive::Armap_entry): Remove.
7929 (Archive::Unused_symbol_iterator): Remove.
7930 (Archive::unused_symbols_begin): Remove.
7931 (Archive::unused_symbols_end): Remove.
7932 (Archive::do_filename): New function.
7933 (Archive::do_get_mtime): New function.
7934 (Archive::do_for_all_unused_symbols): New function.
7935 (Archive::task_): Move to base class.
7936 (Archive::incremental_info_): Likewise.
7937 (class Lib_group): Derive from Library_base.
7938 (Lib_group::do_filename): New function.
7939 (Lib_group::do_get_mtime): New function.
7940 (Lib_group::do_for_all_unused_symbols): New function.
7941 (Lib_group::task_): Move to base class.
7942 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
7943 function.
7944 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
7945 function.
7946 * incremental.cc (Incremental_inputs::report_archive_begin):
7947 Use Library_base; call library's get_mtime; add incremental inputs
7948 entry before members.
7949 (class Unused_symbol_visitor): New class.
7950 (Incremental_inputs::report_archive_end): Use Library_base; use
7951 visitor class to record unused symbols; don't add incremental inputs
7952 entry after members.
7953 (Incremental_inputs::report_object): Use Library_base.
7954 * incremental.h
7955 (Incremental_archive_entry::Incremental_archive_entry): Remove
7956 unused Archive parameter.
7957 (Incremental_inputs::report_archive_begin): Use Library_base.
7958 (Incremental_inputs::report_archive_end): Likewise.
7959 (Incremental_inputs::report_object): Likewise.
7960 * object.cc (Sized_relobj::do_for_all_global_symbols): New
7961 function.
7962 * object.h (Object::for_all_global_symbols): New function.
7963 (Object::do_for_all_global_symbols): New function.
7964 (Sized_relobj::do_for_all_global_symbols): New function.
7965 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
7966 function.
7967 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
7968 function.
7969
61ab3e40
ILT
79702011-03-27 Ian Lance Taylor <iant@google.com>
7971
7972 * archive.cc (Archive::interpret_header): Return -1 if something
7973 goes wrong. Change callers accordingly.
7974
30e1f9e6
CC
79752011-03-25 Cary Coutant <ccoutant@google.com>
7976
7977 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
7978 * testsuite/Makefile.in: Regenerate.
7979
9370ce59 79802011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
7981
7982 * plugin.cc (get_view): New.
7983 (Plugin::load): Pass get_view to the plugin.
7984 (Plugin_manager::get_view): New.
7985
9312bb0a
ILT
79862011-03-21 Ian Lance Taylor <iant@google.com>
7987
7988 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 7989 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 7990
7e12ba9e
ST
79912011-03-21 Sriraman Tallam <tmsriram@google.com>
7992
7993 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
7994 Change == to -eq.
7995 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
7996 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
7997 Change == to -eq.
7998 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
7999 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
8000
fd7a005d
ILT
80012011-03-14 Ian Lance Taylor <iant@google.com>
8002
8003 * script-sections.cc (Sort_output_sections::script_compare):
8004 Rename from is_before, change return type.
8005 (Sort_output_sections::operator()): Adjust accordingly.
8006
ed16fd1b
ILT
80072011-03-11 Jeffrey Yasskin <jyasskin@google.com>
8008
8009 PR gold/12572
8010 * testsuite/odr_violation2.cc: Add comment to make all error line
8011 numbers double digits.
8012 * testsuite/debug_msg.sh: Adjust expected errors.
8013
71ff8986
ILT
80142011-03-09 Jeffrey Yasskin <jyasskin@google.com>
8015
8016 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
8017 but mark earlier ones as non-canonical
8018 (offset_to_iterator): Update search target and example
8019 (do_addr2line): Return extra lines in a vector*
8020 (format_file_lineno): Extract from do_addr2line
8021 (one_addr2line): Add vector* out-param
8022 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
8023 when a lineno entry appeared last for its instruction
8024 (Dwarf_line_info): Add vector* out-param
8025 * object.cc (Relocate_info): Pass NULL for the vector* out-param
8026 * symtab.cc (Odr_violation_compare): Include the lineno in the
8027 comparison again.
8028 (linenos_from_loc): New. Combine the canonical line for an
8029 address with its other lines.
8030 (True_if_intersect): New. Helper functor to make
8031 std::set_intersection a query.
8032 (detect_odr_violations): Compare sets of lines instead of just
8033 one line for each function. This became less deterministic, but
8034 has fewer false positives.
8035 * symtab.h: Declarations.
8036 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
8037 mix an optimized and non-optimized object in the same binary
8038 (odr_violation2.so): Same.
8039 * testsuite/Makefile.in: Regenerate from Makefile.am.
8040 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
8041 * testsuite/debug_msg.sh: Update line numbers and add
8042 assertions.
8043 * testsuite/odr_violation1.cc: Use OdrDerived, in a
8044 non-optimized context.
8045 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
8046 isn't inlined, and use OdrDerived in an optimized context.
8047 * testsuite/odr_header1.h: Defines OdrDerived, where
8048 optimization will change the
8049 first-instruction-in-the-destructor's file and line number.
8050 * testsuite/odr_header2.h: Defines OdrBase.
8051
a19fefdc
ILT
80522011-03-09 Ian Lance Taylor <iant@google.com>
8053
8054 * fileread.cc (File_read::clear_views): Don't delete the whole
8055 file view.
8056
ecb351e9
ILT
80572011-03-08 Ian Lance Taylor <iant@google.com>
8058
8059 PR gold/12525
8060 * fileread.cc: #include <climits>.
8061 (GOLD_IOV_MAX): Define.
8062 (File_read::read_multiple): Limit number of entries by iov_max.
8063 * fileread.h (class File_read): Always set max_readv_entries to
8064 128.
8065
b821d13c
ILT
80662011-03-07 Ian Lance Taylor <iant@google.com>
8067
8068 PR gold/12525
8069 * options.h (class General_options): Add -dy and -dn.
8070
89243142
CC
80712011-03-02 Cary Coutant <ccoutant@google.com>
8072
8073 * testsuite/script_test_9.t: Add TLS segment.
8074
d0773f31
ILT
80752011-03-02 Simon Baldwin <simonb@google.com>
8076
8077 * configure.ac: Add check for gnu_indirect_function support in
8078 the toolchain building binutils.
8079 * configure: Rebuild.
8080
9370ce59 80812011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
8082
8083 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
8084 plugin only symbols.
8085 (Symbol_table::sized_finalize_symbol) Mark symbol only present
8086 in plugin files as not needed in the symbol table.
8087
4cf7a849
ST
80882011-02-11 Sriraman Tallam <tmsriram@google.com>
8089
8090 * output.cc (Output_section::add_input_section): Delay fill
8091 generation for section ordering.
8092
b578bd7d
ILT
80932011-02-09 Ian Lance Taylor <iant@google.com>
8094
8095 PR gold/12316
8096 * object.h (class Sized_relobj): Remove clear_local_symbols.
8097 * reloc.cc (Sized_relobj::do_relocate): Don't call
8098 clear_local_symbols.
8099
9370ce59 81002011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
8101
8102 * plugin.cc (is_visible_from_outside): Return true for symbols
8103 in the -u option.
8104
55382fb7
ILT
81052011-02-04 Jeffrey Yasskin <jyasskin@google.com>
8106
8107 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
8108 filename.
8109
4e271fff
ST
81102011-02-02 Sriraman Tallam <tmsriram@google.com>
8111
8112 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 8113 to std::string.
4e271fff 8114 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 8115 section_name to be std::string.
4e271fff
ST
8116 (is_function_ctor_or_dtor): Change type of parameter to std::string.
8117
d433c3ac
ILT
81182011-01-25 Ian Lance Taylor <iant@google.com>
8119
8120 * script.cc (script_add_extern): Rewrite to use
8121 add_symbol_reference.
8122
880473a6
DK
81232011-01-25 Doug Kwan <dougkwan@google.com>
8124
d433c3ac 8125 * icf.cc (get_section_contents): Always lock section's object.
880473a6 8126
f30f86fa
ILT
81272011-01-24 Ian Lance Taylor <iant@google.com>
8128
8129 * options.h (class General_options): Accept
8130 --no-detect-odr-violations.
8131
8e51a0b9
ILT
81322011-01-24 Ian Lance Taylor <iant@google.com>
8133
8134 * version.cc (version_string): Bump to 1.11.
8135
0f3b89d8
ILT
81362011-01-24 Ian Lance Taylor <iant@google.com>
8137
8138 * plugin.cc (class Plugin_rescan): Define new class.
8139 (Plugin_manager::claim_file): Set any_claimed_.
8140 (Plugin_manager::save_archive): New function.
8141 (Plugin_manager::save_input_group): New function.
8142 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
8143 necessary.
8144 (Plugin_manager::new_undefined_symbol): New function.
8145 (Plugin_manager::rescan): New function.
8146 (Plugin_manager::rescannable_defines): New function.
8147 (Plugin_manager::add_input_file): Set any_added_.
8148 * plugin.h (class Plugin_manager): define new fields rescannable_,
8149 undefined_symbols_, any_claimed_, and any_added_. Declare
8150 Plugin_rescan as friend. Declare new functions.
8151 (Plugin_manager::Rescannable): Define type.
8152 (Plugin_manager::Rescannable_list): Define type.
8153 (Plugin_manager::Undefined_symbol_list): Define type.
8154 (Plugin_manager::Plugin_manager): Initialize new fields.
8155 * archive.cc (Archive::defines_symbol): New function.
8156 (Add_archive_symbols::run): Pass archive to plugins if any.
8157 * archive.h (class Archive): Declare defines_symbol.
8158 * readsyms.cc (Input_group::~Input_group): New function.
8159 (Finish_group::run): Pass input_group to plugins if any.
8160 * readsyms.h (class Input_group): Declare destructor.
8161 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
8162 any.
8163
3bb951e5
ILT
81642011-01-10 Ian Lance Taylor <iant@google.com>
8165
8166 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
8167 section as relro.
8168 (Layout::set_segment_offsets): Reset increase_relro before calling
8169 set_section_addresses a second time.
8170
0aa45fac
CC
81712011-01-04 Cary Coutant <ccoutant@google.com>
8172
8173 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
8174 sections before NOBITS sections.
8175
0db46eb4
L
81762011-01-01 H.J. Lu <hongjiu.lu@intel.com>
8177
8178 * version.cc (print_version): Update copyright to 2011.
8179
829c9745
CC
81802010-12-23 Cary Coutant <ccoutant@google.com>
8181
8182 * output.h (Output_data_reloc::add_output_section): Pass OD instead
8183 of OS to this->add. Add OD parameter to second form of the function.
8184
7500420b
ILT
81852010-12-20 Ian Lance Taylor <iant@google.com>
8186
8187 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
8188 second of two consecutive entries with same offset.
8189
f8e9a930
RW
81902010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8191
8192 * testsuite/Makefile.am (ifuncmain2static_LDADD)
8193 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
8194 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
8195 to avoid unneeded links against $(LDADD).
8196 * testsuite/Makefile.in: Regenerate.
8197
2fbb4320
ILT
81982010-12-15 Ian Lance Taylor <iant@google.com>
8199
8200 PR gold/12324
8201 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
8202 for R_X86_64_32 and R_X86_64_PC32.
8203 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
8204 ver_matching_def_pic.o.
8205 (ver_matching_def_pic.o): New target.
8206
fedb228d
RW
82072010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8208
8209 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
8210 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
8211 Move definition before File_read::View member definitions.
8212 (File_read::View::~View): Initialize and hold lock before
8213 updating current_mapped_bytes.
8214
9b547ce6
RW
82152010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8216
8217 * dwarf_reader.cc: Remove outdated comment.
8218 * gold-threads.cc: Fix typo in error message.
8219 * archive.cc: Fix typos in comments.
8220 * archive.h: Likewise.
8221 * arm-reloc-property.cc: Likewise.
8222 * arm-reloc-property.h: Likewise.
8223 * arm-reloc.def: Likewise.
8224 * arm.cc: Likewise.
8225 * attributes.h: Likewise.
8226 * cref.cc: Likewise.
8227 * ehframe.cc: Likewise.
8228 * fileread.h: Likewise.
8229 * gold.h: Likewise.
8230 * i386.cc: Likewise.
8231 * icf.cc: Likewise.
8232 * incremental.h: Likewise.
8233 * int_encoding.cc: Likewise.
8234 * layout.h: Likewise.
8235 * main.cc: Likewise.
8236 * merge.h: Likewise.
8237 * object.cc: Likewise.
8238 * object.h: Likewise.
8239 * options.cc: Likewise.
8240 * readsyms.cc: Likewise.
8241 * reduced_debug_output.cc: Likewise.
8242 * reloc.cc: Likewise.
8243 * script-sections.cc: Likewise.
8244 * sparc.cc: Likewise.
8245 * symtab.h: Likewise.
8246 * target-reloc.h: Likewise.
8247 * target.cc: Likewise.
8248 * target.h: Likewise.
8249 * timer.cc: Likewise.
8250 * timer.h: Likewise.
8251 * x86_64.cc: Likewise.
8252
83e17bd5
CC
82532010-12-09 Cary Coutant <ccoutant@google.com>
8254
8255 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
8256 stack.
8257 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
8258 parameter; change all callers.
8259 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
8260 * options.h (warn_execstack): New option.
8261
017257f8
DK
82622010-12-07 Doug Kwan <dougkwan@google.com>
8263
8264 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
8265 like function call relocations.
8266
c20cbc06
ILT
82672010-12-07 Ian Lance Taylor <iant@google.com>
8268
8269 * archive.cc (Archive::get_elf_object_for_member): Permit
8270 punconfigured to be NULL.
8271 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
8272 (Archive::include_member): Pass NULL to get_elf_object_for_member
8273 if we searched for the archive and this is the first included
8274 object.
8275
4dbfafcc
ILT
82762010-12-01 Ian Lance Taylor <iant@google.com>
8277
8278 * dwarf_reader.h (class Sized_dwarf_line_info): Add
8279 track_relocs_type_ field.
8280 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8281 Set track_relocs_type_.
8282 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
8283 contents when using RELA relocs.
8284 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
8285 reloc_map_.
8286 * reloc.cc (Track_relocs::next_addend): New function.
8287 * reloc.h (class Track_relocs): Declare next_addend.
8288
e5e19edd
ILT
82892010-12-01 Ian Lance Taylor <iant@google.com>
8290
8291 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
8292 virtual destructor.
8293
9a5ce24c
ILT
82942010-12-01 Ian Lance Taylor <iant@google.com>
8295
8296 * README: Update compilers known to work and fail.
8297
c7791212
NC
82982010-11-23 Matthias Klose <doko@ubuntu.com>
8299
8300 * configure.in: For --enable-gold, handle value `default' instead of
8301 `both*'. Always install ld as ld.bfd, install as ld if gold is
8302 not the default.
8303 * configure: Regenerate.
8304
0ad220c9
DK
83052010-11-18 Doug Kwan <dougkwan@google.com>
8306
8307 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
8308 and right_alignment to be zero. Store result alignment only if it is
8309 greater than existing alignment.
8310
ab8056e0
CC
83112010-11-16 Cary Coutant <ccoutant@google.com>
8312
8313 PR gold/12220
8314 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8315 Check for ".zdebug_line".
8316
fd064a5b
CC
83172010-11-16 Doug Kwan <dougkwan@google.com>
8318 Cary Coutant <ccoutant@google.com>
8319
8320 * output.h (Output_segment::set_section_addresses): Pass increase_relro
8321 by reference; adjust all callers.
8322 * output.cc (Output_segment::set_section_addresses): Adjust references
8323 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
8324 list is empty.
8325 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
8326 end at page boundary.
8327
6fc6ea19
CC
83282010-11-16 Cary Coutant <ccoutant@google.com>
8329
8330 PR gold/12220
8331 * layout.cc (Layout::choose_output_section): Transform names of
8332 compressed sections even when using a script with a SECTIONS clause.
8333 (Layout::output_section_name): Remove code to transform
8334 compressed debug section names.
8335 * output.cc (Output_section::add_input_section): Use uncompressed
8336 section size when tracking input sections.
8337
95a2c8d6
RS
83382010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
8339
8340 * symtab.h (Symbol::NON_PIC_REF): Remove.
8341 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
8342 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
8343 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
8344 (Symbol::use_plt_offset): Take a flags argument and pass it
8345 directly to needs_dynamic_reloc. Restrict check for undefined
8346 weak symbols to function calls.
8347 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
8348 (Target_arm::Scan::global): Use it.
8349 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
8350 (Target_arm::Relocate::relocate): Likewise.
8351 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
8352 parameter with an r_type parameter. Use get_reference_flags
8353 to get the flags.
8354 (Target_arm::Relocate::relocate): Update accordingly.
8355 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
8356 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
8357 (Target_i386::Scan::global): Likewise.
8358 (Target_i386::Relocate::relocate): Likewise.
8359 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
8360 parameter with an r_type parameter. Use get_reference_flags
8361 to get the flags.
8362 (Target_i386::Relocate::relocate): Update accordingly.
8363 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
8364 (Target_powerpc::Scan::global): Use it.
8365 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
8366 (Target_powerpc::Relocate::relocate): Likewise.
8367 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
8368 (Target_sparc::Scan::global): Use it.
8369 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
8370 (Target_sparc::Relocate::relocate): Likewise.
8371 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
8372 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
8373 (Target_x86_64::Scan::global): Likewise.
8374 (Target_x86_64::Relocate::relocate): Likewise.
8375
f625ae50
DK
83762010-11-08 Doug Kwan <dougkwan@google.com>
8377 Cary Coutant <ccoutant@google.com>
8378
8379 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
8380 (Arm_exidx_merge_section::section_contents_): New data member.
8381 (Arm_input_section::Arm_input_section): Initialize original_contents_.
8382 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 8383 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
8384 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
8385 in parameters instead of calling Object::section_contents without
8386 locking.
8387 (Arm_output_section::group_section): New parameter TASK. Pass it
8388 to callees that need locking objects.
8389 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
8390 to lock EXIDX input sections. Fix a formatting issue. Call
8391 Arm_exidx_merged_section::build_contents to create merged section
8392 contents.
8393 (Arm_output_section::create_stub_group): New parameter TASK. Use it
8394 to lock object of stub table owner.
8395 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
8396 TEXT_SIZE to initialize data member TEXT_SIZE_.
8397 (Arm_exidx_input_section::addralign): Fix typo in comment.
8398 (Arm_exidx_input_section::text_size): New method.
8399 (Target_arm::do_relax): New parameter TASK. Pass it to callees
8400 that require locking objects. Lock objects before scanning for stubs
8401 and updating local symbols.
8402 (Arm_input_section<big_endian>::init): Copy contents of original
8403 input section.
2e702c99 8404 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
8405 original input section instead of calling Object::section_contents
8406 without locking.
8407 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
8408 size without calling Object::section_size().
8409 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
8410 for size. Allocate a buffer for merged EXIDX entries.
8411 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 8412 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
8413 building code to Arm_exidx_merged_section::build_contetns. Write
8414 out contetns in buffer instead of building it on the fly.
8415 (Arm_relobj::make_exidx_input_section): Also pass text section size
8416 to Arm_exidx_input_section constructor.
8417 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
8418 (Arm_dynobj::do_read_symbols): Fix memory leak.
8419 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
8420 * target.h: (class Task): Add forward declaration.
8421 (Target::relax): Add new parameter TASK and pass it to
8422 Target::do_relax().
8423 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
8424
5f9bcf58
CC
84252010-11-05 Cary Coutant <ccoutant@google.com>
8426
8427 PR gold/10708
8428 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
8429 object when reading from the file.
8430 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
8431 second layout pass.
8432 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
8433 when reading section contents.
8434 (get_section_contents): Likewise.
8435 (icf::find_identical_sections): Likewise.
8436 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
8437 object when reading from the file.
8438 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
8439 the object when doing deferred section layout.
8440
e597fa08
NC
84412010-11-03 Nick Clifton <nickc@redhat.com>
8442
8443 PR gold/12001
8444 * script.h (class Symbol_assignment: name): New member. Returns
8445 the name of the symbol.
8446 * scrfipt.cc (Script_options::is_pending_assignment): New member.
8447 Returns true if the given symbol name is on the list of
8448 assignments wating to be processed.
8449 * archive.cc (should_incldue_member): If the symbol is undefined,
8450 check to see if it is on the list of symbols pending assignment.
8451
3f9a3278
ILT
84522010-11-03 Ryan Mansfield <rmansfield@qnx.com>
8453
8454 * script-sections.cc (Script_sections::find_memory_region): Check
8455 for a NULL output section pointer.
8456
d06fb4d1
DK
84572010-10-29 Doug Kwan <dougkwan@google.com>
8458
8459 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
8460 Output_section::add_relaxed_input_section.
8461 * output.cc (Output_section::add_relaxed_input_section): Add new
8462 arguments LAYOUT and NAME. Set section order index.
8463 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
8464 Copy section order index.
8465 * output.h (Output_section::add_relaxed_input_section): Add new
8466 arguments LAYOUT and NAME.
8467
90e24de5
ILT
84682010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8469
8470 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 8471 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
8472 * testsuite/Makefile.in: Regenerate.
8473
c9484ea5
DK
84742010-10-20 Doug Kwan <dougkwan@google.com>
8475
8476 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
8477 without SHF_LINK_ORDER flags.
8478 * layout.cc (Layout::choose_output_section): Do not filter
8479 SHF_LINK_ORDER flag in a relocatable link.
8480
5bc2f5be
CC
84812010-10-17 Cary Coutant <ccoutant@google.com>
8482
8483 * output.h (Output_segment::set_section_addresses): Change function
8484 signature. Update all callers.
8485 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
8486 sections.
8487 (Output_segment::set_section_addresses): Align after last TLS
8488 section. Add padding before last relro section instead of after.
8489
0c91cf04
DK
84902010-10-17 Doug Kwan <dougkwan@google.com>
8491
8492 * gold/arm.cc (Target_arm::got_section): Use correct order and set
8493 GOT output section to be writable.
8494
8c21d9d3
CC
84952010-10-14 Cary Coutant <ccoutant@google.com>
8496
8497 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
8498 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
8499 * gold.cc (queue_initial_tasks): Check parameters for incremental link
8500 mode.
8501 * incremental.cc (report_command_line): Ignore all forms of
8502 --incremental.
8503 * layout.cc (Layout::Layout): Check parameters for incremental link
8504 mode.
8505 * options.cc (General_options::parse_incremental): New function.
8506 (General_options::parse_no_incremental): New function.
8507 (General_options::parse_incremental_full): New function.
8508 (General_options::parse_incremental_update): New function.
8509 (General_options::incremental_mode_): New data member.
8510 (General_options::finalize): Check incremental_mode_.
8511 * options.h (General_options): Update help text for --incremental.
8512 Add --no-incremental, --incremental-full, --incremental-update.
8513 (General_options::Incremental_mode): New enum type.
8514 (General_options::incremental_mode): New function.
8515 (General_options::incremental_mode_): New data member.
8516 * parameters.cc (Parameters::incremental_mode_): New data member.
8517 (Parameters::set_options): Set incremental_mode_.
8518 (Parameters::set_incremental_full): New function.
8519 (Parameters::incremental): New function.
8520 (Parameters::incremental_update): New function.
8521 (set_parameters_incremental_full): New function.
8522 * parameters.h (Parameters::set_incremental_full): New function.
8523 (Parameters::incremental): New function.
8524 (Parameters::incremental_update): New function.
8525 (Parameters::incremental_mode_): New data member.
8526 (set_parameters_incremental_full): New function.
8527 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
8528 incremental link mode.
8529 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
8530 (Sized_relobj::do_relocate_sections): Likewise.
8531 * testsuite/Makefile.am (incremental_test): Use --incremental-full
8532 option.
8533 * testsuite/Makefile.in: Regenerate.
8534 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 8535
bb32aa18 85362010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
8537
8538 * script-sections.h (class Script_sections): Make
8539 Sections_elements typedef public.
8540 * script-sections.cc (class Sort_output_sections): Add elements_
8541 field. Add constructor which sets it; change all callers.
8542 (Sort_output_sections::is_before): New function.
8543 (Sort_output_sections::operator()): Call is_before.
8544 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
8545 conditional.
8546 * testsuite/script_test_10.sh: New test. Test script section
8547 order.
8548 * testsuite/script_test_10.t: Likewise.
8549 * testsuite/script_test_10.s: Likewise.
8550 * testsuite/Makefile.am: Wrap the cross linker tests and the
8551 common tests into NATIVE_OR_CROSS_LINKER.
8552 (check_SCRIPTS): Add script_test_10.sh.
8553 (check_DATA): Add script_test_10.stdout.
8554 (script_test_10.o, script_test_10): New targets.
8555 (script_test_10.stdout): New target.
8556 * configure, testsuite/Makefile.in: Regenerate.
8557
3cef7179
ILT
85582010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8559
8560 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
8561 error for the deprecated relocations.
8562 (Target_arm::Scan::global): Likewise.
8563 (Target_arm::Relocate::relocate): Likewise.
8564
7411e9a8
RS
85652010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
8566
8567 * fileread.cc (Input_file::find_file): Initialize *found_name
8568 and *namep when using the fallback search for case 4.
8569
6a9da32a
CC
85702010-10-11 Cary Coutant <ccoutant@google.com>
8571
8572 * options.h (class General_options): Redefine -z lazy as an alias for
8573 the negation of -z now.
8574
ac897c20
ILT
85752010-10-11 Ian Lance Taylor <iant@google.com>
8576
8577 * resolve.cc (symbol_to_bits): Report the value of the unsupported
8578 binding.
8579
ea5cae92
NC
85802010-10-06 Nick Clifton <nickc@redhat.com>
8581
8582 * script-sections.cc(class Memory_region): Remove
8583 current_lma_offset_ field. Rename current_vma_offset_ to
8584 current_offset_. Add last_section_ field.
8585 (Memory_region::get_current_vma_address): Rename to
8586 get_current_address.
8587 (Memory_region::get_current_lma_address): Delete.
8588 (Memory_region::increment_vma_offset): Rename to
8589 increment_offset.
8590 (Memory_region::increment_lma_offset): Delete.
8591 (Memory_region::attributes_compatible): New method. Returns
8592 true if the provided section is compatible with the region.
8593 (Memory_region::get_last_section): New method. Returns the last
8594 section to use the region.
8595 (Memory_region::set_last_section): New method. Stores the last
8596 section to use the region.
8597 (Script_sections::block_in_region): New method. Returns true if
8598 a block of memory is contained within a region.
8599 (Script_sections::find_memory_region): New method. Locates a
8600 memory region to be used to set a VMA or LMA address.
8601 (Output_section_definition::set_section_addresses): Add code to
8602 check for addresses set by memory regions.
8603 (Output_segment::set_section_addresses): Remove memory region
8604 walking code.
8605 (Script_sections::create_segment): Add a warning if a header
8606 segment is created outside of any region.
8607 * script-sections.h (class Script_sections): Add prototypes for
8608 find_memory_region and block_in_region methods.
8609 * testsuite/memory_test.s: Use .long instead of .word.
8610 * testsuite/memory_test.t: Add some more output sections.
8611 * testsuite/memory_test.sh: Update expected output.
8612
a9bfd952
DK
86132010-10-02 Doug Kwan <dougkwan@google.com>
8614
8615 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
8616 defintion to symtab.h
8617 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
8618 declaration to defintion.
8619
bacff3ab
NC
86202010-10-01 Nick Clifton <nickc@redhat.com>
8621
8622 * expression.cc (eval): Replace dummy argument with NULL.
8623 (eval_maybe_dot): Check for a NULL result section pointer.
8624 (Symbol_expression::value): Likewise.
8625 (Dot_expression::value): Likewise.
8626 (BINARY_EXPRESSION): Likewise.
8627 (Max_expression::value): Likewise.
8628 (Min_expression::value): Likewise.
8629 (Absolute_expression::value): Likewise.
8630 (Addr_expression::value_from_output_section): Likewise.
8631 (Loaddddr_expression::value_from_output_section): Likewise.
8632 (Segment_start_expression::value): Likewise.
8633 * script-sections.cc
8634 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
8635 argument with NULL.
8636 (Sections_elememt_dot_assignment::set_section_addresses):
8637 Likewise.
8638 (Output_data_expression::do_write_to_buffer): Likewise.
8639 (Output_section_definition::finalize_symbols): Likewise.
8640 (Output_section_definition::set_section_addresses): Likewise.
8641
f81bc8b5
DK
86422010-09-30 Doug Kwan <dougkwan@google.com>
8643
8644 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
8645
c95e9f27
ST
86462010-09-28 Sriraman Tallam <tmsriram@google.com>
8647
8648 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 8649 function.
c95e9f27
ST
8650 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
8651 virtual function.
8652 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
8653 virtual function.
8654 * icf.cc (get_section_contents): Inline merge sections only when
8655 target allows it.
8656
3cac54d2
RW
86572010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8658
8659 * configure: Regenerate.
8660
2904037a
ILT
86612010-09-17 Ian Lance Taylor <iant@google.com>
8662
8663 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
8664 * testsuite/Makefile.am (memory_test.o): New target.
8665 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
8666 memory_test.t.
8667 * testsuite/Makefile.in: Rebuild.
2904037a 8668
bca7fb63
DK
86692010-09-17 Doug Kwan <dougkwan@google.com>
8670
8671 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
8672 defintion if relocation uses GOT entries of the symbol.
8673 * testsuite/icf_safe_test.sh: Fix test.
8674 * testsuite/icf_safe_so_test.sh: Fix test.
8675
4ef28648
CC
86762010-09-16 Cary Coutant <ccoutant@google.com>
8677
8678 * script_sections.cc (class Memory_region): Remove "NULL" from
8679 vector initializations.
8680
793990de
CC
86812010-09-15 Cary Coutant <ccoutant@google.com>
8682
8683 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
8684 Resolve forwarding symbols.
8685
81e015e2
DK
86862010-09-15 Doug Kwan <dougkwan@google.com>
8687
8688 * gold/testsuite/script_test_3.t: Add ARM special sections.
8689 * gold/testsuite/script_test_4.t: Same.
8690 * gold/testsuite/script_test_5.t: Same.
8691 * gold/testsuite/script_test_6.t: Same.
8692 * gold/testsuite/script_test_7.t: Same.
8693 * gold/testsuite/script_test_7.t: Same.
8694 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
8695
36171d64
CC
86962010-09-14 Cary Coutant <ccoutant@google.com>
8697
8698 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
8699 (Target_x86_64::Relocate::relocate_tls): Replace check for
8700 saw_tls_block_reloc_ with test for executable section.
8701
d89051bd
CC
87022010-09-12 Cary Coutant <ccoutant@google.com>
8703
8704 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
8705 position-independent executables to shared libraries need dynamic
8706 relocations.
8707 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
8708 position-independent executables.
8709 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
8710 * testsuite/Makefile.in: Regenerate.
8711
fca41f0f
NC
87122010-09-10 Nick Clifton <nickc@redhat.com>
8713
8714 PR gold/11997
8715 * testsuite/memory_test.t: Discard any sections that are not
8716 needed.
8717
6695e4b3
L
87182010-09-09 H.J. Lu <hongjiu.lu@intel.com>
8719
8720 PR gold/11996
8721 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
8722 "This::" to work around a bug in gcc 4.2.
8723
8724 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
8725
0f72bf6f
RÁE
87262010-09-09 Rafael Espindola <espindola@google.com>
8727
8728 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
8729 sections with different PF_X flags in the same segment.
8730 (Layout::find_first_load_seg): Search all segments to find the first
8731 one.
8732 * options.h (rosegment): New.
8733
87342010-09-08 Rafael Espindola <espindola@google.com>
a6577478 8735
05a79166 8736 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 8737
aa98ff75
DK
87382010-09-08 Doug Kwan <dougkwan@google.com>
8739
8740 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
8741 (Arm_relobj::do_relocate_sections): Add new parameter for output
8742 file to match the parent.
8743 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
8744 of local symbols instead of input values. Update code to track
8745 changes in gold::relocate_section.
8746 * object.cc (Sized_relobj::compute_final_local_value): New methods.
8747 (Sized_relobj::compute_final_local_value_internal): New methods.
8748 (Sized_relobj::do_finalize_local_symbols): Move code from loop
8749 body into private version of Sized_relobj::compute_final_local_value.
8750 Call the inline method.
8751 * object.h (Symbol_value::Symbol_value): Define destructor. Free
8752 merged symbol value if there is one.
8753 (Symbol_value::has_output_value): New method defintiion.
8754 (Sized_relobj::Compute_final_local_value_status): New enum type.
8755 (Sized_relobj::compute_final_local_value): New methods.
8756 (Sized_relobj::compute_final_local_value_internal): New methods.
8757 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
8758 and arm_cortex_a8.sh.
8759 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
8760 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
8761 New tests.
8762 * Makefile.in: Regenerate.
8763 * testsuite/arm_bl_out_of_range.s: Update test.
8764 * testsuite/thumb_bl_out_of_range.s: Ditto.
8765 * testsuite/thumb_blx_out_of_range.s: Ditto.
8766 * testsuite/arm_branch_out_of_range.sh: New file.
8767 * testsuite/arm_cortex_a8.sh: Ditto.
8768 * testsuite/arm_cortex_a8_b.s: Ditto.
8769 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
8770 * testsuite/arm_cortex_a8_b_local.s: Ditto.
8771 * testsuite/arm_cortex_a8_bl.s: Ditto.
8772 * testsuite/arm_cortex_a8_blx.s: Ditto.
8773 * testsuite/arm_cortex_a8_local.s: Ditto.
8774 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
8775 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
8776
05a79166
L
87772010-09-08 Rafael Espindola <espindola@google.com>
8778
8779 * Makefile.am (memory_test.stdout): Run readelf with -W.
8780 * Makefile.in: Regenerate.
8781 * testsuite/memory_test.sh: Make the regexps accept both 32 and
8782 64 bit output.
8783
33dbc701
RÁE
87842010-09-08 Rafael Espindola <espindola@google.com>
8785
8786 * script-sections.cc (Script_sections::add_memory_region): Convert
8787 field precision to int.
8788 * script.cc (script_set_section_region, script_set_section_region):
8789 Convert field precision to int.
8790
731ca54a
RÁE
87912010-09-08 Rafael Espindola <espindola@google.com>
8792
8793 * arm.cc (do_finalize_sections): Create the __exidx_start and
8794 __exdix_end symbols even when the section is missing.
8795
7f8cd844
NC
87962010-09-08 Nick Clifton <nickc@redhat.com>
8797
8798 * README: Remove claim that MEMORY is not supported.
8799 * expression.cc (script_exp_function_origin)
8800 (script_exp_function_length): Move from here to ...
8801 * script.cc: ... here.
8802 (script_set_section_region, script_add_memory)
8803 (script_parse_memory_attr, script_include_directive): New
8804 functions.
8805 * script-sections.cc
8806 (class Memory_region): New class.
8807 (class Output_section_definition): Add set_memory_region,
8808 set_section_vma, set_section_lma and get_section_name methods.
8809 (class Script_Sections): Add add_memory_region,
8810 find_memory_region, find_memory_region_origin,
8811 find_memory_region_length and set_memory_region methods.
8812 Have set_section_addresses method walk the list of set memory
8813 regions.
8814 Extend the print methos to display memory regions.
8815 * script-sections.h: Add prototypes for new methods.
8816 Add enum for MEMORY region attributes.
8817 * yyscript.y: Add support for parsing MEMORY regions.
8818 * script-c.h: Add prototypes for new functions.
8819 * testsuite/Makefile.am: Add test of MEMORY region functionality.
8820 * testsuite/Makefile.in: Regenerate.
8821 * testsuite/memory_test.sh: New script.
8822 * testsuite/memory_test.s: New assembler source file.
8823 * testsuite/memory_test.t: New linker script.
8824
a4649286
DK
88252010-08-27 Doug Kwan <dougkwan@google.com>
8826
8827 * gold/resolve.cc (Symbol_table::should_override): Let a weak
8828 reference override an existing dynamic weak reference.
8829 * testsuite/Makefile.am: Add new test dyn_weak_ref.
8830 * testsuite/Makefile.in: Regenerate.
8831 * testsuite/dyn_weak_ref.sh: New file.
8832 * testsuite/dyn_weak_ref_1.c: Ditto.
8833 * testsuite/dyn_weak_ref_2.c: Ditto.
8834
b56648ad
ILT
88352010-08-27 Ian Lance Taylor <iant@google.com>
8836
8837 * incremental.h (class Incremental_input_entry): Add virtual
8838 destructor.
8839
809313cb
ILT
88402010-08-27 Ian Lance Taylor <iant@google.com>
8841
8842 * testsuite/start_lib_test_3.c: Mark t3 as used.
8843
11e32464
NC
88442010-08-27 Nick Clifton <nickc@redhat.com>
8845
8846 * options.cc (version_script): Fix small typo in previous
8847 whitespace tidyup.
8848
ca09d69a
NC
88492010-08-25 Nick Clifton <nickc@redhat.com>
8850
8851 * archive.cc: Formatting fixes: Remove whitespace between
8852 typename and following asterisk. Remove whitespace between
8853 function name and opening parenthesis.
8854 * archive.h: Likewise.
8855 * arm.cc: Likewise.
8856 * attributes.cc: Likewise.
8857 * attributes.h: Likewise.
8858 * common.cc: Likewise.
8859 * copy-relocs.cc: Likewise.
8860 * dirsearch.h: Likewise.
8861 * dynobj.cc: Likewise.
8862 * ehframe.cc: Likewise.
8863 * ehframe.h: Likewise.
8864 * expression.cc: Likewise.
8865 * fileread.cc: Likewise.
8866 * fileread.h: Likewise.
8867 * gc.h: Likewise.
8868 * gold-threads.cc: Likewise.
8869 * gold.cc: Likewise.
8870 * i386.cc: Likewise.
8871 * icf.h: Likewise.
8872 * incremental-dump.cc: Likewise.
8873 * incremental.cc: Likewise.
8874 * layout.cc: Likewise.
8875 * layout.h: Likewise.
8876 * main.cc: Likewise.
8877 * merge.cc: Likewise.
8878 * merge.h: Likewise.
8879 * object.cc: Likewise.
8880 * object.h: Likewise.
8881 * options.cc: Likewise.
8882 * options.h: Likewise.
8883 * output.cc: Likewise.
8884 * output.h: Likewise.
8885 * plugin.cc: Likewise.
8886 * plugin.h: Likewise.
8887 * powerpc.cc: Likewise.
8888 * reloc.cc: Likewise.
8889 * script-c.h: Likewise.
8890 * script-sections.cc: Likewise.
8891 * script.cc: Likewise.
8892 * stringpool.cc: Likewise.
8893 * symtab.cc: Likewise.
8894 * symtab.h: Likewise.
8895 * target.cc: Likewise.
8896 * timer.cc: Likewise.
8897 * timer.h: Likewise.
8898 * version.cc: Likewise.
8899 * x86_64.cc: Likewise.
8900
b8fa8750
NC
89012010-08-24 Nick Clifton <nickc@redhat.com>
8902
8903 PR 11899
8904 * layout.cc (segment_precedes): Sort segments by their physical
8905 addresses, if they have been set.
8906
9919d93b
CC
89072010-08-23 Cary Coutant <ccoutant@google.com>
8908
8909 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
8910 symbols data.
8911 (Lib_group::include_member): Unlock object after deleting its
8912 symbols data.
8913 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
8914 the bug fixed here.
8915
97b4be1c
CC
89162010-08-19 Neil Vachharajani <nvachhar@google.com>
8917 Cary Coutant <ccoutant@google.com>
8918
8919 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
8920 constructor, and set_blocker.
8921 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
8922 readsyms_blocker_.
8923 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
8924 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
8925 * testsuite/Makefile.am (start_lib_test): New test case.
8926 * testsuite/Makefile.in: Regenerate.
8927 * testsuite/start_lib_test_main.c: New file.
8928 * testsuite/start_lib_test_1.c: New file.
8929 * testsuite/start_lib_test_2.c: New file.
8930 * testsuite/start_lib_test_3.c: New file.
8931
dd0b1884
ILT
89322010-08-19 Ian Lance Taylor <iant@google.com>
8933
8934 * Makefile.in: Rebuild with automake 1.11.1.
8935 * aclocal.m4: Likewise.
8936 * testsuite/Makefile.in: Likewise.
8937
7223e9ca
ILT
89382010-08-19 Ian Lance Taylor <iant@google.com>
8939
8940 PR 10893
8941 * i386.cc (class Output_data_plt_i386): Update declarations.
8942 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
8943 local_ifuncs_ fields.
8944 (Target_i386::do_plt_section_for_global): New function.
8945 (Target_i386::do_plt_section_for_local): New function.
8946 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
8947 parameter; change all callers. Initialize global_ifuncs_ and
8948 local_ifuncs_. If doing a static link define __rel_iplt_start and
8949 __rel_iplt_end.
8950 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
8951 (Output_data_plt_i386::add_local_ifunc_entry): New function.
8952 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
8953 symbols.
8954 (Target_i386::make_plt_section): New function, broken out of
8955 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
8956 (Target_i386::make_plt_entry): Call make_plt_section.
8957 (Target_i386::make_local_ifunc_plt_entry): New function.
8958 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
8959 (Target_i386::Scan::local): Handle IFUNC symbols. Add
8960 R_386_IRELATIVE to switch.
8961 (Target_i386::Scan::global): Likewise.
8962 (Target_i386::Relocate::relocate): Likewise.
8963 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
8964 switch.
8965 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
8966 (Target_x86_64::do_plt_section_for_global): New function.
8967 (Target_x86_64::do_plt_section_for_local): New function.
8968 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
8969 parameter; change all callers. If doing a static link define
8970 __rela_iplt_start and __rela_iplt_end.
8971 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
8972 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
8973 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
8974 to point to .plt.
8975 (Target_x86_64::make_local_ifunc_plt_entry): New function.
8976 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
8977 switch.
8978 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
8979 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
8980 R_X86_64_IRELATIVE to switch.
8981 (Target_x86_64::Scan::global): Likewise.
8982 (Target_x86_64::Relocate::relocate): Likewise.
8983 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
8984 switch.
8985 * target.h (class Target): Add plt_section_for_global and
8986 plt_section_for_local functions. Add do_plt_section_for_global
8987 and do_plt_section_for_local virtual functions.
8988 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
8989 clarifying comments.
8990 (Symbol::use_plt_offset): Handle IFUNC symbol.
8991 * object.cc (Sized_relobj::Sized_relobj): Initialize
8992 local_plt_offsets_.
8993 (Sized_relobj::local_has_plt_offset): New function.
8994 (Sized_relobj::local_plt_offset): New function.
8995 (Sized_relobj::set_local_plt_offset): New function.
8996 (Sized_relobj::do_count): Handle IFUNC symbol.
8997 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
8998 a bit away from input_shndx_ field. Add set_is_func_symbol and
8999 is_ifunc_symbol functions.
9000 (class Sized_relobj): Update declarations. Remove Tls_got_entry
9001 and Local_tls_got_offsets. Define Local_plt_offsets. Add
9002 local_plt_offsets_ field.
9003 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
9004 * output.h (class Output_section_data): Add non-const
9005 output_section function.
9006 (class Output_data_got): Update declarations.
9007 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
9008 Add use_plt_offset parameter to global and local constructors.
9009 Change all callers. Change local_sym_index_ field to 31 bits.
9010 Change GSYM_CODE and CONSTANT_CODE accordingly.
9011 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
9012 doing a static link don't set sh_link field.
9013 (Output_data_got::Got_entry::write): Use PLT offset if
9014 appropriate.
9015 (Output_data_got::add_global_plt): New function.
9016 (Output_data_got::add_local_plt): New function.
9017 * target-reloc.h (relocate_section): Handle IFUNC symbol.
9018 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
9019 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
9020 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
9021 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
9022 IFUNC conditional.
9023 * testsuite/ifunc-sel.h: New file.
9024 * testsuite/ifuncmain1.c: New file.
9025 * testsuite/ifuncmain1vis.c: New file.
9026 * testsuite/ifuncmod1.c: New file.
9027 * testsuite/ifuncdep2.c: New file.
9028 * testsuite/ifuncmain2.c: New file.
9029 * testsuite/ifuncmain3.c: New file.
9030 * testsuite/ifuncmod3.c: New file.
9031 * testsuite/ifuncmain4.c: New file.
9032 * testsuite/ifuncmain5.c: New file.
9033 * testsuite/ifuncmod5.c: New file.
9034 * testsuite/ifuncmain6pie.c: New file.
9035 * testsuite/ifuncmod6.c: New file.
9036 * testsuite/ifuncmain7.c: New file.
9037 * configure, testsuite/Makefile.in: Rebuild.
9038
56f75c03
ILT
90392010-08-18 Ian Lance Taylor <iant@google.com>
9040
9041 * incremental.cc
9042 (Output_section_incremental_inputs::write_input_files): Add cast
9043 to avoid signed/unsigned comparison warning.
9044 (Output_section_incremental_inputs::write_info_blocks): Likewise.
9045
55455f89
CC
90462010-08-12 Cary Coutant <ccoutant@google.com>
9047
9048 * common.cc (Sort_commons::operator()): Remove unnecessary code.
9049
e2054bcb
ILT
90502010-08-13 Ian Lance Taylor <iant@google.com>
9051
9052 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
9053
74f67560
DK
90542010-08-12 Cary Coutant <ccoutant@google.com>
9055 Doug Kwan <dougkwan@google.com>
9056
9057 * resolve.cc (Symbol_table::should_override): When a weak dynamic
9058 defintion overrides non-weak undef, remember that the original undef
9059 is not weak.
9060 * symtab.cc (Symbol_table::sized_write_global): For undef without
9061 an original weak binding, set binding to global in output.
9062 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
9063 * testsuite/Makefile.in: Regenerate.
9064 * testsuite/strong_ref_weak_def.sh: New file.
9065 * testsuite/strong_ref_weak_def_1.c: Ditto.
9066 * testsuite/strong_ref_weak_def_2.c: Ditto.
9067
d1238d12
CC
90682010-08-12 Cary Coutant <ccoutant@google.com>
9069
9070 * testsuite/incremental_test.sh: Rewrite.
9071 * testsuite/incremental_test_1.c: Rewrite.
9072 * testsuite/incremental_test_2.c: Rewrite.
9073
0e70b911
CC
90742010-08-12 Cary Coutant <ccoutant@google.com>
9075
9076 * arm.cc (Target_arm::got_size): Add const.
9077 (Target_arm::got_entry_count): New function.
9078 (Target_arm::plt_entry_count): New function.
9079 (Target_arm::first_plt_entry_offset): New function.
9080 (Target_arm::plt_entry_size): New function.
9081 (Output_data_plt_arm::entry_count): New function.
9082 (Output_data_plt_arm::first_plt_entry_offset): New function.
9083 (Output_data_plt_arm::get_plt_entry_size): New function.
9084 * i386.cc (Target_i386::got_size): Add const.
9085 (Target_i386::got_entry_count): New function.
9086 (Target_i386::plt_entry_count): New function.
9087 (Target_i386::first_plt_entry_offset): New function.
9088 (Target_i386::plt_entry_size): New function.
9089 (Output_data_plt_i386::entry_count): New function.
9090 (Output_data_plt_i386::first_plt_entry_offset): New function.
9091 (Output_data_plt_i386::get_plt_entry_size): New function.
9092 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
9093 find_incremental_inputs_sections. Dump incremental_got_plt section.
9094 * incremental.cc: Include target.h.
9095 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
9096 parameter. Adjust all callers. Find incremental_got_plt section.
9097 (Incremental_inputs::create_data_sections): Create incremental_got_plt
9098 section.
9099 (Output_section_incremental_inputs::set_final_data_size): Calculate
9100 size of incremental_got_plt section.
9101 (Output_section_incremental_inputs::do_write): Write the
9102 incremental_got_plt section.
9103 (Got_plt_view_info): New struct.
9104 (Local_got_offset_visitor): New class.
9105 (Global_got_offset_visitor): New class.
9106 (Global_symbol_visitor_got_plt): New class.
9107 (Output_section_incremental_inputs::write_got_plt): New function.
9108 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
9109 Add parameter. Adjust all callers.
9110 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
9111 (Incremental_inputs::got_plt_section): New function.
9112 (Incremental_inputs::got_plt_section_): New data member.
9113 (Incremental_got_plt_reader): New class.
9114 * layout.cc (Layout::create_incremental_info_sections): Add the
9115 incremental_got_plt section.
9116 * object.h (Got_offset_list::get_list): New function.
9117 (Got offset_list::for_all_got_offsets): New function.
9118 (Sized_relobj::local_got_offset_list): New function.
9119 * powerpc.cc (Target_powerpc::got_size): Add const.
9120 (Target_powerpc::got_entry_count): New function.
9121 (Target_powerpc::plt_entry_count): New function.
9122 (Target_powerpc::first_plt_entry_offset): New function.
9123 (Target_powerpc::plt_entry_size): New function.
9124 (Output_data_plt_powerpc::entry_count): New function.
9125 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
9126 (Output_data_plt_powerpc::get_plt_entry_size): New function.
9127 * sparc.cc (Target_sparc::got_size): Add const.
9128 (Target_sparc::got_entry_count): New function.
9129 (Target_sparc::plt_entry_count): New function.
9130 (Target_sparc::first_plt_entry_offset): New function.
9131 (Target_sparc::plt_entry_size): New function.
9132 (Output_data_plt_sparc::entry_count): New function.
9133 (Output_data_plt_sparc::first_plt_entry_offset): New function.
9134 (Output_data_plt_sparc::get_plt_entry_size): New function.
9135 * symtab.h (Symbol::got_offset_list): New function.
9136 (Symbol_table::for_all_symbols): New function.
9137 * target.h (Sized_target::got_entry_count): New function.
9138 (Sized_target::plt_entry_count): New function.
9139 (Sized_target::plt_entry_size): New function.
9140 * x86_64.cc (Target_x86_64::got_size): Add const.
9141 (Target_x86_64::got_entry_count): New function.
9142 (Target_x86_64::plt_entry_count): New function.
9143 (Target_x86_64::first_plt_entry_offset): New function.
9144 (Target_x86_64::plt_entry_size): New function.
9145 (Output_data_plt_x86_64::entry_count): New function.
9146 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
9147 (Output_data_plt_x86_64::get_plt_entry_size): New function.
9148
09ec0418
CC
91492010-08-12 Cary Coutant <ccoutant@google.com>
9150
9151 * archive.cc: Include incremental.h.
9152 (Archive::Archive): Initialize incremental_info_.
9153 (Archive::include_member): Record archive members in incremental info.
9154 (Add_archive_symbols::run): Record begin and end of an archive in
9155 incremental info.
9156 (Lib_group::include_member): Record objects in incremental info.
9157 * archive.h (Incremental_archive_entry): Forward declaration.
9158 (Archive::set_incremental_info): New member function.
9159 (Archive::incremental_info): New member function.
9160 (Archive::Unused_symbol_iterator): New class.
9161 (Archive::unused_symbols_begin): New member function.
9162 (Archive::unused_symbols_end): New member function.
9163 (Archive::incremental_info_): New data member.
9164 * incremental-dump.cc (find_input_containing_global): New function.
9165 (dump_incremental_inputs): Dump new incremental info sections.
9166 * incremental.cc: Include symtab.h.
9167 (Output_section_incremental_inputs): New class.
9168 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
9169 new incremental info sections.
9170 (Sized_incremental_binary::do_check_inputs): Likewise.
9171 (Incremental_inputs::report_archive): Remove.
9172 (Incremental_inputs::report_archive_begin): New function.
9173 (Incremental_inputs::report_archive_end): New function.
9174 (Incremental_inputs::report_object): New function.
9175 (Incremental_inputs::finalize_inputs): Remove.
9176 (Incremental_inputs::report_input_section): New function.
9177 (Incremental_inputs::report_script): Rewrite.
9178 (Incremental_inputs::finalize): Do nothing but finalize string table.
9179 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9180 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9181 (Incremental_inputs::create_data_sections): New function.
9182 (Incremental_inputs::relocs_entsize): New function.
9183 (Output_section_incremental_inputs::set_final_data_size): New function.
9184 (Output_section_incremental_inputs::do_write): New function.
9185 (Output_section_incremental_inputs::write_header): New function.
9186 (Output_section_incremental_inputs::write_input_files): New function.
9187 (Output_section_incremental_inputs::write_info_blocks): New function.
9188 (Output_section_incremental_inputs::write_symtab): New function.
9189 * incremental.h (Incremental_script_entry): Forward declaration.
9190 (Incremental_object_entry): Forward declaration.
9191 (Incremental_archive_entry): Forward declaration.
9192 (Incremental_inputs): Forward declaration.
9193 (Incremental_inputs_header_data): Remove.
9194 (Incremental_inputs_header): Remove.
9195 (Incremental_inputs_header_write): Remove.
9196 (Incremental_inputs_entry_data): Remove.
9197 (Incremental_inputs_entry): Remove.
9198 (Incremental_inputs_entry_write): Remove.
9199 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
9200 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
9201 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
9202 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
9203 Likewise.
9204 (Incremental_input_entry): New class.
9205 (Incremental_script_entry): New class.
9206 (Incremental_object_entry): New class.
9207 (Incremental_archive_entry): New class.
9208 (Incremental_inputs::Incremental_inputs): Initialize new data members.
9209 (Incremental_inputs::report_inputs): Remove.
9210 (Incremental_inputs::report_archive): Remove.
9211 (Incremental_inputs::report_archive_begin): New function.
9212 (Incremental_inputs::report_archive_end): New function.
9213 (Incremental_inputs::report_object): Change prototype.
9214 (Incremental_inputs::report_input_section): New function.
9215 (Incremental_inputs::report_script): Change prototype.
9216 (Incremental_inputs::get_reloc_count): New function.
9217 (Incremental_inputs::set_reloc_count): New function.
9218 (Incremental_inputs::create_data_sections): New function.
9219 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9220 (Incremental_inputs::inputs_section): New function.
9221 (Incremental_inputs::symtab_section): New function.
9222 (Incremental_inputs::relocs_section): New function.
9223 (Incremental_inputs::get_stringpool): Add const.
9224 (Incremental_inputs::command_line): Add const.
9225 (Incremental_inputs::inputs): Remove.
9226 (Incremental_inputs::command_line_key): New function.
9227 (Incremental_inputs::input_file_count): New function.
9228 (Incremental_inputs::input_files): New function.
9229 (Incremental_inputs::relocs_entsize): New function.
9230 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9231 (Incremental_inputs::finalize_inputs): Remove.
9232 (Incremental_inputs::Input_info): Remove.
9233 (Incremental_inputs::lock_): Remove.
9234 (Incremental_inputs::inputs_): Change type.
9235 (Incremental_inputs::inputs_map_): Remove.
9236 (Incremental_inputs::current_object_entry_): New data member.
9237 (Incremental_inputs::inputs_section_): New data member.
9238 (Incremental_inputs::symtab_section_): New data member.
9239 (Incremental_inputs::relocs_section_): New data member.
9240 (Incremental_inputs::reloc_count_): New data member.
9241 (Incremental_inputs_reader): New class.
9242 (Incremental_symtab_reader): New class.
9243 (Incremental_relocs_reader): New class.
9244 * layout.cc (Layout::finalize): Move finalization of incremental info
9245 and creation of incremental info sections to follow finalization of
9246 symbol table. Set offsets for postprocessing sections.
9247 (Layout::create_incremental_info_sections): Call
9248 Incremental_inputs::create_data_sections. Add incremental symtab
9249 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
9250 sections to layout after input sections.
9251 * layout.h (struct Timespec): Forward declaration.
9252 (Layout::incremental_inputs): Add const.
9253 (Layout::create_incremental_info_sections): Add parameter.
9254 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
9255 * object.cc: Include incremental.h.
9256 (Relobj::finalize_incremental_relocs): New function.
9257 (Sized_relobj::do_layout): Record input sections in incremental info.
9258 * object.h (Object::output_section): New function.
9259 (Object::output_section_offset): Moved from Relobj.
9260 (Object::get_incremental_reloc_base): New function.
9261 (Object::get_incremental_reloc_count): New function.
9262 (Object::do_output_section): New function.
9263 (Object::do_output_section_offset): Moved from Relobj.
9264 (Object::do_get_incremental_reloc_base): New function.
9265 (Object::do_get_incremental_reloc_count): New function.
9266 (Object::Object): Initialize new data members.
9267 (Relobj::output_section): Renamed do_output_section and moved to
9268 protected.
9269 (Relobj::output_section_offset): Moved to Object.
9270 (Relobj::do_get_incremental_reloc_base): New function.
9271 (Relobj::do_get_incremental_reloc_count): New function.
9272 (Relobj::allocate_incremental_reloc_counts): New function.
9273 (Relobj::count_incremental_reloc): New function.
9274 (Relobj::finalize_incremental_relocs): New function.
9275 (Relobj::next_incremental_reloc_index): New function.
9276 (Relobj::reloc_counts_): New data member.
9277 (Relobj::reloc_bases_): New data member.
9278 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
9279 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
9280 (Sized_relobj::incremental_relocs_scan): New function.
9281 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9282 (Sized_relobj::incremental_relocs_write): New function.
9283 (Sized_relobj::incremental_relocs_write_reltype): New function.
9284 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
9285 incremental link.
9286 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
9287 archives and object files elsewhere.
9288 (Add_symbols::run): Report object files here.
9289 (Finish_group::run): Report end of archive at end of group.
9290 * reloc.cc: Include layout.h, incremental.h.
9291 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
9292 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
9293 (Sized_relobj::incremental_relocs_scan): New function.
9294 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9295 (Sized_relobj::do_relocate_sections): Write incremental relocations.
9296 (Sized_relobj::incremental_relocs_write): New function.
9297 (Sized_relobj::incremental_relocs_write_reltype): New function.
9298 * script.cc (read_input_script): Rewrite test for incremental link.
9299 Change call to Incremental_inputs::report_script.
9300 * symtab.h (Symbol_table::first_global_index): New function.
9301 (Symbol_table::output_count): New function.
9302
ce0d1972
DK
93032010-08-12 Doug Kwan <dougkwan@google.com>
9304
9305 * arm.cc (Target_arm::merge_object_attributes): Check command line
9306 options --no-wchar-size-warning and --no-enum-size-warning.
9307 * options.h (General_options): Add ld-compatible options
9308 --no-enum-size-warning and --no-wchar-size-warning.
9309
6e5710ce
ILT
93102010-08-04 Ian Lance Taylor <iant@google.com>
9311
9312 * x86_64.cc (Target_x86_64::Scan::local): Use
9313 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
9314 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
9315 (Target_x86_64::Scan::global): Likewise.
9316 (Target_x86_64::Relocate::relocate): Likewise.
9317 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
9318 Likewise.
9319
fef830db
CC
93202010-08-03 Cary Coutant <ccoutant@google.com>
9321
9322 * merge.cc (Output_merge_string::do_add_input_section): Count strings
9323 to reserve space in merged_strings vector. Keep total input size
9324 for stats.
9325 (Output_merge_string::do_print_merge_stats): Print total input size.
9326 * merge.h (Output_merge_string): Add input_size_ field.
9327 * stringpool.cc (Stringpool_template::string_length): Move
9328 implementations out of Stringpool_template class and place in
9329 stringpool.h.
9330 * stringpool.h (string_length): Move out of Stringpool_template.
9331
1e3811b0
ILT
93322010-08-03 Ian Lance Taylor <iant@google.com>
9333
9334 PR 11712
9335 * layout.cc (relaxation_loop_body): If address of load segment is
9336 set, adjust address to include headers if possible.
9337
7af0c620
ILT
93382010-08-03 Ian Lance Taylor <iant@google.com>
9339
9340 * version.cc (version_string): Bump to 1.10.
9341
22f0da72
ILT
93422010-08-03 Ian Lance Taylor <iant@google.com>
9343
9344 PR 11805
9345 * layout.h (enum Output_section_order): Define.
9346 (class Layout): Update declarations.
9347 * layout.cc (Layout::get_output_section): Add order parameter.
9348 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
9349 is_first_non_relro parameters. Change all callers.
9350 (Layout::choose_output_section): Likewise.
9351 (Layout::add_output_section_data): Likewise.
9352 (Layout::make_output_section): Likewise. Set order.
9353 (Layout::default_section_order): New function.
9354 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
9355 * output.cc (Output_section::Output_section): Initialize order_.
9356 Don't initialize deleted fields.
9357 (Output_segment::Output_segment): Don't initialize deleted
9358 fields.
9359 (Output_segment::add_output_section_to_load): New function
9360 replacing add_output_section. Change all callers to call this or
9361 add_output_section_to_nonload.
9362 (Output_segment::add_output_section_to_nonload): New function.
9363 (Output_segment::remove_output_section): Rewrite.
9364 (Output_segment::add_initial_output_data): Likewise.
9365 (Output_segment::has_any_data_sections): Likewise.
9366 (Output_segment::is_first_section_relro): Likewise.
9367 (Output_segment::maximum_alignment): Likewise.
9368 (Output_segment::has_dynamic_reloc): New function replacing
9369 dynamic_reloc_count. Change all callers.
9370 (Output_segment::has_dynamic_reloc_list): New function replacing
9371 dynamic_reloc_count_list. Change all callers.
9372 (Output_segment::set_section_addresses): Rewrite.
9373 (Output_segment::set_offset): Rewrite.
9374 (Output_segment::find_first_and_last_list): Remove.
9375 (Output_segment::set_tls_offsets): Rewrite.
9376 (Output_segment::first_section_load_address): Likewise.
9377 (Output_segment::output_section_count): Likewise.
9378 (Output_segment::section_with_lowest_load_address): Likewise.
9379 (Output_segment::write_section_headers): Likewise.
9380 (Output_segment::print_sections_to_map): Likewise.
9381 * output.h (class Output_data): Remove dynamic_reloc_count_
9382 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
9383 (Output_data::add_dynamic_reloc): Rewrite.
9384 (Output_data::has_dynamic_reloc): New function.
9385 (Output_data::dynamic_reloc_count): Remove.
9386 (class Output_section): Add order_ field. Remvoe is_relro_local_,
9387 is_last_relro_, is_first_non_relro_, is_interp_,
9388 is_dynamic_linker_section_ fields. Add order and set_order
9389 functions. Remove is_relro_local, set_is_relro_local,
9390 is_last_relro, set_is_last_relro, is_first_non_relro,
9391 set_is_first_non_relro functions, is_interp, set_is_interp,
9392 is_dynamic_linker_section, and set_is_dynamic_linker_section
9393 functions.
9394 (class Output_segment): Change Output_data_list from std::list to
9395 std:;vector. Add output_lists_ field. Remove output_data_ and
9396 output_bss_ fields. Update declarations.
9397
3ff2ccb0
ILT
93982010-08-02 Ian Lance Taylor <iant@google.com>
9399
9400 * arm.cc (Target_arm::gc_process_relocs): Use typename.
9401 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
9402 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
9403
88a4108b
ILT
94042010-08-02 Ian Lance Taylor <iant@google.com>
9405
9406 PR 11855
9407 * script.cc (Script_options::Script_options): Initialize
9408 symbol_definitions_ and symbol_references_.
9409 (Script_options::add_symbol_assignment): Update
9410 symbol_definitions_ and symbol_references_.
9411 (Script_options::add_symbol_reference): New function.
9412 (script_symbol): New function.
9413 * script.h (class Script_options): Add symbol_definitions_ and
9414 symbol_references_ fields.
9415 (Script_options::referenced_const_iterator): New type.
9416 (Script_options::referenced_begin): New function.
9417 (Script_options::referenced_end): New function.
9418 (Script_options::is_referenced): New function.
9419 (Script_options::any_unreferenced): New function.
9420 * script-c.h (script_symbol): Declare.
9421 * yyscript.y (exp): Call script_symbol.
9422 * symtab.cc: Include "script.h".
9423 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
9424 Change all callers. Check symbols referenced by scripts.
9425 (Symbol_table::add_undefined_symbols_from_command_line): Add
9426 layout parameter. Change all callers.
9427 (Symbol_table::do_add_undefined_symbols_from_command_line):
9428 Likewise. Break out loop body. Check symbols referenced by
9429 scripts.
9430 (Symbol_table::add_undefined_symbol_from_command_line): New
9431 function broken out of
9432 do_add_undefined_symbols_from_command_line.
9433 * symtab.h (class Symbol_table): Update declarations.
9434 * archive.cc: Include "layout.h".
9435 (Archive::should_include_member): Add layout parameter. Change
9436 all callers. Check for symbol mentioned in expression.
9437 * archive.h (class Archive): Update declaration.
9438 * object.cc (Sized_relobj::do_should_include_member): Add layout
9439 parameter.
9440 * object.h (Object::should_include_member): Add layout parameter.
9441 Change all callers.
9442 (Object::do_should_include_member): Add layout parameter.
9443 (class Sized_relobj): Update declaration.
9444 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
9445 parameter.
9446 * dynobj.h (class Sized_dynobj): Update declaration.
9447 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
9448 layout parameter.
9449 * plugin.h (class Sized_pluginobj): Update declaration.
9450
5f1ab67a
ILT
94512010-08-02 Ian Lance Taylor <iant@google.com>
9452
9453 PR 11866
9454 * output.cc (Output_segment::set_offset): Search for the first and
9455 last sections rather than assuming that the list is in order.
9456 (Output_segment::find_first_and_last_list): New function.
9457 * output.h (class Output_segment): Update declarations.
9458 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
9459 (relro_strip_test_SOURCES): New variable.
9460 (relro_strip_test_DEPENDENCIES): New variable.
9461 (relro_strip_test_LDFLAGS): New variable.
9462 (relro_strip_test_LDADD): New variable.
9463 (relro_strip_test.so): New target.
9464
a8df5856
ILT
94652010-08-02 Ian Lance Taylor <iant@google.com>
9466
9467 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
9468 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
9469 (Target_i386::got_tlsdesc_section): New function.
9470 (Target_i386::got_section): Create space for GOT entries for
9471 TLSDESC relocations.
9472 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
9473 R_386_TLS_GOTDESC.
9474 (Target_i386::Scan::global): Likewise.
9475 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
9476 using TLSDESC GOT.
9477 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
9478 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
9479 (Target_x86_64::got_tlsdesc_section): New function.
9480 (Target_x86_64::got_section): Create space for GOT entries for
9481 TLSDESC relocations.
9482 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
9483 R_386_TLS_GOTDESC.
9484 (Target_x86_64::Scan::global): Likewise.
9485 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
9486 using TLSDESC GOT.
9487
0c10a0a6
ILT
94882010-08-02 Ian Lance Taylor <iant@google.com>
9489
9490 * testsuite/final_layout.sh: Use dc to convert from hex to
9491 decimal.
9492
41cbeecc
ST
94932010-07-29 Sriraman Tallam <tmsriram@google.com>
9494
9495 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
9496 paramter to the call to gold::gc_process_relocs.
9497 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
9498 paramter to the call to gold::gc_process_relocs.
9499 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
9500 parameter to the call to gold::gc_process_relocs.
9501 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
9502 template parameter to the call to gold::gc_process_relocs.
9503 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
9504 paramter to the call to gold::gc_process_relocs.
9505 * gc.h (get_embedded_addend_size): New function.
9506 (gc_process_relocs): Save the size of the reloc for use by ICF.
9507 * icf.cc (get_section_contents): Get the addend from the text section
9508 for SHT_REL relocation sections.
9509 * icf.h (Icf::Reloc_addend_size_info): New typedef.
9510 (Icf::Reloc_info): Add new member reloc_addend_size_info.
9511 * int_encoding.h (read_from_pointer): New overloaded function.
9512 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
9513 * testsuite/icf_sht_rel_addend_test.sh: New file.
9514 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
9515 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
9516
6ea55b82
RW
95172010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9518
9519 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
9520 * Makefile.in: Regenerate.
9521 * testsuite/Makefile.in: Regenerate.
9522
9691462b
ILT
95232010-07-27 Jeffrey Yasskin <jyasskin@google.com>
9524
9525 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
9526 * gold/testsuite/debug_msg.cc: Likewise.
9527 * gold/testsuite/odr_violation1.cc
9528 * gold/testsuite/odr_violation2.cc
9529
76897331
CC
95302010-07-21 Cary Coutant <ccoutant@google.com>
9531
9532 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
9533 string, and length fields.
9534 (Output_merge_string::Merged_strings_list): New type.
9535 (Output_merge_string::Merged_strings_lists): New typedef.
9536 (Output_merge_string): Replace merged_strings_ with
9537 merged_strings_lists_.
9538 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
9539 Merged_strings_list per input object and section. Don't store pointer
9540 to the string. Don't store length with each merged string entry.
9541 (Output_merge_string::finalize_merged_data): Loop over list of merged
9542 strings lists. Recompute length of each merged string.
9543
78384e8f
CC
95442010-07-15 Cary Coutant <ccoutant@google.com>
9545
9546 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
9547 here.
9548
783659f9
ILT
95492010-07-14 Ian Lance Taylor <iant@google.com>
9550
9551 * descriptors.cc (Descriptors::open): Report correct name in error
9552 message.
9553
131687b4
DK
95542010-07-13 Doug Kwan <dougkwan@google.com>
9555
9556 * arm.cc (Arm_input_section::Arm_input_section): For a
9557 SHT_ARM_EXIDX section, always keeps the input sections.
9558 (Arm_input_section::set_exidx_section_link): New method.
9559 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
9560 has_errors_ to false.
9561 (Arm_exidx_input_section::has_errors,
9562 Arm_exidx_input_section::set_has_errors): New methods.
9563 (Arm_exidx_input_section::has_errors_): New data member.
9564 (Arm_relobj::get_exidx_shndx_list): New method.
9565 (Arm_output_section::append_text_sections_to_list): Do not skip
9566 section without SHF_EXECINSTR.
9567 (Arm_output_section::fix_exidx_coverage): Skip input sections with
9568 errors.
2e702c99 9569 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
9570 section header. Make error messages more verbose. Check for
9571 a non-executable section linked to an EXIDX section.
9572 (Arm_relobj::do_read_symbols): Remove error checking, which has been
9573 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
9574 check that there is no deferred EXIDX section if we exit early.
9575 Instead of not making an EXIDX section in case of an error, make one
9576 and set the has_errors flag of it.
9577 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
9578 in a relocatable link.
9579 (Target_arm::do_relax): Look for the EXIDX output section instead of
9580 assuming that it is called .ARM.exidx.
2e702c99 9581 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
9582 section list. Do not check for SHF_EXECINSTR section flags but
9583 skip any input section with errors.
9584 * output.cc (Output_section::Output_section): Initialize
9585 always_keeps_input_sections_ to false.
9586 (Output_section::add_input_section): Check for
9587 always_keeps_input_sections_.
9588 * output.h (Output_section::always_keeps_input_sections,
9589 Output_section::set_always_keeps_input_sections): New methods.
9590 (Output_section::always_keeps_input_sections): New data member.
9591
69517287
RÁE
95922010-07-13 Rafael Espindola <espindola@google.com>
9593
9594 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
9595 * fileread.h (Input_file): Add try_extra_search_path and find_file.
9596
82742395
ILT
95972010-07-13 Philip Herron <herron.philip@googlemail.com>
9598 Ian Lance Taylor <iant@google.com>
9599
9600 * output.h (Output_section_lookup_maps::add_merge_section):
9601 Correct check of whether value was inserted.
9602 (Output_section_lookup_maps::add_merge_input_section): Likewise.
9603 (Output_section_lookup_maps::add_relaxed_input_section):
9604 Likewise.
9605 * arm.cc (Target_arm::got_section): Remove used local os.
9606 * i386.cc (Target_i386::got_section): Likewise.
9607 * x86_64.cc (Target_x86_64::got_section): Likewise.
9608 * sparc.cc (Target_sparc::got_section): Likewise.
9609 (Target_sparc::relocate): Remove unused local have_got_offset.
9610 * powerpc.cc (Target_powerpc::relocate): Likewise.
9611
f2d707b5
ILT
96122010-07-13 Ian Lance Taylor <iant@google.com>
9613
241531d6
ILT
9614 * compressed_output.cc (zlib_decompress): Fix signature in
9615 !HAVE_ZLIB_H case.
9616
f2d707b5
ILT
9617 * archive.cc (Archive::include_member): Unlock an external member
9618 of a thin archive. Don't bother to delete an object we know is
9619 NULL.
9620
a2e47362
CC
96212010-07-12 Cary Coutant <ccoutant@google.com>
9622
9623 * compressed_output.cc (zlib_decompress): New function.
9624 (get_uncompressed_size): New function.
9625 (decompress_input_section): New function.
9626 * compressed_output.h (get_uncompressed_size): New function.
9627 (decompress_input_section): New function.
9628 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
9629 Handle compressed debug sections.
9630 * layout.cc (is_compressed_debug_section): New function.
9631 (Layout::output_section_name): Map compressed section names to
9632 canonical names.
9633 * layout.h (is_compressed_debug_section): New function.
9634 (is_debug_info_section): Recognize compressed debug sections.
9635 * merge.cc: Include compressed_output.h.
9636 (Output_merge_data::do_add_input_section): Handle compressed
9637 debug sections.
9638 (Output_merge_string::do_add_input_section): Handle compressed
9639 debug sections.
9640 * object.cc: Include compressed_output.h.
9641 (Sized_relobj::Sized_relobj): Initialize new data members.
9642 (build_compressed_section_map): New function.
9643 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
9644 * object.h (Object::section_is_compressed): New method.
9645 (Object::do_section_is_compressed): New method.
9646 (Sized_relobj::Compressed_section_map): New type.
9647 (Sized_relobj::do_section_is_compressed): New method.
9648 (Sized_relobj::compressed_sections_): New data member.
9649 * output.cc (Output_section::add_input_section): Handle compressed
9650 debug sections.
9651 * reloc.cc: Include compressed_output.h.
9652 (Sized_relobj::write_sections): Handle compressed debug sections.
9653
ce279a62
CC
96542010-07-08 Cary Coutant <ccoutant@google.com>
9655
9656 * resolve.cc (Symbol_table::resolve): Remember whether undef was
9657 weak when resolving to a dynamic def.
9658 (Symbol_table::should_override): Add adjust_dyndef flag; set it
9659 for weak undef/dynamic def cases. Adjust callers.
9660 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
9661 undef_binding_weak_.
9662 (Symbol_table::sized_write_globals): Adjust symbol binding.
9663 (Symbol_table::sized_write_symbol): Add binding parameter.
9664 * symtab.h (Symbol::set_undef_binding): New method.
9665 (Symbol::is_undef_binding_weak): New method.
9666 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
9667 (Symbol_table::should_override): Add new parameter.
9668 (Symbol_table::sized_write_symbol): Add new parameter.
9669
9670 * testsuite/weak_undef_file1.cc: Add new test case.
9671 * testsuite/weak_undef_file2.cc: Fix header comment.
9672 * testsuite/weak_undef_test.cc: Add new test case.
9673
b2286c10
DK
96742010-06-29 Doug Kwan <dougkwan@google.com>
9675
9676 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
9677 Initialize USE_SYMBOL_.
9678 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
9679 definition.
9680 (Arm_reloc_property::uses_symbol_): New data member declaration.
9681 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
9682 uses symbol value and symbol is undefined but not weakly undefined.
9683
4802450a
RÁE
96842010-06-28 Rafael Espindola <espindola@google.com>
9685
9686 * plugin.cc (Plugin::load): Use dlerror.
9687
e5ca47ba
ILT
96882010-06-26 Jeffrey Yaskin <jyasskin@google.com>
9689
9690 * symtab.cc (detect_odr_violations): When reporting an ODR
9691 violation, report an object where the symbol is defined.
9692
8a75a161
DK
96932010-06-25 Doug Kwan <dougkwan@google.com>
9694
9695 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
9696 (Target_arm::section_may_have_icf_unsafe_pointers): New method
9697 definition.
9698 (Target_arm::Scan::local_reloc_may_be_function_pointer,
9699 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
9700 target hook to detect function points.
9701 (Target_arm::Scan::possible_function_pointer_reloc): New method.
9702 * icf.h (Icf::check_section_for_function_pointers): Change type of
9703 parameter SECTION_NAME to const reference to std::string. Use
9704 target hook to determine if section may have unsafe pointers.
9705 * target.h (Target::section_may_have_icf_unsafe_pointers): New
9706 method definition.
9707
42218b9f
RÁE
97082010-06-21 Rafael Espindola <espindola@google.com>
9709
9710 * fileread.cc (Input_file::find_fie): New
9711 (Input_file::open): Use Input_file::find_fie.
9712 * fileread.h (Input_file::find_fie): New
9713 * plugin.cc (set_extra_library_path): New.
9714 (Plugin::load): Add set_extra_library_path to the transfer vector.
9715 (Plugin_manager::set_extra_library_path): New.
9716 (Plugin_manager::add_input_file): Use the extra search path if set.
9717 (set_extra_library_path(): New.
9718 * plugin.h (Plugin_manager): Add set_extra_library_path and
9719 extra_search_path_.
9720
a0506cca
CC
97212010-06-19 Cary Coutant <ccoutant@google.com>
9722
9723 * layout.cc (gdb_sections): Add .debug_types.
9724 (lines_only_debug_sections): Likewise.
9725
6508b958
RÁE
97262010-06-18 Rafael Espindola <espindola@google.com>
9727
9728 * plugin.cc (add_input_file,add_input_library)
9729 (Plugin_manager::add_input_file): Make filename arguments const.
9730 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
9731 const.
9732
3e235302
DK
97332010-06-16 Doug Kwan <dougkwan@google.com>
9734
9735 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
9736 .ARM.attributes section if we have not merged any input
9737 attributes sections.
9738
106e8a6c
DK
97392010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9740
9741 * arm.cc: Allow combining objects with no EABI version
9742 information.
9743
91ff43fe
RÁE
97442010-06-15 Rafael Espindola <espindola@google.com>
9745
9746 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
9747
68ed838c
ILT
97482010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9749
9750 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
9751 (struct iovec): Correct !HAVE_READV definition.
9752
f3a2388f
CC
97532010-06-10 Cary Coutant <ccoutant@google.com>
9754
9755 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
9756 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
9757 reloc sections.
9758 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
9759
9760 PR 11683
9761 * symtab.h (Symbol::is_placeholder): New member function.
9762 * target-reloc.h (relocate_section): Check for placeholder symbols.
9763
9764 * testsuite/Makefile.am (plugin_test_8): New test.
9765 (plugin_test_9): New test.
9766 * testsuite/Makefile.in: Regenerate.
9767
e1df38aa
NC
97682010-06-09 Nick Clifton <nickc@redhat.com>
9769
9770 * yyscript.y (input_list_element): Allow strings prefixed with
9771 the '-' character. Treat these as libraries.
9772 * script.cc (script_add_library): New function. Adds a library
9773 specified by "-l<name>" found in an input script.
9774 * script-c.h: Add prototype for script_add_library.
9775
25bbe950
DK
97762010-06-07 Doug Kwan <dougkwan@google.com>
9777
9778 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
9779 Restrict stub-group size to be within long conditional branch
9780 range when working around cortex-A8 erratum.
9781
0f32ea4c
ILT
97822010-06-07 Damien Diederen <dd@crosstwine.com>
9783
9784 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
9785 #ifdef typo.
9786
8fe2a369
ST
97872010-06-03 Sriraman Tallam <tmsriram@google.com>
9788
9789 PR gold/11658
9790 * output.cc
9791 (Output_section::Input_section_sort_entry::compare_section_ordering):
9792 Change to return non-zero correctly.
9793 (Output_section::Input_section_sort_section_order_index_compare
9794 ::operator()): Change to fix ambiguity in comparisons.
9795
6e9ba2ca
ST
97962010-06-01 Sriraman Tallam <tmsriram@google.com>
9797
9798 * gold.h (is_wildcard_string): New function.
9799 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
9800 (Layout::layout_eh_frame): Ditto.
9801 (Layout::find_section_order_index): New method.
9802 (Layout::read_layout_from_file): New method.
9803 * layout.h (Layout::find_section_order_index): New method.
9804 (Layout::read_layout_from_file): New method.
9805 (Layout::input_section_position_): New private member.
9806 (Layout::input_section_glob_): New private member.
9807 * main.cc (main): Call read_layout_from_file here.
9808 * options.h (--section-ordering-file): New option.
9809 * output.cc (Output_section::input_section_order_specified_): New
9810 member.
9811 (Output_section::Output_section): Initialize new member.
9812 (Output_section::add_input_section): Add new parameter.
9813 Keep input sections when --section-ordering-file is used.
9814 (Output_section::set_final_data_size): Sort input sections when
9815 section ordering file is specified.
9816 (Output_section::Input_section_sort_entry): Add new parameter.
9817 Check sorting type.
9818 (Output_section::Input_section_sort_entry::compare_section_ordering):
9819 New method.
9820 (Output_section::Input_section_sort_compare::operator()): Change to
9821 consider section_order_index.
9822 (Output_section::Input_section_sort_init_fini_compare::operator()):
9823 Change to consider section_order_index.
9824 (Output_section::Input_section_sort_section_order_index_compare
9825 ::operator()): New method.
9826 (Output_section::sort_attached_input_sections): Change to sort
9827 according to section order when specified.
e1df38aa
NC
9828 (Output_section::add_input_section<32, true>): Add new parameter.
9829 (Output_section::add_input_section<64, true>): Add new parameter.
9830 (Output_section::add_input_section<32, false>): Add new parameter.
9831 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
9832 * output.h (Output_section::add_input_section): Add new parameter.
9833 (Output_section::input_section_order_specified): New
9834 method.
9835 (Output_section::set_input_section_order_specified): New method.
9836 (Input_section::Input_section): Initialize section_order_index_.
9837 (Input_section::section_order_index): New method.
9838 (Input_section::set_section_order_index): New method.
9839 (Input_section::section_order_index_): New member.
9840 (Input_section::Input_section_sort_section_order_index_compare): New
9841 struct.
9842 (Output_section::input_section_order_specified_): New member.
9843 * script-sections.cc (is_wildcard_string): Delete and move modified
9844 method to gold.h.
9845 (Output_section_element_input::Output_section_element_input): Modify
9846 call to is_wildcard_string.
9847 (Output_section_element_input::Input_section_pattern
9848 ::Input_section_pattern): Ditto.
9849 (Output_section_element_input::Output_section_element_input): Ditto.
9850 * testsuite/Makefile.am (final_layout): New test case.
9851 * testsuite/Makefile.in: Regenerate.
9852 * testsuite/final_layout.cc: New file.
9853 * testsuite/final_layout.sh: New file.
9854
3537c84b
RÁE
98552010-06-01 Rafael Espindola <espindola@google.com>
9856
9857 * plugin.cc (Plugin::load): Pass the output name to the plugin.
9858
105b6afd
RÁE
98592010-06-01 Rafael Espindola <espindola@google.com>
9860
9861 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
9862 visibility of symbols.
9863
29e11421
DK
98642010-05-27 Doug Kwan <dougkwan@google.com>
9865
9866 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
9867 from start of output section instead of address for a local symbol
9868 in a merged or relaxed section when doing a relocatable link.
9869
5e0f337e
RÁE
98702010-05-26 Rafael Espindola <espindola@google.com>
9871
703d02da 9872 PR 11604
5e0f337e
RÁE
9873 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
9874 adding sections the garbage collector removed.
9875 * gold/testsuite/Makefile.am: Add test.
9876 * gold/testsuite/Makefile.in: Regenerate.
9877 * gold/testsuite/plugin_test_7.sh: New.
9878 * gold/testsuite/plugin_test_7_1.c: New.
9879 * gold/testsuite/plugin_test_7_2.c: New.
9880
f4187277
RÁE
98812010-05-26 Rafael Espindola <espindola@google.com>
9882
9883 * script-sections.cc (Output_section_definition::set_section_addresses):
9884 Check for --section-start.
9885
5c388529
DK
98862010-05-26 Doug Kwan <dougkwan@google.com>
9887
9888 * arm.cc (Arm_scan_relocatable_relocs): New class.
9889 (Target_arm::relocate_special_relocatable): New method.
9890 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
9891 (Arm_relocate_functions::thumb_branch_common): Same.
9892 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
9893 instead of Default_scan_relocatable_relocs.
9894 * target-reloc.h (relocate_for_relocatable): Let target handle
9895 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
9896 * target.h (Sized_target::relocate_special_relocatable): New method.
9897
bca1c3ae
ILT
98982010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9899
9900 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
9901
0439c796
DK
99022010-05-23 Doug Kwan <dougkwan@google.com>
9903
9904 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
9905 instead of a cast.
9906 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
9907 with a direct branch, not a conditional branch, to a stub.
9908 * merge.cc (Output_merge_base::record_input_section): New method
9909 defintion.
9910 (Output_merge_data::do_add_input_section): Record input section if
9911 keeps-input-sections flag is set.
9912 (Output_merge_string::do_add_input_section): Ditto.
9913 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
9914 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
9915 INPUT_SECTIONS_.
9916 (Output_merge_base::keeps_input_sections,
9917 Output_merge_base::set_keeps_input_sections,
9918 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
9919 method definitions.
9920 (Output_merge_base::Input_sections): New type declaration.
9921 (Output_merge_base::input_sections_begin,
9922 Output_merge_base::input_sections_end,
9923 Output_merge_base::do_set_keeps_input_sections): New method definitions.
9924 (Output_merge_base::bool keeps_input_sections_,
9925 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
9926 Output_merge_base::input_sections_): New data members.
9927 (Output_merge_data::do_set_keeps_input_sections): New method
9928 defintion.
9929 (Output_merge_string::do_set_keeps_input_sections): Ditto.
9930 * output.cc (Output_section::Input_section::relobj): Move method
9931 defintion from class declaration to here and handle merge sections.
9932 (Output_section::Input_section::shndx): Ditto.
9933 (Output_section::Output_section): Remove initializations of removed
9934 data members and initialize new data member LOOKUP_MAPS_.
9935 (Output_section::add_input_section): Set keeps-input-sections flag
9936 for a newly created merge output section as appropriate. Adjust code
9937 to use Output_section_lookup_maps class.
9938 (Output_section::add_relaxed_input_section): Adjst code for lookup
9939 maps code refactoring.
2e702c99 9940 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
9941 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
9942 class. If adding input section to a newly created merge output
9943 section fails, remove the new merge section.
9944 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 9945 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 9946 (Output_section::find_merge_section): Ditto.
0439c796 9947 (Output_section::build_lookup_maps): New method defintion.
2e702c99 9948 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
9949 Output_section_lookup_maps class.
9950 (Output_section::get_input_sections): Export merge sections. Adjust
9951 code to use Output_section_lookup_maps class.
9952 (Output_section:::add_script_input_section): Adjust code to use
9953 Output_section_lookup_maps class. Update lookup maps for merge
9954 sections also.
9955 (Output_section::discard_states): Use Output_section_lookup_maps.
9956 (Output_section::restore_states): Same.
9957 * output.h (Merge_section_properties): Move class defintion out of
9958 Output_section.
9959 (Output_section_lookup_maps): New class.
9960 (Output_section::Input_section::is_merge_section): New method
9961 defintion.
9962 (Output_section::Input_section::relobj): Move defintion out of class
9963 defintion. Declare method only.
9964 (Output_section::Input_section::shndx): Ditto.
9965 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 9966 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
9967 (Output_section::Merge_section_by_properties_map,
9968 Output_section::Output_section_data_by_input_section_map,
9969 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
9970 Remove types.
2e702c99 9971 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
9972 KEEPS_INPUT_SECTIONS.
9973 (Output_section::build_lookup_maps): New method declaration.
9974 (Output_section::merge_section_map_,
9975 Output_section::merge_section_by_properties_map_,
9976 Output_section::relaxed_input_section_map_,
9977 Output_section::is_relaxed_input_section_map_valid_): Remove data
9978 members.
9979 (Output_section::lookup_maps_): New data member.
9980
76295588
L
99812010-05-21 Doug Kwan <dougkwan@google.com>
9982
9983 PR gold/11619
9984 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
9985 avoid a compilation error.
9986
d103a984
RÁE
99872010-05-19 Rafael Espindola <espindola@google.com>
9988
9989 * script-sections.cc (Output_section_definition::allocate_to_segment):
9990 Update the phdrs_list even when the output section is NULL.
9991 * testsuite/Makefile.am: Add test.
9992 * testsuite/Makefile.in: Regenerate.
9993 * testsuite/script_test_9.cc: New.
9994 * testsuite/script_test_9.sh: New.
9995 * testsuite/script_test_9.t: New.
9996
6625d24e
DK
99972010-05-19 Doug Kwan <dougkwan@google.com>
9998
9999 * arm.cc (Arm_input_section::original_size): New method.
10000 (Arm_input_section::do_addralign): Add a cast.
10001 (Arm_input_section::do_output_offset): Remove static cast.
10002 (Arm_input_section::original_addralign,
10003 Arm_input_section::original_size_): Change type to uint32_t.
10004 (Arm_input_section::init): Add safe casts for section alignment
10005 and size.
10006 (Arm_input_section::set_final_data_size): Do not set address and
10007 offset of stub table.
10008 (Arm_output_section::fix_exidx_coverage): Change use of of
10009 Output_section::Simple_input_section to that of
10010 Output_section::Input_section.
10011 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
10012 except for the first pass.
10013 * output.cc (Output_section::get_input_sections): Change type of
10014 input_sections to std::list<Input_section>.
10015 (Output_section::add_script_input_section): Rename from
10016 Output_section::add_simple_input_section. Change type of SIS
10017 parameter from Simple_input_section to Input_section.
10018 * output.h (Output_section::Simple_input_section): Remove class.
10019 (Output_section::Input_section): Change class visibility to public.
10020 (Output_section::Input_section::addralign): Use stored alignments
10021 for special input sections if set.
10022 (Output_section::Input_section::set_addralign): New method.
10023 (Output_section::get_input_sections): Change parameter type from
10024 list of Simple_input_section to list of Input_section.
10025 (Output_section::add_script_input_section): Rename from
10026 Output_section::add_simple_input_section. Change first parameter's
10027 type from Simple_input_section to Input_section and remove the
10028 second and third parameters.
10029 * script-sections.cc (Input_section::Input_section_list): Change
10030 type to list of Output_section::Input_section/
10031 (Input_section_info::Input_section_info): Change parameter type of
10032 INPUT_SECTION to Output_section::Input_section.
10033 (Input_section_info::input_section): Change return type.
10034 (Input_section_info::input_section_): Change type to
10035 Output_section::Input_section.
10036 (Output_section_element_input::set_section_addresses): Adjust code
10037 to use Output_section::Input_section instead of
10038 Output_section::Simple_input_section. Adjust code for renaming
10039 of Output_section::add_simple_input_section.
10040 (Orphan_output_section::set_section_addresses): Ditto.
10041
e1e82ea4
RW
100422010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10043
10044 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
10045 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
10046
91e75c8a
RÁE
100472010-05-18 Rafael Espindola <espindola@google.com>
10048
10049 * options.cc (General_options::finalize): Handle -nostdlib.
10050 * options.h (nostdlib): New option.
10051 * script.cc (script_add_search_dir): Handle -nostdlib.
10052
da59ad79
DK
100532010-05-12 Doug Kwan <dougkwan@google.com>
10054
10055 * arm.cc (Target_arm::do_finalize_sections): Create an empty
10056 attributes section only if there no attributes section after merging.
10057 (Target_arm::merge_object_attributes): Move value of
e1df38aa 10058 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
10059 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
10060 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
10061 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
10062 and arm_attr_merge_7.stdout.
10063 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
10064 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
10065 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
10066 arm_attr_merge_7b.o): New rules.
10067 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
10068 arm_attr_merge_7
10069 * testsuite/Makefile.in: Regenerate.
10070 * testsuite/arm_attr_merge.sh: New file.
10071 * testsuite/arm_attr_merge_[67][ab].s: Same.
10072
3e01a7fd
NC
100732010-05-05 Nick Clifton <nickc@redhat.com>
10074
10075 * po/es.po: Updated Spanish translation.
10076
7ad2014a
L
100772010-04-27 H.J. Lu <hongjiu.lu@intel.com>
10078
10079 * Makefile.am (install-exec-local): Properly install gold as
10080 default cross linker.
10081 * Makefile.in: Regenerated.
10082
4fda8867
NC
100832010-04-27 H.J. Lu <hongjiu.lu@intel.com>
10084 Nick Clifton <nickc@redhat.com>
10085
10086 * configure.ac (install_as_default): Define and set to false
10087 unless --enable-gold or --enable-gold=both/gold has been
10088 specified.
10089 * configure: Regenerate.
10090
10091 * Makefile.am (install-exec-local): Install the executable as
10092 'ld.gold'. If install_as_default is true then also install it as
10093 'ld'.
10094 * Makefile.in: Regenerated.
10095
bd288ea2
ILT
100962010-04-24 Ian Lance Taylor <iant@google.com>
10097
10098 * layout.cc (Layout::layout_reloc): In relocatable link don't
10099 combine reloc sections for grouped sections.
10100
ef38fd8a
ST
101012010-04-23 Sriraman Tallam <tmsriram@google.com>
10102
10103 * gc.h (gc_process_relocs): Pass information on relocs pointing to
10104 sections that are not ordinary to icf.
10105 * icf.cc (get_section_contents): Handle relocation pointing to section
10106 with no object or shndx information.
10107 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
10108 * testsuite/Makefile.in: Regenerate.
10109 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
10110 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
10111
f6973bdc
ILT
101122010-04-22 Ian Lance Taylor <iant@google.com>
10113
10114 * expression.cc (Expression::Expression_eval_info): Add
10115 result_alignment_pointer field.
10116 (Expression::eval_with_dot): Add result_alignment_pointer
10117 parameter. Change all callers.
10118 (Expression::eval_maybe_dot): Likewise.
10119 (class Binary_expression): Add alignment_pointer parameter to
10120 left_value and right_value. Change all callers.
10121 (BINARY_EXPRESSION): Set result alignment.
10122 (class Trinary_expression): Add alignment_pointer parameter to
10123 arg2_value and arg3_value. Change all callers.
10124 (Trinary_cond::value): Set result alignment.
10125 (Max_expression::value, Min_expression::value): Likewise.
10126 (Align_expression::value): Likewise.
10127 * script-sections.cc (class Sections_element): Add dot_alignment
10128 parameter to set_section_addresses virtual function. Update
10129 instantiations.
10130 (class Output_section_element): Likewise.
10131 (Script_sections::create_segments): Add dot_alignment parameter.
10132 Change all callers.
10133 (Script_sections::create_segments_from_phdrs_clause): Likewise.
10134 (Script_sections::set_phdrs_clause_addresses): Likewise.
10135 * script-sections.h: Update declarations.
10136 * script.h: Update declarations.
10137 * output.h (Output_segment::set_minimum_p_align): Don't decrease
10138 min_p_align.
10139 * testsuite/script_test_3.t: Set large alignment.
10140 * testsuite/script_test_3.sh: Make sure that at least one LOAD
10141 segment has expected alignment.
10142
9c9c98a5
NC
101432010-04-22 Nick Clifton <nickc@redhat.com>
10144
10145 * po/gold.pot: Updated by the Translation project.
10146 * po/vi.po: Updated Vietnamese translation.
10147
2253bfba
L
101482010-04-22 H.J. Lu <hongjiu.lu@intel.com>
10149
10150 * testsuite/Makefile.am (check_PROGRAMS): Add
10151 icf_virtual_function_folding_test.
10152 * testsuite/Makefile.in: Regenerated.
10153
85fdf906
AH
101542010-04-15 Andrew Haley <aph@redhat.com>
10155
10156 * options.h (merge_exidx_entries): New option.
10157 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
10158 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
10159 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
10160 (Target_arm::merge_exidx_entries): New function.
10161 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
10162 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
10163 to Arm_exidx_fixup constructor.
10164 Add new arg, merge_exidx_entries.
10165 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
10166 Arm_output_section::fix_exidx_coverage.
10167
ce97fa81
ST
101682010-04-18 Sriraman Tallam <tmsriram@google.com>
10169
10170 * icf.cc (get_section_contents): Check for preemptible functions.
10171 Ignore addend when appropriate.
10172 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
10173 section folded.
10174 (add_from_relobj): Check for section folded.
10175 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
10176 * symtab.h (should_add_dynsym_entry): Add new parameter.
10177 * target-reloc.h (scan_relocs): Check for section folded.
10178 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
10179 Check reloc types for function pointers in shared objects.
10180 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
10181 case.
10182 (icf_preemptible_functions_test): New test case.
10183 (icf_string_merge_test): New test case.
10184 * testsuite.Makefile.in: Regenerate.
10185 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
10186 bar_glob. Refactor code.
10187 * testsuite/icf_preemptible_functions_test.cc: New file.
10188 * testsuite/icf_preemptible_functions_test.sh: New file.
10189 * testsuite/icf_string_merge_test.cc: New file.
10190 * testsuite/icf_string_merge_test.sh: New file.
10191 * testsuite/icf_virtual_function_folding_test.cc: New file.
10192 * testsuite/icf_virtual_function_folding_test.sh: New file.
10193
04ceb17c
DK
101942010-04-14 Doug Kwan <dougkwan@google.com>
10195
10196 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
10197 for local symbol recounting if we remove a section due to ICF.
10198 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
10199 there are no regular objects in input.
10200
153e7da4
DK
102012010-04-13 Doug Kwan <dougkwan@google.com>
10202
10203 * arm.cc (Arm_input_section::set_final_data_size): Compute
10204 accurate final data size instead of using current data size.
10205
4dbd9faf
DK
102062010-04-09 Doug Kwan <dougkwan@google.com>
10207
10208 * layout.cc (Layout::choose_output_section): Handle script section
10209 types.
10210 (Layout::make_output_section_for_script): Add section type parameter.
10211 Handle script section types.
10212 * layout.h (Layout::make_output_section_for_script): Add section
10213 type parameter.
10214 * output.cc (Output_section::Output_section): Initialize data member
10215 is_noload_.
10216 (Output_section::do_reset_address_and_file_offset): Do not set address
10217 to 0 if section is a NOLOAD section.
10218 * output.h (Output_section::is_noload): New method.
10219 (Output_section::set_is_noload): Ditto.
10220 (Output_section::is_noload_): New data member.
10221 * script-c.h (Script_section_type): New enum type.
10222 (struct Parser_output_section_header): Add new file section_type.
10223 * script-sections.cc (Sections_element::output_section_name): Add
10224 parameter for returning script section type.
10225 (Output_section_definition::output_section_name): Ditto.
10226 (Output_section_definition::section_type)P; New method.
10227 (Output_section_definiton::script_section_type_name): Ditto.
10228 (Output_section_definition::script_section_type_): New data member.
10229 (Output_section_definition::Output_section_definition): Initialize
10230 data member Output_section_definition::script_section_type_.
10231 (Output_section_definition::create_sections): Pass script section type
10232 to Layout::make_output_section_for_script.
10233 (Output_section_definition::output_section_name): Return script
10234 section type to caller.
10235 (Output_section_definition::set_section_address): Do not advance
10236 dot value and load address if section type is NOLOAD. Set address
10237 of NOLOAD sections regardless of section flags.
10238 (Output_section_definition::print): Print section type if it is
10239 not SCRIPT_SECTION_TYPE_NONE.
10240 (Output_section_definition::section_type): New method.
10241 (Output_section_definition::script_section_type_name): Ditto.
10242 (Script_sections::output_section_name): Add new parameter
10243 PSECTION_TYPE for returning script section type. Pass it to
10244 section elements. Handle discard sections.
10245 (Sort_output_sections::operator()): Handle NOLOAD sections.
10246 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 10247 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
10248 returning script section type.
10249 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
10250 INFO and NOLOAD.
10251 * yyscript.y (union): Add new field SECTION_TYPE.
10252 (COPY, DSECT, INFO, NOLOAD): New tokens.
10253 (opt_address_and_section_type): Change type to output_section_header.
10254 (section_type): New non-terminal
10255 (section_header): Handle section type.
2253bfba 10256 (opt_address_and_section_type): Return section type value.
4dbd9faf 10257
721ea635
L
102582010-04-09 H.J. Lu <hongjiu.lu@intel.com>
10259
10260 * testsuite/plugin_common_test_1.c (foo): Add prototype.
10261 * testsuite/plugin_common_test_2.c (foo): Likewise.
10262
6bf924b0
DK
102632010-04-08 Doug Kwan <dougkwan@google.com>
10264
10265 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
10266 Output_merge_data.
10267 * output.cc (Output_section::add_merge_input_section): Simplify
10268 code and return status of Output_merge_base::add_input_section.
e1df38aa 10269 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
10270 returns true.
10271
24af6f92
DK
102722010-04-07 Doug Kwan <dougkwan@google.com>
10273
10274 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
10275 if section is marked as containing instructions but has no mapping
10276 symbols.
10277 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
10278 correct section index.
10279 (Arm_relobj::find_linked_text_section): Ditto.
10280
00698fc5
CC
102812010-04-07 Cary Coutant <ccoutant@google.com>
10282
10283 * archive.cc (include_member): Destroy Read_symbols_data object before
10284 releasing file.
10285 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
10286 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
10287 (Read_symbols_data::~Read_symbols_data) New destructor.
10288 (Section_relocs::Section_relocs) New constructor.
10289 (Section_relocs::~Section_relocs) New destructor.
10290 (Read_relocs_data::Read_relocs_data) New constructor.
10291 (Read_relocs_data::~Read_relocs_data) New destructor.
10292 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
10293 pointers to NULL after deleting.
10294
7296d933
DK
102952010-04-07 Doug Kwan <dougkwan@google.com>
10296
10297 * arm.cc: Replace "endianity" with "endianness" in comments.
10298 (Arm_exidx_cantunwind): Ditto.
10299 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
10300 (Arm_relobj::merge_flags_and_attributes): New method.
10301 (Arm_relobj::merge_flags_and_attributes_): New data member.
10302 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
10303 (Arm_relobj::scan_sections_for_stubs): Ditto.
10304 (Arm_relobj::do_read_symbols): Check to see if we really want to
10305 merge processor-specific flags and attributes. Exit early if
10306 an object is empty except for section names and the undefined symbol.
10307 (Target_arm::do_finalize_sections): Move check for ELF format to
10308 Arm_relobj::do_read_symbols. Merge processor specific flags and
10309 attributes from a regular object only when we have determined that
10310 it is aapropriate. Do not create an .ARM.attributes section in
10311 output if there is no regular input object.
10312 (Target_arm::merge_processor_specific_flags): Check
10313 --warn-mismatch before printing any error.
10314 (Target_arm::merge_object_attributes): Ditto.
10315 * gold.cc (queue_middle_tasks): Handle the case in which there is
10316 no regular object in input.
10317 * options.cc (General_options::parse_EB): New method.
10318 (General_options::parse_EL): Same.
10319 (General_options::General_options): Initialize endianness_.
10320 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
10321 New options.
10322 (General_options::Endianness): New enum.
10323 (General_options::endianness): New method.
10324 (General_options::endianness_): New data member.
10325 * parameters.cc (Parameters::set_options): Check target endianness.
10326 (Parameters::set_target_once): Ditto.
10327 (Parameters::check_target_endianness): New method.
10328 (parameters_force_valid_target): If either -EL or -EB is specified,
10329 use it to define endianness of default target.
10330 * parameters.h (Parameters::check_target_endianness): New method
10331 declaration.
10332 * target.h (class Target): Change "endianity" to "endianness"
10333 in comments.
10334
efc8d4f2
RW
103352010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10336
10337 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
10338 * configure: Regenerate.
10339 * Makefile.in: Regenerate.
10340 * testsuite/Makefile.in: Regenerate.
10341
be234d88
CC
103422010-04-06 Cary Coutant <ccoutant@google.com>
10343
10344 gcc PR lto/42757
10345 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
10346 prevailing definitions of common symbols.
10347 * testsuite/plugin_test_6.sh: New test case.
10348 * testsuite/plugin_common_test_1.c: New test case.
10349 * testsuite/plugin_common_test_2.c: New test case.
10350 * testsuite/Makefile.am (plugin_test_6): New test case.
10351 * testsuite/Makefile.in: Regenerate.
10352
bd32c6bd
NC
103532010-04-06 Nick Clifton <nickc@redhat.com>
10354
10355 * po/vi.po: New Vietnamese translation.
10356
323c532f
DK
103572010-03-30 Doug Kwan <dougkwan@google.com>
10358
10359 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
10360
4fcd97eb
DK
103612010-03-25 Doug Kwan <dougkwan@google.com>
10362
10363 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
10364 to avoid a conversion warning on a 32-bit host.
10365
4ebf39db
ILT
103662010-03-24 Ian Lance Taylor <iant@google.com>
10367
10368 * testsuite/script_test_3.t: Add a TLS segment.
10369 * testsuite/Makefile.am (check_PROGRAMS): Add
10370 tls_phdrs_script_test.
10371 (tls_phdrs_script_test_SOURCES): Define.
10372 (tls_phdrs_script_test_DEPENDENCIES): Define.
10373 (tls_phdrs_script_test_LDFLAGS): Define.
10374 (tls_phdrs_script_test_LDADD): Define.
10375 * testsuite/Makefile.in: Rebuild.
10376
4a599bdd
CC
103772010-03-23 Cary Coutant <ccoutant@google.com>
10378
10379 * fileread.cc (find_or_make_view): Fix comment.
10380
6c93b22c
ILT
103812010-03-23 Ian Lance Taylor <iant@google.com>
10382
10383 * script-sections.cc (class Orphan_section_placement): Define
10384 PLACE_TLS and PLACE_TLS_BSS.
10385 (Orphan_section_placement::Orphan_section_placement): Initialize
10386 new places.
10387 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
10388 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
10389 (tls_script_test_SOURCES): Define.
10390 (tls_script_test_DEPENDENCIES): Define.
10391 (tls_script_test_LDFLAGS): Define.
10392 (tls_script_test_LDADD): Define.
10393 * testsuite/Makefile.in: Rebuild.
10394
a2c7281b
DK
103952010-03-22 Doug Kwan <dougkwan@google.com>
10396
10397 * arm.cc (Arm_relocate_functions::abs8,
10398 Arm_relocate_functions::abs16): Use correct check for overflow
10399 specified in the ARM ELF specs.
10400 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
10401 target of a BLX instruction specially.
10402 (Reloc_stub::stub_type_for_reloc): Ditto.
10403 (Relocate::relocate): Use symbolic names instead of numeric relocation
10404 codes to report error.
10405 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
10406 workaround.
10407 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
10408 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
10409 thumb2_blx_out_of_range.stdout
10410 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
10411 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
10412 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
10413 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
10414 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
10415 thumb2_blx_in_range, thumb2_blx_in_range.o,
10416 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
10417 thumb2_blx_out_of_range.o): New rules.
2e702c99 10418 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
10419 thumb2_blx_in_range and thumb2_blx_out_of_range.
10420 * testsuite/Makefile.in: Regenerate.
10421 * arm_branch_in_range.sh: Add tests for THUMB BLX.
10422 * testsuite/thumb_blx_in_range.s: New file.
10423 * testsuite/thumb_blx_out_of_range.s: New file.
10424
b0193076
RÁE
104252010-03-22 Rafael Espindola <espindola@google.com>
10426
10427 * archive.cc (Should_include): Move to archive.h.
10428 (should_include_member): Make it a member of Archive.
10429 (Lib_group): New.
10430 (Add_lib_group_symbols): New.
10431 * archive.h: Include options.h.
10432 (Archive_member): Moved from Archive.
10433 (Should_include): Moved from archive.cc.
10434 (Lib_group): New.
10435 (Add_lib_group_symbols): New.
10436 * dynobj.cc (do_should_include_member): New.
10437 * dynobj.h (do_should_include_member): New.
10438 * gold.cc (queue_initial_tasks): Update call to queue.
10439 * main.cc (main): Print lib group stats.
10440 * object.cc (do_should_include_member): New.
10441 * object.h: Include archive.h.
10442 (Object::should_include_member): New.
10443 (Object::do_should_include_member): New.
10444 (Sized_relobj::do_should_include_member): New.
10445 * options.cc (General_options::parse_start_lib): New.
10446 (General_options::parse_end_lib): New.
10447 (Input_arguments::add_file): Handle lib groups.
10448 (Input_arguments::start_group): Check we are not in a lib.
10449 (Input_arguments::start_lib): New.
10450 (Input_arguments::end_lib): New.
10451 * options.h (General_options): Add start_lib and end_lib.
10452 (Input_argument::lib_): New.
10453 (Input_argument::lib): New.
10454 (Input_argument::is_lib): New.
10455 (Input_file_lib): New.
10456 (Input_arguments::in_lib_): New.
10457 (Input_arguments::in_lib): New.
10458 (Input_arguments::start_lib): New.
10459 (Input_arguments::end_lib_): New.
10460 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
10461 in unused members as preempted.
10462 (Sized_pluginobj::do_should_include_member): New.
10463 * plugin.h (Sized_pluginobj::do_should_include_member): New.
10464 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
10465 return the blocker.
10466 (Read_symbols::do_whole_lib_group): New.
10467 (Read_symbols::do_lib_group): New.
10468 (Read_symbols::do_read_symbols): Handle lib groups.
10469 (Read_symbols::get_name): Handle lib groups.
10470 * readsyms.h (Read_symbols): Add an archive member pointer.
10471 (Read_symbols::do_whole_lib_group): New.
10472 (Read_symbols::do_lib_group): New.
10473 (Read_symbols::member_): New.
10474 * script.cc (read_input_script): Update call to queue_soon.
10475
d099120c
DK
104762010-03-19 Doug Kwan <dougkwan@google.com>
10477
10478 * arm.cc (Stub_table::Stub_table): Initialize new data members
10479 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10480 (Stub_table::add_reloc_stub): Assign stub offset and update
10481 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10482 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
10483 New data members.
2e702c99 10484 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
10485 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
10486 instead of going over all reloc stubs.
2e702c99 10487 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
10488 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10489 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 10490 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
10491 Stringpool_template::offset_.
10492 * stringpool.h (Stringpool_template::set_no_zero_null): Set
10493 Stringpool_template::offset_ to zero.
10494
1aa37384
DK
104952010-03-15 Doug Kwan <dougkwan@google.com>
10496
10497 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10498 offset_.
10499 (Stringpool_template::new_key_offset): New method.
10500 (Stringpool_template::add_string): Assign offsets when adding new
10501 strings.
10502 (Stringpool_template::set_string_offsets): Do not set string offsets
10503 when not optimizing.
10504 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
10505 member size_.
2e702c99
RM
10506 (Chunked_vector::clear): Clear size_.
10507 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
10508 (Chunked_vector::size): Return size_.
10509 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 10510 (Chunked_vector::size_): New data member.
1aa37384
DK
10511 (Stringpool_template::set_no_zero_null): Assert string set is empty.
10512 (Stringpool_template::new_key_offset): New method declaration.
10513 (Stringpool_template::offset_): New data member.
10514
b672b057
RÁE
105152010-03-15 Rafael Espindola <espindola@google.com>
10516
10517 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
10518 Add_symbols' constructor.
10519 * readsyms.h (Add_symbols): Remove the input_group member.
10520
b6848d3c
ILT
105212010-03-10 Ian Lance Taylor <iant@google.com>
10522
10523 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
10524 target to ask whether a reference to a symbol requires a stack
10525 split.
10526 * target.h (Target::is_call_to_non_split): New function.
10527 (Target::do_is_call_to_non_split): Declare virtual function.
10528 * target.cc: Include "symtab.h".
10529 (Target::do_is_call_to_non_split): New function.
10530 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
10531
a2a5469e
CC
105322010-03-10 Cary Coutant <ccoutant@google.com>
10533
10534 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
10535 (File_read::open[1]): Remove initial mapping of whole_file_view_.
10536 (File_read::open[2]): Add whole_file_view_ to list of views.
10537 (File_read::make_view): Remove test of whole_file_view_.
10538 (File_read::find_or_make_view): Create whole_file_view_ if
10539 necessary.
10540 (File_read::clear_views): Replace bool parameter with enum;
10541 adjust all callers. Don't delete views with permanent data;
10542 do delete cached views and views from archives if
10543 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
10544 if clearing the corresponding view.
10545 * fileread.h (File_read::Clear_views_mode): New enum.
10546 (File_read::View::is_permanent_view): New method.
10547 (File_read::clear_views): Replace bool parameter
10548 with enum; adjust all callers.
10549 * options.h (General_options): Change keep_files_mapped option;
10550 add map_whole_files.
10551 * readsyms.cc (Add_symbols::run): Delete sd_ object before
10552 releasing the file.
10553 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
10554 the file.
10555
8861f32b
DM
105562010-03-10 David S. Miller <davem@davemloft.net>
10557
10558 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
10559
d62d0f5f
ST
105602010-03-09 Sriraman Tallam <tmsriram@google.com>
10561
10562 * icf.cc (get_section_contents): Add '@' marker after processing the
10563 merge reloc.
10564
9177756d
DK
105652010-03-08 Doug Kwan <dougkwan@google.com>
10566
10567 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
10568 due to a conversion warning.
10569 (Arm_relobj::update_output_local_symbol_count): Check for local
10570 symbol with unset output index.
10571
9e9e071b
ILT
105722010-03-05 Ian Lance Taylor <iant@google.com>
10573
10574 * options.h (class General_options): Add --spare-dynamic-tags.
10575 * output.cc (Output_data_dynamic::set_final_data_size): Implement
10576 --spare-dynamic-tags.
10577
a81ee015
ILT
105782010-03-05 Ian Lance Taylor <iant@google.com>
10579
10580 * incremental.cc: Include "libiberty.h".
10581
44ec90b9
RO
105822010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
10583
10584 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
10585 function, is_info_ member.
10586 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
10587 (Versions::Versions): Update caller.
10588 (Versions::define_base_version): Likewise.
10589 (Versions::add_def): Likewise.
10590
0897ed3b
ST
105912010-03-03 Sriraman Tallam <tmsriram@google.com>
10592
10593 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
10594 (Scan::possible_function_pointer_reloc): New function.
10595 (Scan::local_reloc_may_be_function_pointer): Change to call
10596 possible_function_pointer_reloc.
10597 (Scan::global_reloc_may_be_function_pointer): Ditto.
10598 * icf.h (Icf::check_section_for_function_pointers): Change to reject
10599 relocations in ".data.rel.ro._ZTV" section.
10600 * testsuite/icf_safe_so_test.sh: Change to pass i386.
10601 * testsuite/icf_safe_so_test.cc: Ditto.
10602 * testsuite/icf_safe_test.cc: Ditto.
10603 * testsuite/icf_safe_test.sh: Ditto.
10604
d3bbad62
ILT
106052010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10606 Ian Lance Taylor <iant@google.com>
10607
10608 * target-reloc.h (relocate_section): Check the symbol table index
10609 for -1U before setting the local symbol index.
10610 (scan_relocatable_relocs): If copying the relocation, record that
10611 the local symbol is required.
10612 * object.h (Symbol_value::is_output_symtab_index_set): New
10613 function.
10614 (Symbol_value::may_be_discarded_from_output_symtab): New
10615 function.
10616 (Symbol_value::has_output_symtab_entry): New function.
10617 (Symbol_value::needs_output_symtab_entry): Remove.
10618 (Symbol_value::output_symtab_index): Make sure the symbol index is
10619 set.
10620 (Symbol_value::set_output_symtab_index): Make sure the symbol
10621 index is not set. Make sure the new index is valid.
10622 (Symbol_value::set_must_have_output_symtab_entry): New function.
10623 (Symbol_value::has_output_dynsym_entry): New function.
10624 (Symbol_value::set_output_dynsym_index): Make sure the new index
10625 is valid.
10626 (Sized_relobj::set_must_have_output_symtab_entry): New function.
10627 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
10628 local symbol if permitted.
10629 (Sized_relobj::do_finalize_local_symbols): Call
10630 is_output_symtab_index_set rather than needs_output_symtab_entry.
10631 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
10632 rather than needs_output_symtab_entry. Call
10633 has_output_dynsym_entry rather than needs_output_dynsym_entry.
10634 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
10635 is_output_symtab_index_set rather than needs_output_symtab_entry.
10636 * testsuite/discard_locals_relocatable_test.c: New file.
10637 * testsuite/discard_locals_test.sh: Test -r.
10638 * testsuite/Makefile.am (check_DATA): Add
10639 discard_locals_relocatable_test1.syms,
10640 discard_local_relocatable_test2.syms.
10641 (MOSTLYCLEANFILES): Likewise. Also add
10642 discard_locals_relocatable_test1.lout and
10643 discard_locals_relocatable_test2.out.
10644 (discard_locals_relocatable_test1.syms): New target.
10645 (discard_locals_relocatable_test.o): New target.
10646 (discard_locals_relocatable_test1.out): New target.
10647 (discard_locals_relocatable_test2.syms): New target.
10648 (discard_locals_relocatable_test2.out): New target.
10649 (various): Add missing ../ld-new dependencies.
10650 * testsuite/Makefile.in: Rebuild.
10651
7e8ccf26
NC
106522010-03-03 Nick Clifton <nickc@redhat.com>
10653
10654 * po/fi.po: New Finnish translation.
10655
2a0ff005
DK
106562010-03-01 Doug Kwan <dougkwan@google.com>
10657
10658 * layout.cc (Layout::Layout): Force section types of .init_array*,
10659 .preinit_array* and .fini_array* sections.
10660 * output.cc (Output_section::Input_section_sort_entry::has_priority):
10661 Fix check of return value of std::string::find.().
10662 (Output_section::Input_section_sort_compare::operator()): Remove
10663 comment about .init_array.
10664 (Output_section::Input_section_sort_init_fini_compare::operator()):
10665 New method.
10666 (Output_section::sort_attached_input_sections): Handle .init_array
10667 and .fini_array specially.
10668 * output.h (Output_section::Inut_section_sort_compare): Update
10669 comment.
10670 (Output_section::Input_section_sort_init_fini_compare): New struct.
10671
c3e4ae29
DK
106722010-02-26 Doug Kwan <dougkwan@google.com>
10673
10674 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
10675 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
10676 * testsuite/debug_msg.sh: Avoid matching source line number for
10677 use of global variable undef_int.
10678
2fd9ae7a
DK
106792010-02-26 Doug Kwan <dougkwan@google.com>
10680
10681 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
10682 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
10683 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
10684 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
10685 * options.cc (General_options::General_options): Initialize member
10686 fix_v4bx_.
10687 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
10688 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
10689 and rm_no_fix_v4bx.stdout
10690 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
10691 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
10692 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
10693 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
10694 and arm_no_fix_v4bx.
10695 * Makefile.in: Regenerate.
10696 * testsuite/arm_fix_v4bx.s: New file.
10697 * testsuite/arm_fix_v4bx.sh: Ditto.
10698
67ec7d0b
DK
106992010-02-24 Doug Kwan <dougkwan@google.com>
10700
10701 * arm.cc (Target_arm::got_section): Make the .got section the first
10702 non RELRO section in the data segment.
10703 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
10704 suffixes of section names.
10705
10165461
DK
107062010-02-24 Doug Kwan <dougkwan@google.com>
10707
10708 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
10709 flags and attributes merging if an input file is a binary file.
10710 * fileread.cc (Input_file::open): Record format of original file.
10711 * fileread.h (Input_file::Format): New enum type.
2e702c99 10712 (Input_file::Input_file): Initialize data member format_.
10165461
DK
10713 (Input_file::format): New method definition.
10714 (Input_file::format_):: New data member.
10715
4a54abbb
DK
107162010-02-24 Doug Kwan <dougkwan@google.com>
10717
10718 * arm.cc (Arm_output_data_got): New class.
10719 (ARM_TCB_SIZE): New constant
10720 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
10721 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
10722 If user uses a script with a SECTIONS clause, issue only a warning
10723 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 10724 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
10725 garbage collection.
10726 (Target_arm::got_mode_index_entry): Handle static linking.
10727 (Target_arm::Scan::local): Ditto.
10728 (Target_arm::Scan::global): Ditto.
10729 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
10730 all incorrectly implemented relocations.
e1df38aa 10731 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
10732 Arm_output_section::fix_exidx_coverage.
10733 * layout.cc (Layout::section_name_mapping): Remove trailing dots
10734 from ".ARM.exidx." and ".ARM.extab.".
10735
ca419a6f
ILT
107362010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10737
10738 * arm.cc (Target_arm::do_finalize_sections): Create attribute
10739 section if it does not already exist.
10740 * attributes.cc (Attributes_section_data::Attributes_section_data):
10741 Don't crash if size is zero.
10742
135b9c78
ILT
107432010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10744 Ian Lance Taylor <iant@google.com>
10745
10746 * gold.cc (queue_middle_tasks): If no input files were opened,
10747 exit.
10748 * workqueue.h (Task_function::Task_function): Assert that there is
10749 a blocker.
10750
bb0bfe4f
DK
107512010-02-22 Doug Kwan <dougkwan@google.com>
10752
10753 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
10754 * icf.cc (get_section_contents): Cast snprintf arguments to long long
10755 types to avoid warnings due to different uint64_t implementations
10756 on different hosts.
10757
2a2b6d42
DK
107582010-02-21 Doug Kwan <dougkwan@google.com>
10759
10760 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
10761 handling of the maximum backward branch offset.
2e702c99 10762 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
10763 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
10764 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 10765 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
10766 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
10767 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
10768 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
10769 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
10770 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
10771 thumb_bl_out_of_range thumb_bl_out_of_range.o,
10772 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
10773 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
10774 thumb2_bl_out_of_range.o): New rules.
10775 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
10776 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
10777 thumb2_bl_out_of_range
10778 * testsuite/Makefile.in: Regenerate.
10779 * testsuite/arm_bl_in_range.s: New file.
10780 * testsuite/arm_bl_out_of_range.s: Ditto.
10781 * testsuite/arm_branch_in_range.sh: Ditto.
10782 * testsuite/arm_branch_range.t: Ditto.
10783 * testsuite/thumb2_branch_range.t: Ditto.
10784 * testsuite/thumb_bl_in_range.s: Ditto.
10785 * testsuite/thumb_bl_out_of_range.s: Ditto.
10786 * testsuite/thumb_branch_range.t: Ditto.
10787
b487ad64
ST
107882010-02-20 Sriraman Tallam <tmsriram@google.com>
10789
10790 * gc.h (gc_process_relocs): Change vectors to point to the new list.
10791 Add reloc offset information.
10792 * icf.cc (get_section_contents): Change iterators to point to the new
10793 vectors. Add reloc offset information to the contents.
10794 * icf.h (Icf::Sections_reachable_info): New typedef.
10795 (Icf::Sections_reachable_list): New typedef.
10796 (Icf::Offset_info): New typedef.
10797 (Icf::Reloc_info): New struct typedef.
10798 (Icf::Reloc_info_list): New typedef.
10799 (Icf::symbol_reloc_list): Delete method.
10800 (Icf::addend_reloc_list): Delete method.
10801 (Icf::section_reloc_list): Delete method.
10802 (Icf::reloc_info_list): New method.
10803 (Icf::reloc_info_list_): New member.
10804
f96accdf
DK
108052010-02-19 Doug Kwan <dougkwan@google.com>
10806
10807 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
10808 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
10809 * arm.cc (Arm_relocation_functions): New forward declaration.
10810 (Target_arm::Target_arm): Initialize new data members
10811 got_mod_index_offset_ and tls_base_symbol_defined_.
10812 (Target_arm::Relocate::relocate_tls): New method.
10813 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
10814 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
10815 New methods.
2e702c99 10816 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
10817 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
10818 (Target_arm::got_mod_index_offset_,
10819 Target_arm::tls_base_symbol_defined_): New data members.
10820 (Target_arm::Scan::local, Target::Scan::global,
10821 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
10822 relocations.
10823
c8761b9a
DK
108242010-02-18 Doug Kwan <dougkwan@google.com>
10825
10826 * arm.cc (Arm_relobj::find_linked_text_section): New method.
10827 (Arm_relobj::make_exidx_input_section): Pass section index of linked
10828 text section as a parameter becuase some broken tools may not set
10829 the link in section header.
10830 (Target_arm::has_got_section): New method.
10831 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
10832 without any mapping symbol as data only. Remove warning.
10833 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
10834 link in its section header, try to discover the link by inspecting the
10835 REL31 relocation at the beginning of the section.
10836 (Target_arm::Scan::check_non_pic): Report name of offending relocation
10837 in error message.
10838 (Target_arm::Scan::global): Treat any reference to the symbol
10839 _GLOBAL_OFFSET_TABLE_ as a GOT access.
10840
21bb3914
ST
108412010-02-12 Sriraman Tallam <tmsriram@google.com>
10842
10843 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
10844 (Scan::global_reloc_may_be_function_pointer): New function.
10845 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10846 (Scan::global_reloc_may_be_function_pointer): New function.
10847 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10848 (Scan::global_reloc_may_be_function_pointer): New function.
10849 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
10850 (Scan::global_reloc_may_be_function_pointer): New function.
10851 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
10852 (Scan::global_reloc_may_be_function_pointer): New function.
10853 (Scan::possible_function_pointer_reloc): New function.
10854 (Target_x86_64::can_check_for_function_pointers): New function.
10855 * gc.h (gc_process_relocs): Scan relocation types to determine if
10856 function pointers were taken for targets that support it.
10857 * icf.cc (Icf::find_identical_sections): Include functions for
10858 folding in safe ICF whose pointer is not taken.
10859 * icf.h (Secn_fptr_taken_set): New typedef.
10860 (fptr_section_id_): New member.
10861 (section_has_function_pointers): New function.
10862 (set_section_has_function_pointers): New function.
10863 (check_section_for_function_pointers): New function.
10864 * options.h: Fix comment for safe ICF option.
10865 * target.h (can_check_for_function_pointers): New function.
10866 * testsuite/Makefile.am: Add icf_safe_so_test test case.
10867 Modify icf_safe_test for X86-64.
10868 * testsuite/Makefile.in: Regenerate.
10869 * testsuite/icf_safe_so_test.cc: New file.
10870 * testsuite/icf_safe_so_test.sh: New file.
10871 * testsuite/icf_safe_test.cc (kept_func_3): New function.
10872 (main): Change to take pointer to function kept_func_3.
10873 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
10874 folding is done correctly for X86-64.
10875
0da6fa6c
DM
108762010-02-12 David S. Miller <davem@davemloft.net>
10877
10878 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
10879 is_symbolless parameter.
10880 (Output_reloc<SHT_REL>::is_symbolless): New.
10881 (Output_reloc<SHT_REL>::is_symbolless_): New.
10882 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
10883 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
10884 (Output_reloc<SHT_RELA>::is_symbolless): New.
10885 (Output_data_reloc::add_global): Handle is_symbolless.
10886 (Output_data_reloc::add_global_relative): Likewise.
10887 (Output_data_reloc::add_local): Likewise.
10888 (Output_data_reloc::add_local_relative): Likewise.
10889 (Output_data_reloc::add_symbolless_global_addend): New.
10890 (Output_data_reloc::add_symbolless_local_addend): New.
10891 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
10892 is_symbolless.
10893 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
10894 instead of ->is_relative_
10895 (Output_reloc::write): Likewise.
10896 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
10897 (Output_reloc::write_rel): Simplify.
10898
10899 * sparc.cc (Target_sparc::Scan::local): Use
10900 ->add_symbolless_local_addend as needed.
10901 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
10902 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
10903 based upon relocation offset.
10904
e4782e83
DK
109052010-02-11 Doug Kwan <dougkwan@google.com>
10906
10907 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
10908 (Target_arm::Scan::global): Ditto. Also remove a comment before the
10909 beginning of function.
10910 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
10911 and MOVT_ABS relocations. Those are non issued in scanning. Fix
10912 parameter is_32bit in calls to should_apply_static_reloc.
10913 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
10914 (check_DATA): Add arm_abs_global.stdout.
10915 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
10916 arm_abs_global.stdout): New rules.
10917 (MOSTLLYCLEANFILES): Add arm_abs_global
10918 * Makefile.in: Regenerate.
10919 * testsuite/arm_abs_global.s: New file.
10920 * testsuite/arm_abs_global.sh: Ditto.
10921 * testsuite/arm_abs_lib.s: Ditto.
10922
93ceb764
ILT
109232010-02-11 Ian Lance Taylor <iant@google.com>
10924
10925 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
10926 Read_relocs task.
10927 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
10928 Allocate_commons_task first.
10929 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
10930 task, rather than symtab_lock_.
10931 (Gc_process_relocs::~Gc_process_relocs): New function.
10932 (Gc_process_relocs::is_runnable): Check this_blocker_.
10933 (Gc_process_relocs::locks): Use next_blocker_ rather than
10934 blocker_.
10935 (Scan_relocs::~Scan_relocs): New function.
10936 (Scan_relocs::is_runnable): Check this_blocker_ rather than
10937 symtab_lock_.
10938 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
10939 next_blocker_.
10940 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
10941 fields. Add this_blocker_ and next_blocker_ fields. Adjust
10942 constructor accordingly.
10943 (class Gc_process_relocs): Likewise.
10944 (class Scan_relocs): Likewise.
10945 * common.h (class Allocate_commons_task): Remove symtab_lock_
10946 field, and corresponding constructor parameter.
10947 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
10948 symtab_lock_.
10949 (Allocate_commons_task::locks): Likewise.
10950
114dfbe1
ILT
109512010-02-11 Ian Lance Taylor <iant@google.com>
10952
10953 * gold-threads.h (class Once): Define.
10954 (class Initialize_lock): Rewrite as child of Once.
10955 * gold-threads.cc (class Once_initialize): Define.
10956 (once_pointer_control): New static variable.
10957 (once_pointer, once_arg): New static variables.
10958 (c_run_once): New static function.
10959 (Once::Once, Once::run_once, Once::internal_run): New functions.
10960 (class Initialize_lock_once): Remove.
10961 (initialize_lock_control): Remove.
10962 (initialize_lock_pointer): Remove.
10963 (initialize_lock_once): Remove.
10964 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
10965 (Initialize_lock::initialize): Rewrite.
10966 (Initialize_lock::do_run_once): New function.
10967 * archive.cc (Archive::interpret_header): Only clear name if it is
10968 not already empty.
10969 * fileread.cc: Include "gold-threads.h"
10970 (file_counts_lock): New static variable.
10971 (file_counts_initialize_lock): Likewise.
10972 (File_read::release): Only increment counts when using --stats.
10973 Use a lock around the increment.
10974 * parameters.cc (class Set_parameters_target_once): Define.
10975 (set_parameters_target_once): New static variable.
10976 (Parameters::Parameters): Move here from parameters.h.
10977 (Parameters::set_target): Rewrite.
10978 (Parameters::set_target_once): New function.
10979 (Parameters::clear_target): Move here and rewrite.
10980 * parameters.h (class Parameters): Update declarations. Add
10981 set_parameters_target_once_ field.
10982 (Parameters::Parameters): Move to parameters.cc.
10983 (Parameters::clear_target): Likewise.
10984 * readsyms.cc (Read_symbols::do_group): Create a Start_group
10985 task.
10986 (Start_group::~Start_group): New function.
10987 (Start_group::is_runnable): New function.
10988 (Start_group::locks, Start_group::run): New functions.
10989 (Finish_group::run): Change saw_undefined to size_t.
10990 * readsyms.h (class Start_group): Define.
10991 (class Finish_group): Change saw_undefined_ field to size_t.
10992 (Finish_group::Finish_group): Remove saw_undefined and
10993 this_blocker parameters. Change all callers.
10994 (Finish_group::set_saw_undefined): New function.
10995 (Finish_group::set_blocker): New function.
10996 * symtab.h (class Symbol_table): Change saw_undefined to return
10997 size_t. Change saw_undefined_ field to size_t.
10998 * target-select.cc (Set_target_once::do_run_once): New function.
10999 (Target_selector::Target_selector): Initialize set_target_once_
11000 field. Don't initialize lock_ and initialize_lock_ fields.
11001 (Target_selector::instantiate_target): Rewrite.
11002 (Target_selector::set_target): New function.
11003 * target-select.h (class Set_target_once): Define.
11004 (class Target_selector): Update declarations. Make
11005 Set_target_once a friend. Remove lock_ and initialize_lock_
11006 fields. Add set_target_once_ field.
11007
fa17a3f4
ILT
110082010-02-10 Ian Lance Taylor <iant@google.com>
11009
11010 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
11011 queueing any tasks.
11012 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
11013 (queue_middle_tasks): Add all blockers before queueing any tasks.
11014 (queue_final_tasks): Likewise.
11015 * token.h (Task_token::add_blockers): New function.
11016 * object.h (Input_objects::number_of_relobjs): New function.
11017
c7177d31
ILT
110182010-02-10 Ian Lance Taylor <iant@google.com>
11019
5de0e392
ILT
11020 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
11021 shared, not if not position independent.
11022 * x86_64.cc (Relocate::relocate_tls): Likewise.
11023 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
11024 (tls_pie_pic_test): New target.
11025 * testsuite/Makefile.in: Rebuild.
11026
c7177d31
ILT
11027 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
11028 (tls_test_main_pie.o, tls_test_pie.o): New targets.
11029 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
11030 * testsuite/Makefile.in: Rebuild.
11031
684b268a
DM
110322010-02-09 David S. Miller <davem@davemloft.net>
11033
11034 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
11035 R_SPARC_RELATIVE using ->add_local_relative().
11036 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
11037
612a8d3d
DM
11038 * output.h (Output_data_dynamic::add_section_size): New method
11039 that takes two Output_data objects.
11040 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
11041 entry param. Handle it in initializers.
11042 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
11043 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
11044 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
11045 arg.
11046 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
11047 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
11048 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
11049 for dynrel_includes_plt.
11050 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11051 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11052 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
11053 before .rela.plt
11054 (Target_sparc::do_finalize_sections): Update to pass true for
11055 dynrel_includes_plt.
11056 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
11057 output before .rela.plt
11058 (Target_powerpc::do_finalize_sections): Update to pass true for
11059 dynrel_includes_plt when 32-bit.
11060
cb1be87e
DK
110612010-02-08 Doug Kwan <dougkwan@google.com>
11062
11063 * arm.cc (Arm_relobj::simple_input_section_output_address): New
11064 method.
11065 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
11066 Arm_relobj::scan_section_for_cortex_a8_stubs,
11067 Arm_relobj::do_relocation_section): Instead of calling
11068 Output_section::output_address, use faster
11069 Arm_relobj::simple_input_section_output_address.
11070
705b5121
DM
110712010-02-08 David S. Miller <davem@davemloft.net>
11072
11073 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
11074 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
11075 relocation helper function.
11076
024c4466
DM
11077 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
11078 just like R_SPARC_GOT{10,13,22}.
11079 (Target_sparc::Scan::local): Likewise.
11080 (Target_sparc::Relocate:relocate): Likewise.
11081
9109c078
ILT
110822010-02-06 Ian Lance Taylor <iant@google.com>
11083
11084 * configure.ac: Rewrite targetobjs duplicate removal code to use
11085 only shell constructs.
11086 * configure: Rebuild.
11087
cf846138
DK
110882010-02-05 Doug Kwan <dougkwan@google.com>
11089
11090 PR 11247
11091 * arm.cc (Arm_relobj::section_is_scannable): New method.
11092 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
11093 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
11094
6cfaf60b
DK
110952010-02-04 Doug Kwan <dougkwan@google.com>
11096
11097 PR 11247
11098 * arm-reloc-property.cc (cstdio): Include.
11099 * configure.ac (targetobjs): Remove duplicates.
11100 * configure: Regenerate.
11101 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
11102 big and little endian version for a given address size.
11103
5c57f1be
DK
111042010-02-03 Doug Kwan <dougkwan@google.com>
11105
11106 * arm-reloc-property.cc
11107 (Arm_reloc_property_table::reloc_name_in_error_message): New method
11108 definition.
11109 * arm-reloc-property.h
11110 (Arm_reloc_property_table::get_implemented_static_reloc_property):
11111 New method definition.
11112 (Arm_reloc_property_table::reloc_name_in_error_message): New method
11113 declaration.
11114 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
11115 overflow to N.
11116 (GOT_PREL): Change implemented to Y.
11117 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
11118 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
11119 (Arm_relocate_functions::movw_abs_nc): Remove method.
11120 (Arm_relocate_functions::movt_abs): Ditto.
11121 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
11122 (Arm_relocate_functions::thm_movt_abs): Ditto.
11123 (Arm_relocate_functions::movw_rel_nc): Ditto.
11124 (Arm_relocate_functions::movw_rel): Ditto.
11125 (Arm_relocate_functions::movt_rel): Ditto.
11126 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
11127 (Arm_relocate_functions:thm_movw_rel): Ditto.
11128 (Arm_relocate_functions:thm_movt_rel): Ditto.
11129 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
11130 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
11131 New method definitions.
11132 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
11133 (Arm_relocation_functions::arm_grp_ldr): Ditto.
11134 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
11135 (Arm_relocation_functions::arm_grp_ldc): Ditto.
11136 (Target_arm::Relocate::relocate): Check for non-static or
11137 unimplemented relocation code and exit early. Change calls to
11138 Target_arm::reloc_uses_thumb_bit and
11139 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
11140 instead. Refactor code to handle similar relocations to increase
11141 code sharing. Remove check for unsupported relocation code in switch
11142 statement.
11143 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
11144 relocation property table to find out size. Change error message to
11145 print out the name of a relocation code instead of the numeric value.
11146 (Target_arm::scan_reloc_for_stub): Use relocation property table
11147 instead of calling Target_arm::reloc_uses_thumb_bit().
11148
218c5831
DK
111492010-02-02 Doug Kwan <dougkwan@google.com>
11150
11151 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
11152 types of relaxed input section.
11153
0d31c79d
DK
111542010-02-02 Doug Kwan <dougkwan@google.com>
11155
11156 * Makefile.am (HFILES): Add arm-reloc-property.h.
11157 (DEFFILES): New.
2e702c99
RM
11158 (TARGETSOURCES): Add arm-reloc-property.cc
11159 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
11160 (libgold_a_SOURCES): $(DEFFILES)
11161 * Makefile.in: Regenerate.
11162 * arm-reloc-property.cc: New file.
11163 * arm-reloc-property.h: New file.
11164 * arm-reloc.def: New file.
11165 * arm.cc: Update comments.
11166 (arm-reloc-property.h): New included header.
11167 (arm_reloc_property_table): New global variable.
11168 (Target_arm::do_select_as_default_target): New method definition.
11169 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
11170 arm-reloc-property to targ_extra_obj.
11171 * parameters.cc (set_parameters_target): Call
11172 Target::select_as_default_target().
11173 * target.h (Target::select_as_default_target): New method definition.
11174 (Target::do_select_as_default_target): Same.
11175
546c7457
DK
111762010-02-01 Doug Kwan <dougkwan@google.com>
11177
11178 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
11179 first_output_text_section_.
11180 (Arm_exidx_fixup::first_output_text_section): New method definition.
11181 (Arm_exidx_fixup::first_output_text_section_): New data member.
11182 (Arm_exidx_fixup::process_exidx_section): Record the first text
11183 output section seen.
11184 (Arm_output_section::fix_exidx_coverage): Set correct linked section
11185 and entsize in output section header.
11186
11b861d5
DK
111872010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11188
11189 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
11190 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
11191 (Arm_relocate_functions::thm_alu11): New Method.
11192 (Arm_relocate_functions::thm_pc8): New Method.
11193 (Arm_relocate_functions::thm_pc12): New Method.
11194 (Target_arm::Scan::local): Handle the relocations.
11195 (Target_arm::Scan::global): Likewise.
11196 (Target_arm::Relocate::relocate): Likewise.
11197 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11198
c9a2c125
DK
111992010-01-29 Doug Kwan <dougkwan@google.com>
11200
11201 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
11202 of relocation types as ld.
11203
1521477a
DK
112042010-01-29 Doug Kwan <dougkwan@google.com>
11205
11206 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
11207 to public.
11208 (Arm_relocate_functions::thumb_branch_common): Ditto.
11209 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
11210 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
11211 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
11212 Arm_relocate_functions::jump24): Remove.
11213 (Target_arm::Relocate::relocate): Adjust code to call
11214 Arm_relocation_functions::arm_branch_common and
11215 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 11216 wrappers. Merge switch-cases together to reduce source code size.
1521477a 11217
e7eca48c
DK
112182010-01-29 Doug Kwan <dougkwan@google.com>
11219
11220 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
11221 output_local_symbol_count_needs_update_.
11222 (Arm_relobj::output_local_symbol_count_needs_update,
11223 Arm_relobj::set_output_local_symbol_count_needs_update,
11224 Arm_relobj::update_output_local_symbol_count): New methods.
11225 (Arm_relobj::output_local_symbol_count_needs_update_): New data
11226 member.
11227 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
11228 of pointed function as in a R_ARM_PREL31 relocation.
11229 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
11230 for output local symbol count updating.
11231 (Target_arm::do_relax): Update output local symbol counts in objects
11232 if necessary.
11233 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
11234
02961d7e
ILT
112352010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11236
11237 * arm.cc: Added support for the ARM relocations:
11238 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
11239 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
11240 (Arm_relocate_functions::movw_rel_nc): Renamed (was
11241 movw_prel_nc).
11242 (Arm_relocate_functions::movw_rel): New method.
11243 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
11244 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
11245 thm_movw_prel_nc).
11246 (Arm_relocate_functions::thm_movw_rel): New method.
11247 (Arm_relocate_functions::thm_movt_rel): Renamed (was
11248 thm_movt_prel).
11249 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
11250 relocations.
11251 (Target_arm::Scan::global): Likewise.
11252 (Target_arm::Relocate::relocate): Likewise.
11253 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11254 Likewise.
11255
b10d2873
ILT
112562010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11257
11258 * arm.cc: Added support for ARM group relocations.
11259 (Target_arm::reloc_needs_sym_origin): New method.
11260 (Arm_relocate_functions::calc_grp_kn): New method.
11261 (Arm_relocate_functions::calc_grp_residual): New method.
11262 (Arm_relocate_functions::calc_grp_gn): New method.
11263 (Arm_relocate_functions::arm_grp_alu): New Method.
11264 (Arm_relocate_functions::arm_grp_ldr): New Method.
11265 (Arm_relocate_functions::arm_grp_ldrs): New Method.
11266 (Arm_relocate_functions::arm_grp_ldc): New Method.
11267 (Target_arm::Scan::local): Handle the ARM group relocations.
11268 (Target_arm::Scan::global): Likewise.
11269 (Target_arm::Relocate::relocate): Likewise.
11270 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11271 Likewise.
11272
2b328d4e
DK
112732010-01-26 Doug Kwan <dougkwan@google.com>
11274
11275 * arm.cc (set): Include.
11276 (class Arm_exidx_fixup): Change type of last_input_section_ to const
11277 pointer type.
2e702c99 11278 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
11279 (Arm_output_section::append_text_sections_to_list): New method.
11280 (Arm_output_section::fix_exidx_coverage): Ditto.
11281 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 11282 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
11283 Relobj::set_section_offset() instead of
11284 Sized_relobj::invalidate_section_offset().
2e702c99 11285 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
11286 parameter for section headers. Ignore relocation sections for
11287 unallocated sections and EXIDX sections.
11288 (Target_arm::fix_exidx_coverage): New method.
11289 (Target_arm::output_section_address_less_than): New type.
11290 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
11291 linked text section instead of the EXIDX section.
11292 (Arm_output_section::create_stub_group): Add an assertion to check
11293 that this is not an EXIDX output section.
11294 (Arm_output_section::append_text_sections_to_list): New method.
11295 (Arm_output_section::fix_exidx_coverage): Ditto.
11296 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 11297 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
11298 (Target_arm::do_relax): Fix EXIDX output section coverage in the
11299 first pass.
11300 (Target_arm::fix_exidx_coverage): New method.
11301 * object.h (Relobj::set_output_section): New method.
11302 (Sized_relobj::invalidate_section_offset): Remove method.
11303 (Sized_relobj::do_invalidate_section_offset): Remove method.
11304 (Sized_relobj::do_set_section_offset): Handle offset value -1.
11305
c7f3c371
DK
113062010-01-25 Doug Kwan <dougkwan@google.com>
11307
11308 * arm.cc (Arm_exidx_merged_section::do_output_offset):
11309 Fix warning due to signed and unsigned comparison on a 32-bit host.
11310
8923b24c
DK
113112010-01-22 Doug Kwan <dougkwan@google.com>
11312
11313 * arm.cc (Target_arm::do_relax): Record an output section for section
11314 offset adjustment it contains any stub table that has changed.
11315 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
11316 offsets in an output section if necessary.
11317 * output.cc (Output_section::Output_section): Initialize
11318 section_offsets_need_adjustments_.
11319 (Output_section::add_input_section_for_script): Renamed to
11320 Output_section::add_simple_input_section.
11321 (Output_section::save_states): Add a comment.
11322 (Output_section::discard_states): New method defintion.
11323 (Output_section::adjust_section_offsets): Same.
11324 * output.h (Output_section::add_input_section_for_script): Renamed to
11325 Output_section::add_simple_input_section.
11326 (Output_section::discard_states): New method declaration.
11327 (Output_section::adjust_section_offsets): Same.
11328 (Output_section::section_offsets_need_adjustment,
11329 Output_section::set_section_offsets_need_adjustment): New method
11330 definitions.
11331 (Output_section::section_offsets_need_adjustment_): New data member.
11332 * script-sections.cc
11333 (Output_section_element_input::set_section_address): Adjust code for
11334 renaming of Output_section::add_input_section_for_script.
11335 (Orphan_output_section::set_section_address): Same.
11336
9b2fd367
DK
113372010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11338
11339 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
11340 Fix_v4bx enum values .
11341 * gold/options.h (General_options): New option definitions.
11342 (General_options::fix_v4bx): New method.
11343 (General_options::Fix_v4bx): New enum.
11344 * gold/options.cc (General_options::parse_fix_v4bx): New method.
11345 (General_options::parse_fix_v4bx_interworking): New method.
11346
80d0d023
DK
113472010-01-22 Doug Kwan <dougkwan@google.com>
11348
11349 * arm.cc (Arm_exidx_fixup): New class.
11350
af2cdeae
DK
113512010-01-21 Doug Kwan <dougkwan@google.com>
11352
11353 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
11354 classes.
11355 (Arm_exidx_section_offset_map): New type.
11356
993d07c1
DK
113572010-01-21 Doug Kwan <dougkwan@google.com>
11358
11359 * arm.cc (Arm_exidx_input_section): New class.
11360 (Arm_relobj::exidx_input_section_by_link,
11361 Arm_relobj::exidx_input_section_by_shndx,
11362 Arm_relobj::make_exidx_input_section): New methods.
11363 (read_arm_attributes_section): Remove.
11364 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
11365 information about them.
11366 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
11367 to here.
11368
5ac169d4
DK
113692010-01-20 Doug Kwan <dougkwan@google.com>
11370
11371 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
11372 Input_section_specifier to Section_id.
11373 (Target_arm::new_arm_input_section: Adjust code for change of key
11374 type.
11375 (Target_arm::find_arm_input_section): Ditto.
11376 * gc.h (object.h): Include for Section_id nand Section_id_hash.
11377 (Section_id): Remove.
11378 (Garbage_collection::Section_id_hash): Remove.
11379 * icf.h (object.h): Include for Section_id nand Section_id_hash.
11380 (Section_id): Remove.
11381 (Icf::Section_id_hash): Remove.
11382 * object.h (Section_id, Const_section_id, Section_id_hash,
11383 Const_section_id_hash): New type definitions.
11384 * output.cc (Output_section::add_relaxed_input_section): Change to
11385 use Const_section_id instead of Input_section_specifier as key type.
11386 (Output_section::add_merge_input_section): Ditto.
11387 (Output_section::build_relaxation_map): Change to use Section_id
11388 instead of Input_section_specifier as key type.
2e702c99 11389 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
11390 Ditto.
11391 (Output_section::convert_input_sections_to_relaxed_sections): Change
11392 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 11393 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
11394 (Output_section::find_relaxed_input_section): Ditto.
11395 * output.h (Input_section_specifier): Remove class.
11396 (Output_section::Output_section_data_by_input_section_map): Change
11397 key type to Const_section_id.
11398 (Output_section::Output_relaxed_input_section_by_input_section_map):
11399 Ditto.
11400 (Output_section::Relaxation_map): Change key type to Section_id.
11401
a2162063
ILT
114022010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11403
11404 * gold/arm.cc: Added support for R_ARM_V4BX relocation
11405 (class Arm_v4bx_stub): New class.
11406 (DEF_STUBS): Updated definition to support v4_veneer_bx.
11407 (Stub_factory::make_arm_v4bx_stub): New method.
11408 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
11409 (Stub_table::empty): Handle v4bx stubs.
11410 (Stub_table::add_arm_v4bx_stub): New method.
11411 (Stub_table::find_arm_v4bx_stub): New method.
11412 (Arm_relocate_functions::v4bx): New method.
11413 (Target_arm::fix_v4bx): New method.
11414 (Target_arm::Target_arm): Handle R_ARM_V4BX.
11415 (Stub_table::relocate_stubs): Likewise.
11416 (Stub_table::do_write): Likewise.
11417 (Stub_table::update_data_size_and_addralign): Likewise.
11418 (Stub_table::finalize_stubs): Likewise.
11419 (Target_arm::Scan::local): Likewise.
11420 (Target_arm::Scan::global): Likewise.
11421 (Target_arm::do_finalize_sections): Likewise.
11422 (Target_arm::Relocate::relocate): Likewise.
11423 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11424 Likewise.
11425 (Target_arm::scan_reloc_for_stub): Likewise.
11426 (Target_arm::scan_reloc_section_for_stubs): Likewise.
11427
5696ab0b
ILT
114282010-01-19 Ian Lance Taylor <iant@google.com>
11429
11430 * output.cc (Output_section_headers::do_sized_write): Write large
11431 segment count to sh_info field.
11432 (Output_file_header::do_sized_write): For large segment count,
11433 write PN_XNUM to e_phnum field.
11434
800d0f56
ILT
114352010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11436
11437 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
11438 (Arm_relocate_functions::thm_jump8): New function.
11439 (Arm_relocate_functions::thm_jump11): New function.
11440 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
11441 R_ARM_THM_JUMP11.
11442 (Target_arm::Scan::global): Likewise.
11443 (Target_arm::Relocate::relocate): Likewise.
11444 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11445 Likewise.
11446
41263c05
DK
114472010-01-14 Doug Kwan <dougkwan@google.com>
11448
11449 * arm.cc (map, utility): Include headers.
11450 (Target_arm::apply_cortex_a8_workaround): New method.
11451 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
11452 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
11453 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
11454 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
11455 the --[no-]fix-cortex-a8 command line options.
11456 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
11457 (Target_arm::relocate_stub): Use addend in instruction template.
11458 * options.h (DEFINE_bool): Set the user-set flag.
11459 (General_options): Add --[no-]-fix-cortex options.
11460 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 11461 : Update fast look-up map after conversion.
41263c05 11462
459e9b03
ST
114632010-01-14 Sriraman Tallam <tmsriram@google.com>
11464
11465 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
11466 in the first pass of do_layout.
11467
b521dfe4
DK
114682010-01-13 Doug Kwan <dougkwan@google.com>
11469
11470 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11471 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
11472 apparent compiler problem of not folding static constant integral
11473 data members of elfcpp::Elf_sizes<32>.
11474
44272192
DK
114752010-01-13 Doug Kwan <dougkwan@google.com>
11476
11477 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11478 Arm_relobj::section_needs_cortex_a8_stub_scanning,
11479 Arm_relobj::scan_section_for_cortex_a8_erratum,
11480 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
11481 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
11482 sections to scan for relocation stubs into a new method
11483 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
11484 relocation and Cortex-A8 stub scanning.
11485 (Target_arm::do_relax): Force stubs to be after stubbed sections
11486 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 11487 the beginning of a new relaxation pass. Update a comment.
44272192
DK
11488 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
11489
44b71ece
ILT
114902010-01-12 Ian Lance Taylor <iant@google.com>
11491
11492 * target-reloc.h (visibility_error): New inline function.
11493 (relocate_section): Call visibility_error.
11494 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
11495 (MOSTLYCLEANFILES): Likewise.
11496 (protected_4_pic.o, protected_3.err): New targets.
11497 * testsuite/protected_4.cc: New file.
11498
a120bc7f
DK
114992010-01-12 Doug Kwan <dougkwan@google.com>
11500
11501 * arm.cc (Cortex_a8_reloc): New class.
11502 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
11503 and cortex_a8_relocs_info_.
11504 (Target_arm::fix_cortex_a8): New method definition.
11505 (Target_arm::Cortex_a8_relocs_info): New type.
11506 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
11507 New data member declarations.
11508 (Target_arm::scan_reloc_for_stub): Record information about
11509 relocations for THUMB branches that might be exempted from the
11510 Cortex-A8 workaround.
11511 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
11512 at the beginning of a relaxation pass.
11513
20138696
DK
115142010-01-12 Doug Kwan <dougkwan@google.com>
11515
11516 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
11517 (Arm_relobj::Mapping_symbol_position,
11518 Arm_reloj::Mapping_symbol_position_less,
11519 Arm_relobj::Mapping_symbols_info): New types.
11520 (Target_arm::is_mapping_symbol_name): New method definition.
11521 (Arm_relobj::do_count_local_symbols): Save information about mapping
11522 symbols.
11523
089d69dc
DK
115242010-01-11 Doug Kwan <dougkwan@google.com>
11525
11526 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
11527 Arm_relocate_functions::thumb32_branch_upper,
11528 Arm_relocate_functions::thumb32_branch_lower,
11529 Arm_relocate_functions::thumb32_cond_branch_offset,
11530 Arm_relocate_functions::thumb32_cond_branch_upper,
11531 Arm_relocate_functions::thumb32_cond_branch_lower,
11532 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
11533 branch offset encoding.
11534 (Arm_relocate_functions::thumb_branch_common): Use new branch
11535 offset encoding methods to avoid code duplication.
11536 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
11537 (Stub_addend_reader::operator()): Use new branch encoding method
11538 to avoid code duplication.
11539
99e5bff2
DK
115402010-01-11 Doug Kwan <dougkwan@google.com>
11541
11542 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
11543 (Target_arm::do_finalize_sections): Define special EXIDX section
11544 symbols only if referenced.
11545 * gc.h (Garbage_collection::add_reference): New method.
11546 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
11547 code duplication.
11548
98e090bd
ILT
115492010-01-11 Ian Lance Taylor <iant@google.com>
11550
d0a91bd8
ILT
11551 * script.cc (Version_script_info::build_expression_list_lookup):
11552 Change complaing about duplicate wildcard match from error to
11553 warning.
11554
98e090bd
ILT
11555 * script.cc (class Lazy_demangler): Recreate--revert part of patch
11556 of 2009-12-30.
11557 (Version_script_info::Version_script_info): Initialize globs_,
11558 default_version_, default_is_global_, and exact_. Don't
11559 initialize globals_ or locals_.
11560 (Version_script_info::build_lookup_tables): Build local symbols
11561 first.
11562 (Version_script_info::unquote): New function.
11563 (Version_script_info::add_exact_match): New function.
11564 (Version_script_info::build_expression_list_lookup): Remove lookup
11565 parameter. Add is_global parameter. Change all callers. Handle
11566 wildcard pattern specially. Unquote pattern. Call
11567 add_exact_match.
11568 (Version_script_info::get_name_to_match): New function.
11569 (Version_script_info::get_symbol_version): New function.
11570 (Version_script_info::get_symbol_version_helper): Remove.
11571 (Version_script_info::check_unmatched_names): Call unquote.
11572 * script.h (class Version_script_info): Change get_symbol_version
11573 to be non-inline and add is_global parameter; change all callers.
11574 Rewrite symbol_is_local. Update declarations. Define struct
11575 Version_tree_match, Exact, Globs. Don't define struct Lookup.
11576 Remove globals_ and locals_ members. Add exact_, globs_,
11577 default_version_, is_global_.
11578 (Version_script_info::Glob): Remove pattern, add expression and
11579 is_global. Update constructor. Change all callers.
11580 * dynobj.cc (Versions::finalize): Mark the version symbol as the
11581 default version.
11582 (Versions::symbol_section_contents): If a symbol is undefined, or
11583 defined in a dynamic object, set the version index to
11584 VER_NDX_LOCAL.
11585 * symtab.cc (Symbol_table::add_from_relobj): Don't call
11586 symbol_is_local.
11587 (Symbol_table::add_from_pluginobj): Likewise.
11588 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
11589
d56962d3
DK
115902010-01-11 Doug Kwan <dougkwan@google.com>
11591
11592 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
11593 (incremental_dump_LDADD): Add linking option for libintl.
11594 * Makefile.in: Regenerate.
11595
94e6ee91
L
115962010-01-11 H.J. Lu <hongjiu.lu@intel.com>
11597
11598 PR gold/11144
11599 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
11600 instead of -Ds.
11601 * testsuite/Makefile.in: Regenerated.
11602
e96c574b
DK
116032010-01-10 Doug Kwan <dougkwan@google.com>
11604
11605 * options.h (DEFINE_var): Use parentheses around argument varname__
11606 in macro body to avoid any unintended subsequent substitutions.
11607
7198066b
ILT
116082010-01-10 Ian Lance Taylor <iant@google.com>
11609
ba4d53bf
ILT
11610 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
11611 candidates before doing symbol resolution.
11612
7198066b
ILT
11613 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
11614 ODR candidates if only one is weak.
11615
a2beed37
ILT
116162010-01-08 Ian Lance Taylor <iant@google.com>
11617
11618 * script.cc (Version_script_info::build_expression_list_lookup):
11619 Don't warn about ambiguous version, just record the ambiguity.
11620 (Version_script_info::get_symbol_version_helper): Give error if
11621 version is ambiguous.
11622
2fb7225c
DK
116232010-01-08 Doug Kwan <dougkwan@google.com>
11624
11625 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
11626 prev_data_size_ and prev_addralign_. Remove initializer for
11627 deleted data member has_been_changed_.
11628 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
11629 to determine if the table is empty.
11630 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
11631 Remove.
11632 (Stub_table::add_reloc_stub): Define method in class definition
11633 instead of just declaring it there.
11634 (Stub_table::add_cortex_a8_stub): New method definition.
11635 (Stub_table::update_data_size_and_addralign): Ditto.
11636 (Stub_table::finalize_stubs): Ditto.
11637 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
11638 (Stub_table::do_addralign_): Return address alignment in the
11639 (Stub_table::do_reset_address_and_file_offset): Define method in
11640 class definition instead of declaring it there. Set current data
11641 size to be the data size of the previous pass.
11642 (Stub_table::set_final_data_size): Use current data size as the
11643 final data size.
11644 (Stub_table::relocate_stub): Change parameter type of stub from
11645 Reloc_stub pointer to Stub pointer.
11646 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
11647 (Stub_table::Cortex_a8_stub_list): New typedef.
11648 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
11649 Stub_table::prev_addralign_): New data member.
11650 (Arm_relobj::Arm_relobj): Initialize data member
11651 section_has_cortex_a8_workaround_.
11652 (Arm_relobj::section_has_cortex_a8_workaround,
11653 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
11654 definitions.
11655 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
11656 declarations.
11657 (Target_arm::relocate_stub): Change parameter type of stub from
11658 Reloc_stub pointer to Stub pointer.
11659 (Insn_template::size, Insn_template::alignment): Handle
11660 THUMB16_SPECIAL_TYPE.
11661 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
11662 Stub_table::update_data_size_and_addralign,
11663 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
11664 definitions.
11665 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
11666 (Stub_table::do_write): Ditto.
11667 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 11668
880cd20d
ILT
116692010-01-08 Ian Lance Taylor <iant@google.com>
11670
11671 PR 11108
11672 * symtab.h (class Symbol): Remove fields is_target_special_ and
11673 has_plt_offset_. Add field is_defined_in_discarded_section_.
11674 (Symbol::is_defined_in_discarded_section): New function.
11675 (Symbol::set_is_defined_in_discarded_section): New function.
11676 (Symbol::has_plt_offset): Rewrite.
11677 (Symbol::set_plt_offset): Verify that new offset is not -1U.
11678 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
11679 Don't initialize is_target_special_ or has_plt_offset_.
11680 Initialize is_defined_in_discarded_section_.
11681 (Symbol_table::add_from_relobj): If appropriate, set
11682 is_defined_in_discarded_section.
11683 * resolve.cc (Symbol::override_base_with_special): Don't test
11684 is_target_special_. Change has_plt_offset_ to has_plt_offset().
11685 * target-reloc.h (relocate_section): Do special handling for
11686 symbols defined in discarded sections for global symbols as well
11687 as local symbols.
11688
2703e3eb
ILT
116892010-01-08 Ian Lance Taylor <iant@google.com>
11690
11691 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
11692 the SHT_SYMTAB case.
11693
339d40a3
ILT
116942010-01-08 Ian Lance Taylor <iant@google.com>
11695
11696 * object.cc (Sized_relobj::do_layout): Don't get confused if
11697 layout_eh_frame returns NULL.
11698
abecea76
ILT
116992010-01-08 Ian Lance Taylor <iant@google.com>
11700
11701 PR 11084
11702 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
11703 dynamic symbol table, use the normal symbol table.
11704 (Sized_dynobj::do_read_symbols): Remove assertion about type of
11705 symbol table.
11706
6b7dd3f3
ILT
117072010-01-08 Ian Lance Taylor <iant@google.com>
11708
11709 PR 11072
11710 * layout.cc (Layout::include_section): Remove .gnu_debuglink
11711 sections.
11712
36c50e63
L
117132010-01-08 H.J. Lu <hongjiu.lu@intel.com>
11714
11715 * version.cc (print_version): Change to "Copyright 2010".
11716
e291e7b9
ILT
117172010-01-08 Ian Lance Taylor <iant@google.com>
11718
11719 PR 10287
11720 PR 11063
11721 * i386.cc (class Target_i386): Change return type of plt_section
11722 to be non-const.
11723 (class Output_data_plt_i386): Add tls_desc_rel_ field.
11724 (Output_data_plt_i386::Output_data_plt_i386): Initialize
11725 tls_desc_rel_ field.
11726 (Output_data_plt_i386::rel_tls_desc): New function.
11727 (Target_i386::rel_tls_desc_section): New function.
11728 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
11729 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
11730 R_386_TLS_DESC reloc in rel_tls_desc_section.
11731 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
11732 Define struct Tlsdesc_info.
11733 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
11734 (Target_x86_64::do_reloc_symbol_index): New function.
11735 (Target_x86_64::add_tlsdesc_info): New function.
11736 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
11737 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
11738 tlsdesc_rel_ field.
11739 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
11740 all callers.
11741 (Output_data_plt_x86_64::rela_tlsdesc): New function.
11742 (Target_x86_64::rela_tlsdesc_section): New function.
11743 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
11744 handling.
11745 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
11746 (Target_x86_64::do_reloc_addend): New function.
11747 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
11748 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
11749 declarations. Define TARGET_CODE. Add arg field to u1_ union.
11750 (Output_reloc::type): New function.
11751 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
11752 (Output_reloc::is_target_specific): New function.
11753 (Output_reloc::target_arg): New function.
11754 (class Output_reloc) [SHT_RELA]: Add four new constructors for
11755 absolute relocs and target specific relocs.
11756 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
11757 add_target_specific.
11758 (class Output_data_reloc) [SHT_RELA]: Likewise.
11759 * output.cc (Output_reloc::Output_reloc): Add four new versions
11760 for absolute relocs and target specific relocs.
11761 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
11762 (Output_reloc::get_symbol_index): Likewise.
11763 (Output_reloc::local_section_offset): Check that local_sym_index_
11764 is not TARGET_CODE or 0.
11765 (Output_reloc::symbol_value): Likewise.
11766 (Output_reloc::write) [SHT_RELA]: Call target for target specific
11767 reloc.
11768 * target.h (class Target): Add reloc_symbol_index and reloc_addend
11769 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
11770 functions.
11771 * layout.cc (add_target_dynamic_tags): Use output section for
11772 DT_PLTRELSZ and DT_JMPREL.
11773
3a44184e
ILT
117742010-01-07 Ian Lance Taylor <iant@google.com>
11775
11776 PR 11061
11777 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
11778 function.
11779 (class Output_data_reloc_generic): Define.
11780 (class Output_data_reloc_base): Change base class to
11781 Output_data_reloc_generic. Change add() method to call
11782 bump_relative_reloc_count for a relative reloc. Remove
11783 sort_relocs_ field.
11784 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
11785 to sort_relocs().
11786 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
11787 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
11788 appropriate.
11789 * layout.h (class Layout): Update declaration.
11790
ea715a34
ILT
117912010-01-07 Ian Lance Taylor <iant@google.com>
11792
11793 * output.h (class Output_data): Add const version of
11794 output_section and do_output_section.
11795 (class Output_section_data): Add const version of
11796 do_output_section.
11797 (class Output_section): Likewise.
11798 * layout.cc (Layout::add_target_dynamic_tags): New function.
11799 * layout.h (class Layout): Update declarations.
11800 * arm.cc (Target_arm::do_finalize_sections): Use
11801 add_target_dynamic_tags.
11802 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11803 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11804 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11805 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11806
659948a4
ILT
118072010-01-07 Ian Lance Taylor <iant@google.com>
11808
11809 PR 11042
11810 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
11811 object as needed.
11812
9d3b86f6
ILT
118132010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
11814 Ian Lance Taylor <iant@google.com>
11815
11816 PR 11019
11817 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
11818 Xindex::read_symtab_xindex.
11819
bb0d3eb0
DK
118202010-01-07 Doug Kwan <dougkwan@google.com>
11821
11822 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
11823 (Insn_template::thumb16_bcond_insn): New method declaration.
11824 (Insn_template): Fix spelling.
11825 (Stub::thumb16_special): New method declaration.
11826 (Stub::do_write): Define virtual method which was previously pure
11827 virtual.
11828 (Stub::do_thumb16_special): New method declaration.
11829 (Stub::do_fixed_endian_write): New template member.
11830 (Reloc_stub::do_write): Remove.
11831 (Reloc_stub::do_fixed_endian_write): Remove.
11832 (Cortex_a8_stub): New class definition.
11833 (Stub_factory::make_cortex_a8_stub): New method definition.
11834 (Stub_factory::Stub_factory): Add missing static storage class
11835 qualifier for elf32_arm_stub_a8_veneer_blx.
11836
ffeef7df
ILT
118372010-01-07 Ian Lance Taylor <iant@google.com>
11838
dc3f80fe
ILT
11839 PR 10980
11840 * options.h (class General_options): Add --warn-unresolved-symbols
11841 and --error-unresolved-symbols.
11842 * errors.cc (Errors::undefined_symbol): Implement
11843 --warn-unresolved-symbols.
11844
ffeef7df
ILT
11845 * options.h (class General_options): Add -z text and -z textoff.
11846 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
11847
f1ec9ded
ST
118482010-01-06 Sriraman Tallam <tmsriram@google.com>
11849
11850 * gc.h (Garbage_collection::Cident_section_map): New typedef.
11851 (Garbage_collection::cident_sections): New function.
11852 (Garbage_collection::add_cident_section): New function.
11853 (Garbage_collection::cident_sections_): New member.
11854 (gc_process_relocs): Add references to sections whose names are C
11855 identifiers.
11856 * gold.h (cident_section_start_prefix): New constant.
11857 (cident_section_stop_prefix): New constant.
11858 (is_cident): New function.
11859 * layout.cc (Layout::define_section_symbols): Replace string constants
11860 with the newly defined constants.
11861 * object.cc (Sized_relobj::do_layout): Track sections whose names are
11862 C identifiers.
11863 * testsuite/Makefile.am: Add gc_orphan_section_test.
11864 * testsuite/Makefile.in: Regenerate.
11865 * testsuite/gc_orphan_section_test.cc: New file.
11866 * testsuite/gc_orphan_section_test.sh: New file.
11867
6eda8c29
ILT
118682010-01-06 Ian Lance Taylor <iant@google.com>
11869
b9674e17
ILT
11870 PR 10980
11871 * options.h (class General_options): Add --warn-shared-textrel.
11872 * layout.cc (Layout::finish_dynamic_section): Implement
11873 --warn-shared-textrel.
11874
6eda8c29
ILT
11875 PR 10980
11876 * options.h (class General_options): Add --warn-multiple-gp.
11877
32dcd44e
ILT
118782010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11879
11880 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
11881 $(THREADSLIB) and $(LIBDL).
11882 * Makefile.in: Rebuild.
11883
a192ba05
ILT
118842010-01-06 Ian Lance Taylor <iant@google.com>
11885
11886 PR 10980
11887 * options.cc (General_options::parse_section_start): New function.
11888 (General_options::section_start): New function.
11889 (General_options::General_options): Initialize all members.
11890 * options.h: Include <map>
11891 (class General_options): Add --section-start. Add section_starts_
11892 member.
11893 * layout.cc (Layout::attach_allocated_section_to_segment): If
11894 --section-start was used, set the address of the segment. Remove
11895 local sort_sections.
11896 (Layout::relaxation_loop_body): If the address of the load segment
11897 has been set by --section-start, don't use it.
11898 * output.h (Output_segment::update_flags_for_output_section): New
11899 function.
11900 * output.cc (Output_segment::add_output_section): Call
11901 update_flags_for_output_section.
11902
dde3f402
ILT
119032010-01-05 Ian Lance Taylor <iant@google.com>
11904
62dfdd4d
ILT
11905 PR 10980
11906 * options.h (class General_options): Add --undefined-version.
11907 * script.cc (struct Version_expression): Add was_matched_by_symbol
11908 field.
11909 (Version_script_info::matched_symbol): New function.
11910 (Version_script_info::get_symbol_version_helper): Call
11911 matched_symbol.
11912 (Version_script_info::check_unmatched_names): New function.
11913 * script.h (class Version_script_info): Update declarations.
11914 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
11915
9c4ae156
ILT
11916 * options.h (class General_options): Use DEFINE_bool_alias for
11917 allow_multiple_definition.
11918 * resolve.cc (Symbol_table::should_override): Don't test
11919 allow_multiple_definition.
11920
dde3f402
ILT
11921 PR 10980
11922 * options.h (class General_options): Add --cref.
11923 * main.cc (main): Print cref table if --cref. Don't close mapfile
11924 until after printing cref table.
11925 * cref.cc: Include "symtab.h".
11926 (class Cref_inputs): Define Cref_table_compare and Cref_table.
11927 (Cref_table_compare::operator()): New function.
11928 (Cref_inputs::gather_cref): New function.
11929 (filecol): New static const.
11930 (Cref_inputs::print_cref): New function.
11931 (Cref::print_cref): New function.
11932 * cref.h: Include <cstdio>.
11933 (class Cref): Update declarations.
11934 * mapfile.h (Mapfile::file): New function.
11935 * object.h (class Object): Define Symbols. Declare virtual
11936 do_get_global_symbols.
11937 (Object::get_global_symbols): New function.
11938 * object.cc (Input_objects::add_object): Pass object to cref_ if
11939 --cref.
11940 (Input_objects::archive_start): Likewise.
11941 (Input_objects::archive_stop): Likewise.
11942 (Input_objects::print_cref): New function.
11943 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
11944 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
11945 --cref.
11946 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
11947 function.
11948 * plugin.h (class Sized_pluginobj): Update declarations.
11949
8781f709
ILT
119502010-01-05 Ian Lance Taylor <iant@google.com>
11951
11952 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
11953 to is_default_version. Rename insdef to insdefault.
11954 (Symbol_table::add_from_relobj): Rename def to is_default_version
11955 and local to is_forced_local.
11956 (Symbol_table::add_from_pluginobj): Likewise.
11957 (Symbol_table::add_from_dynobj): Likewise.
11958 (Symbol_table::define_special_symbol): Rename insdef to
11959 insdefault.
11960
fe35d28d
ILT
119612010-01-04 Ian Lance Taylor <iant@google.com>
11962
30bc8c46
ILT
11963 PR 10980
11964 * options.h (class General_options): Add
11965 --allow-multiple-definition and -z muldefs.
11966 * resolve.cc (Symbol_table::should_override): Don't warn about a
11967 multiple symbol definition if --allow-multiple-definition or -z
11968 muldefs.
11969
7eaea549
ILT
11970 PR 10980
11971 * options.h (class General_options): Add --add-needed and
11972 --copy-dt-needed-entries. Tweak --as-needed help entry.
11973 * object.cc (Input_objects::check_dynamic_dependencies): Give an
11974 error if --copy-dt-needed-entries aka --add-needed is used and
11975 would cause a change in behaviour.
11976
fe35d28d
ILT
11977 PR 10980
11978 * options.h (class General_options): Add -G as a short version of
11979 --shared. Add no-op options -assert, -g, and -i.
11980
55a2bb35
ST
119812010-01-04 Sriraman Tallam <tmsriram@google.com>
11982
11983 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
11984 check for .text or .gnu.linkonce.t sections.
11985 * icf.cc (Icf::find_identical_sections): Ditto.
11986 Change the detection for mangled function name within the section
11987 name.
11988 * icf.h (is_section_foldable_candidate): New function.
11989
719328e1
ILT
119902009-12-30 Ian Lance Taylor <iant@google.com>
11991
11992 PR 10980
11993 * options.h (class General_options): Permit two dashes with
11994 --retain-symbols-file.
11995
d7bb5745
ILT
119962009-12-30 Ian Lance Taylor <iant@google.com>
11997
403a15dd
ILT
11998 PR 10979
11999 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
12000 don't put the file header and segment headers in the text
12001 segment.
12002
eda294df
ILT
12003 PR 10979
12004 * common.cc (Sort_commons::operator()): Stabilize sort when both
12005 entries are NULL.
12006 (Symbol_table::do_allocate_commons_list): When allocating common
12007 symbols, skip a symbol which is no longer common.
12008 * symtab.h (Symbol::is_common): Test whether the symbol comes from
12009 an object before checking its type.
12010 * testsuite/common_test_2.c: New file.
12011 * testsuite/common_test_3.c: New file.
12012 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
12013 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
12014 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
12015 (common_test_2_pic.o, common_test_2.so): New targets.
12016 (common_test_3_pic.o, common_test_3.so): New targets.
12017 * testsuite/Makefile.in: Rebuild.
12018
d7bb5745
ILT
12019 PR 10979
12020 * script.cc (read_input_script): If we see a new SECTIONS clause,
12021 and we have added an input section, give an error.
12022 * layout.h (class Layout): Add have_added_input_section function.
12023 Add have_added_input_section_ field.
12024 * layout.cc (Layout::Layout): Initialize
12025 have_added_input_section_.
12026 (Layout::layout): Set have_added_input_section_.
12027 (Layout::layout_eh_frame): Likewise.
12028
fc59c572
ILT
120292009-12-30 Ian Lance Taylor <iant@google.com>
12030
12031 PR 10931
12032 * options.h (class General_options): Add --sort-common option.
12033 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
12034 * common.cc (Sort_common): Add sort_order parameter to
12035 constructor. Add sort_order_ field.
12036 (Sort_commons::operator): Check sort_order_.
12037 (Symbol_table::allocate_commons): Determine the sort order.
12038 (Symbol_table::do_allocate_commons): Add sort_order parameter.
12039 Change all callers.
12040 (Symbol_table::do_allocate_commons_list): Likewise.
12041
1c74fab0
ILT
120422009-12-30 Ian Lance Taylor <iant@google.com>
12043
12044 PR 10916
12045 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
12046 symbols from this object, don't change the visibility of an
12047 undefined symbol.
12048 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
12049
6affe781
ILT
120502009-12-30 Ian Lance Taylor <iant@google.com>
12051
12052 PR 10861
12053 * script.h (class Version_script_info): Define Language enum.
12054 Update declarations. Define Glob, Exact, and Lookup types. Add
12055 new fields globals_, locals_, and is_finalized_.
12056 * script.cc: Various formatting fixes.
12057 (class Parser_closure): Change language_stack_ from a vector of
12058 std::string to one of Version_script_info::Language. Adjust all
12059 uses accordingly.
12060 (class Lazy_demangler): Remove.
12061 (struct Version_expression): Change language from std::string to
12062 Version_script_info::Language.
12063 (Version_script_info::Version_script_info): New function.
12064 (Version_script_info::~Version_script_info): Don't call clear.
12065 (Version_script_info::finalize): New function.
12066 (Version_script_info::build_lookup_tables): New function.
12067 (Version_script_info::build_expression_list_lookup): New
12068 function.
12069 (Version_script_info::get_symbol_version_helper): Rewrite to use
12070 lookup tables.
12071 (Version_script_info::print_expression_list): Adjust to use
12072 Version_script_info::Language.
12073 (script_push_lex_into_version_mode): Check that the version script
12074 has not been finalized.
12075 (version_script_push_lang): Change language string to
12076 Version_script_info::Language.
12077 * options.cc (Command_line::version_script): New function.
12078 * options.h (class General_options): Add finalize_dynamic_list
12079 function. Change version_script from declaration to definition.
12080 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
12081 * testsuite/version_script.map: Remove duplicate def of foo.
12082 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
12083 version_script.map.
12084 * testsuite/Makefile.in: Rebuild.
12085
818bf354
ILT
120862009-12-30 Ian Lance Taylor <iant@google.com>
12087
12088 PR 10843
12089 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
12090 if the input symbol index is 0, make the output symbol index 0.
12091
ebcc8304
ILT
120922009-12-30 Ian Lance Taylor <iant@google.com>
12093
12094 PR 10670
12095 * options.h (class General_options): Add -x/--discard-all.
12096 * object.cc (Sized_relobj::do_count_local_symbols): Handle
12097 --discard-all. If the local symbol needs a dynamic entry, check
12098 that before handling --discard-locals.
12099
176fe33f
ILT
121002009-12-30 Ian Lance Taylor <iant@google.com>
12101
bb321bb1
ILT
12102 PR 10450
12103 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
12104 flags to PF_R.
12105 (Output_segment::add_output_section): Don't change the flags if
12106 the type is PT_TLS.
12107
176fe33f
ILT
12108 PR 10450
12109 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
12110 GNU hash table if they need a dynamic value. Otherwise, don't add
12111 them if they are defined in a dynamic object or are forced local.
12112
e8cd95c7
ILT
121132009-12-29 Ian Lance Taylor <iant@google.com>
12114
1b81fb71
ILT
12115 PR 10450
12116 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
12117 .gnu.hash table for a 32-bit target.
12118
8d6d383d
ILT
12119 PR 10450
12120 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
12121 regular and a dynamic object only needs a dynamic symbol table
12122 entry if it is externally visible.
12123
e785ec03
ILT
12124 PR 10450
12125 * i386.cc (class Target_i386): Initialize global_offset_table_ in
12126 constructor. Add global_offset_table_ field.
12127 (Target_i386::got_section): Set global_offset_table_.
12128 (Target_i386::do_finalize_sections): Set global_offset_table_
12129 size.
12130 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
12131 in constructor. Add global_offset_table_ field.
12132 (Target_x86_64::got_section): Set global_offset_table_.
12133 (Target_x86_64::do_finalize_sections): Set global_offset_table_
12134 size.
12135
1a2dff53
ILT
12136 * layout.cc (Layout::Layout): Initialize increase_relro_.
12137 (Layout::get_output_section): Add is_relro, is_last_relro, and
12138 is_first_non_relro parameters. Change all callers.
12139 (Layout::choose_output_section): Likewise.
12140 (Layout::add_output_section_data): Likewise.
12141 (Layout::make_output_section): Likewise.
12142 (Layout::set_segment_offsets): Clear increase_relro when using a
12143 linker script.
12144 * layout.h (class Layout): Add increase_relro method. Add
12145 increase_relro_ field. Update declarations.
12146 * output.cc (Output_section::Output_section): Initialize
12147 is_last_relro_ and is_first_non_relro_.
12148 (Output_segment::add_output_section): Group relro sections is
12149 do_sort is true. Handle is_last_relro and is_first_non_relro.
12150 (Output_segment::maximum_alignment): Remove relro handling.
12151 (Output_segment::set_section_addresses): Add increase_relro
12152 parameter. Change all callers. Add initial alignment to align
12153 relro sections on separate page. Remove old relro handling.
12154 (Output_segment::set_section_list_addresses): Remove in_relro
12155 parameter. Change all callers.
12156 (Output_segment::set_offset): Add increase parameter. Change all
12157 callers. Remove old relro handling.
12158 * output.h (class Output_section): Add new methods: is_last_relro,
12159 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
12160 Add is_last_relro_ and is_first_non_relro_ fields.
12161 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
12162 Create separate .got.plt section. Call increase_relro.
12163 * x86_64.cc (Target_x86_64::got_section): Likewise.
12164 * testsuite/relro_script_test.t: Add .got.plt.
12165
f0ba79e2
ILT
12166 PR 10450
12167 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
12168 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
12169 (Layout::finalize): Call set_dynamic_symbol_size.
12170 (Layout::set_dynamic_symbol_size): New function.
12171 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
12172 set_dynamic_symbol_size.
12173
e8cd95c7
ILT
12174 PR 10450
12175 * output.h (class Output_section): Add is_entsize_zero_ field.
12176 * output.cc (Output_section::Output_section): Initialize
12177 is_entsize_zero_.
12178 (Output_section::set_entsize): If two different entsizes are
12179 requested, force it to zero.
12180 (Output_section::add_input_section): Set flags for .debug_str
12181 before updating section flags. Set entsize.
12182 (Output_section::update_flags_for_input_section): Set SHF_MERGE
12183 and SHF_STRING if all input sections have those flags.
12184
3e1b9a8a
RÁE
121852009-12-29 Rafael Espindola <espindola@google.com>
12186
12187 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
12188 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
12189 reporting.
3e1b9a8a 12190
3dcad376
ST
121912009-12-29 Sriraman Tallam <tmsriram@google.com>
12192
12193 * options.cc (General_options::parse_version): Allow -v to exit
12194 without an error if there is nothing to link.
12195
084e2665
ILT
121962009-12-29 Ian Lance Taylor <iant@google.com>
12197
12198 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
12199 using a version of gcc before 4.1.
12200 * configure: Rebuild.
12201
250acde3
CD
122022009-12-28 Chris Demetriou <cgd@google.com>
12203
12204 * attributes.cc (Output_attributes_section_data::do_write): Use
12205 std::vector::front rather than std::vector::data.
12206
99fff23b
ILT
122072009-12-28 Ian Lance Taylor <iant@google.com>
12208
12209 * symtab.h (class Symbol_table): Add enum Defined.
12210 * resolve.cc (Symbol_table::should_override): Add defined
12211 parameter. Change all callers. Test whether object is NULL
12212 before calling a method on it.
12213 (Symbol_table::report_resolve_problem): Add defined parameter.
12214 Change all callers.
12215 (Symbol_table::should_override_with_special): Likewise.
12216 * symtab.cc (Symbol_table::define_in_output_data): Add defined
12217 parameter. Change all callers.
12218 (Symbol_table::do_define_in_output_data): Likewise.
12219 (Symbol_table::define_in_output_segment): Likewise.
12220 (Symbol_table::do_define_in_output_segment): Likewise.
12221 (Symbol_table::define_as_constant): Likewise.
12222 (Symbol_table::do_define_as_constant): Likewise.
12223 * script.h (class Symbol_assignment): Add is_defsym parameter to
12224 constructor; change all callers.
12225 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
12226 parameter. Change all callers. Add is_defsym_ field.
12227 (class Parser_closure): Add parsing_defsym parameter to
12228 constructor; change all callers. Add parsing_defsym accessor
12229 function. Add parsing_defsym_ field.
12230
556bd683
ILT
122312009-12-28 Ian Lance Taylor <iant@google.com>
12232
12233 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 12234 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 12235
1782c879
ILT
122362009-12-23 Ian Lance Taylor <iant@google.com>
12237
12238 * i386.cc (Target_i386::do_calls_non_split): Recognize
12239 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
12240 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
12241 -fsplit-stack prologue when using %r11.
1782c879 12242
329ca2b1
ST
122432009-12-21 Sriraman Tallam <tmsriram@google.com>
12244
12245 * options.cc (General_options::parse_version): Make -v continue and do
12246 the link like GNU ld does.
12247
d675ff46
RÁE
122482009-12-17 Rafael Avila de Espindola <espindola@google.com>
12249
12250 * Makefile.am (CCFILES): Add timer.cc.
12251 (HFILES): Add timer.h.
12252 * configure.ac: Check for sysconf and times.
12253 * main.cc: include timer.h.
12254 (main): Use Timer instead of get_run_time.
12255 * timer.cc: New.
12256 * timer.h: New.
12257 * workqueue.cc: include timer.h.
12258 (Workqueue::find_and_run_task):
12259 Report user, sys and wall time.
12260 * Makefile.in: Regenerate.
12261 * config.in: Regenerate.
12262 * configure: Regenerate.
12263
d6344fb5
DK
122642009-12-16 Doug Kwan <dougkwan@google.com>
12265
12266 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
12267 sections.
12268 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
12269 relaxed input sections.
12270 * output.cc (Output_section::find_relaxed_input_section): Change
12271 return type to Output_relaxed_input_section pointer. Adjust code
12272 for new type of relaxed_input_section_map_.
12273 * output.h (Output_section::find_relaxed_input_section): Change
12274 return type to Output_relaxed_input_section pointer.
12275 (Output_section::Output_relaxed_input_section_by_input_section_map):
12276 New type.
12277 (Output_section::relaxed_input_section_map_): Change type to
12278 Output_section::Output_relaxed_input_section_by_input_section_map.
12279 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
12280 input section.
12281
0e0d5469
ILT
122822009-12-15 Ian Lance Taylor <iant@google.com>
12283
12284 * layout.cc (Layout::create_shstrtab): Only write out after input
12285 sections if we are compressing debug sections.
12286
0649a889
ILT
122872009-12-15 Ian Lance Taylor <iant@google.com>
12288
12289 * archive.cc (Archive::add_symbols): Only look up a symbol without
12290 a version if there is, in fact, a version.
12291
2ea97941
ILT
122922009-12-14 Ian Lance Taylor <iant@google.com>
12293
12294 Revert -Wshadow changes, all changes from:
12295 2009-12-11 Doug Kwan <dougkwan@google.com>
12296 2009-12-11 Nick Clifton <nickc@redhat.com>
12297 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
12298
b0eec2cc
DK
122992009-12-11 Doug Kwan <dougkwan@google.com>
12300
12301 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
12302 due to -Wshadow.
12303 * attributes.cc (Object_attribute::size): Ditto.
12304 (Attributes_section_data::size): Ditto.
12305 (Attributes_section_data::Attributes_section_data): Ditto.
12306 (Output_attributes_section_data::do_write): Ditto.
12307 * attributes.h (Object_attribute::set_type): Ditto.
12308 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
12309
91d6fa6a
NC
123102009-12-11 Nick Clifton <nickc@redhat.com>
12311
12312 * archive.cc: Fix shadowed variable warnings.
12313 * arm.cc: Likewise.
12314 * compressed_output.cc: Likewise.
12315 * compressed_output.h: Likewise.
12316 * configure: Likewise.
12317 * dwarf_reader.cc: Likewise.
12318 * dynobj.cc: Likewise.
12319 * dynobj.h: Likewise.
12320 * ehframe.cc: Likewise.
12321 * ehframe.h: Likewise.
12322 * errors.cc: Likewise.
12323 * expression.cc: Likewise.
12324 * fileread.cc: Likewise.
12325 * fileread.h: Likewise.
12326 * freebsd.h: Likewise.
12327 * i386.cc: Likewise.
12328 * icf.cc: Likewise.
12329 * incremental.h: Likewise.
12330 * layout.cc: Likewise.
12331 * layout.h: Likewise.
12332 * mapfile.cc: Likewise.
12333 * merge.cc: Likewise.
12334 * merge.h: Likewise.
12335 * object.cc: Likewise.
12336 * object.h: Likewise.
12337 * options.h: Likewise.
12338 * output.cc: Likewise.
12339 * output.h: Likewise.
12340 * parameters.cc: Likewise.
12341 * plugin.cc: Likewise.
12342 * powerpc.cc: Likewise.
12343 * reduced_debug_output.cc: Likewise.
12344 * reduced_debug_output.h: Likewise.
12345 * reloc.cc: Likewise.
12346 * reloc.h: Likewise.
12347 * resolve.cc: Likewise.
12348 * script-sections.cc: Likewise.
12349 * script.cc: Likewise.
12350 * script.h: Likewise.
12351 * sparc.cc: Likewise.
12352 * symtab.cc: Likewise.
12353 * symtab.h: Likewise.
12354 * target-select.cc: Likewise.
12355 * target-select.h: Likewise.
12356 * token.h: Likewise.
12357 * workqueue.cc: Likewise.
12358 * workqueue.h: Likewise.
12359 * x86_64.cc: Likewise.
12360
a0351a69
DK
123612009-12-10 Doug Kwan <dougkwan@google.com>
12362
12363 * arm.cc (attributes.h): New include.
12364 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
12365 (Arm_relobj::~Arm_relobj): Delete object pointed by
12366 attributes_section_data_.
12367 (Arm_relobj::attributes_section_data): New method definition.
12368 (Arm_relobj::attributes_section_data_): New data member declaration.
12369 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
12370 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
12371 attributes_section_data_.
12372 (Arm_dynobj::attributes_section_data): New method definition.
12373 (Arm_dynobj::attributes_section_data_): New data member declaration.
12374 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
12375 initialization value of may_use_blx_ to false.
2e702c99 12376 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
12377 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
12378 object attributes to compute results instead of hard-coding.
12379 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
12380 Target_arm::get_secondary_compatible_arch,
12381 Target_arm::set_secondary_compatible_arch
12382 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12383 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
12384 New method declarations.
12385 (Target_arm::get_aeabi_object_attribute): New method definition.
12386 (Target_arm::attributes_section_data_): New data member declaration.
12387 (read_arm_attributes_section): New template definition.
12388 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
12389 (Arm_dynobj::do_read_symbols): Ditto.
12390 (Target_arm::do_finalize_sections): Merge attributes sections from
12391 input. Check for BLX use after attributes section merging.
12392 Fix __exidx_start and __exidx_end visibility. Create an
12393 .ARM.attributes section if necessary.
12394 (Target_arm::get_secondary_compatible_arch,
12395 Target_arm::set_secondary_compatible_arch,
12396 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12397 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 12398 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
12399 New method definitions.
12400
b59befec
ILT
124012009-12-09 Ian Lance Taylor <iant@google.com>
12402
12403 * plugin.cc (Plugin::load): Don't cast from void* to a function
12404 pointer.
12405
1276bc89
ILT
124062009-12-09 Ian Lance Taylor <iant@google.com>
12407
12408 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
12409 information fields.
12410
2f2de248
L
124112009-12-09 H.J. Lu <hongjiu.lu@intel.com>
12412
12413 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
12414 Replace two_file_shared_1.so with two_file_shared_2.so.
12415 * testsuite/Makefile.in: Regenerated.
12416
4f787271
DK
124172009-12-08 Doug Kwan <dougkwan@google.com>
12418
12419 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
12420 (HFILES): Add attributes.h and int_encoding.h.
12421 * Makefile.in: Regenerate.
12422 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
12423 function definitions to int_encoding.cc
12424 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
12425 prototypes to int_encoding.h
12426 * reduced_debug_output.cc (int_encoding.h): New include.
12427 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
12428 function definitions to int_encoding.cc
12429 (insert_into_vector, read_from_pointer): Move template definitions to
12430 int_encoding.h
12431 * attributes.cc: New file.
12432 * attributes.h: New file.
12433 * int_encoding.cc: New file.
12434 * int_encoding.h: New file.
12435
20b52f1a
RÁE
124362009-12-07 Rafael Avila de Espindola <espindola@google.com>
12437
12438 PR gold/11055
12439 * incremental-dump.cc (dump_incremental_inputs): New.
12440 (main): Use dump_incremental_inputs.
12441
53d7974c
L
124422009-12-07 H.J. Lu <hongjiu.lu@intel.com>
12443
12444 PR gold/10893
12445 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
12446 checking elfcpp::STT_FUNC.
12447 (Target_i386::Relocate::relocate): Likewise.
12448 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
12449
12450 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
12451 symbols from shared libraries into normal FUNC symbols.
12452
12453 * symtab.h (Symbol): Add is_func and use it.
12454
05a352e6
DK
124552009-12-05 Doug Kwan <dougkwan@google.com>
12456
12457 * arm.cc (Target_arm::arm_info): Initialize new fields
12458 attributes_section and attributes_vendor.
12459 * i386.cc (Target_i386::i386_info): Same.
12460 * object.cc (Sized_relobj::do_layout): Skip attribute section.
12461 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
12462 fields attributes_section and attributes_vendor.
53d7974c 12463 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
12464 * target.h (Target::attributes_section, Target::attributes_vendor,
12465 Target::is_attributes_section, Target::attribute_arg_type,
12466 Target::attributes_order): New method definitions.
12467 (Target::Target_info::attributes_section,
12468 Target::Target_info::attributes_vendor): New fields.
12469 (Target::do_attribute_arg_type, Target::do_attributes_order): New
12470 virtual method definitions.
12471 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
12472 attributes_section and attributes_vendor.
12473 * testsuite/testfile.cc (Target_test::test_target_info): Same.
12474
f4e5969c
DK
124752009-12-05 Doug Kwan <dougkwan@google.com>
12476
12477 * arm.cc: Update comments about interworking and stub generation.
12478 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
12479 considered as non-PIC.
12480 (Arm_relocate_functions::base_abs): Fix formatting.
12481 (Arm_relocate_functions::got_prel): Fix comment. Change interface
12482 of function to use GOT entry address instead of offset.
12483 (Target_arm::Scan::global): Issue an error if a symbol would need a
12484 PLT does not get one because it is untyped. Remove code to create
12485 dynamic symbols for relative branches.
12486 (Target_arm::Relocate::relocate: Use 0 instead of false since function
12487 takes unsigned integer instead of boolean.
12488
1abce4a6
L
124892009-12-05 H.J. Lu <hongjiu.lu@intel.com>
12490
12491 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
12492 (two_file_test_LDADD): Likewise.
12493 (common_test_1_LDADD): Likewise.
12494 (exception_test_LDADD) Likewise.
12495 (weak_test_LDADD): Likewise.
12496 (many_sections_test_LDADD): Likewise.
12497 (initpri1_LDADD): Likewise.
12498 (script_test_1_LDADD): Likewise.
12499 (script_test_2_LDADD): Likewise.
12500 (justsyms_LDADD): Likewise.
12501 (binary_test_LDADD): Likewise.
12502 (large_LDADD): Likewise.
12503 * testsuite/Makefile.in: Regenerated.
12504
adcf2816 125052009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 12506
adcf2816
L
12507 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
12508 (Symbol_table::override_with_special): Likewise.
12509 (Symbol_table::add_from_object): Likewise.
12510
28e67f5d
RÁE
125112009-12-04 Rafael Avila de Espindola <espindola@google.com>
12512
12513 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12514 Don't set the data_offset twice.
12515
ae10a101
RÁE
125162009-12-04 Rafael Avila de Espindola <espindola@google.com>
12517
12518 * testsuite/Makefile.in: Regenerate.
12519
f59f41f3
DK
125202009-12-03 Doug Kwan <dougkwan@google.com>
12521
12522 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
12523 (Target_arm::do_finalize_sections): Add parameter for symbol table
12524 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
12525 * i386.cc (Target_i386::do_finalize_sections): Add an additional
12526 parameter for symbol table pointer.
12527 * layout.cc (Layout::finalize): Call Target::finalize_sections with
12528 an additional parameter for a pointer to symbol table.
12529 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
12530 parameter for a symbol table pointer.
12531 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
12532 * target.h (Target::finalize_sections, Target::do_finalize_sections):
12533 Ditto.
12534 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
12535 parameter for a symbol table pointer.
12536
ca55d848
RÁE
125372009-12-03 Rafael Avila de Espindola <espindola@google.com>
12538
12539 * incremental.cc (Incremental_inputs_header)
12540 (Incremental_inputs_header_write, Incremental_inputs_entry)
12541 (Incremental_inputs_entry_write): Move ...
12542 * incremental.h (Incremental_inputs_header)
12543 (Incremental_inputs_header_write, Incremental_inputs_entry)
12544 (Incremental_inputs_entry_write): here.
12545
3aec4f9c
RÁE
125462009-12-02 Rafael Avila de Espindola <espindola@google.com>
12547
12548 * incremental.cc (make_sized_incremental_binary): Set the target.
12549 Error if it is incompatible.
12550 * output.h (Output_file): Add filename method.
12551
9c0ae74d
RÁE
125522009-12-02 Rafael Avila de Espindola <espindola@google.com>
12553
12554 * incremental.cc (Incremental_inputs_entry): Remove unused argument
12555 from the get_* methods.
12556
a45500ae
RÁE
125572009-12-02 Rafael Avila de Espindola <espindola@google.com>
12558
12559 * incremental-dump.cc (main): Check that the offeset of a script is 0.
12560 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12561 Write 0 for the data_offset of scripts.
12562
325e6408
RÁE
125632009-12-02 Rafael Avila de Espindola <espindola@google.com>
12564
12565 * testsuite/Makefile.am: Add the incremental_test.sh test.
12566 * testsuite/incremental_test.sh: New.
12567 * testsuite/incremental_test_1.c: New.
12568 * testsuite/incremental_test_2.c: New.
12569
954c3e2e
RÁE
125702009-12-01 Rafael Avila de Espindola <espindola@google.com>
12571
703d02da 12572 * incremental-dump.cc (main): Fix typos.
954c3e2e 12573
f8086623
RÁE
125742009-11-27 Rafael Avila de Espindola <espindola@google.com>
12575
12576 PR gold/11025
12577 * incremental-dump.cc (main): Use llu to print 64 bit values.
12578
3b0dd6ac
L
125792009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
12580 H.J. Lu <hongjiu.lu@intel.com>
12581
12582 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
12583 $(LIBDL).
12584 (incremental_dump_LDADD): Likewise.
12585 * Makefile.in: Regenerated.
12586
a6d1ef57 125872009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 12588
a6d1ef57
DK
12589 Revert:
12590
12591 2009-11-25 Doug Kwan <dougkwan@google.com>
12592
12593 * arm.cc (Target_arm::Target_arm): Move method definition
12594 outside of class definition. Add code to handle
12595 --target1-rel, --target1-abs and --target2= options.
12596 (Target_arm::get_reloc_reloc_type): Change method to be
12597 non-static and const.
12598 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
12599 New data member declaration.
12600 (Target_arm::Scan::local, Target_arm::Scan::global,
12601 Target_arm::Relocate::relocate,
12602 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12603 Adjust call to Target_arm::get_real_reloc_type.
12604 (Target_arm::get_real_reloc_type): Use command line options
12605 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12606 * options.h (--target1-rel, --target1-abs, --target2): New
12607 ARM-only options.
12608
50aeb7d4
DK
126092009-11-25 Doug Kwan <dougkwan@google.com>
12610
12611 * arm.cc (Target_arm::Target_arm): Move method definition outside of
12612 class definition. Add code to handle --target1-rel, --target1-abs
12613 and --target2= options.
12614 (Target_arm::get_reloc_reloc_type): Change method to be non-static
12615 and const.
12616 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
12617 member declaration.
12618 (Target_arm::Scan::local, Target_arm::Scan::global,
12619 Target_arm::Relocate::relocate,
12620 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
12621 call to Target_arm::get_real_reloc_type.
12622 (Target_arm::get_real_reloc_type): Use command line options to
12623 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12624 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
12625 options.
12626
51938283
DK
126272009-11-25 Doug Kwan <dougkwan@google.com>
12628
12629 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
12630 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
12631 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
12632 formatting.
12633 (Arm_relocate_functions::thm_call): Replace body with a call to
12634 Arm_relocate_functions::thumb_branch_common.
12635 (Arm_relocate_functions::thm_jump24,
12636 Arm_relocate_functions::thm_xpc22): New method definitions.
12637 (Arm_relocate_functions::thumb_branch_common): New method definition.
12638 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
12639 operator.
12640 (Target_arm::Relocate::relocate): Adjust call to thm_call.
12641 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
12642
e2b8f3c4
RÁE
126432009-11-24 Rafael Avila de Espindola <espindola@google.com>
12644
12645 * Makefile.am: Build incremental-dump
12646 * Makefile.in: Regenerate.
12647 * incremental-dump.cc: New.
12648 * incremental.cc (Incremental_inputs_header_data,
12649 Incremental_inputs_entry_data): Move to incremental.h
12650 * incremental.h: (Incremental_inputs_header_data,
12651 Incremental_inputs_entry_data): Move from incremental.cc
12652
bcba9aec
RÁE
126532009-11-24 Rafael Avila de Espindola <espindola@google.com>
12654
12655 * incremental.cc (Incremental_inputs_header,
12656 Incremental_inputs_header_write, Incremental_inputs_entry,
12657 Incremental_inputs_entry_write): Add a typedef with the data type.
12658
7c3afe08
RÁE
126592009-11-24 Rafael Avila de Espindola <espindola@google.com>
12660
12661 * incremental.cc (Incremental_inputs_header,
12662 Incremental_inputs_header_write, Incremental_inputs_entry,
12663 Incremental_inputs_entry_write): Update comment about which
12664 type has the filed descriptions.
12665
d204b6e9
DK
126662009-11-15 Doug Kwan <dougkwan@google.com>
12667
12668 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
12669 (Arm_relocate_functions::arm_branch_common): Change method defintion
12670 in class definition to a method declaration and update list of formal
12671 parameters.
12672 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
12673 Arm_relocation_functions::jump24): Adjust call to
12674 Arm_relocate_functions::arm_branch_common. Update list of formal
12675 parameters.
12676 (Arm_relocate_functions::xpc25): New method definition.
12677 (Arm_relocate_functions::arm_branch_common): Move method defintion
12678 out from class definition. Use stubs for mode-switching and extending
12679 branch ranges.
12680 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
12681 specially. Change code to enable use of stubs in ARM branches.
12682
43d12afe
DK
126832009-11-10 Doug Kwan <dougkwan@google.com>
12684
12685 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
12686 in method declaration.
12687 (Target_arm::relocate_stub): New method declaration.
12688 (Target_arm::default_target): Change to return a pointer instead of
12689 a const reference.
12690 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
12691 Target_arm::default_target.
12692 (Arm_Relobj::do_relocate_sections): Remove options paramater in
12693 method definition.
12694 (Target_arm::relocate_section): Adjust view.
12695 (Target_arm::relocate_stub): New method definition.
12696
ac33a407
DK
126972009-11-10 Doug Kwan <dougkwan@google.com>
12698
12699 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
12700 a format warning.
12701 * incremental.cc (open_incremental_binary): Initialized local
12702 variables to avoid warnings.
12703 * object.cc (make_elf_object): Ditto.
12704 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
12705 a format warning.
e1df38aa 12706
88ee28e9
L
12707009-11-09 H.J. Lu <hongjiu.lu@intel.com>
12708
12709 PR gold/10930
12710 * testsuite/plugin_test.c: Include "config.h".
12711
2daedcd6
DK
127122009-11-09 Doug Kwan <dougkwan@google.com>
12713
12714 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
12715 (arm_symbol_value): Remove.
12716 (Arm_relocate_functions::arm_branch_common,
12717 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
12718 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
12719 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
12720 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
12721 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
12722 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
12723 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
12724 Arm_relocate_functions::thm_mobw_abs_nc,
12725 Arm_relocate_functions::thm_mov_abs,
12726 Arm_relocate_functions::movw_prel_nc,
12727 Arm_relocate_functions::thm_movt_abs,
12728 Arm_relocate_functions::movt_prel,
12729 Arm_relocate_functions::thm_movw_prel_nc,
12730 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
12731 (Target_arm::Relocate::relocate): Only decompose address into two
12732 parts if relocation type uses the thumb-bit and pass the actual
12733 bit instead of a flag indicating that the thumb-bit is used. Adjust
12734 calls to methods in Arm_relocate_functions for this change.
12735
1276bc89 127362009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
12737
12738 PR 10925
12739 * reloc.cc: Instantiate
12740 Sized_relobj::initialize_input_to_output_maps and
12741 Sized_relobj:free_input_to_output_maps.
12742
e53ad1b5
ILT
127432009-11-06 Ian Lance Taylor <iant@google.com>
12744
12745 PR 10876
12746 * defstd.cc (in_segment): Set only_if_ref true for "end".
12747
eb44217c
DK
127482009-11-06 Doug Kwan <dougkwan@google.com>
12749
12750 * arm.cc (class Reloc_stub): Correct a comment.
12751 (Target_arm::Target_arm): Initialize arm_input_section_map_.
12752 (Target_arm::scan_section_for_stubs): New method declaration.
12753 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
12754 Change methods from private to protected.
12755 (Target_arm::do_may_relax): New method definition.
12756 (Target_arm::do_relax, Target_arm::group_sections,
12757 Target_arm::scan_reloc_for_stub,
12758 Target_arm::scan_reloc_section_for_stubs): New method declarations.
12759 (Target_arm::arm_input_section_map_): New data member declaration.
12760 (Target_arm::scan_reloc_for_stub,
12761 Target_arm::scan_reloc_section_for_stubs,
12762 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
12763 Target_arm::do_relax): New method definitions.
12764
5d329b7d
ILT
127652009-11-06 Mikolaj Zalewski <mikolaj@google.com>
12766
12767 * configure.ac: Check for (struct stat)::st_mtim
12768 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
12769 * config.in: Regenerate.
12770 * configure: Regenerate.
12771
96a0d71b
ILT
127722009-11-05 Ian Lance Taylor <iant@google.com>
12773
12774 PR 10910
12775 * output.cc (Output_segment::add_output_section): Add missing
12776 return statement.
12777
594c8e5e
ILT
127782009-11-04 Ian Lance Taylor <iant@google.com>
12779
12780 PR 10880
12781 * object.h (class Object): Add is_needed and set_is_needed
12782 methods. Add is_needed_ field. Make bool fields into bitfields.
12783 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
12784 defined in a dynamic object and referenced by a regular object,
12785 set is_needed for the dynamic object.
12786 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
12787 if the file is marked with as_needed and it is not needed.
12788
22b127cc
ILT
127892009-11-04 Ian Lance Taylor <iant@google.com>
12790
12791 PR 10887
12792 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
12793 tags if data is discarded by linker script.
12794 * i386.cc (Target_i386::do_finalize_sections): Likewise.
12795 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
12796 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
12797 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
12798
f5c870d2
ILT
127992009-11-04 Ian Lance Taylor <iant@google.com>
12800
12801 * layout.cc (Layout::get_output_section): Add is_interp and
12802 is_dynamic_linker_section parameters. Change all callers.
12803 (Layout::choose_output_section): Likewise.
12804 (Layout::make_output_section): Likewise.
12805 (Layout::add_output_section_data): Add is_dynamic_linker_section
12806 parameter. Change all callers.
12807 * layout.h (class Layout): Update declarations.
12808 * output.h (class Output_section): Add is_interp, set_is_interp,
12809 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
12810 Add is_interp_, is_dynamic_linker_section_ fields. Change
12811 generate_code_fills_at_write_ to a bitfield.
12812 * output.cc (Output_section::Output_sections): Initialize new
12813 fields.
12814 (Output_segment::add_output_section): Add do_sort parameter.
12815 Change all callers.
12816
1ae4d23b
ILT
128172009-11-03 Ian Lance Taylor <iant@google.com>
12818
12819 PR 10860
12820 * options.h (class General_options): Add --warn-common.
12821 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
12822 merging two common symbols.
12823 (Symbol_table::should_override): Handle --warn-common when merging
12824 a common symbol with a defined symbol. Use report_resolve_problem
12825 for multiple definitions.
12826 (Symbol_table::report_resolve_problem): New function.
12827 * symtab.h (class Symbol_table): Declare report_resolve_problem.
12828
55da9579
DK
128292009-11-03 Doug Kwan <dougkwan@google.com>
12830
12831 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
12832 stub_factory_.
12833 (Target_arm::stub_factory): New method definition.
12834 (Target_arm::new_arm_input_section,
12835 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
12836 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 12837 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
12838 New type definitions.
12839 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
12840 member declarations.
12841 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
12842 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
12843 New method definitions.
12844
37a9ac43
ILT
128452009-11-03 Ian Lance Taylor <iant@google.com>
12846
12847 * options.h (class General_options): Add --warn_constructors.
12848
b3d6a3d4
ILT
128492009-11-03 Ian Lance Taylor <iant@google.com>
12850
12851 PR 10893
12852 * defstd.cc (in_section): Add entries for __rel_iplt_start,
12853 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
12854
934b01dd
ILT
128552009-11-03 Ian Lance Taylor <iant@google.com>
12856
12857 PR 10895
12858 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
12859 --msgid-bugs-address.
12860 (install-pdf): New target.
12861 (install-data_yes): Look up one directory to find mkinstalldirs.
12862
03c1939b
L
128632009-11-03 H.J. Lu <hongjiu.lu@intel.com>
12864
12865 * po/Make-in (.po.gmo): Don't generate .gmo files in source
12866 tree.
12867
ebd95253
DK
128682009-10-30 Doug Kwan <dougkwan@google.com>
12869
12870 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
12871
e9bbb538
DK
128722009-10-30 Doug Kwan <dougkwan@google.com>
12873
12874 * arm.cc (Stub_addend_reader): New struct template definition
12875 and partial specializations.
12876 (Stub_addend_reader::operator()): New method definition for a
12877 partially specialized template.
12878
d5b40221
DK
128792009-10-30 Doug Kwan <dougkwan@google.com>
12880
12881 * arm.cc (Arm_relobj::processor_specific_flags): New method
12882 definition.
12883 (Arm_relobj::do_read_symbols): New method declaration.
12884 (Arm_relobj::processor_specific_flags_): New data member declaration.
12885 (Arm_dynobj): New class definition.
12886 (Target_arm::do_finalize_sections): Add input_objects parameter.
12887 (Target_arm::do_adjust_elf_header): New method declaration.
12888 (Target_arm::are_eabi_versions_compatible,
12889 (Target_arm::merge_processor_specific_flags): New method declaration.
12890 (Target_arm::do_make_elf_object): New overloaded method definitions
12891 and declaration.
12892 (Arm_relobj::do_read_symbols): New method definition.
12893 (Arm_dynobj::do_read_symbols): Ditto.
12894 (Target_arm::do_finalize_sections): Add input_objects parameters.
12895 Merge processor-specific flags from all input objects.
12896 (Target_arm::are_eabi_versions_compatible,
12897 Target_arm::merge_processor_specific_flags,
12898 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
12899 New method definitions.
12900 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
12901 Input_objects pointer type parameter.
12902 * layout.cc (Layout::finalize): Pass input objects to target's.
12903 finalize_sections function.
12904 * output.cc (Output_file_header::do_sized_write): Set ELF file
12905 header's processor-specific flags.
12906 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
12907 Input_objects pointer type parameter.
12908 * sparc.cc (Target_sparc::do_finalize_sections): Same.
12909 * target.h (Input_objects): New forward class declaration.
12910 (Target::processor_specific_flags,
12911 Target::are_processor_specific_flags_sect): New method definitions.
12912 (Target::finalize_sections): Add input_objects parameter.
12913 (Target::Target): Initialize processor_specific_flags_ and
12914 are_processor_specific_flags_set_.
12915 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
12916 parameter.
12917 (Target::set_processor_specific_flags): New method definition.
12918 (Target::processor_specific_flags_,
12919 Target::are_processor_specific_flags_set_): New data member
12920 declarations.
12921 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
12922 Input_objects pointer type parameter.
12923
ebabffbd
DK
129242009-10-30 Doug Kwan <dougkwan@google.com>
12925
12926 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
12927
ad0f2072
ILT
129282009-10-28 Ian Lance Taylor <iant@google.com>
12929
12930 * object.h (class Relobj): Drop options parameter from
12931 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
12932 do_scan_relocs, do_relocate. Change all callers.
12933 (class Sized_relobj): Drop options parameters from
12934 do_gc_process_relocs, do_scan_relocs, do_relocate,
12935 do_relocate_sections, relocate_sections, emit_relocs_scan,
12936 emit_relocs_scan_reltype. Change all callers.
12937 (struct Relocate_info): Remove options field and all references to
12938 it.
12939 * reloc.h (class Read_relocs): Remove options constructor
12940 parameter and options_ field. Change all callers.
12941 (class Gc_process_relocs, class Scan_relocs): Likewise.
12942 (class Relocate_task): Likewise.
12943 * target-reloc.h (scan_relocs): Remove options parameter. Change
12944 all callers.
12945 (scan_relocatable_relocs): Likewise.
12946 * target.h (class Sized_target): Remove options parameter from
12947 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
12948 all callers.
12949 * gc.h (gc_process_relocs): Remove options parameter. Change all
12950 callers.
12951 * arm.cc: Update functions to remove options parameters.
12952 * i386.cc: Likewise.
12953 * powerpc.cc: Likewise.
12954 * sparc.cc: Likewise.
12955 * x86_64.cc: Likewise.
12956 * testsuite/testfile.cc: Likewise.
12957
8ffa3667
DK
129582009-10-28 Doug Kwan <dougkwan@google.com>
12959
12960 * arm.cc (Arm_relobj): New class definition.
e1df38aa 12961 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
12962 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
12963 New method definitions.
12964
40f36857
CC
129652009-10-28 Cary Coutant <ccoutant@google.com>
12966
12967 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
12968 (Plugin::cleanup_done_): New member.
12969 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
12970 (Plugin_manager::cleanup_done_): Remove.
12971 (Plugin_manager::add_input_file): Edit error message.
12972 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
12973 (Plugin_manager::cleanup): Remove use of cleanup_done_.
12974
2c849493
ILT
129752009-10-27 Mikolaj Zalewski <mikolajz@google.com>
12976
12977 * fileread.cc: (File_read::View::~View): Use the new
12978 data_ownership_ filed.
12979 (File_read::~File_read): Dispose the new whole_file_view_.
12980 (File_read::open): Mmap the whole file if needed.
12981 (File_read::open): Use whole_file_view_ instead of contents_.
12982 (File_read::find_view): Use whole_file_view_ if applicable.
12983 (File_read::do_read): Use whole_file_view_ instead of contents_.
12984 (File_read::make_view): Use whole_file_view_ instead of contents_,
12985 update File_read::View::View call.
12986 (File_read::find_or_make_view): Update File_read::View::View
12987 call.
12988 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
12989 remove contents_
12990 (File_read::View::Data_ownership): New enum.
12991 (File_read::View::View): Replace bool mapped_ with Data_ownership
12992 argument.
12993 (File_read::View::mapped_): Remove (replaced by data_ownership_).
12994 (File_read::View::data_ownership_): New field.
12995 (File_read::contents_): Remove (replaced by whole_file_view_).
12996 (File_read::whole_file_view_): New field.
12997 * options.h (class General_options): Add --keep-files-mapped.
12998
24998053
CC
129992009-10-27 Cary Coutant <ccoutant@google.com>
13000
13001 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
13002 * testsuite/Makefile.am (plugin_test_5): New test case.
13003 * testsuite/Makefile.in: Regenerate.
13004
72adc4fa
DK
130052009-10-25 Doug Kwan <dougkwan@google.com>
13006
13007 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
13008 from private to protected to allow access by child class.
13009 (Sized_relobj::do_relocate_sections): New method declaration.
13010 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 13011 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
13012 Sized_relobj::relocate_sections. Instantiate template explicitly
13013 for different target sizes and endianity.
13014
07f508a2
DK
130152009-10-24 Doug Kwan <dougkwan@google.com>
13016
13017 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
13018 (Arm_input_section::as_arm_input_section): New method.
13019 (Arm_output_section): New class definition.
13020 (Arm_output_section::create_stub_group,
13021 Arm_output_section::group_sections): New method definitions.
13022
10ad9fe5
DK
130232009-10-22 Doug Kwan <dougkwan@google.com>
13024
13025 * arm.cc (Arm_input_section): New class definition.
13026 (Arm_input_section::init, Arm_input_section:do_write,
13027 Arm_input_section::set_final_data_size,
13028 Arm_input_section::do_reset_address_and_file_offset): New method
13029 definitions.
13030
56ee5e00
DK
130312009-10-21 Doug Kwan <dougkwan@google.com>
13032
13033 * arm.cc (Stub_table, Arm_input_section): New forward class
13034 declarations.
13035 (Stub_table): New class defintion.
13036 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
13037 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
13038 New method definition.
13039
b569affa
DK
130402009-10-21 Doug Kwan <dougkwan@google.com>
13041
13042 * arm.cc: Update copyright comments.
13043 (Target_arm): New forward class template declaration.
13044 (Arm_address): New type.
13045 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
13046 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
13047 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
13048 constants.
13049 (Insn_template): Same.
13050 (DEF_STUBS): New macro.
13051 (Stub_type): New enum type.
13052 (Stub_template): New class definition.
13053 (Stub): Same.
13054 (Reloc_stub): Same.
13055 (Stub_factory): Same.
13056 (Target_arm::Target_arm): Initialize may_use_blx_ and
13057 should_force_pic_veneer_.
13058 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
13059 Target_arm::should_force_pic_veneer,
13060 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
13061 Target_arm::using_thumb_only, Target_arm:;default_target): New
13062 method defintions.
13063 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
13064 New data member declarations.
13065 (Insn_template::size, Insn_template::alignment): New method defintions.
13066 (Stub_template::Stub_template): New method definition.
13067 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
13068 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
13069 (Stub_factory::Stub_factory): New method definition.
13070 * gold.h (string_hash): New template.
13071 * output.h (Input_section_specifier::hash_value): Use
13072 gold::string_hash.
13073 (Input_section_specifier::string_hash): Remove.
13074 * stringpool.cc (Stringpool_template::string_hash): Use
13075 gold::string_hash.
13076
6c172549
DK
130772009-10-20 Doug Kwan <dougkwan@google.com>
13078
13079 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
13080 symbols of relaxed input sections.
13081 * output.h (Output_section::find_relaxed_input_section): Make
13082 method public.
13083
c5617f2f
DK
130842009-10-16 Doug Kwan <dougkwan@google.com>
13085
13086 * dynobj.cc (Versions::Versions): Initialize version_script_.
13087 Only insert base version symbol definition for a shared object
13088 if version script defines any version versions.
13089 (Versions::define_base_version): New method definition.
13090 (Versions::add_def): Check that base version is not needed.
13091 (Versions::add_need): Define base version lazily.
13092 * dynobj.h (Versions::define_base_version): New method declaration.
13093 (Versions::needs_base_version_): New data member declaration.
13094 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
13095 (check_DATA): Add no_version_test.stdout.
13096 (libno_version_test.so, no_version_test.o no_version_test.stdout):
13097 New make rules.
13098 * testsuite/Makefile.in: Regenerate.
13099 * testsuite/no_version_test.c: New file.
13100 * testsuite/no_version_test.sh: Ditto.
13101
3c12dcdb
DK
131022009-10-16 Doug Kwan <dougkwan@google.com>
13103
13104 * expression.cc (class Segment_start_expression): New class definition.
13105 (Segment_start_expression::value): New method definition.
13106 (script_exp_function_segment_start): Return a new
13107 Segment_start_expression.
13108 * gold/script-c.h (script_saw_segment_start_expression): New function
13109 prototype.
13110 * script-sections.cc (Script_sections::Script_sections): Initialize
13111 SAW_SEGMENT_START_EXPRESSION_ to false.
13112 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
13113 and -Tbbs options to specify section addresses if given in
13114 command line and no SEGMENT_START expression is seen in a script.
13115 * script-sections.h (Script_sections::saw_segment_start_expression,
13116 Script_sections::set_saw_segment_start_expression): New method
13117 definition.
13118 (Script_sections::saw_segment_start_expression_): New data member
13119 declaration.
13120 * script.cc (script_saw_segment_start_expression): New function.
13121 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
13122 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
13123 script_test_7.sh and script_test_8.sh.
13124 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
13125 script_test_8.stdout.
13126 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
13127 (script_test_6, script_test_6.stdout, script_test_7,
13128 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
13129 * Makefile.in: Regenerate.
13130 * testsuite/script_test_6.sh: New file.
13131 * testsuite/script_test_6.t: Same.
13132 * testsuite/script_test_7.sh: Same.
13133 * testsuite/script_test_7.t: Same.
13134 * testsuite/script_test_8.sh: Same.
13135
64b1ae37
DK
131362009-10-16 Doug Kwan <dougkwan@google.com>
13137
13138 * output.cc (Output_segment::set_section_list_address): Cast
13139 expressions to unsigned long long type to avoid format warnings.
13140
661be1e2
ILT
131412009-10-15 Ian Lance Taylor <iant@google.com>
13142
12edd763 13143 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 13144 dot assignment to script_sections_.
12edd763
ILT
13145 * script-sections.cc (Script_sections::add_dot_assignment):
13146 Initialize if necessary.
13147
68b6574b
ILT
13148 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
13149 program headers with no load segment if there is a linker script.
13150
661be1e2
ILT
13151 * layout.cc (Layout::set_segment_offsets): Align the file offset
13152 to the segment aligment for -N or -n with no load segment.
13153 * output.cc (Output_segment::add_output_section): Don't crash if
13154 the first section is a TLS section.
13155 (Output_segment::set_section_list_addresses): Print an error
13156 message if the address moves backward in a linker script.
13157 * script-sections.cc
13158 (Output_section_element_input::set_section_addresses): Don't
13159 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
13160 (Orphan_output_section::set_section_addresses): Likewise.
13161
f15f61a7
DK
131622009-10-15 Doug Kwan <dougkwan@google.com>
13163
13164 * layout.cc (Layout::finish_dynamic_section): Generate tags
13165 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
13166 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
13167 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
13168
82bb573a
ILT
131692009-10-14 Ian Lance Taylor <iant@google.com>
13170
13171 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
13172 fields.
13173 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
13174 data_shdr fields of relinfo.
13175 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
13176 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
13177 R_386_TLS_LDO_32, adjust based on section flags.
13178 (Target_i386::Relocate::fix_up_ldo): Remove.
13179
374ad285
ILT
131802009-10-13 Ian Lance Taylor <iant@google.com>
13181
13182 Add support for -pie.
13183 * options.h (class General_options): Add -pie and
13184 --pic-executable.
13185 (General_options::output_is_position_independent): Test -pie.
13186 (General_options::output_is_executable): Return true if not shared
13187 and not relocatable.
13188 (General_options::output_is_pie): Remove.
13189 * options.cc (General_options::finalize): Reject incompatible uses
13190 of -pie.
13191 * gold.cc (queue_middle_tasks): A -pie link is not static.
13192 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
13193 * symtab.cc (Symbol::final_value_is_known): Return false if
13194 output_is_position_independent.
13195 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
13196 output_is_position_independent.
13197 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
13198 output_is_position_independent.
13199 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
13200 output_is_position_independent.
13201 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
13202 two_file_pie_test.
13203 (basic_pie_test.o, basic_pie_test): New targets.
13204 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
13205 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
13206 (two_file_pie_test): New target.
13207 * testsuite/Makefile.in: Rebuild.
13208 * README: Remove note saying that -pie is not supported.
13209
c6585162
ILT
132102009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
13211
13212 * options.h (class General_options): Add -init and -fini.
13213 * layout.cc (Layout::finish_dynamic_section): Emit
13214 given init and fini functions.
13215
032ce4e9
ST
132162009-10-13 Sriraman Tallam <tmsriram@google.com>
13217
13218 * gc.h (gc_process_relocs): Check if icf is enabled using new
13219 function.
13220 * gold.cc (queue_initial_tasks): Likewise.
13221 (queue_middle_tasks): Likewise.
13222 * object.cc (do_layout): Likewise.
13223 * symtab.cc (is_section_folded): Likewise.
13224 * main.cc (main): Likewise.
13225 * reloc.cc (Read_relocs::run): Likewise.
13226 (Sized_relobj::do_scan_relocs): Likewise.
13227 * icf.cc (is_function_ctor_or_dtor): New function.
13228 (Icf::find_identical_sections): Check if function is ctor or dtor when
13229 safe icf is chosen.
13230 * options.h (General_options::icf): Change option to be an enum.
13231 (Icf_status): New enum.
13232 (icf_enabled): New method.
13233 (icf_safe_folding): New method.
13234 (set_icf_status): New method.
13235 (icf_status_): New variable.
13236 * (options.cc) (General_options::finalize): Set icf_status_.
13237 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
13238 icf_test and icf_keep_unique_test to use the --icf enum flag.
13239 * testsuite/icf_safe_test.sh: New file.
e1df38aa 13240 * testsuite/icf_safe_test.cc: New file.
032ce4e9 13241
f345227a
ST
132422009-10-12 Sriraman Tallam <tmsriram@google.com>
13243
13244 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
13245 includes to gc.h and icf.h.
13246 * arm.cc: Include gc.h.
13247 * gold.cc: Likewise.
13248 * i386.cc: Likewise.
13249 * powerpc.cc: Likewise.
13250 * sparc.cc: Likewise.
13251 * x86_64.cc: Likewise.
13252 * gc.h: Include icf.h.
13253
1c7814ed
ILT
132542009-10-11 Ian Lance Taylor <iant@google.com>
13255
13256 * plugin.cc: Include "gold.h" before other header files.
13257
ae3b5189
CD
132582009-10-10 Chris Demetriou <cgd@google.com>
13259
13260 * options.h (Input_file_argument::Input_file_type): New enum.
13261 (Input_file_argument::is_lib_): Replace with...
13262 (Input_file_argument::type_): New member.
13263 (Input_file_argument::Input_file_argument): Take Input_file_type
13264 'type' rather than boolean 'is_lib' as second argument.
13265 (Input_file_argument::is_lib): Use type_.
13266 (Input_file_argument::is_searched_file): New function.
13267 (Input_file_argument::may_need_search): Handle is_searched_file.
13268 * options.cc (General_options::parse_library): Support -l:filename.
13269 (General_options::parse_just_symbols): Update for Input_file_argument
13270 changes.
13271 (Command_line::process): Likewise.
13272 * archive.cc (Archive::get_file_and_offset): Likewise.
13273 * plugin.cc (Plugin_manager::release_input_file): Likewise.
13274 * script.cc (read_script_file, script_add_file): Likewise.
13275 * fileread.cc (Input_file::Input_file): Likewise.
13276 (Input_file::will_search_for): Handle is_searched_file.
13277 (Input_file::open): Likewise.
13278 * readsyms.cc (Read_symbols::get_name): Likewise.
13279 * testsuite/Makefile.am (searched_file_test): New test.
13280 * testsuite/Makefile.in: Regenerate.
13281 * testsuite/searched_file_test.cc: New file.
13282 * testsuite/searched_file_test_lib.cc: New file.
13283
f3048a1d
ILT
132842009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13285 Ian Lance Taylor <iant@google.com>
13286
13287 * descriptor.cc: Include <cstdio> and "binary-io.h".
13288 (Descriptors::open): Open the files in binary mode always.
13289 * script.cc (Lex::get_token): Treat \r as whitespace.
13290
d4780e57
ILT
132912009-10-09 Ian Lance Taylor <iant@google.com>
13292
13293 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
13294
d9a893b8
ILT
132952009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13296 Ian Lance Taylor <iant@google.com>
13297
13298 * configure.ac: Check for readv function also.
13299 * fileread.cc (readv): Define if not HAVE_READV.
13300 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
13301 does not exist.
13302 * config.in: Regenerate.
13303 * configure: Regenerate.
13304
c0a62865
DK
133052009-10-09 Doug Kwan <dougkwan@google.com>
13306
13307 * layout.cc (Layout::make_output_section): Call target hook to make
13308 ordinary output section.
13309 (Layout::finalize): Adjust parameter list of call the
13310 Target::may_relax().
13311 * layout.h (class Layout::section_list): New method.
13312 * merge.h (Output_merge_base::entsize): Change visibility to public.
13313 (Output_merge_base::is_string, Output_merge_base::do_is_string):
13314 New methods.
13315 (Output_merge_string::do_is_string): New method.
13316 * object.cc (Sized_relobj::do_setup): renamed from
13317 Sized_relobj::set_up.
13318 * object.h (Sized_relobj::adjust_shndx,
13319 Sized_relobj::initializ_input_to_output_maps,
13320 Sized_relobj::free_input_to_output_maps): Change visibilities to
13321 protected.
13322 (Sized_relobj::setup): Virtualize.
13323 (Sized_relobj::do_setup): New method declaration.
13324 (Sized_relobj::invalidate_section_offset,
13325 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
13326 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
13327 * options.cc (parse_int): New function.
13328 * options.h (parse_int): New declaration.
13329 (DEFINE_int): New macro.
13330 (stub_group_size): New option.
13331 * output.cc (Output_section::Output_section): Initialize memebers
13332 merge_section_map_, merge_section_by_properties_map_,
13333 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
13334 (Output_section::add_input_section): Handled deferred code-fill
13335 generation and remove an old comment.
13336 (Output_section::add_relaxed_input_section): New method definition.
13337 (Output_section::add_merge_input_section): Use merge section by
13338 properties map to speed to search. Update merge section maps
13339 as appropriate.
13340 (Output_section::build_relaxation_map): New method definition.
13341 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
13342 Same.
13343 (Output_section::relax_input_section): Renamed to
13344 Output_section::convert_input_sections_to_relaxed_sections and change
13345 interface to take a vector of pointers to relaxed sections.
13346 (Output_section::find_merge_section,
13347 Output_section::find_relaxed_input_section): New method definitions.
13348 (Output_section::is_input_address_mapped,
13349 Output_section::output_offset, Output_section::output_address):
13350 Use output section data maps to speed up searching.
13351 (Output_section::find_starting_output_address): Add comments.
13352 (Output_section::do_write,
13353 Output_section::write_to_postprocessing_buffer): Do code-fill
13354 generation as appropriate.
13355 (Output_section::get_input_sections): Invalidate relaxed input section
13356 map.
13357 (Output_section::restore_states): Adjust type of checkpoint .
13358 Invalidate relaxed input section map.
13359 * output.h (Output_merge_base): New class declaration.
13360 (Input_section_specifier): New class defintion.
13361 (class Output_relaxed_input_section) Change base class to
13362 Output_section_data_build.
13363 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
13364 base class initializer.
13365 (Output_section::add_relaxed_input_section): New method declaration.
13366 (Output_section::Input_section): Change visibility to protected.
2e702c99 13367 (Output_section::Input_section::relobj,
c0a62865
DK
13368 Output_section::Input_section::shndx): Handle relaxed input sections.
13369 Output_section::input_sections) Change visibility to protected. Also
13370 define overload to return a non-const pointer.
13371 (Output_section::Merge_section_properties): New class defintion.
13372 (Output_section::Merge_section_by_properties_map,
13373 Output_section::Output_section_data_by_input_section_map,
13374 Output_section::Relaxation_map): New types.
13375 (Output_section::relax_input_section): Rename method to
13376 Output_section::convert_input_sections_to_relaxed_sections and change
13377 interface to take a vector of relaxed section pointers.
13378 (Output_section::find_merge_section,
13379 Output_section::find_relaxed_input_section,
13380 Output_section::build_relaxation_map,
13381 Output_section::convert_input_sections_in_list_to_relaxed_sections):
13382 New method declarations.
13383 (Output_section::merge_section_map_
13384 Output_section::merge_section_by_properties_map_,
13385 Output_section::relaxed_input_section_map_,
13386 Output_section::is_relaxed_input_section_map_valid_,
13387 Output_section::generate_code_fills_at_write_): New data members.
13388 * script-sections.cc
13389 (Output_section_element_input::set_section_addresses): Call
13390 current_data_size and addralign methods of relaxed input sections.
13391 (Orphan_output_section::set_section_addresses): Call current_data_size
13392 and addralign methods of relaxed input sections.
13393 * symtab.cc (Symbol_table::compute_final_value): Extract template
13394 from the body of Symbol_table::sized_finalize_symbol.
13395 (Symbol_table::sized_finalized_symbol): Call
13396 Symbol_table::compute_final_value.
13397 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
13398 (Symbol_table::compute_final_value): New templated method declaration.
13399 * target.cc (Target::do_make_output_section): New method defintion.
13400 * target.h (Target::make_output_section): New method declaration.
13401 (Target::relax): Add more parameters for input objects, symbol table
13402 and layout. Adjust call to do_relax.
13403 (Target::do_make_output_section): New method declaration.
13404 (Target::do_relax): Add parameters for input objects, symbol table
13405 and layout.
13406
d446d6c4
ILT
134072009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13408
13409 * pread.c: Include stdio.h.
13410
bc06c745
ILT
134112009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13412
13413 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
13414 defined.
13415
75aea3d0
ILT
134162009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13417
13418 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
13419 Change read_shndx type to unsigned int.
13420 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13421 int.
13422 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13423 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
13424 Change read_shndx type to unsigned int.
13425 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13426 int.
13427 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13428 * layout.cc (Layout::create_symtab_sections): Cast the result of
13429 local_symcount * symsize to off_t in the gold_assert.
13430
be8fcb75
ILT
134312009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13432
13433 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
13434 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
13435 R_ARM_BASE_ABS.
13436 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
13437 (Arm_relocate_functions::thm_abs5): New function.
13438 (Arm_relocate_functions::abs12): New function.
13439 (Arm_relocate_functions::abs16): New function.
13440 (Arm_relocate_functions::base_abs): New function.
13441 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
13442 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
13443 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
13444 R_ARM_BASE_ABS.
13445 (Scan::global): Likewise.
13446 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
13447 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
13448 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
13449 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
13450 R_ARM_BASE_ABS.
13451
c2a122b6
ILT
134522009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13453
13454 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
13455 (Arm_relocate_functions::movt_prel): New function.
13456 (Arm_relocate_functions::thm_movw_prel_nc): New function.
13457 (Arm_relocate_functions::thm_movt_prel): New function.
13458 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
13459 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
13460 (Scan::global, Relocate::relocate): Likewise.
13461 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13462
c4aa1e2d
ILT
134632009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13464
13465 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
13466 Incremental_checker.
13467 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
13468 unsigned int.
13469 (class Incremental_inputs_header): New class.
13470 (Incremental_inputs_header_writer): Edit comment.
13471 (Incremental_inputs_entry): New class.
13472 (Incremental_inputs_entry_writer): Edit comment.
13473 (Sized_incremental_binary::do_find_incremental_inputs_section):
13474 Add *strtab_shndx parameter, fill it.
13475 (Sized_incremental_binary::do_check_inputs): New method.
13476 (Incremental_checker::can_incrementally_link_output_file): Use
13477 Sized_incremental_binary::check_inputs.
13478 (Incremental_inputs::report_command_line): Save command line in
13479 command_line_.
13480 * incremental.h:
13481 (Incremental_binary::find_incremental_inputs_section): New
13482 method.
13483 (Incremental_binary::do_find_incremental_inputs_section): Add
13484 strtab_shndx parameter.
13485 (Incremental_binary::do_check_inputs): New pure virtual method.
13486 (Sized_incremental_binary::do_check_inputs): Declare.
13487 (Incremental_checker::Incremental_checker): Add incremental_inputs
13488 parameter, use it to initialize incremental_inputs_.
13489 (Incremental_checker::incremental_inputs_): New field.
13490 (Incremental_checker::command_line): New method.
13491 (Incremental_checker::inputs): New method.
13492 (Incremental_checker::command_line_): New field.
13493
c549a694
ILT
134942009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13495
13496 * incremental.cc: Include <cstdarg> and "target-select.h".
13497 (vexplain_no_incremental): New function.
13498 (explain_no_incremental): New function.
13499 (Incremental_binary::error): New method.
13500 (Sized_incremental_binary::do_find_incremental_inputs_section): New
13501 method.
13502 (make_sized_incremental_binary): New function.
13503 (open_incremental_binary): New function.
13504 (can_incrementally_link_file): Add checks if output is ELF and has
13505 inputs section.
13506 * incremental.h: Include "elfcpp_file.h" and "output.h".
13507 (Incremental_binary): New class.
13508 (Sized_incremental_binary): New class.
13509 (open_incremental_binary): Declare.
13510 * object.cc (is_elf_object): Use
13511 elfcpp::Elf_recognizer::is_elf_file.
13512 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
13513 * output.h (Output_file::filesize): New method.
13514
fd3c5f0b
ILT
135152009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13516
13517 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
13518 New function.
13519 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
13520 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
13521 function.
13522 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
13523 function.
13524 (Arm_relocate_functions::movw_abs_nc): New function.
13525 (Arm_relocate_functions::movt_abs): New function.
13526 (Arm_relocate_functions::thm_movw_abs_nc): New function.
13527 (Arm_relocate_functions::thm_movt_abs): New function.
13528 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
13529 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
13530 (Scan::global): Likewise.
13531 (Relocate::relocate): Likewise.
13532 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13533
7f5309a5
ILT
135342009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13535
13536 * arm.cc (Arm_relocate_functions::got_prel) New function.
13537 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
13538 (Relocate::relocate): Likewise.
13539 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13540
364c7fa5
ILT
135412009-10-06 Ian Lance Taylor <iant@google.com>
13542
13543 * options.h (class General_options): Define
13544 split_stack_adjust_size parameter.
13545 * object.h (class Object): Add uses_split_stack_ and
13546 has_no_split_stack_ fields. Add uses_split_stack and
13547 has_no_split_stack accessor functions. Declare
13548 handle_split_stack_section.
13549 (class Reloc_symbol_changes): Define.
13550 (class Sized_relobj): Define Function_offsets. Declare
13551 split_stack_adjust, split_stack_adjust_reltype, and
13552 find_functions.
13553 * object.cc (Object::handle_split_stack_section): New function.
13554 (Sized_relobj::do_layout): Call handle_split_stack_section.
13555 * dynobj.cc (Sized_dynobj::do_layout): Call
13556 handle_split_stack_section.
13557 * reloc.cc (Sized_relobj::relocate_sections): Call
13558 split_stack_adjust for executable sections in split_stack
13559 objects. Pass reloc_map to relocate_section.
13560 (Sized_relobj::split_stack_adjust): New function.
13561 (Sized_relobj::split_stack_adjust_reltype): New function.
13562 (Sized_relobj::find_functions): New function.
13563 * target-reloc.h: Include "object.h".
13564 (relocate_section): Add reloc_symbol_changes parameter. Change
13565 all callers.
13566 * target.h (class Target): Add calls_non_split method. Declare
13567 do_calls_non_split virtual method. Declare match_view and
13568 set_view_to_nop.
13569 * target.cc: Include "elfcpp.h".
13570 (Target::do_calls_non_split): New function.
13571 (Target::match_view): New function.
13572 (Target::set_view_to_nop): New function.
13573 * gold.cc (queue_middle_tasks): Give an error if mixing
13574 split-stack and non-split-stack objects with -r.
13575 * i386.cc (Target_i386::relocate_section): Add
13576 reloc_symbol_changes parameter.
13577 (Target_i386::do_calls_non_split): New function.
13578 * x86_64.cc (Target_x86_64::relocate_section): Add
13579 reloc_symbol_changes parameter.
13580 (Target_x86_64::do_calls_non_split): New function.
13581 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
13582 parameter.
13583 * powerpc.cc (Target_powerpc::relocate_section): Add
13584 reloc_symbol_changes parameter.
13585 * sparc.cc (Target_sparc::relocate_section): Add
13586 reloc_symbol_changes parameter.
13587 * configure.ac: Call AM_CONDITIONAL for the default target.
13588 * configure: Rebuild.
13589 * testsuite/Makefile.am (TEST_AS): New variable.
13590 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
13591 (check_DATA): Add split_i386 and split_x86_64 files.
13592 (SPLIT_DEFSYMS): Define.
13593 (split_i386_[1234n].o): New targets.
13594 (split_i386_[124]): New targets.
13595 (split_i386_[1234r].stdout): New targets.
13596 (split_x86_64_[1234n].o): New targets.
13597 (split_x86_64_[124]): New targets.
13598 (split_x86_64_[1234r].stdout): New targets.
13599 (MOSTLYCLEANFILES): Add new executables.
13600 * testsuite/split_i386.sh: New file.
13601 * testsuite/split_x86_64.sh: New file.
13602 * testsuite/split_i386_1.s: New file.
13603 * testsuite/split_i386_2.s: New file.
13604 * testsuite/split_i386_3.s: New file.
13605 * testsuite/split_i386_4.s: New file.
13606 * testsuite/split_i386_n.s: New file.
13607 * testsuite/split_x86_64_1.s: New file.
13608 * testsuite/split_x86_64_2.s: New file.
13609 * testsuite/split_x86_64_3.s: New file.
13610 * testsuite/split_x86_64_4.s: New file.
13611 * testsuite/split_x86_64_n.s: New file.
13612 * testsuite/testfile.cc (Target_test): Update relocation_section
13613 function.
13614 * testsuite/Makefile.in: Rebuild.
13615
e8a9fcda
ILT
136162009-10-06 Ian Lance Taylor <iant@google.com>
13617
13618 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
13619 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
13620 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
13621 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
13622 the address on ldo_addrs_.
13623 (Target_i386::Relocate::fix_up_ldo): New function.
13624
e99daf92
ILT
136252009-10-06 Rafael Espindola <espindola@google.com>
13626
13627 * plugin.cc (add_input_library): New.
13628 (Plugin::load): Add add_input_library to tv.
13629 (Plugin_manager::add_input_file): Add the is_lib argument.
13630 (add_input_file): Update call to Plugin_manager::add_input_file.
13631 (add_input_library): New.
13632 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
13633
966d4097
DK
136342009-09-30 Doug Kwan <dougkwan@google.com>
13635
13636 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
13637 symbol and call Symbol::may_need_copy_reloc to determine if
13638 a copy reloc is needed.
13639 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
13640 nocopyreloc is given in command line.
13641 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
13642 given in command line.
13643 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
13644 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
13645 of the removed Target_i386::may_need_copy_reloc.
13646 * options.h (copyreloc): New option with default value false.
13647 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13648 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
13649 instead of the removed Target_powerpc::may_need_copy_reloc.
13650 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13651 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
13652 instead of the removed Target_sparc::may_need_copy_reloc.
13653 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
13654 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
13655 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
13656 instead of the removed Target_x86_64::may_need_copy_reloc.
13657
029ba973
ILT
136582009-09-30 Ian Lance Taylor <iant@google.com>
13659
13660 * object.h (class Object): Remove target_ field, and target,
13661 sized_target, and set_target methods.
13662 (Object::sized_target): Remove.
13663 (class Sized_relobj): Update declarations. Remove sized_target.
13664 * object.cc (Sized_relobj::setup): Remove target parameter.
13665 Change all callers.
13666 (Input_objects::add_object): Don't do anything with the target.
13667 (make_elf_sized_object): Add punconfigured parameter. Change all
13668 callers. Set or test parameter target.
13669 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
13670 Change all callers.
13671 * parameters.cc (Parameters::set_target): Change parameter type to
13672 be non-const.
13673 (Parameters::default_target): Remove.
13674 (set_parameters_target): Change parameter type to be non-const.
13675 (parameters_force_valid_target): New function.
13676 (parameters_clear_target): New function.
13677 * parameters.h (class Parameters): Update declarations. Remove
13678 default_target method. Add sized_target and clear_target
13679 methods. Change target_ to be non-const.
13680 (set_parameters_target): Update declaration.
13681 (parameters_force_valid_target): Declare.
13682 (parameters_clear_target): Declare.
13683 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
13684 as NULL if we aren't searching.
13685 (Add_symbols::run): Don't check for compatible target.
13686 * fileread.cc (Input_file::open_binary): Call
13687 parameters_force_valid_target.
13688 * gold.cc (queue_middle_tasks): Likewise.
13689 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
13690 set_target on object.
13691 * dynobj.h (class Sized_dynobj): Update declarations.
13692 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
13693 make_elf_object returns NULL.
13694 (Archive::include_member): Don't check whether object target is
13695 compatible.
13696 * output.cc (Output_section::add_input_section): Get target from
13697 parameters.
13698 (Output_section::relax_input_section): Likewise.
13699 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
13700 parameters.
13701 (Sized_relobj::do_scan_relocs): Likewise.
13702 (Sized_relobj::relocate_sections): Likewise.
13703 * resolve.cc (Symbol_table::resolve): Likewise.
13704 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
13705 parameter. Change all callers.
13706 (Symbol_table::add_from_object): Get target from parameters.
13707 (Symbol_table::add_from_relobj): Don't check object target.
13708 (Symbol_table::add_from_dynobj): Likewise.
13709 (Symbol_table::define_special_symbol): Get target from
13710 parameters.
13711 * symtab.h (class Symbol_table): Update declaration.
13712 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
13713 parameter. Change all callers. Clear parameter target.
13714 (Binary_test): Test target here.
13715 * testsuite/object_unittest.cc (gold_testsuite): Remove
13716 target_test_pointer parameter. Change all callers.
13717 (Object_test): Test target here.
13718
a6a22b83
ILT
137192009-09-26 Ian Lance Taylor <iant@google.com>
13720
13721 * testsuite/initpri1.c: Don't try to use constructor priorities if
13722 compiling with gcc before 4.3.
13723
6a8f49fe
ILT
137242009-09-22 Mikolaj Zalewski <mikolajz@google.com>
13725
13726 * testsuite/retain_symbols_file_test.sh (check_present): Change
13727 output file name to retain_symbols_file_test.stdout.
13728 (check_absent): Likewise.
13729
8c604651
CS
137302009-09-18 Craig Silverstein <csilvers@google.com>
13731
13732 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
13733 * options.cc: Include <cerrno> and <fstream>.
13734 (General_options::finalize): Parse -retain-symbols-file tag.
13735 * options.h: New flag.
13736 (General_options): New method should_retain_symbol, new
13737 variable symbols_to_retain.
13738 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
13739 should_retain_symbol map.
13740 * testsuite/Makefile.am (retain_symbols_file_test): New test.
13741 * testsuite/Makefile.in: Regenerate.
13742 * testsuite/retain_symbols_file_test.sh: New file.
13743
ca58b19f
NC
137442009-09-18 Nick Clifton <nickc@redhat.com>
13745
13746 * po/es.po: Updated Spanish translation.
13747
20e6d0d6
DK
137482009-09-17 Doug Kwan <dougkwan@google.com>
13749
13750 * debug.h (DEBUG_RELAXATION): New constant.
13751 (DEBUG_ALL): Add DEBUG_RELAXATION.
13752 (debug_string_to_enum): Add relaxation debug option.
13753 * layout.cc
13754 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
13755 Layout::Relaxation_debug_check::read_sections,
13756 Layout::Relaxation_debug_check::read_sections): New method definitions.
13757 (Layout::Layout): Initialize data members
13758 record_output_section_data_from_scrips_,
13759 script_output_section_data_list_ and relaxation_debug_check_.
13760 (Layout::save_segments, Layout::restore_segments,
13761 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13762 Layout::relaxation_loop_body): New method definitions.
13763 (Layout::finalize): Support relaxation. Move section layout code to
13764 Layout::relaxation_loop_body.
13765 (Layout::set_asection_address_from_script): Move code for orphan
13766 section placement out.
13767 (Layout::place_orphan_sections_in_script): New method definition.
13768 * layout.h (Output_segment_headers, Output_file_header):
13769 New forward class declarations.
13770 (Layout::~Layout): Define.
13771 (Layout::new_output_section_data_from_script): New method definition.
13772 (Layout::place_orphan_sections_in_script): New method declaration.
13773 (Layout::Segment_states): New type declaration.
13774 (Layout::save_segments, Layout::restore_segments,
13775 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13776 Layout::relaxation_loop_body): New method declarations.
13777 (Layout::Output_section_data_list): New type declaration.
13778 (Layout::Relaxation_debug_check): New class definition.
13779 (Layout::record_output_section_data_from_script_,
13780 Layout::script_output_section_data_list_, Layout::segment_states_,
13781 Layout::relaxation_debug_check_): New data members.
13782 * output.cc: (Output_section_headers::do_size): New method definition.
13783 (Output_section_headers::Output_section_headers): Move size
13784 computation to Output_section_headers::do_size.
13785 (Output_segment_headers::do_size): New method definition.
e1df38aa 13786 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
13787 Output_file_header::do_size and call it.
13788 (Output_file_header::do_size): New method definition.
13789 (Output_data_group::Output_data_group): Adjust call to
13790 Output_section_data.
13791 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
13792 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 13793 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
13794 RELAXED_INPUT_SECTION_CODE.
13795 (Output_section::Output_section): Initialize data member checkpoint_.
13796 (Output_section::~Output_section): Delete checkpoint object pointed
13797 by checkpoint_.
13798 (Output_section::add_input_section): Always add an Input_section if
13799 relaxing.
13800 (Output_section::add_merge_input_section): Add assert.
13801 (Output_section::relax_input_section): New method definition.
13802 (Output_section::set_final_data_size): Set load address to zero for
13803 an unallocated section.
13804 (Output_section::do_address_and_file_offset_have_reset_values):
13805 New method definition.
13806 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
13807 Handle relaxed input section.
13808 (Output_section::sort_attached_input_sections): Checkpoint input
13809 section list lazily.
13810 (Output_section::get_input_sections): Change type of input_sections to
13811 list of Simple_input_section pointers. Checkpoint input section list
13812 lazily. Also handle relaxed input sections.
13813 (Output_section::add_input_section_for_script): Take a reference to
13814 a Simple_input_section object instead of Relobj pointer and section
13815 index as parameter. Handle relaxed input sections.
13816 (Output_section::save_states, Output_section::restore_states): New
13817 method definitions.
13818 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
13819 (Output_data::is_data_size_fixed): New method definition.
13820 (Output_data::reset_addresss_and_file_offset): Do not reset data size
13821 if it is fixed.
13822 (Output_data::address_and_file_offset_have_reset_values): New method
13823 definition.
13824 (Output_data::do_address_and_file_offset_have_reset_values): New method
13825 definition.
13826 (Output_data::set_data_size): Check that data size is not fixed.
13827 (Output_data::fix_data_size): New method definition.
13828 (Output_data::is_data_size_fixed_): New data member.
13829 (Output_section_headers::set_final_data_size): New method definition.
13830 (Output_section_headers::do_size): New method declaration.
13831 (Output_segment_headers::set_final_data_size): New method definition.
13832 (Output_segment_headers::do_size): New method declaration.
13833 (Output_file_header::set_final_data_size)::New method definition.
13834 (Output_file_header::do_size)::New method declaration.
13835 (Output_section_data::Output_section_data): Add new parameter
13836 is_data_size_fixed and use it to fix data size.
13837 (Output_data_const::Output_data_const): Adjust call to base class
13838 constructor and fix data size.
13839 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
13840 base class constructor and fix data size.
13841 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
13842 base class constructor and fix data size.
13843 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
13844 class constructor and fix data size.
13845 (Output_data_group::set_final_data_size): New method definition.
13846 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
13847 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
13848 class constructor and fix data size.
13849 (Output_relaxed_input_section): New class definition.
13850 (Output_section::Simple_input_section): New class definition.
13851 (Output_section::get_input_sections): Adjust parameter list.
13852 (Output_section::add_input_section_for_script): Same.
13853 (Output_section::save_states, Output_section::restore_states,
13854 Output_section::do_address_and_file_offset_have_reset_values,
13855 (Output_section::Input_section::Input_section): Handle
13856 RELAXED_INPUT_SECTION_CODE. Add new overload for
13857 Output_relaxed_input_section.
13858 (Output_section::Input_section::is_input_section,
13859 Output_section::Input_section::set_output_section): Handle relaxed
13860 input section.
13861 (Output_section::Input_section::is_relaxed_input_section,
13862 Output_section::Input_section::output_section_data,
13863 Output_section::Input_section::relaxed_input_section): New method
13864 definitions.
13865 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
13866 value.
13867 (Output_section::Input_section::u1_): Update comments.
13868 (Output_section::Input_section::u2_): Add new union member poris.
13869 (Output_section::Checkpoint_output_section): New classs definition.
13870 (Output_section::relax_input_section): New method declaration.
13871 (Output_section::checkpoint_): New data member.
13872 (Output_segment): Update comments.
13873 (Output_segment::Output_segment): Un-privatize copy constructor.
13874 (Output_segment::operator=): Un-privatize.
13875 * script-sections.cc (Output_section_element::Input_section_list):
13876 Change element type to Output_section::Simple_input_section.
13877 (Output_section_element_dot_assignment::set_section_addresses):
13878 Register output section data for relaxation clean up.
13879 (Output_data_exression::Output_data_expression): Adjust call to base
13880 constructor to fix data size.
13881 (Output_section_element_data::set_section_addresses): Register
13882 Output_data_expression object for relaxation clean up.
13883 (struct Input_section_info): Replace Relobj pointer and section index
13884 pair with Output_section::Simple_input_section and Convert struct to a
13885 class.
13886 (Input_section_sorter::operator()): Adjust access to
e1df38aa 13887 Input_section_info data member to use accessors.
20e6d0d6
DK
13888 (Output_section_element_input::set_section_addresses): Use layout
13889 parameter. Adjust code to use Output_section::Simple_input_section
13890 and Input_secction_info classes. Register filler for relaxation
13891 clean up.
13892 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
13893 and section index pair with Output_section::Simple_input_section
13894 class. Adjust code accordingly.
13895 (Phdrs_element::release_segment): New method definition.
13896 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
13897 segment list.
13898 (Script_sections::release_segments): New method definition.
13899 * gold/script-sections.h (Script_sections::release_segments): New
13900 method declaration.
13901 * gold/target.h (Target::may_relax, Target::relax,
13902 Target::do_may_relax, Target::do_relax): New method definitions.
13903
5e445df6
ILT
139042009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13905
13906 * arm.cc (has_signed_unsigned_overflow): New function.
13907 (Arm_relocate_functions::abs8): New function.
13908 (Target_arm::Scan::local): Handle R_ARM_ABS8.
13909 (Target_arm::Scan::global): Likewise.
13910 (Target_arm::relocate::relocate): Likewise.
13911 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
13912 Likewise.
13913
8c604651 139142009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
13915
13916 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
13917 * testsuite/Makefile.in: Regenerate.
13918
1e9cc1c2
NC
139192009-09-11 Nick Clifton <nickc@redhat.com>
13920
13921 * po/gold.pot: Updated by the Translation project.
13922
6a89f575
CC
139232009-09-08 Cary Coutant <ccoutant@google.com>
13924
13925 * output.cc (Output_file::open): Add execute permission to empty file.
13926 * testsuite/Makefile.am (permission_test): New test.
13927 * testsuite/Makefile.in: Regenerate.
13928
fdcac5af
ILT
139292009-09-02 Ian Lance Taylor <iant@google.com>
13930
13931 * output.cc (Output_file::resize): Call map_no_anonymous rather
13932 than map.
13933
44453f85
ILT
139342009-09-01 Mikolaj Zalewski <mikolajz@google.com>
13935
13936 * gold.cc: Include "incremental.h".
13937 (queue_initial_tasks): Call Incremental_checker methods.
13938 * incremental.cc: Include "output.h".
13939 (Incremental_checker::can_incrementally_link_output_file): New
13940 method.
13941 * incremental.h (Incremental_checker): New class.
13942
13943 * output.cc (Output_file::open_for_modification): New method.
13944 (Output_file::map_anonymous): Changed return type to bool. Record
13945 map in base_ field.
13946 (Output_file::map_no_anonymous): New method, broken out of map.
13947 (Output_file::map): Use map_no_anonymous and map_anonymous.
13948 * output.h (class Output_file): Update declarations.
13949
293c1386
CC
139502009-08-24 Cary Coutant <ccoutant@google.com>
13951
13952 * options.h (Command_line::Pre_options): New class.
13953 (Command_line::pre_options): New member.
13954 * options.cc (gold::options::ready_to_register): New variable.
13955 (One_option::register_option): Do nothing if not registering options.
13956 Assert if same short option registered twice.
13957 (General_options::General_options): Turn off option registration when
13958 done constructing.
13959 (Command_line::Pre_options::Pre_options): New constructor.
13960
f773f3d2
CC
139612009-08-24 Cary Coutant <ccoutant@google.com>
13962
06a73cfe
CC
13963 * options.h (General_options::no_keep_memory): Remove incorrect
13964 short option.
f773f3d2 13965
a15af8e2
RW
139662009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13967
13968 * Makefile.am (am__skiplex, am__skipyacc): New.
13969 * Makefile.in: Regenerate.
13970
c462b41b
RW
139712009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13972
14ec8efd
RW
13973 * Makefile.am (AM_CPPFLAGS): Renamed from ...
13974 (INCLUDES): ... this.
13975 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
13976 (AM_CPPFLAGS): Renamed from ...
13977 (INCLUDE): ... this.
13978 * Makefile.in, testsuite/Makefile.in: Regenerate.
13979
81ecdfbb
RW
13980 * Makefile.in: Regenerate.
13981 * aclocal.m4: Likewise.
13982 * config.in: Likewise.
13983 * configure: Likewise.
13984 * testsuite/Makefile.in: Likewise.
13985
c462b41b
RW
13986 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
13987 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
13988 * Makefile.in: Regenerate.
13989 * testsuite/Makefile.in: Regenerate.
13990
2da73f13
CC
139912009-08-19 Cary Coutant <ccoutant@google.com>
13992
13993 * resolve.cc (Symbol_table::resolve): Don't complain about defined
13994 symbols in shared libraries overridden by hidden or internal symbols
13995 in the main program.
13996
2db70501
CD
139972009-08-19 Chris Demetriou <cgd@google.com>
13998
13999 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
14000 checking source file names in error messages.
14001
f733487b
DK
140022009-08-18 Doug Kwan <dougkwan@google.com>
14003
14004 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
14005 an elcpp::Ehdr as parameter. Adjust call to set_target.
14006 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
14007 an elfcpp::Ehdr as parameter.
14008 * object.cc (Object::set_target): Remove the version that looks up
14009 a target and sets it.
14010 (Sized_relobj::setup): Take a Target object instead of
14011 an elfcpp::Ehdr as parameter. Adjust call to set_target.
14012 (make_elf_sized_object): Find target and ask target to
14013 make an ELF object.
14014 * object.h: (Object::set_target): Remove the version that looks up
14015 a target and sets it.
14016 (Sized_relobj::setup): Take a Target object instead of
14017 an elfcpp:Ehdr as parameter.
14018 * target.cc: Include dynobj.h.
14019 (Target::do_make_elf_object_implementation): New.
2e702c99 14020 (Target::do_make_elf_object): New.
f733487b
DK
14021 * target.h (Target::make_elf_object): New template declaration.
14022 (Target::do_make_elf_object): New method declarations.
14023 (Target::do_make_elf_object_implementation): New template declaration.
14024
cc70f101
ILT
140252009-08-14 Ian Lance Taylor <iant@google.com>
14026
14027 * gold.h (FUNCTION_NAME): Define.
14028 (gold_unreachable): Use FUNCTION_NAME.
14029
ef5e0cb1
ST
140302009-08-12 Sriraman Tallam <tmsriram@google.com>
14031
14032 * icf.cc (Icf::find_identical_sections): Issue a warning when a
14033 symbol in the --keep-unique list is not found.
14034
48c187ce
ST
140352009-08-12 Sriraman Tallam <tmsriram@google.com>
14036
14037 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
14038 been maked as --keep-unique.
14039 (Icf::unfold_section): New function.
14040 * icf.h (Icf::unfold_section): New function.
14041 * options.h (General_options::keep_unique): New option.
14042 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
14043 * testsuite/Makefile.in: Regenerate.
14044 * testsuite/icf_keep_unique_test.sh: New file.
14045 * testsuite/icf_keep_unique_test.cc: New file.
14046
645afe0c
CC
140472009-08-12 Cary Coutant <ccoutant@google.com>
14048
14049 PR 10471
14050 * resolve.cc (Symbol_table::resolve): Check for references from
14051 dynamic objects to hidden and internal symbols.
14052 * testsuite/Makefile.am (hidden_test.sh): New test.
14053 * testsuite/Makefile.in: Regenerate.
14054 * testsuite/hidden_test.sh: New script.
14055 * testsuite/hidden_test_1.c: New test source.
14056 * testsuite/hidden_test_main.c: New test source.
14057
11af873f
DK
140582009-08-11 Doug Kwan <dougkwan@google.com>
14059
14060 * arm.cc: Update comments.
14061 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
14062 segment to locate the .ARM.exidx section if present.
14063
b9f7d72d
DK
140642009-08-09 Doug Kwan <dougkwan@google.com>
14065
14066 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
14067 patch.
14068
ddd3c53c
ST
140692009-08-07 Sriraman Tallam <tmsriram@google.com>
14070 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
14071 compiler warnings.
14072
27721062
ST
140732009-08-06 Sriraman Tallam <tmsriram@google.com>
14074
14075 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
14076 valid tls_segment only for non-debug-section relocations.
14077 * testsuite/Makefile.am: Add gc_tls_test.
14078 * testsuite/Makefile.in: Regenerate.
14079 * testsuite/gc_tls_test.cc: New file.
14080 * testsuite/gc_tls_test.sh: New file.
14081
ef15dade 140822009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 14083
ef15dade
ST
14084 * icf.cc: New file.
14085 * icf.h: New file.
14086 * Makefile.am (CCFILES): Add icf.cc.
14087 (HFILES): Add icf.h
14088 * Makefile.in: Regenerate.
14089 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
14090 * gc.h (gc_process_relocs): Populate lists used by icf to contain
14091 section, symbol and addend information for the relocs.
14092 * gold.cc (queue_middle_tasks): Call identical code folding.
14093 * gold.h: Add defines for multimap.
14094 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
14095 to the call of finalize_local_symbols.
14096 * main.cc (main): Create object of class Icf.
14097 * object.cc (Sized_relobj::do_layout): Allow this function to be
14098 called twice during icf.
14099 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
14100 to sections marked as identical by icf.
14101 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
14102 when available.
14103 (Sized_relobj::do_section_entsize): New function.
14104 * object.h (Object::section_entsize): New function.
14105 (Object::do_section_entsize): New pure virtual function.
14106 (Relobj::finalize_local_symbols): Add new parameter.
14107 (Relobj::do_section_entsize): New function.
14108 * options.h (General_options::icf): New option.
14109 (General_options::icf_iterations): New option.
14110 (General_options::print_icf_sections): New option.
14111 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
14112 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
14113 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
14114 icf.
14115 * symtab.cc (Symbol_table::is_section_folded): New function.
14116 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
14117 to sections marked as identical by icf.
14118 * symtab.h (Symbol_table::set_icf): New function.
14119 (Symbol_table::icf): New function.
14120 (Symbol_table::is_section_folded): New function.
14121 (Symbol_table::icf_): New data member.
14122 * target-reloc.h (relocate_section): Ignore sections folded by icf.
14123 * testsuite/Makefile.am: Add commands to build icf_test.
14124 * testsuite/Makefile.in: Regenerate.
14125 * testsuite/icf_test.sh: New file.
14126 * testsuite/icf_test.cc: New file.
14127
c3b65ac4
CD
141282009-07-24 Chris Demetriou <cgd@google.com>
14129
14130 * layout.cc (is_compressible_debug_section): Fix incorrect
14131 comment about compressed section names.
14132
1caf2c51
ILT
141332009-07-20 Ian Lance Taylor <ian@airs.com>
14134
14135 PR 10419
14136 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
14137
1ef4d87f
ILT
141382009-07-16 Ian Lance Taylor <iant@google.com>
14139
14140 PR 10400
14141 * layout.h: #include <map>.
14142 (class Kept_section): Change from struct to class. Add accessors
14143 and setters. Add section size to Comdat_group mapping. Change
14144 Comdat_group to std::map. Add is_comdat_ field. Add
14145 linkonce_size field in union.
14146 (class Layout): Update declaration of find_or_add_kept_section.
14147 Don't declare find_kept_object.
14148 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
14149 parameter. Add object, shndx, is_comdat, and is_group_name
14150 parameters. Change all callers. Adjust for new Kept_section.
14151 (Layout::find_kept_object): Remove.
14152 * object.cc (Sized_relobj::include_section_group): Update use of
14153 Kept_section. Rename secnum to shndx. Only record
14154 Kept_comdat_section if sections are the same size.
14155 (Sized_relobj::include_linkonce_section): Update use of
14156 Kept_section. Only record Kept_comdat_section if sections are the
14157 same size. Set size of linkonce section.
14158 (Sized_relobj::map_to_kept_section): Update call to
14159 get_kept_comdat_section.
14160 * object.h (class Sized_relobj): Rename fields in
14161 Kept_comdat_section to drop trailing underscores; change object
14162 field to Relobj*. Change Kept_comdat_section_table to store
14163 struct rather than pointer.
14164 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
14165 Add kept_object and kept_shndx parameters. Change all callers.
14166 (Sized_relobj::get_kept_comdat_section): Change return type to
14167 bool. Add kept_object and kept_shndx parameters. Change all
14168 callers.
14169 * plugin.cc (Pluginobj::include_comdat_group): Update call to
14170 Layout::find_or_add_kept_section.
14171
37c3b7b0
ILT
141722009-07-09 Ian Lance Taylor <iant@google.com>
14173
14174 * merge.cc (Object_merge_map::initialize_input_to_output_map):
14175 Reserve space in the hash table.
14176
98fa85cb
ILT
141772009-07-06 Mikolaj Zalewski <mikolajz@google.com>
14178
14179 * fileread.cc (File_read::get_mtime): New method.
14180 * fileread.h (Timespec): New structure.
14181 (File_read::get_mtime): New method.
14182 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
14183 Renamed from timestamp_nsec.
14184 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
14185 Elf_Xword.
e1df38aa 14186 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 14187 timestamp_nsec.
e1df38aa 14188 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
14189 (Incremental_inputs::report_obejct): Save mtime; style fix.
14190 (Incremental_inputs::report_script): Save mtime; style fix.
14191 (Incremental_inputs::finalize_inputs): Style fix.
14192 (Incremental_inputs::finalize): Style fix.
14193 (Incremental_inputs::create_input_section_data): Store inputs
14194 mtime.
14195 * incremental.h (Incremental_inputs::report_script): Add mtime
14196 argument.
14197 (Incremental_inputs::Input_info::Input_info): Intialize only one
14198 union member.
14199 (Incremental_inputs::Input_info::archive): Move to nameless
14200 union.
14201 (Incremental_inputs::Input_info::obejct): Move to nameless union.
14202 (Incremental_inputs::Input_info::script): Move to nameless union.
14203 (Incremental_inputs::mtime): New field.
14204 * script.cc (read_input_script): Pass file mtime to
14205 Incremental_input.
14206 * script.h (Script_info::inputs): Style fix.
14207
c9d70757
ILT
142082009-07-01 Ian Lance Taylor <ian@airs.com>
14209
14210 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
14211 instead of 32.
14212
9c547ec3
ILT
142132009-06-24 Ian Lance Taylor <iant@google.com>
14214
14215 PR 10156
14216 * layout.cc (Layout::choose_output_section): If we find an
14217 existing section, update the flags.
14218 (Layout::create_notes): New function, broken out of
14219 Layout::finalize.
14220 (Layout::finalize): Don't create note sections.
14221 (Layout::create_note): Don't crash if linker script discards
14222 section.
14223 (Layout::create_gold_note): Likewise.
14224 (Layout::create_build_id): Likewise. Don't set
14225 after_input_sections on the section.
14226 (Layout::create_executable_stack_info): Remove target parameter.
14227 Change caller.
14228 * layout.h (class Layout): Declare create_notes. Update
14229 declaration of create_executable_stack_info.
14230 * gold.cc (queue_middle_tasks): Call create_notes.
14231 * output.cc (Output_section::update_flags_for_input_section): Move
14232 here from output.h. If SHF_ALLOC flag is newly set, mark address
14233 invalid.
14234 * output.h (Output_data::mark_address_invalid): New function.
14235 (class Output_section): Only declare, not define,
14236 update_flags_for_input_section. Remove set_flags.
14237
55458500
ILT
142382009-06-24 Ian Lance Taylor <iant@google.com>
14239
14240 * script-sections.cc (Output_section_definition::
14241 set_section_addresses): Rename shadowing local load_address to
14242 laddr.
14243
1307d6cd
ILT
142442009-06-24 Ian Lance Taylor <iant@google.com>
14245
14246 PR 10244
14247 * reloc.cc (relocate_sections): Skip empty relocation sections.
14248
ec3f783e
ILT
142492009-06-23 Ian Lance Taylor <iant@google.com>
14250
14251 PR 10156
14252 * layout.cc (Layout::create_note): Use choose_output_section
14253 rather than make_output_section.
14254
459c9f1c
ILT
142552009-06-23 Ian Lance Taylor <iant@google.com>
14256
14257 PR 10237
14258 * options.cc (General_options::parse_V): Set printed_version_.
14259 (General_options::General_options): Initialize printed_version_.
14260 * options.h (class General_options): Add printed_version_ field.
14261 * gold.cc (queue_initial_tasks): If there are no input files,
14262 don't give a fatal error if we printed the version information.
14263 (queue_middle_tasks): If using -r with a shared object, give a
14264 fatal error rather than an ordinary error.
14265
1518dc8f
ILT
142662009-06-23 Ian Lance Taylor <iant@google.com>
14267
14268 PR 10219
14269 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
14270 (Layout::make_output_section): Set have_stabstr_section_ if we see
14271 a .stab*str section.
14272 (Layout::finalize): Call link_stabs_sections.
14273 (Layout::link_stabs_sections): New file.
14274 * layout.h (class Layout): Add have_stabstr_section_ field.
14275 Declare link_stabs_sections.
14276
3d857b98
DK
142772009-06-23 Doug Kwan <dougkwan@google.com>
14278
14279 * Makefile.am (libgold_a_LIBADD): New.
14280 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 14281 * Makefile.in: Regenerate.
3d857b98
DK
14282 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
14283 * configure: Regenerate.
14284 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
14285 * fileread.cc: Include sys/state.h
14286 * gold.h: Declare memmem and strndup if found missing.
14287 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
14288
0639a6f6
ILT
142892009-06-23 Ian Lance Taylor <iant@google.com>
14290
14291 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
14292 * configure: Rebuild.
14293
8d63875c
ILT
142942009-06-23 Ian Lance Taylor <iant@google.com>
14295
14296 PR 10147
14297 * object.cc (Object::section_contents): Don't try to get a view if
14298 the section has length zero.
14299 (Object::handle_gnu_warning_section): If the section is empty, use
14300 the name of the section as the warning.
14301
f7c8a183
ILT
143022009-06-23 Ian Lance Taylor <iant@google.com>
14303
14304 PR 10133
14305 * stringpool.h (class Stringpool_template): Add optimize_ field.
14306 (Stringpool_template::set_optimize): New function.
14307 * stringpool.cc (Stringpool_template::Stringpool_template):
14308 Initialize optimize_ field.
14309 (Stringpool_template::set_string_offsets): Test local optimize
14310 fild rather than parameter.
14311 * layout.cc (Layout::Layout): Call set_optimize on the section
14312 name stringpool.
14313
e6a307ba
ILT
143142009-06-22 Ian Lance Taylor <iant@google.com>
14315
14316 PR 10030
14317 * yyscript.y: Parse TARGET.
14318 * script.cc (script_set_target): New function.
14319 * script-c.h (script_set_target): Declare.
14320 * options.cc (General_options::string_to_object_format): Rename
14321 from string_to_object_format in anonymous namespace. Change
14322 callers.
14323 * options.h (class General_options): Declare
14324 string_to_object_format.
14325
3ee173de
ILT
143262009-06-22 Ian Lance Taylor <iant@google.com>
14327
14328 * script-sections.cc (Script_sections::create_segments): Don't put
14329 program headers in a PT_LOAD segment if -n or -N.
14330
143312009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
14332
14333 PR 10141
14334 * options.h (class General_options): Add -z lazy and -z now. Sort
14335 -z options into alphabetical order.
14336 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
14337
cd6739a1 143382009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
14339
14340 * layout.cc (Layout::make_output_section): Call
14341 Target::new_output_section.
14342 (Layout::attach_allocated_section_to_segment): Put large section
14343 sections in a separate load segment with the large segment flag
14344 set.
14345 (Layout::segment_precedes): Sort large data segments after other
14346 load segments.
14347 (align_file_offset): New static function.
14348 (Layout::set_segment_offsets): Use align_file_offset.
14349 * output.h (class Output_section): Add is_small_section_ and
14350 is_large_section_ fields.
14351 (Output_section::is_small_section): New function.
14352 (Output_section::set_is_small_section): New function.
14353 (Output_section::is_large_section): New function.
14354 (Output_section::set_is_large_section): New function.
14355 (Output_section::is_large_data_section): New function.
14356 (class Output_segment): Add is_large_data_segment_ field.
14357 (Output_segment::is_large_data_segment): New function.
14358 (Output_segment::set_is_large_data_segment): New function.
14359 * output.cc (Output_section::Output_section): Initialize new
14360 fields.
14361 (Output_segment::Output_segment): Likewise.
14362 (Output_segment::add_output_section): Add assertion that large
14363 data sections always go in large data segments. Force small data
14364 sections to the end of the list of data sections. Force small BSS
14365 sections to the start of the list of BSS sections. For large BSS
14366 sections to the end of the list of BSS sections.
14367 * symtab.h (class Symbol): Declare is_common_shndx.
14368 (Symbol::is_defined): Check Symbol::is_common_shndx.
14369 (Symbol::is_common): Likewise.
14370 (class Symbol_table): Define enum Commons_section_type. Update
14371 declarations. Add small_commons_ and large_commons_ fields.
14372 * symtab.cc (Symbol::is_common_shndx): New function.
14373 (Symbol_table::Symbol_table): Initialize new fields.
14374 (Symbol_table::add_from_object): Put small and large common
14375 symbols in the right list.
14376 (Symbol_table::sized_finalized_symbol): Check
14377 Symbol::is_common_shndx.
14378 (Symbol_table::sized_write_globals): Likewise.
14379 * common.cc (Symbol_table::do_allocate_commons): Allocate new
14380 common symbol lists. Don't call do_allocate_commons_list if the
14381 list is empty.
14382 (Symbol_table::do_allocate_commons_list): Remove is_tls
14383 parameter. Add comons_section_type parameter. Change all
14384 callers. Handle small and large common symbols.
14385 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
14386 Symbol::is_common_shndx.
14387 * resolve.cc (symbol_to_bits): Likewise.
14388 * target.h (Target::small_common_shndx): New function.
14389 (Target::small_common_section_flags): New function.
14390 (Target::large_common_shndx): New function.
14391 (Target::large_common_section_flags): New function.
14392 (Target::new_output_section): New function.
14393 (Target::Target_info): Add small_common_shndx, large_common_shndx,
14394 small_common_section_flags, and large_common_section_flags
14395 fields.
14396 (Target::do_new_output_section): New virtual function.
14397 * arm.cc (Target_arm::arm_info): Initialize new fields.
14398 * i386.cc (Target_i386::i386_info): Likewise.
14399 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
14400 Likewise.
14401 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
14402 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
14403 (Target_x86_64::do_new_output_section): New function.
14404 * configure.ac: Define conditional MCMODEL_MEDIUM.
14405 * testsuite/Makefile.am (check_PROGRAMS): Add large.
14406 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
14407 (large_LDFLAGS): Define.
14408 * testsuite/large.c: New file.
14409 * testsuite/testfile.cc (Target_test::test_target_info):
14410 Initialize new fields.
14411 * configure, testsuite/Makefile.in: Rebuild.
14412
bb04269c
DK
144132009-06-05 Doug Kwan <dougkwan@google.com>
14414
14415 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 14416 * Makefile.in: Regenerate.
bb04269c
DK
14417 * i386.cc (class Target_i386): Define new virtual method to
14418 override do_is_local_label_name in parent.
14419 * object.cc (Sized_relobj::do_count_local_symbols): Discard
14420 local symbols if --discard-locals or -X is given.
14421 * options.h (class General_options): Declare new options
14422 '--discard-locals' and '-X' for discarding locals.
14423 * target.h (class Target): Define new methods is_local_label_name.
14424 Declare new virtual method do_is_local_label_name.
14425 * target.cc: New file.
14426 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
14427 (check_SCRIPTS): Add discard_locals_test.sh.
14428 (check_DATA): Add discard_local_tests.syms.
14429 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
14430 (discard_local_tests.syms, discard_locals_test.o): New make rules.
14431 * testsuite/Makefile.in: Regenerate.
14432 * testsuite/discard_locals_test.c: New file.
14433 * testsuite/discard_locals_test.sh: Same.
14434
805bb01c
DK
144352009-06-05 Doug Kwan <dougkwan@google.com>
14436
14437 * object.cc (Sized_relobj::Sized_relobj): Initialize
14438 discarded_eh_frame_shndx_ to -1U.
14439 (Sized_relobj::do_layout): Record index of a discard .eh_frame
14440 section.
14441 (Sized_relobj::do_count_local_symbols): Skip local symbols in
14442 a discarded .eh_frame section.
14443 (Sized_relobj::do_finalize_local_symbols): Ditto.
14444 * object.h (class Sized_relobj): Declare new member
14445 discarded_eh_frame_shndx_.
14446 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
14447 (local_labels_test.o, local_labels_test): New rules.
14448 * testsuite/Makefile.in: Regenerate.
14449
1dcd334d
DK
144502009-06-04 Doug Kwan <dougkwan@google.com>
14451
14452 * layout.cc (Layout::section_name_mapping): Add mapping for
14453 special ARM sections.
14454
96d49306
DK
144552009-06-03 Doug Kwan <dougkwan@google.com>
14456
14457 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
14458 (utils::has_overflow): Same.
14459
dff16297
ILT
144602009-06-03 Ian Lance Taylor <iant@google.com>
14461
14462 * layout.cc (Layout::section_name_mapping): New array, replacing
14463 Layout::linkonce_mapping.
14464 (Layout::section_name_mapping_count): New variable, replacing
14465 Layout::linkonce_mapping_count.
14466 (Layout::linkonce_output_name): Remove.
14467 (Layout::output_section_name): Rewrite.
14468 * layout.h (class Layout): Rename Linkonce_mapping to
14469 Section_name_mapping, linkonce_mapping to section_name_mapping,
14470 linkonce_mapping_count to section_name_mapping_count. Don't
14471 declare linkonce_output_name.
14472
c121c671
DK
144732009-06-03 Doug Kwan <dougkwan@google.com>
14474
14475 * gold/arm.cc (namespace utils): New.
14476 (Target_arm::reloc_is_non_pic): Define new method.
14477 (class Arm_relocate_functions): New.
14478 (Target_arm::Relocate::relocate): Handle relocation types used by
14479 Android.
14480
07800fab
ILT
144812009-06-03 Ian Lance Taylor <iant@google.com>
14482
14483 * arm.cc (Target_arm::scan::global): Use || instead of |.
14484
c121c671
DK
144852009-06-02 Doug Kwan <dougkwan@google.com>
14486
14487 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
14488 issued_non_pic_error_.
14489 (class Target_arm::Scan): Declare new method check_non_pic.
14490 Define new method symbol_needs_plt_entry.
14491 Declare new data member issued_non_pic_error_.
14492 (class Target_arm::Relocate): Declare new method
14493 should_apply_static_reloc.
14494 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
14495 (Target_arm::Scan::check_non_pic): Define new method.
14496 (Target_arm::Scan::local): Handle a small subset of reloc types used
14497 by Android.
14498 (Target_arm::Scan::local): Same.
14499 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
14500
b19b0c6d
ILT
145012009-05-31 Mikolaj Zalewski <mikolajz@google.com>
14502
14503 * incremental.cc (Incremental_inputs::report_command_line): Filter
14504 out --incremental-* options.
14505
94cdfcff
DK
145062009-05-29 Doug Kwan <dougkwan@google.com>
14507
14508 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
14509 template class.
14510 (class Target_arm): Update comment.
14511 (Target_arm::Target_arm): Initialize new data members GOT_,
14512 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
14513 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
14514 and Target_arm::rel_dyn_section.
14515 Declare new_enum Target_arm::Got_type.
14516 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
14517 and DYNBSS_.
14518 Update commments for member do_dynsym_value.
14519 (Target_arm::got_size, Target_arm::plt_section,
14520 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
14521 new methods inside class defintion.
14522 (Target_arm::got_section): Define new method.
14523 (Target_arm::rel_dyn_section): Same.
14524 (Output_data_plt_arm): New template class.
14525 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
14526 (Output_data_plt_arm:do_adjust_output_section): Define new method.
14527 (Output_data_plt_arm::add_entry): Same.
14528 (Output_data_plt_arm::first_plt_entry): Define new
14529 static data member for PLT instruction template.
14530 (Output_data_plt_arm::plt_entry): Same.
14531 (Output_data_plt_arm::do_write): Define new method.
14532 (Target_arm::make_plt_entry): Same.
14533 (Target_arm::do_finalize_sections): Same.
14534 (Target_arm::do_dynsym_value): Same.
14535
4a657b0d
DK
145362009-05-28 Doug Kwan <dougkwan@google.com>
14537
14538 * Makefile.am (TARGETSOURCES): Add arm.cc.
14539 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
14540 * Makefile.in: Regenerate.
14541 * arm.cc: New file.
14542 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
14543
e7ae8c36
DK
145442009-05-26 Doug Kwan <dougkwan@google.com>
14545
14546 * options.cc (General_options::parse_exclude_libs). Fix a comment.
14547 (General_options::check_excluded_libs): Strip off directories in
14548 archive name before matching like GNU ld does.
14549 * testsuite/Makefile.am (MOSTLYCLEANFILES,
14550 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
14551 (exclude_libs_test_LDFLAGS): Add linker option
14552 -Wl,--exclude-libs,libexclude_libs_test_3
14553 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
14554 an explicit archive without using -l.
14555 (alt/libexclude_libs_test_3.a): New make rule.
14556 * testsuite/Makefile.in: Regenerate.
14557 * testsuite/exclude_libs_test.c : Declare lib3_default().
14558 (main): Call it.
14559 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
14560 * exclude_libs_test_3.c: New file.
14561
f12e7348
NC
145622009-05-26 Nick Clifton <nickc@redhat.com>
14563
14564 * po/id.po: New Indonesian translation.
14565 * po/gold.pot: Updated template file.
14566
4daadc0d
ST
145672009-05-22 Sriraman Tallam <tmsriram@google.com>
14568
e1df38aa 14569 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
14570 gc_comdat_test files. Add -Wl,--gc-sections to build
14571 gc_comdat_test.
14572 * testsuite/Makefile.in: Regenerate.
14573 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
14574
531813ad
ST
145752009-05-21 Sriraman Tallam <tmsriram@google.com>
14576
14577 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
14578 kept comdat section was garbage collected.
14579 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
14580 * testsuite/Makefile.in: Regenerate.
14581 * testsuite/gc_comdat_test.sh: New file.
14582 * testsuite/gc_comdat_test_1.cc: New file.
14583 * testsuite/gc_comdat_test_2.cc: New file.
14584
65514900
CC
145852009-05-19 Doug Kwan <dougkwan@google.com>
14586
14587 * archive.cc (Archive::Archive): Move constructor from archive.h
14588 to here. Initialize no_export_.
14589 (Archive::get_elf_object_for_member): Set no_export flag of object.
14590 * archive.h (Archive::Archive): Move constructor body to
14591 archive.cc.
14592 (Archive::no_export): New method.
14593 (Archive::no_export_): New field.
14594 * object.h (Object::Object): Initialize no_export_ to false.
14595 (Object::no_export, Object::set_no_export): New methods.
14596 (Object::no_export_): New field.
14597 * options.cc (General_options::parse_exclude_libs): New method.
14598 (General_options::check_excluded_libs) Same.
14599 * options.h (exclude_libs): New option.
14600 (General_options::check_excluded_libs): New method declaration.
14601 (General_options::excluded_libs_): New field.
14602 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
14603 default or protected visibility if an object has no-export flag set.
14604 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
14605 (check_SCRIPTS): Add exclude_libs_test.sh.
14606 (check_DATA): Add exclude_libs_test.syms.
14607 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
14608 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
14609 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
14610 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
14611 (exclude_libs_test.syms, libexclude_libs_test_1.a,
14612 libexclude_libs_test_2.a): New rules.
14613 * testsuite/Makefile.in: Regenerate.
14614 * testsuite/exclude_libs_test.c: New file.
14615 * testsuite/exclude_libs_test.sh: Ditto.
14616 * testsuite/exclude_libs_test_1.c: Ditto.
14617 * testsuite/exclude_libs_test_2.c: Ditto.
14618
1b77ea50
ILT
146192009-05-15 Ian Lance Taylor <iant@google.com>
14620
14621 * configure.ac: Check for declarations for cases where libiberty.h
14622 checks HAVE_DECL_xxx.
14623 * configure, config.in: Rebuild.
14624
072fe7ce
ILT
146252009-05-15 Mikolaj Zalewski <mikolajz@google.com>
14626
14627 * gold.h (Incremental_argument_list): Remove (invalid) forward
14628 declaration.
14629 * incremental.cc (Incremental_inputs::report_achive): New method.
14630 (Incremental_inputs::report_object): New method.
14631 (Incremental_inputs::report_script): New method.
14632 (Incremental_inputs::finalize_inputs): New method.
14633 (Incremental_inputs::finalize): Call finalize_inputs().
14634 (Incremental_inputs::sized_create_incremental_inputs_section_data):
14635 Create inputs entries.
14636 * incremental.h (Incremental_input_type): New enum.
14637 (Incremental_inputs::Incremental_input): Initialize new fields.
14638 (Incremental_inputs::report_inputs): New method.
14639 (Incremental_inputs::report_achive): New method.
14640 (Incremental_inputs::report_object): New method.
14641 (Incremental_inputs::report_script): New method.
14642 (Incremental_inputs::finalize_inputs): New method.
14643 (Incremental_inputs::Input_info): New struct.
14644 (Incremental_inputs::Input_info_map): New typedef.
14645 (Incremental_inputs::lock_): New field.
14646 (Incremental_inputs::Inputs_): New field.
14647 (Incremental_inputs::Inputs_map): New field.
14648 * main.cc (main): Call Incremental_input::report_inputs.
14649 * options.h (Input_argument_list): Typedef moved from
14650 Input_arguments.
14651 (Input_file_group::Files): Remove, use ::Input_argument_list.
14652 (Input_file_group::Input_argument_list): Remove, use
14653 ::Input_argument_list.
14654 * plugin.cc (Plugin_manager::add_input_file): Add error in
14655 incremental build.
14656 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
14657 functions.
14658 * script.cc (read_input_script): Call
14659 Incremental_input::report_script.
14660 * script.h (Script_info): New class.
14661
b0481b0b
ILT
146622009-04-27 Ian Lance Taylor <iant@google.com>
14663
14664 * x86_64.cc (do_adjust_output_section): Set entsize to
14665 plt_entry_size.
14666
b22a5a41 146672009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
14668
14669 * output.cc (Output_file::close): After short writes, continue
14670 writing from the correct offset in the buffer being written.
14671
40fde488
CD
146722009-04-23 Chris Demetriou <cgd@google.com>
14673
14674 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
14675 * configure: Regenerate.
14676 * config.in: Regenerate.
14677 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
14678 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
14679
3ce2c28e
ILT
146802009-04-21 Mikolaj Zalewski <mikolajz@google.com>
14681
14682 * incremental.cc (Incremental_inputs_header_data): Renamed from
14683 Incremental_input_header_data.
14684 (Incremental_inputs_header_data::data_size): New field.
14685 (Incremental_inputs_header_data::put_input_file_count): Renamed
14686 from input_file_count.
14687 (Incremental_inputs_header_data::put_command_line_offset): Renamed
14688 from command_line_offset.
14689 (Incremental_inputs_header_data::put_reserved): Renamed from
14690 put_reserved.
14691 (Incremental_inputs_entry_data): Renamed from
14692 Incremental_input_entry_data.
14693 (Incremental_inputs_entry_data::data_size): New field.
14694 (Incremental_inputs::report_command_line): New method.
14695 (Incremental_inputs::finalize): New method.
14696 (Incremental_inputs::create_incremental_inputs_data): New method.
14697 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
14698 * incremental.h: New file.
14699 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 14700 (Layout::finalize): Create incremental inputs section in
3ce2c28e 14701 incremental builds.
703d02da 14702 (Layout::create_incremental_info_sections): New method.
3ce2c28e 14703 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
14704 (Layout::create_incremental_info_sections): New method.
14705 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
14706 * main.cc (main): Notify Incremental_input of the command line.
14707
e55bde5e
ILT
147082009-04-01 Ian Lance Taylor <iant@google.com>
14709 Mikolaj Zalewski <mikolajz@google.com>
14710
14711 * gold.h (reserve_unordered_map): Define, three versions, one for
14712 each version of Unordered_map.
14713 * layout.cc (Layout::Layout): Remove options parameter. Add
14714 number_of_input_files parameter. Don't initialize options_.
14715 Initialize number_of_input_files_ and resized_signatures_. Move
14716 sections_are_attached_.
14717 (Layout::layout_group): Reserve space for group_signatures_.
14718 (Layout::find_or_add_kept_section): Change name parameter to be a
14719 reference. Resize signatures_ map when it gets large enough.
14720 (Layout::layout_eh_frame): Use parameters->options() instead of
14721 this->options_.
14722 (Layout::make_output_section): Likewise.
14723 (Layout::attach_allocated_section_to_segment): Likewise.
14724 (Layout::finalize, Layout::create_executable_stack): Likewise.
14725 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
14726 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
14727 * layout.h (class Layout): Update declarations. Remove options_
14728 field. Add number_of_input_files_ and resized_signatures_
14729 fields. Move sections_are_attached_ field.
14730 * main.cc (main): Pass number of input files to Layout
14731 constructor. Don't pass options.
14732
154b857c
ILT
147332009-03-30 Ian Lance Taylor <iant@google.com>
14734
14735 * ffsll.c (ffsll): Correct implementation.
14736
2f35ab9b
ILT
147372009-03-27 Ian Lance Taylor <iant@google.com>
14738
fd03461a
ILT
14739 * ffsll.c: New file.
14740 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
14741 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
14742 * ftruncate.c (ftruncate): Declare before definition.
14743 * mremap.c (mremap): Likewise.
14744 * pread.c (pread): Likewise.
14745 * configure, Makefile.in, config.in: Rebuild.
14746
2f35ab9b
ILT
14747 * mremap.c: New file.
14748 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
14749 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
14750 (mremap): Declare if HAVE_MREMAP is not defined.
14751 * configure, Makefile.in, config.in: Rebuild.
14752
33aea2fd
CC
147532009-03-27 Cary Coutant <ccoutant@google.com>
14754
14755 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
14756 position independent.
14757 * sparc.cc (Target_sparc::check_non_pic): Likewise.
14758 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
14759
6d479619
CC
147602009-03-24 Cary Coutant <ccoutant@google.com>
14761
14762 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
14763 an executable.
14764 (needs_dynamic_reloc): Likewise.
14765
afc06bb8
ILT
147662009-03-24 Ian Lance Taylor <iant@google.com>
14767
14768 * yyscript.y (file_cmd): Recognize EXTERN.
14769 (extern_name_list, extern_name_list_body): New nonterminals.
14770 * script.cc (script_add_extern): Define.
14771 * script-c.h (script_add_extern): Declare.
14772
f6060a4d
ILT
147732009-03-24 Rafael Avila de Espindola <espindola@google.com>
14774
14775 * object.cc (is_elf_object): Define.
14776 * object.h (is_elf_object): Declare.
14777 * archive.cc (Archive::get_elf_object_for_member): Call
14778 is_elf_object.
33aea2fd 14779 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 14780
26736d8e
ILT
147812009-03-24 Elliott Hughes <enh@google.com>
14782
14783 * output.cc (Output_file::map_anonymous): Define.
14784 (Output_file::map): Use map_anonymous. If the regular mmap fails,
14785 try an anonymous one. Report the size if the mmap fails.
14786 * output.h (class Output_file): Declare map_anonymous.
14787
22fd9730
ILT
147882009-03-24 Ian Lance Taylor <iant@google.com>
14789
14790 * target-select.cc (instantiate_target): Don't acquire the lock if
14791 the instantiated_target_ field has already been set.
14792
cb010894
ILT
147932009-03-23 Ian Lance Taylor <iant@google.com>
14794
7f055c20
ILT
14795 * gold-threads.h (class Initialize_lock): Define.
14796 * gold-threads.cc (class Initialize_lock_once): Define.
14797 (initialize_lock_control): New static variable.
14798 (initialize_lock_pointer): New static variable.
14799 (initialize_lock_once): New static function.
14800 (Initialize_lock::Initialize_lock): Define.
14801 (Initialize_lock::initialize): Define.
14802 * target-select.h: Include "gold-threads.h".
14803 (class Target_selector): Add lock_ and initialize_lock_ fields.
14804 Don't define instantiate_target, just declare it.
14805 * target-select.cc (Target_selector::Target_selector): Initialize
14806 new fields.
14807 (Target_selector::instantiate_target): Define.
14808 * descriptors.h: Include "gold-threads.h".
14809 (class Descriptors): Add initialize_lock_ field.
14810 * descriptors.cc (Descriptors::Descriptors): Initialize new
14811 field.
14812 (Descriptors::open): Use initialize_lock_ field
14813 * errors.h (class Errors): Add initialize_lock_ field.
14814 * errors.cc (Errors::Errors): Initialize new field.
14815 (Errors::initialize_lock): Use initialize_lock_ field.
14816 * powerpc.cc (class Target_selector_powerpc): Remove
14817 instantiated_target_ field. In do_recognize call
14818 instantiate_target rather than do_instantiate_target. In
14819 do_instantiate_target just allocate a new target.
14820 * sparc.cc (class Target_selector_sparc): Likewise.
14821
36959681
ILT
14822 * freebsd.h: New file.
14823 * i386.cc: Include "freebsd.h".
14824 (Target_i386): Derive from Target_freebsd rather than
14825 Sized_target.
14826 (Target_selector_i386): Derive from Target_selector_freebsd rather
14827 than Target_selector.
14828 * x86_64.cc: Include "freebsd.h".
14829 (Target_x86_64): Derive from Target_freebsd rather than
14830 Sized_target.
14831 (Target_selector_x86_64): Derive from Target_selector_freebsd
14832 rather than Target_selector.
14833 * target.h (class Target): Add adjust_elf_header and
14834 do_adjust_elf_header.
14835 * output.cc (Output_file_header:: do_sized_write): Call target
14836 adjust_elf_header routine.
14837 * configure.tgt: Set targ_osabi.
14838 * configure.ac: Define GOLD_DEFAULT_OSABI.
14839 * parameters.cc (Parameters::default_target): Pass
14840 GOLD_DEFAULT_OSABI to select_target.
14841 * target-select.h (class Target_selector): Make instantiate_target
14842 protected rather than private.
14843 * Makefile.am (HFILES): Add freebsd.h.
14844 * configure, Makefile.in, config.in: Rebuild.
14845
cb010894
ILT
14846 * merge.cc (do_add_input_section): Correct pend value. Change
14847 message about last entry not being null terminated from error to
14848 warning.
14849
0e879927
ILT
148502009-03-20 Mikolaj Zalewski <mikolajz@google.com>
14851
14852 * incremental.cc: New file.
14853 * Makefile.am (CCFILES): Add incremental.cc.
14854 * Makefile.in: Rebuild.
14855
41105937
PP
148562009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
14857
14858 * layout.cc (Layout::output_section_name): Preserve names
14859 of '.note.' sections.
e1df38aa 14860
60439920
ILT
148612009-03-19 Ian Lance Taylor <iant@google.com>
14862
14863 * descriptors.cc (Descriptors::open): Check that the options are
14864 valid before using them.
14865
0d371ad3
ILT
148662009-03-18 Ian Lance Taylor <iant@google.com>
14867
14868 * script-sections.h: Include <list>.
14869 (class Script_sections): Change Sections_elements from std::vector
14870 to std::list. Typedef public Elements_iterator. Add
14871 orphan_section_placement_, data_segment_align_start_, and
14872 saw_data_segment_align_ fields. Remove data_segment_align_index_
14873 field.
14874 * script-sections.cc (class Orphan_section_placement): New class.
14875 (class Sections_element): Add virtual functions is_relro and
14876 orphan_section_init. Remove virtual function place_orphan_here.
14877 (class Output_section_definition): Add is_relro and
14878 orphan_section_init. Remove place_orphan_here.
14879 (class Orphan_output_section): Likewise.
14880 (Script_sections::Script_sections): Update for field changes.
14881 (Script_sections::data_segment_align): Set saw_data_segment_align_
14882 and data_segment_align_start_, not data_segment_align_index.
14883 (Script_sections::data_segment_relro_end): Check
14884 saw_data_segment_align_. Use data_segment_align_start_ rather
14885 than data_segment_align_index_.
14886 (Script_sections::place_orphan): Rewrite to use
14887 Orphan_section_placement.
14888
9201d894
ILT
148892009-03-17 Ian Lance Taylor <iant@google.com>
14890
9c5b8369
ILT
14891 * archive.cc (Archive::add_symbols): Check for a version attached
14892 to the symbol name in the archive map.
14893 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
14894 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
14895 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
14896 (ver_test_11.a): New target.
14897 * testsuite/Makefile.in: Rebuild.
14898
9201d894
ILT
14899 * configure.ac: Check for chsize and posix_fallocate. Replace
14900 ftruncate.
14901 * ftruncate.c: New file, from gnulib.
14902 * output.cc (posix_fallocate): Define dummy version if not
14903 HAVE_POSIX_FALLOCATE.
14904 (Output_file::map): Call posix_fallocate rather than lseek and
14905 write.
14906 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
14907 * configure, Makefile.in, config.in: Rebuild.
14908
ef4ab7a8 149092009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 14910
ef4ab7a8
PP
14911 * layout.h (Layout::create_note): Add section_name parameter.
14912 * layout.cc (Layout::create_note): Likewise.
14913 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 14914
8c500701
ILT
149152009-03-17 Ian Lance Taylor <iant@google.com>
14916
e85b18e1
ILT
14917 * descriptors.cc: Include "options.h".
14918 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
14919 (Descriptors::open): Always use O_CLOEXEC when opening a new
14920 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
14921 then set FD_CLOEXEC.
14922
9efe6174
ILT
14923 * sparc.cc (class Target_sparc): Add has_got_section.
14924 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
14925 make sure we have a GOT section.
14926
14927 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
14928 (Target_sparc::Scan::local): Likewise.
14929 (Target_sparc::Scan::global): Likewise.
14930 (Target_sparc::Relocate::relocate): Likewise.
14931 (Target_sparc::Relocate::relocate_tls): Likewise.
14932
8c500701
ILT
14933 * symtab.cc (Symbol_table::define_default_version): New function,
14934 broken out of add_from_object.
14935 (Symbol_table::add_from_object): Call define_default_version.
14936 (Symbol_table::define_special_symbol): Add resolve_oldsym
14937 parameter. Change all callers. If the version for a symbol comes
14938 from a version script, resolve it with the symbol with the same
14939 name with no version. Also add the symbol without a version if
14940 appropriate.
14941 (do_define_in_output_data): If resolving with oldsym, don't delete
14942 sym.
14943 (do_define_in_output_segment): Likewise.
14944 (do_define_as_constant): Likewise.
14945 * symtab.h (class Symbol_table): Update declarations.
14946
f1ed28fb
ILT
149472009-03-13 Ian Lance Taylor <iant@google.com>
14948
15f8229b
ILT
14949 * readsyms.cc (Read_symbols::incompatible_warning): New function.
14950 (Read_symbols::requeue): New function.
14951 (Read_symbols::do_read_symbols): If make_elf_object fails because
14952 the target type is not configured, and the file was searched for,
14953 issue a warning and retry with the next directory.
14954 (Add_symbols::run): If the file has an incompatible format, and
14955 it was searched for, requeue the Read_symbols task. On error,
14956 release the object.
14957 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
14958 dirindex parameter to constructor. Change all callers. Declare
14959 incompatible_warning and requeue.
14960 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
14961 input_argument_ and input_group_ fields. Add them to
14962 constructor. Change all callers.
14963 (class Read_script): Add dirindex_ field. Add it to constructor.
14964 Change all callers.
14965 * archive.cc (Archive::setup): Remove input_objects parameter.
14966 Change all callers.
14967 (Archive::get_file_and_offset): Likewise.
14968 (Archive::read_all_symbols): Likewise.
14969 (Archive::read_symbols): Likewise.
14970 (Archive::get_elf_object_for_member): Remove input_objects
14971 parameter. Add punconfigured parameter. Change all callers.
14972 (Archive::add_symbols): Change return type to bool. Check return
14973 value of include_member.
14974 (Archive::include_all_members): Likewise.
14975 (Archive::include_member): Change return type to bool. Return
14976 false if first included object has incompatible target. Set
14977 included_member_ field.
14978 (Add_archive_symbols::run): If add_symbols returns false, requeue
14979 Read_symbols task.
14980 * archive.h (class Archive): Add included_member_ field.
14981 Initialize it in constructor. Add input_file and searched_for
14982 methods. Update declarations.
14983 (class Add_archive_symbols): Add dirpath_, dirindex_, and
14984 input_argument_ fields. Add them to constructor. Change all
14985 callers.
14986 * script.cc: Include "target-select.h".
14987 (class Parser_closure): Add skip_on_incompatible_target_ and
14988 found_incompatible_target_ fields. Add
14989 skip_on_incompatible_target parameter to constructor. Change all
14990 callers. Add methods skip_on_incompatible_target,
14991 clear_skip_on_incompatible_target, found_incompatible_target, and
14992 set_found_incompatible_target.
14993 (read_input_script): Add dirindex parameter. Change all callers.
14994 If parser finds an incompatible target, requeue Read_symbols
14995 task.
14996 (script_set_symbol): Clear skip_on_incompatible_target in
14997 closure.
14998 (script_add_assertion, script_parse_option): Likewise.
14999 (script_start_sections, script_add_phdr): Likewise.
15000 (script_check_output_format): New function.
15001 * script.h (read_input_script): Update declaration.
15002 * script-c.h (script_check_output_format): Declare.
15003 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
15004 (ignore_cmd): Remove OUTPUT_FORMAT.
15005 * fileread.cc (Input_file::Input_file): Add explicit this.
15006 (Input_file::will_search_for): New function.
15007 (Input_file::open): Add pindex parameter. Change all callers.
15008 * fileread.h (class Input_file): Add input_file_argument method.
15009 Declare will_search_for. Update declarations.
15010 * object.cc (make_elf_object): Add punconfigured parameter.
15011 Change all callers.
15012 * object.h (class Object): Make input_file public. Add
15013 searched_for method.
15014 (make_elf_object): Update declaration.
15015 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
15016 restart search.
15017 * dirsearch.h (class Dirsearch): Update declaration.
15018 * options.h (class General_options): Add --warn-search-mismatch.
15019 * parameters.cc (Parameters::is_compatible_target): New function.
15020 * parameters.h (class Parameters): Declare is_compatible_target.
15021 * workqueue.cc (Workqueue::add_blocker): New function.
15022 * workqueue.h (class Workqueue): Declare add_blocker.
15023
f1ed28fb
ILT
15024 * fileread.cc (Input_file::open): Remove options parameter.
15025 Change all callers.
15026 (Input_file::open_binary): Likewise.
15027 * script.cc (read_input_script): Likewise.
15028 * readsyms.h (class Read_symbols): Remove options_ field. Remove
15029 options parameter from constructor. Change all callers.
15030 (class Read_script): Likewise.
15031 * fileread.h (class Input_file): Update declarations.
15032 * script.h (read_input_script): Update declaration.
15033
34dd024a
NC
150342009-03-10 Nick Clifton <nickc@redhat.com>
15035
15036 * po/es.po: New Spanish translation.
15037
6d71b17c
CC
150382009-03-06 Cary Coutant <ccoutant@google.com>
15039
15040 * options.cc (parse_short_option): Keep dash_z from registering itself.
15041
031cdbed
ILT
150422009-03-03 Ian Lance Taylor <iant@google.com>
15043
15044 PR 9918
15045 * target-reloc.h (relocate_section): Pass output_section to
15046 relocate.
15047 * i386.cc (Target_i386::should_apply_static_reloc): Add
15048 output_section parameter. Change all callers.
15049 (Target_i386::Relocate::relocate): Add output_section parameter.
15050 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
15051 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
15052 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
15053 * testsuite/two_file_shared.sh: New script.
15054 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
15055 (check_DATA): Add two_file_shared.dbg.
15056 (two_file_shared.dbg): New target.
15057 * testsuite/Makefile.in: Rebuild.
15058
15d5fa16
ILT
150592009-03-01 Ian Lance Taylor <iant@google.com>
15060
15061 * configure.ac: Check for byteswap.h.
15062 * configure: Rebuild.
15063 * config.in: Rebuild.
15064
8a4c0b0d
ILT
150652009-03-01 Mikolaj Zalewski <mikolajz@google.com>
15066
15067 * layout.cc (Layout::find_or_add_kept_section): New function.
15068 (Layout::add_comdat): Removed.
15069 * layout.h (struct Kept_section): Move out of class Layout.
15070 Remove trailing underscores from field names. Add group_sections
15071 field. Rename group_ field to is_group. Change all uses.
15072 (class Layout): Declare find_or_add_kept_section, not add_comdat.
15073 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
15074 comdat_groups_ field.
15075 (Sized_relobj::include_section_group): Use
15076 find_or_add_kept_section and Kept_section::group_sections.
15077 (Sized_relobj::include_linkonce_section): Likewise.
15078 * object.cc (class Sized_relobj): Don't define Comdat_group or
15079 Comdat_group_table. Remove find_comdat_group and
15080 add_comdat_group. Remove comdat_groups_ field.
15081 * plugin.cc (include_comdat_group): Use
15082 Layout::find_or_add_kept_section.
15083
b4ecf66b
ILT
150842009-02-28 Ian Lance Taylor <iant@google.com>
15085
14359ca0
ILT
15086 * README: --gc-sections and map files are now supported. Document
15087 some build requirements.
15088
b4ecf66b
ILT
15089 PR 6992
15090 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
15091 relocatable link set the value of the section symbol to zero.
15092 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
15093 relocatable link don't include the section address in the local
15094 symbol value.
15095
0602e05a
ILT
150962009-02-27 Ian Lance Taylor <iant@google.com>
15097
fd9d194f
ILT
15098 PR 6811
15099 * options.h (class Search_directory): Add is_system_directory.
15100 (class General_options): Declare is_in_system_directory.
15101 * options.cc (get_relative_sysroot): Make static.
15102 (get_default_sysroot): Make static.
15103 (General_optoins::is_in_system_directory): New function.
15104 * fileread.cc (Input_file::is_in_system_directory): New function.
15105 * fileread.h (class Input_file): Declare is_in_system_directory.
15106 * object.h (class Object): Add is_in_system_directory.
15107 (class Input_objects): Remove system_library_directory_ field.
15108 * object.cc (Input_objects::add_object): Don't set
15109 system_library_directory_.
15110 (input_objects::found_in_system_library_directory): Remove.
15111 * symtab.cc (Symbol_table::write_globals): Remove input_objects
15112 parameter. Change all callers.
15113 (Symbol_table::sized_write_globals): Likewise.
15114 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
15115 Call Object::is_in_system_directory.
15116 * symtab.h (class Symbol_table): Update declarations.
15117
61edd21f
ILT
15118 PR 5990
15119 * descriptors.h (Open_descriptor): Add is_on_stack field.
15120 * descriptors.cc (Descriptors::open): If the descriptor is on the
15121 top of the stack, remove it. Initialize is_on_stack field.
15122 (Descriptors::release): Only add pod to stack if it is not on the
15123 stack already.
15124 (Descriptors::close_some_descriptor): Clear stack_next and
15125 is_on_stack fields.
15126
e29e076a
ILT
15127 PR 7091
15128 * output.cc (Output_section::find_starting_output_address): Rename
15129 from starting_output_address; add PADDR parameter; change return
15130 type.
15131 * output.h (class Output_section): Declare
15132 find_starting_output_address instead of starting_output_address.
15133 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
15134 section symbol for which we can't find a merge section.
15135
0602e05a
ILT
15136 PR 9836
15137 * symtab.cc (Symbol_table::add_from_object): If the visibility is
15138 hidden or internal, force the symbol to be local.
15139 * resolve.cc (Symbol::override_visibility): Define.
15140 (Symbol::override_base): Use override_visibility.
15141 (Symbol_table::resolve): Likewise.
15142 (Symbol::override_base_with_special): Likewise.
15143 (Symbol_table::override_with_special): If the visibility is hidden
15144 or internal, force the symbol to be local.
15145 * symtab.h (class Symbol): Add set_visibility and
15146 override_visibility.
15147 * testsuite/ver_test_1.sh: New file.
15148 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
15149 (check_DATA): Add ver_test_1.syms.
15150 (ver_test_1.syms): New target.
15151 * testsuite/Makefile.in: Rebuild.
15152
401a9a73
CC
151532009-02-25 Cary Coutant <ccoutant@google.com>
15154
15155 * layout.cc (Layout::choose_output_section): Don't rename sections
15156 when using a linker script that has a SECTIONS clause.
15157 * Makefile.in: Regenerate.
15158
15159 * testsuite/Makefile.am (script_test_5.sh): New test case.
15160 * testsuite/Makefile.in: Regenerate.
15161 * testsuite/script_test_5.cc: New file.
15162 * testsuite/script_test_5.sh: New file.
15163 * testsuite/script_test_5.t: New file.
15164
f488e4b0
CC
151652009-02-13 Rafael Avila de Espindola <espindola@google.com>
15166
15167 * archive.cc (Archive::include_member): Update calls to add_symbols.
15168 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
15169 the Layout argument.
15170 * dynobj.h (do_add_symbols): Add the Layout argument.
15171 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
15172 Layout argument.
15173 * object.h (Object::add_symbols): Add the Layout argument.
15174 (Object::do_add_symbols): Add the Layout argument.
15175 (Sized_relobj::do_add_symbols): Add the Layout argument.
15176 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
15177 Unify the two versions.
15178 (Add_plugin_symbols): Remove.
15179 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
15180 (Sized_pluginobj::do_add_symbols): Unify the two versions.
15181 (Add_plugin_symbols): Remove.
15182 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
15183 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
15184 (Add_symbols::run): Make it work with Pulginobj.
15185
89dd1680
ILT
151862009-02-06 Ian Lance Taylor <iant@google.com>
15187
15188 * object.cc (Sized_relobj::do_layout): Make info message start
15189 with lower case letter.
15190
266d0a74
ILT
151912009-02-06 Mikolaj Zalewski <mikolajz@google.com>
15192
602b464e
ILT
15193 * binary.cc: Fix file comment.
15194
266d0a74
ILT
15195 * options.h (enum Incremental_disposition): Define.
15196 (class General_options): Add new options: --incremental,
15197 --incremental_changed, --incremental_unchanged,
15198 --incremental_unknown. Add incremental_disposition_ and
15199 implicit_incremental_ fields.
15200 (General_options::incremental_disposition): New function.
15201 (class Position_dependent_options): Add incremental_disposition
15202 option.
15203 (Position_dependent_options::copy_from_options): Set incremental
15204 dispositions.
15205 * options.cc (General_options::parse_incremental_changed): New
15206 function.
2e702c99
RM
15207 (General_options::parse_incremental_unchanged): New function.
15208 (General_options::parse_incremental_unknown): New function.
15209 (General_options::General_options): Initialize new fields
266d0a74 15210 incremental_disposition_ and implicit_incremental_.
2e702c99 15211 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
15212 without --incremental.
15213
f073bbf7
CD
152142009-02-06 Chris Demetriou <cgd@google.com>
15215
15216 * gold.h (gold_undefined_symbol): Change to take only a Symbol
15217 pointer and to report location as the file name associated with
15218 the symbol.
15219 (gold_undefined_symbol_at_location): New function to replace the
15220 old gold_undefined_symbol functionality.
15221 * target-reloc.h (relocate_section): Update to use
15222 gold_undefined_symbol_at_location.
15223 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
15224 Call gold_undefined_symbol function rather than gold_error.
15225 * errors.h (Errors::undefined_symbol): Take location as a
15226 string, rather than calculating it from a relocation.
15227 * errors.cc (Errors::fatal): Print "fatal error:" before the
15228 formatted message.
15229 (Errors::error, Errors::error_at_location): Print "error: "
15230 before the formatted message.
15231 (Errors::undefined_symbol): Take location as a string, rather
15232 than calculating it from a relocation.
15233 (gold_undefined_symbol_at_location): New function akin to
15234 old gold_undefined_symbol, calculates location from relocation.
15235 (gold_undefined_symbol): Change to take only a Symbol pointer
15236 and to report location as the file name associated with the symbol.
15237 * testsuite/debug_msg.sh: Update for changed error messages.
15238 * testsuite/undef_symbol.sh: Likewise.
15239
8e94a90c
ILT
152402009-02-04 Duncan Sands <baldrick@free.fr>
15241
15242 PR 9812
15243 * reduced_debug_output.h
15244 (Output_reduced_debug_abbrev_section::failed): Use format for
15245 gold_warning.
15246 (Output_reduced_debug_info_section::faild): Likewise.
15247
88a0e15b
ILT
152482009-01-31 Mikolaj Zalewski <mikolajz@google.com>
15249
15250 * script.cc (Lazy_demangler): New class.
2e702c99 15251 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
15252 symbol only once.
15253
5efc7cd2
CC
152542009-01-29 Cary Coutant <ccoutant@google.com>
15255
15256 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
15257 to __tls_get_addr.
15258 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
15259
e0ebcf42
ILT
152602009-01-28 Ian Lance Taylor <iant@google.com>
15261
5efc7cd2 15262 * version.cc (version_string): Bump to 1.9.
75fe7426 15263
e0ebcf42
ILT
15264 * gold.h: Include <cstring> and <stdint.h>.
15265 * version.cc: Include <cstdio>.
15266 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
15267 warning.
15268 * reduced_debug_output.cc (insert_into_vector): Rename from
15269 Insert_into_vector; change all callers. Use Swap_unaligned to
15270 avoid aliasing issue; remove union since it is unnecessary.
15271
8e2813be 152722009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
15273
15274 * Makefile.am (CCFILES): Add gc.cc.
15275 (HFILES): Add gc.h.
15276 * Makefile.in: Regenerate.
15277 * gold.cc (Gc_runner): New class.
15278 (queue_initial_tasks): Call garbage collection related tasks
15279 when corresponding options are invoked.
15280 (queue_middle_gc_tasks): New function.
15281 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
15282 processed early before laying out sections during garbage collection.
15283 * gold.h (queue_middle_gc_tasks): New function.
15284 (is_prefix_of): Move from "layout.cc".
15285 * i386.cc (Target_i386::gc_process_relocs): New function.
15286 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
15287 * main.cc (main): Create object of class "Garbage_collection".
15288 * object.cc (Relobj::copy_symbols_data): New function.
15289 (Relobj::is_section_name_included): New function.
e1df38aa
NC
15290 (Sized_relobj::do_layout): Allow this function to be called twice
15291 during garbage collection and defer layout of section during the
6d03d481
ST
15292 first call.
15293 * object.h (Relobj::get_symbols_data): New function.
15294 (Relobj::is_section_name_included): New function.
15295 (Relobj::copy_symbols_data): New function.
15296 (Relobj::set_symbols_data): New function.
15297 (Relobj::get_relocs_data): New function.
15298 (Relobj::set_relocs_data): New function.
15299 (Relobj::is_output_section_offset_invalid): New pure virtual function.
15300 (Relobj::gc_process_relocs): New function.
15301 (Relobj::do_gc_process_relocs): New pure virtual function.
15302 (Relobj::sd_): New data member.
15303 (Sized_relobj::is_output_section_offset_invalid): New function.
15304 (Sized_relobj::do_gc_process_relocs): New function.
15305 * options.h (General_options::gc_sections): Modify to not be a no-op.
15306 (General_options::print_gc_sections): New option.
15307 * plugin.cc (Plugin_finish::run): Remove function call to
15308 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
15309 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
15310 * reloc.cc (Read_relocs::run): Add task to process relocs and
15311 determine unreferenced sections when doing garbage collection.
15312 (Gc_process_relocs): New class.
15313 (Sized_relobj::do_gc_process_relocs): New function.
15314 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
15315 sections that are garbage collected.
15316 * reloc.h (Gc_process_relocs): New class.
15317 * sparc.cc (Target_sparc::gc_process_relocs): New function.
15318 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
15319 symbols whose corresponding sections are garbage collected.
15320 (Symbol_table::Symbol_table): Add new parameter for the garbage
15321 collection object.
15322 (Symbol_table::gc_mark_undef_symbols): New function.
15323 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15324 (Symbol_table::gc_mark_dyn_syms): New function.
15325 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
15326 as garbage.
15327 (Symbol_table::add_from_object): Likewise.
15328 (Symbol_table::add_from_relobj): When building shared objects, do not
15329 treat externally visible symbols as garbage.
15330 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
15331 table information for static and relocatable links.
15332 * symtab.h (Symbol_table::set_gc): New function.
15333 (Symbol_table::gc): New function.
15334 (Symbol_table::gc_mark_undef_symbols): New function.
15335 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15336 (Symbol_table::gc_mark_dyn_syms): New function.
15337 (Symbol_table::gc_): New data member.
e1df38aa 15338 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
15339 function.
15340 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
15341 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
15342
3b293544
CF
153432009-01-20 Chris Faylor <me.sourceware@sourceware.org>
15344
15345 * options.h (General_options::gc_sections): Define as a no-op for now.
15346 (General_options::no_keep_memory): Ditto.
15347 (General_options::Bshareable): Define.
15348 * options.cc (General_options::finalize): Honor -Bshareable.
15349
83d22aa8
AS
153502009-01-20 Andreas Schwab <schwab@suse.de>
15351
15352 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
15353 read the value in the contents, since we don't use it. Use the
15354 template endianness when writing.
15355 (Relocate::relocate): Use it for R_PPC_REL16_HA.
15356
cd536b21
AS
153572009-01-19 Andreas Schwab <schwab@suse.de>
15358
15359 * configure.tgt (powerpc64-*): Fix targ_obj.
15360
99e9a495
ILT
153612009-01-15 Ian Lance Taylor <iant@google.com>
15362
15363 * object.cc (Sized_relobj::write_local_symbols): Don't write out
15364 local symbols when stripping all symbols.
15365
bbbfea06
CC
153662009-01-14 Cary Coutant <ccoutant@google.com>
15367
99e9a495 15368 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 15369
0f7c0701
CC
153702009-01-14 Cary Coutant <ccoutant@google.com>
15371
15372 * archive.cc (Archive::get_elf_object_for_member): Remove call
15373 to File_read::claim_for_plugin.
15374 * descriptors.cc (Descriptors::open): Remove reference to
15375 is_claimed.
15376 (Descriptors::claim_for_plugin): Remove.
15377 * descriptors.h (Descriptors::claim_for_plugin): Remove.
15378 (Descriptors::is_claimed): Remove.
15379 (claim_descriptor_for_plugin): Remove.
15380 * fileread.cc (File_read::claim_for_plugin): Remove.
15381 * fileread.h (File_read::claim_for_plugin): Remove.
15382 (File_read::descriptor): Reopen descriptor if necessary.
15383 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
15384 (Plugin_manager::all_symbols_read): Add task parameter. Change
15385 all callers.
15386 (Plugin_manager::get_input_file): New function.
15387 (Plugin_manager::release_input_file): New function.
15388 (Pluginobj::Pluginobj): Add filesize parameter and initialize
15389 corresponding data member.
15390 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
15391 and pass to base constructor. Change all callers.
15392 (get_input_file, release_input_file): New functions.
15393 (make_sized_plugin_object): Add filesize parameter. Change all callers.
15394 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
15395 (Plugin_manager::all_symbols_read): Add task parameter.
15396 (Plugin_manager::get_input_file): New function.
15397 (Plugin_manager::release_input_file): New function.
15398 (Plugin_manager::task_): New data member.
15399 (Pluginobj::Pluginobj): Add filesize parameter.
15400 (Pluginobj::filename): New function.
15401 (Pluginobj::descriptor): New function.
15402 (Pluginobj::filesize): New function.
15403 (Pluginobj::filesize_): New data member.
15404 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
15405 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
15406 File_read::claim_for_plugin; use Object::unlock to unlock the file.
15407
15408 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
15409 with archive libraries.
15410 * testsuite/Makefile.in: Regenerate.
15411 * testsuite/plugin_test.c (struct sym_info): New type.
15412 (get_input_file, release_input_file): New static variables.
15413 (onload): Capture new transfer vector entries.
15414 (claim_file_hook): Stop reading at end of file according to filesize.
15415 Factor out parsing of readelf output into separate function.
15416 (all_symbols_read_hook): Exercise get_input_file and release_input_file
15417 APIs and get the source file name from the symbol table. Convert
15418 source file name to corresponding object file name. Print info
15419 message when adding new input files.
15420 (parse_readelf_line): New function.
15421 * testsuite/plugin_test_1.sh: Add checks for new info messages.
15422 * testsuite/plugin_test_2.sh: Likewise.
15423 * testsuite/plugin_test_3.sh: Likewise.
15424 * testsuite/plugin_test_4.sh: New test case.
15425
62a6d109
ILT
154262009-01-07 Ian Lance Taylor <iant@google.com>
15427
15428 * version.cc (version_string): Bump to 1.8.
15429
483620e8
CC
154302008-12-23 Cary Coutant <ccoutant@google.com>
15431
15432 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
15433 * plugin.cc (Plugin_manager::finish): Rename as
15434 layout_deferred_objects. Move cleanup to separate function.
15435 (Plugin_manager::cleanup): New function.
15436 (Plugin_finish::run): Call layout_deferred_objects and cleanup
15437 separately.
15438 * plugin.h (Plugin_manager::finish): Rename as
15439 layout_deferred_objects.
15440 (Plugin_manager::cleanup): New function.
15441 (Plugin_manager::cleanup_done): New field.
15442
d66a9eb3
CC
154432008-12-23 Cary Coutant <ccoutant@google.com>
15444
15445 * plugin.cc (is_visible_from_outside): New function.
15446 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
15447 so we don't return "IR only" status for exported symbols or -r links.
15448
15449 * testsuite/Makefile.am (plugin_test_3): New test case.
15450 * testsuite/Makefile.in: Regenerate.
15451 * testsuite/plugin_test_3.sh: New file.
15452
5995b570
CC
154532008-12-22 Cary Coutant <ccoutant@google.com>
15454
15455 * object.cc (Sized_relobj::layout_section): New function.
15456 (Sized_relobj::do_layout): Defer layout of input sections until after
15457 plugin has provided replacement files.
15458 (Sized_relobj::do_layout_deferred_sections): New function.
15459 * object.h (Relobj::set_section_offset): Remove virtual keyword.
15460 (Relobj::layout_deferred_sections): New function.
15461 (Relobj::do_layout_deferred_sections): New function.
15462 (Sized_relobj::do_layout_deferred_sections): New function.
15463 (Sized_relobj::layout_section): New function.
15464 (Sized_relobj::Deferred_layout): New structure.
15465 (Sized_relobj::deferred_layout_): New field.
15466 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
15467 Change all callers. Layout deferred sections.
15468 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
15469 references.
15470 (Plugin_hook::run): Move code from do_plugin_hook inline.
15471 (Plugin_hook::do_plugin_hook): Remove.
15472 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
15473 (Plugin_manager::finish): Renamed, was cleanup.
15474 (Plugin_manager::should_defer_layout): New function.
15475 (Plugin_manager::add_deferred_layout_object): New function.
15476 (Plugin_manager::Deferred_layout_list): New type.
15477 (Plugin_manager::deferred_layout_objects_): New field.
15478 (Plugin_hook::do_plugin_hook): Remove.
15479
ee769c88
ILT
154802008-12-17 Ian Lance Taylor <iant@google.com>
15481
15482 * options.h (class General_options): Add --no case for
15483 --export-dynamic.
15484
abc8dcba
CC
154852008-12-16 Cary Coutant <ccoutant@google.com>
15486
15487 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
15488 vector.
15489 (Plugin_manager::claim_file): Create plugin object even if
15490 plugin did not call the add_symbols callback.
15491 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
15492 asking for more symbols than were added.
15493 * testsuite/Makefile.am (plugin_test_1): Add test case with
15494 no global symbols.
15495 (empty.syms): New target.
15496 * testsuite/Makefile.in: Regenerate.
15497 * testsuite/plugin_test.c (claim_file_hook): Add new debug
15498 message. Don't call add_symbols if no globals.
15499 (all_symbols_read_hook): Don't provide replacement for empty
15500 claimed file.
15501
b0074644
ILT
155022008-12-12 Ian Lance Taylor <iant@google.com>
15503
68943102
ILT
15504 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
15505 r_type == 0 for a local symbol with r_sym == 0.
15506 (scan_relocatable_relocs): Pass r_sym to
15507 local_non_section_strategy.
15508 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
15509 r_sym parameter.
15510
b0074644
ILT
15511 * configure.ac: Update test for TLS descriptors: they are
15512 supported as of glibc 2.9.
15513 * configure: Rebuild.
15514
c2508178
ILT
155152008-12-11 Ian Lance Taylor <iant@google.com>
15516
15517 PR 7091
15518 * target-reloc.h (Default_scan_relocatable_relocs): For each
15519 function, map r_type == 0 to RELOC_DISCARD.
15520
2756a258
CC
155212008-12-10 Cary Coutant <ccoutant@google.com>
15522
15523 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
15524 object to override a kept COMDAT group from a plugin object.
15525
bb6f53d3
ILT
155262008-12-09 Ian Lance Taylor <iant@google.com>
15527
fbc558e1
ILT
15528 PR 7088
15529 * yyscript.y (file_cmd): Handle INPUT.
15530
bb6f53d3
ILT
15531 * testsuite/initpri1.c: Change all declarations to be full
15532 prototypes by adding void, to avoid compiler warnings.
15533
4674ecfc
CC
155342008-12-05 Rafael Avila de Espindola <espindola@google.com>
15535
15536 * options.cc (General_options::parse_plugin_opt): New.
15537 (General_options::add_plugin): The argument now is just the filename.
15538 (General_options::add_plugin_option): New.
15539 * options.h (plugin_opt): New.
15540 (add_plugin): Change argument name.
15541 (add_plugin_option): New.
15542 * plugin.cc (Plugin::load): Don't parse the plugin option.
15543 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
15544 (Plugin::add_option): New.
15545 (Plugin::args_): Change type.
15546 (Plugin::filename_): New.
15547 (Plugin_manager::add_plugin_option): New.
15548 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
15549 * testsuite/Makefile.in: Regenerate.
15550
fd06b4aa
CC
155512008-12-05 Cary Coutant <ccoutant@google.com>
15552
15553 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
15554 Handle --strip-lto-sections option.
15555 * options.h (strip_lto_sections): New option.
15556
6c52134c
CC
155572008-12-01 Cary Coutant <ccoutant@google.com>
15558
15559 * plugin.cc (ld_plugin_message): Change format parameter to const.
15560 Fix mismatch between new[] and delete.
15561
a45248e0
CC
155622008-11-14 Cary Coutant <ccoutant@google.com>
15563
15564 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
15565 instead of -1U.
15566
c82fbeee
CS
155672008-11-05 Craig Silverstein <csilvers@google.com>
15568
15569 * options.cc (General_options::parse_dynamic_list): New function.
15570 * options.h (General_options): New flags dynamic_list,
15571 dynamic_list_data, dynamic_list_cpp_new, and
15572 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
15573 (General_options::in_dynamic_list): New function.
15574 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
15575 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
15576 (Lex::can_continue_name): Likewise.
15577 (yylex): Likewise.
15578 (read_script_file): New parameter script_options.
15579 (read_dynamic_list): New function.
15580 (Script_options::define_dynamic_list): New function.
15581 (dynamic_list_keyword_parsecodes): New variable.
15582 (dynamic_list_keywords): New variable.
15583 * script.h (Script_options::define_dynamic_list): New function
15584 prototype.
15585 (read_dynamic_list): New function prototype.
15586 * symtab.cc (strprefix): New macro.
15587 (Symbol::should_add_dynsym_entry): Support dynamic_list,
15588 dynamic_list_data, dynamic_list_cpp_new, and
15589 dynamic_list_cpp_typeinfo.
15590 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
15591 (dynamic_list_expr): New rule.
15592 (dynamic_list_nodes): Likewise.
15593 (dynamic_list_node): Likewise.
15594 * testsuite/Makefile.am (dynamic_list): New test.
15595 * testsuite/Makefile.in: Regenerated.
15596 * testsuite/dynamic_list.t: New file.
15597 * testsuite/dynamic_list.sh: New file.
15598
e0bb29a5
CS
155992008-11-05 Craig Silverstein <csilvers@google.com>
15600
15601 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
15602 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
15603 (t11_last): Likewise.
15604 * testsuite/ver_test_6.c (main): Likewise.
15605
4e1e25e0
CC
156062008-10-07 Cary Coutant <ccoutant@google.com>
15607
15608 * options.c (General_options::finalize): Add check for -static and
15609 -shared.
15610 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
15611 is not empty.
15612
92f03fcb
CC
156132008-10-02 Cary Coutant <ccoutant@google.com>
15614
15615 * plugin.cc (make_sized_plugin_object): Fix conditional
15616 compilation to work when not all targets are enabled.
15617
fbd8a257
CC
156182008-09-29 Cary Coutant <ccoutant@google.com>
15619
15620 * archive.cc (Archive::get_file_and_offset): Use filename instead
15621 of name to get library path.
15622 (Archive::include_member): Unlock external member of a thin archive.
15623
15624 * testsuite/Makefile.am (TEST_AR): New variable.
15625 (thin_archive_test_1): New test.
15626 (thin_archive_test_2): New test.
81636b3f
CC
15627 * testsuite/Makefile.in: Regenerate.
15628 * testsuite/thin_archive_main.cc: New file.
15629 * testsuite/thin_archive_test_1.cc: New file.
15630 * testsuite/thin_archive_test_2.cc: New file.
15631 * testsuite/thin_archive_test_3.cc: New file.
15632 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 15633
eff45813
CC
156342008-09-29 Cary Coutant <ccoutant@google.com>
15635
15636 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
15637 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
15638 instead of -1U.
15639 (Sized_relobj::do_finalize_local_symbols): Likewise.
15640 (Sized_relobj::map_to_kept_section): Likewise.
15641 * object.h (Sized_relobj::invalid_address): New constant.
15642 (Sized_relobj::do_output_section_offset): Check for invalid_address
15643 and return -1ULL.
15644 * output.cc (Output_reloc::local_section_offset): Use constant
15645 invalid_address instead of -1U.
15646 (Output_reloc::get_address): Likewise.
15647 (Output_section::output_address): Change -1U to -1ULL.
15648 * output.h (Output_reloc::invalid_address): New constant.
15649 * reloc.cc (Sized_relobj::write_sections): Use constant
15650 invalid_address instead of -1U.
15651 (Sized_relobj::relocate_sections): Likewise.
15652 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
15653 values for merge sections.
15654 * target-reloc.h (relocate_for_relocatable): Use constant
15655 invalid_address instead of -1U.
15656
89fc3421
CC
156572008-09-19 Cary Coutant <ccoutant@google.com>
15658
15659 Add plugin functionality for link-time optimization (LTO).
15660 * configure.ac (plugins): Add --enable-plugins option.
15661 * configure: Regenerate.
15662 * config.in: Regenerate.
15663 * Makefile.am (LIBDL): New variable.
15664 (CCFILES): Add plugin.cc.
15665 (HFILES): Add plugin.h.
15666 (ldadd_var): Add LIBDL.
15667 * Makefile.in: Regenerate.
15668
15669 * archive.cc: Include "plugin.h".
15670 (Archive::setup): Don't preread archive symbols when using a plugin.
15671 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
15672 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
15673 files.
15674 (Archive::include_member): Add symbols from plugin objects.
15675 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
15676 * descriptors.cc (Descriptors::open): Check for file descriptors
15677 abandoned by plugins.
15678 (Descriptors::claim_for_plugin): New function.
15679 * descriptors.h (Descriptors::claim_for_plugin): New function.
15680 (Open_descriptor::is_claimed): New field.
15681 (claim_descriptor_for_plugin): New function.
15682 * fileread.cc (File_read::claim_for_plugin): New function.
15683 * fileread.h (File_read::claim_for_plugin): New function.
15684 (File_read::descriptor): New function.
15685 * gold.cc: Include "plugin.h".
15686 (queue_initial_tasks): Add task to call plugin hooks for generating
15687 new object files.
15688 * main.cc: Include "plugin.h".
15689 (main): Load plugin libraries.
15690 * object.h (Pluginobj): Declare.
15691 (Object::pluginobj): New function.
15692 (Object::do_pluginobj): New function.
15693 (Object::set_target): New function.
15694 * options.cc: Include "plugin.h".
15695 (General_options::parse_plugin): New function.
15696 (General_options::General_options): Initialize plugins_ field.
15697 (General_options::add_plugin): New function.
15698 * options.h (Plugin_manager): Declare.
15699 (General_options): Add --plugin option.
15700 (General_options::has_plugins): New function.
15701 (General_options::plugins): New function.
15702 (General_options::add_plugin): New function.
15703 (General_options::plugins_): New field.
15704 * plugin.cc: New file.
15705 * plugin.h: New file.
15706 * readsyms.cc: Include "plugin.h".
15707 (Read_symbols::do_read_symbols): Check for archive before checking
15708 for ELF file. Call plugin hooks to claim files.
15709 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
15710 from a real object file; force override when processing replacement
15711 files.
15712 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
15713 (Symbol::init_base_object): Likewise.
15714 (Symbol::init_base_output_data): Likewise.
15715 (Symbol::init_base_output_segment): Likewise.
15716 (Symbol::init_base_constant): Likewise.
15717 (Symbol::init_base_undefined): Likewise.
15718 (Symbol::output_section): Assert that object is not a plugin.
15719 (Symbol_table::add_from_pluginobj): New function.
15720 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
15721 undefined.
15722 (Symbol_table::sized_write_globals): Likewise.
15723 (Symbol_table::add_from_pluginobj): Instantiate template.
15724 * symtab.h (Sized_pluginobj): Declare.
15725 (Symbol::in_real_elf): New function.
15726 (Symbol::set_in_real_elf): New function.
15727 (Symbol::in_real_elf_): New field.
15728 (Symbol_table::add_from_pluginobj): New function.
15729
15730 * testsuite/Makefile.am (AM_CFLAGS): New variable.
15731 (LIBDL): New variable.
15732 (LDADD): Add LIBDL.
15733 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
15734 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
15735 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
15736 (MOSTLYCLEANFILES): Likewise.
15737 * testsuite/Makefile.in: Regenerate.
15738 * testsuite/plugin_test.c: New file.
15739 * testsuite/plugin_test_1.sh: New file.
15740 * testsuite/plugin_test_2.sh: New file.
15741
de31bda5
ILT
157422008-09-16 Ian Lance Taylor <iant@google.com>
15743
9c2d0ef9
ILT
15744 * target-reloc.h (relocate_section): Check whether a symbol is
15745 defined by the ABI before reporting an undefined symbol error.
15746 * target.h (Target::is_defined_by_abi): Make parameter const.
15747 (Target::do_is_defined_by_abi): Likewise.
15748 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
15749 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
15750 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
15751 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
15752 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
15753 * testsuite/Makefile.in: Rebuild.
15754
de31bda5
ILT
15755 * fileread.cc (make_view): Add casts to avoid warning.
15756
9fa33bee
AO
157572008-09-16 Alexandre Oliva <aoliva@redhat.com>
15758
15759 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
15760 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15761
183fd0e3
AO
157622008-09-16 Alexandre Oliva <aoliva@redhat.com>
15763
15764 * options.h (General_options::output_is_executable): New.
15765 (General_options::output_is_pie): New.
15766 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
15767 for shared libraries.
15768 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15769
7be8330a
CD
157702008-09-11 Chris Demetriou <cgd@google.com>
15771
15772 * options.h (origin): New -z option.
15773 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
15774 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
15775 in DT_FLAGS_1.
15776
a9caad02
CC
157772008-09-05 Cary Coutant <ccoutant@google.com>
15778
15779 * fileread.cc (File_read::make_view): Add check for attempt to map
15780 beyond end of file.
15781
ae6dce4d
CC
157822008-09-05 Cary Coutant <ccoutant@google.com>
15783
15784 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
15785 explicit instantiations.
15786
d7ab2a47
KVH
157872008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
15788
15789 PR gold/6858
15790 * options.cc (General_options::finalize): Allow undefined symbols
15791 in shlibs if linking -shared.
15792
15793 PR gold/6859
15794 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
15795 symbols as not needing a dynsym entry.
15796
1e52a9c1
CS
157972008-08-20 Craig Silverstein <csilvers@google.com>
15798
15799 * fileread.cc (File_read::open): Do not lock the file unless it
15800 was successfully opened.
15801
d85c80a3
CC
158022008-08-14 Cary Coutant <ccoutant@google.com>
15803
15804 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
15805 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
15806 * testsuite/tls_test.cc (struct int128): 128-bit struct
15807 for testing TLS relocs with non-zero addend.
15808 (v12): New TLS variable.
15809 (t12): New test.
15810 (t_last): Add check for v12.
15811 * testsuite/tls_test.h (t12): New function.
15812 * testsuite/tls_test_main.cc (thread_routine): Call new test.
15813
2d924fd9
ILT
158142008-08-13 Ian Lance Taylor <iant@google.com>
15815
15816 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
15817 set tls_segment_ or relro_segment_.
15818 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
15819 when appropriate.
15820 * output.h (Output_section::clear_is_relro): New function.
15821 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
15822 sections specially even when output_data_ is empty.
15823 (Output_segment::maximum_alignment): When first section is relro,
15824 only force alignment for PT_LOAD segments.
15825 * script.cc (script_data_segment_align): New function.
15826 (script_data_segment_relro_end): New function.
15827 * script-c.h (script_data_segment_align): Declare.
15828 (script_data_segment_relro_end): Declare.
15829 * script-sections.h (class Script_sections): Declare
15830 data_segment_align and data_segment_relro_end. Add fields
15831 segment_align_index_ and saw_relro_end_.
15832 * script-sections.cc (class Sections_element): Add set_is_relro
15833 virtual function. Add new bool* parameter to place_orphan_here.
15834 Add get_output_section virtual function.
15835 (class Output_section_definition): Add set_is_relro. Add new
15836 bool* parameter to place_orphan_here. Add get_output_section.
15837 Add is_relro_ field.
15838 (Output_section_definition::Output_section_definition): Initialize
15839 evaluated_address_, evaluated_load_address, evaluated_addralign_,
15840 and is_relro_ fields.
15841 (Output_section_definition::place_orphan_here): Add is_relro
15842 parameter.
15843 (Output_section_definition::set_section_addresses): Set relro for
15844 output section.
15845 (Output_section_definition::alternate_constraint): Likewise.
15846 (class Orphan_output_section): Add new bool* parameter to
15847 place_orphan_here. Add get_output_section.
15848 (Orphan_output_section::place_orphan_here): Add is_relro
15849 parameter.
15850 (Script_sections::Script_sections): Initialize
15851 data_segment_align_index_ and saw_relro_end_.
15852 (Script_sections::data_segment_align): New function.
15853 (Script_sections::data_segment_relro_end): New function.
15854 (Script_sections::place_orphan): Set or clear is_relro.
15855 (Script_sections::set_section_addresses): Force alignment of first
15856 TLS section.
15857 * yyscript.y (exp): Call script_data_segment_align and
15858 script_data_segment_relro_end.
15859 * testsuite/relro_script_test.t: New file.
15860 * testsuite/relro_test.cc (using_script): Declare.
15861 (t1, t2): Test using_script.
15862 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
15863 (relro_script_test_SOURCES): Define.
15864 (relro_script_test_DEPENDENCIES): Define.
15865 (relro_script_test_LDFLAGS): Define.
15866 (relro_script_test_LDADD): Define.
15867 (relro_script_test.so): New target.
15868 * testsuite/Makefile.in: Rebuild.
15869
f827c9a9
CC
158702008-08-06 Cary Coutant <ccoutant@google.com>
15871
15872 * archive.cc (Archive::total_archives, Archive::total_members)
15873 (Archive::total_members_loaded): New variables.
15874 (Archive::setup): Add parameter. Add option to preread
15875 archive symbols.
15876 (Archive::read_armap): Add counter.
15877 (Archive::get_file_and_offset): New function.
15878 (Archive::get_elf_object_for_member): New function.
15879 (Archive::read_all_symbols): New function.
15880 (Archive::read_symbols): New function.
15881 (Archive::add_symbols): Add counters.
15882 (Archive::include_all_members): Use armap to find members if it's
15883 already built.
15884 (Archive::include_member): Skip reading symbols if already read.
15885 Factored code into Archive::get_file_and_offset and
15886 Archive::get_elf_object_for_member. Changed call to
15887 Mapfile::report_include_archive_member.
15888 (Archive::print_stats): New function.
15889 * archive.h: Declare Object and Read_symbols_data classes.
15890 (Archive::Archive): Add initializers for new members.
15891 (Archive::setup): Add parameter.
15892 (Archive::print_stats): New function.
15893 (Archive::total_archives, Archive::total_members)
15894 (Archive::total_members_loaded): New variables.
15895 (Archive::get_file_and_offset): New function.
15896 (Archive::get_elf_object_for_member): New function.
15897 (Archive::read_all_symbols): New function.
15898 (Archive::read_symbols): New function.
15899 (Archive::Archive_member): New class.
15900 (Archive::members_): New member.
15901 (Archive::num_members_): New member.
15902 * main.cc: Include archive.h.
15903 (main): Call Archive::print_stats.
15904 * mapfile.cc (Mapfile::report_include_archive_member): Delete
15905 archive parameter; member_name is now the fully-decorated name.
15906 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
15907 * options.h: (General_options): Add --preread-archive-symbols option.
15908 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
15909 Archive::setup.
15910
de4c45bd
ILT
159112008-08-04 Ian Lance Taylor <iant@google.com>
15912
15913 * symtab.h (Symbol::use_plt_offset): New function.
15914 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
15915 * powerpc.cc (Relocate::relocate): Likewise.
15916 * sparc.cc (Relocate::relocate): Likewise.
15917 * x86_64.cc (Relocate::relocate): Likewise.
15918 * testsuite/weak_plt.sh: New test.
15919 * testsuite/weak_plt_main.cc: New test.
15920 * testsuite/weak_plt_shared.cc: New test.
15921 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
15922 (check_PROGRAMS): Add weak_plt.
15923 (check_DATA): Add weak_plt_shared.so.
15924 (weak_plt_main_pic.o, weak_plt): New targets.
15925 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
15926 * testsuite/Makefile.in: Rebuild.
15927
15928 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
15929 gcctestdir/ld.
15930 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
15931 * testsuite/Makefile.in: Rebuild.
15932
323ee3f4
AM
159332008-08-04 Alan Modra <amodra@bigpond.net.au>
15934
15935 * Makefile.am (POTFILES.in): Set LC_ALL=C.
15936 * Makefile.in: Regenerate.
15937 * po/POTFILES.in: Regenerate.
15938
7c07ecec
ILT
159392008-07-29 Ian Lance Taylor <iant@google.com>
15940
15941 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
15942 symbols before other symbols.
15943 * testsuite/script_test_2.cc (test_addr): Declare.
15944 (test_addr_alias): Declare.
15945 (main): Check that test_addr and test_addr_alias have the right
cd536b21 15946 values.
7c07ecec
ILT
15947 * testsuite/script_test_2.t: Define test_addr_alias and
15948 test_addr.
15949
5778530e
ILT
159502008-07-24 Ian Lance Taylor <iant@google.com>
15951
2a00e4fb
ILT
15952 PR 5990
15953 * descriptors.cc: New file.
15954 * descriptors.h: New file.
15955 * gold-threads.h (class Hold_optional_lock): New class.
15956 * fileread.cc: Include "descriptors.h".
15957 (File_read::~File_read): Release descriptor rather than closing
15958 it.
15959 (File_read::open) [file]: Call open_descriptor rather than open.
15960 Set is_descriptor_opened_.
15961 (File_read::open) [memory]: Assert that descriptor is not open.
15962 (File_read::reopen_descriptor): New function.
15963 (File_read::release): Release descriptor.
15964 (File_read::do_read): Make non-const. Reopen descriptor.
15965 (File_read::read): Make non-const.
15966 (File_read::make_view): Reopen descriptor.
15967 (File_read::do_readv): Likewise.
15968 * fileread.h (class File_read): Add is_descriptor_opened_ field.
15969 Update declarations.
15970 * layout.cc: Include "descriptors.h".
15971 (Layout::create_build_id): Use open_descriptor rather than open.
15972 * output.cc: Include "descriptors.h".
15973 (Output_file::open): Use open_descriptor rather than open.
15974 * archive.cc (Archive::const_iterator): Change Archive to be
15975 non-const.
15976 (Archive::begin, Archive::end): Make non-const.
15977 (Archive::count_members): Likewise.
15978 * archive.h (class Archive): Update declarations.
15979 * object.h (Object::read): Make non-const.
15980 * Makefile.am (CCFILES): Add descriptors.cc.
15981 (HFILES): Add descriptors.h.
15982 * Makefile.in: Rebuild.
15983
801647d1
ILT
15984 PR 6716
15985 * gold.h: Always include <clocale>. Add Solaris workarounds
15986 following code in binutils/sysdep.h.
15987
5edd166e
ILT
15988 PR 6048
15989 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
15990 this->eh_frame_hdr_ is NULL before using it.
15991
c89ad728
ILT
15992 * dynobj.cc (Versions::Versions): Update comment.
15993
aa86f06b
ILT
15994 * dynobj.cc (Versions::Versions): If there is an soname, use it as
15995 the base version name.
15996
5778530e
ILT
15997 * stringpool.cc (Stringpool_template::add_with_length): Set key to
15998 array size plus one.
15999 (Stringpool_template::set_string_offsets): Subtract one from key
16000 before using it as an array index.
16001 (Stringpool_template::get_offset_with_length): Likewise.
16002 (Stringpool_template::write_to_buffer): Likewise.
16003 * stringpool.h (Stringpool_template::get_offset_from_key):
16004 Likewise.
16005
057ead22
ILT
160062008-07-23 Ian Lance Taylor <iant@google.com>
16007
7f649c59
ILT
16008 PR 6658
16009 * object.h (Merged_symbol_value::value): Do our best to handle a
16010 negative addend.
16011
057ead22
ILT
16012 PR 6647
16013 * script.cc (Version_script_info::get_versions): Don't add empty
16014 version tag to return value.
16015 (Version_script_info::get_symbol_version_helper): Change return
16016 type to bool. Add pversion parameter. Change all callers.
16017 (script_register_vers_node): Don't require a non-NULL tag.
16018 * script.h (class Version_script_info): Update declarations.
16019 (Version_script_info::get_symbol_version): Change return type to
16020 bool. Add version parameter. Change all callers.
16021 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
16022 handling. Handle an empty version from a version script.
16023 (Symbol_table::define_special_symbol): Likewise.
16024 * testsuite/ver_test_10.script: New file.
16025 * testsuite/ver_test_10.sh: New file.
16026 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
16027 (check_DATA): Add ver_test_10.syms.
16028 (ver_test_10.syms, ver_test_10.so): New target.
16029 * testsuite/Makefile.in: Rebuild.
16030
58e54ac2
CD
160312008-07-23 Simon Baldwin <simonb@google.com>
16032
16033 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
16034 to zero for undefined symbols from dynamic libraries.
16035
95d14cd3
ILT
160362008-07-23 Ian Lance Taylor <iant@google.com>
16037
16038 * symtab.cc (Symbol_table::resolve): Remove version parameter.
16039 Change all callers.
16040 * symtab.h (class Symbol_table): Update declaration.
16041 * testsuite/ver_test_9.cc: New file.
16042 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
16043 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
16044 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
16045 (ver_test_9.so, ver_test_9.o): New targets.
16046 * testsuite/Makefile.in: Rebuild.
16047
92de84a6
ILT
160482008-07-22 Ian Lance Taylor <iant@google.com>
16049
34810851
ILT
16050 * options.h (class General_options): Define --check-sections.
16051 * layout.cc (Layout::set_segment_offsets): Handle
16052 --check-sections.
16053
af6156ef
ILT
16054 * options.h (class General_options): Define -n/--nmagic and
16055 -N/--omagic.
16056 * options.cc (General_options::finalize): For -n/--nmagic or
16057 -N/--omagic, set -static.
16058 * layout.cc (Layout::attach_allocated_section_to_segment): If
16059 -N/--omagic, don't put read-only and read-write sections in
16060 different segments.
16061 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
16062 finding a read-only segment.
16063 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
16064 don't set the minimum segment alignment to the common page size,
16065 and don't set the file offset to the address modulo the page size.
16066 * script-sections.cc (Script_sections::create_segments): If
16067 -n/--omagic, don't put read-only and read-write sections in
16068 different segments.
16069
92de84a6
ILT
16070 * cref.cc: New file.
16071 * cref.h: New file.
16072 * options.h (class General_options): Add --print-symbol-counts.
16073 * main.cc (main): Issue defined symbol report if requested.
16074 * archive.cc (Archive::interpret_header): Make into a const member
16075 function.
16076 (Archive::add_symbols): Call Input_objects::archive_start and
16077 archive_stop.
16078 (Archive::const_iterator): Define new class.
16079 (Archive::begin, Archive::end): New functions.
16080 (Archive::include_all_members): Rewrite to use iterator.
16081 (Archive::count_members): New function.
16082 * archive.h (class Archive): Update declarations.
16083 (Archive::filename): New function.
16084 * object.cc: Include "cref.h".
16085 (Sized_relobj::Sized_relobj): Initialize defined_count_.
16086 (Sized_relobj::do_get_global_symbol_counts): New function.
16087 (Input_objects::add_object): Add object to cross-referencer.
16088 (Input_objects::archive_start): New function.
16089 (Input_objects::archive_stop): New function.
16090 (Input_objects::print_symbol_counts): New function.
16091 * object.h: Declare Cref and Archive.
16092 (Object::get_global_symbol_counts): New function.
16093 (Object::do_get_global_symbol_counts): New pure virtual function.
16094 (class Sized_relobj): Add defined_count_ field. Update
16095 declarations.
16096 (class Input_objects): Add cref_ field. Update constructor.
16097 Update declarations.
16098 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
16099 defined_count_.
16100 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
16101 symbol counts.
16102 (Sized_dynobj::do_get_global_symbol_counts): New function.
16103 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
16104 defined_count_. Update declarations. Define Symbols typedef.
16105 * symtab.cc (Symbol_table::add_from_relobj): Add defined
16106 parameter. Change all callers.
16107 (Symbol_table::add_from_dynobj): Add sympointers and defined
16108 parameters. Change all callers.
16109 * symtab.h (class Symbol_table): Update declarations.
16110 * Makefile.am (CCFILES): Add cref.cc.
16111 (HFILES): Add cref.h.
16112 * Makefile.in: Rebuild.
16113
3f7c5e1d
CD
161142008-07-22 Simon Baldwin <simonb@google.com>
16115
16116 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
16117 to zero when writing undefined symbols.
16118
e0b64032
ILT
161192008-07-22 Ian Lance Taylor <iant@google.com>
16120
16121 * output.cc (Output_section::add_input_section): Don't try to
16122 merge empty merge sections.
16123
096b02cf
CS
161242008-07-21 Craig Silverstein <csilvers@google.com>
16125
16126 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
16127 Include symbol version in error message.
cd536b21 16128
1d1f116d
CD
161292008-07-20 Chris Demetriou <cgd@google.com>
16130
cd536b21 16131 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
16132 (RANDOM_SEED_CFLAGS): New substituted variable.
16133 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
16134 * configure: Rebuild.
16135 * Makefile.in: Likewise.
16136 * testsuite/Makefile.in: Likewise.
16137
a18f591e
ILT
161382008-07-18 Ian Lance Taylor <iant@google.com>
16139
16140 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
16141 where we see NAME/NULL and NAME/VERSION as separate symbols.
16142 * testsuite/ver_test_main.cc (main): Call t4.
16143 (t4, t4_2a): Define.
16144 * testsuite/ver_test_2.cc (t4_2): Define.
16145 * testsuite/ver_test_2.script: Put t4_2a in VER2.
16146 * testsuite/ver_test_4.cc (t4_2a): Define.
16147 * testsuite/ver_test_4.script: Put t4_2a in VER2.
16148 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
16149
c6e3f6ed
ILT
161502008-07-17 Ian Lance Taylor <iant@google.com>
16151
16152 * dynobj.cc (Versions::add_def): If we give an error about a
16153 missing version, go ahead and create the version anyhow.
16154
ef9beddf
ILT
161552008-07-10 Ian Lance Taylor <iant@google.com>
16156
16157 Handle output sections with more than 0x7fffffff bytes.
16158 * object.h (class Relobj): Change map_to_output_ to
16159 output_sections_, and just keep a section pointer. Change all
16160 uses. Move comdat group support to Sized_relobj.
16161 (Relobj::is_section_specially_mapped): Remove.
16162 (Relobj::output_section): Remove poff parameter. Change all
16163 callers.
16164 (Relobj::output_section_offset): New function.
16165 (Relobj::set_section_offset): Rewrite.
16166 (Relobj::map_to_output): Remove.
16167 (Relobj::output_sections): New function.
16168 (Relobj::do_output_section_offset): New pure virtual function.
16169 (Relobj::do_set_section_offset): Likewise.
16170 (class Sized_relobj): Add section_offsets_ field. Add comdat
16171 group support from Relobj. Update declarations.
16172 (Sized_relobj::get_output_section_offset): New function.
16173 (Sized_relobj::do_output_section_offset): New function.
16174 (Sized_relobj::do_set_section_offset): New function.
16175 * object.cc (Relobj::output_section_address): Remove.
16176 (Sized_relobj::Sized_relobj): Initialize new fields.
16177 (Sized_relobj::include_section_group): Cast find_kept_object to
16178 Sized_relobj.
16179 (Sized_relobj::include_linkonce_section): Likewise.
16180 (Sized_relobj::do_layout): Use separate arrays for output section
16181 and output offset.
16182 (Sized_relobj::do_count_local_symbols): Change map_to_output to
16183 output_sections.
16184 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
16185 output_sections and section_offsets.
16186 (Sized_relobj::write_local_symbols): Likewise.
16187 (map_to_kept_section): Compute output address directly.
16188 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
16189 output_sections and section_offsets.
16190 (Sized_relobj::write_sections): Likewise.
16191 (Sized_relobj::relocate_sections): Likewise.
16192 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
16193 * output.h (class Output_reloc): Update declarations. Change
16194 u2_.relobj to Sized_relobj*.
16195 (class Output_data_reloc): Change add functions to use
16196 Sized_relobj*.
16197 * output.cc (Output_reloc::Output_reloc): Change relobj to
16198 Sized_relobj*.
16199 (Output_reloc::local_section_offset): Change return type to
16200 Elf_Addr. Use get_output_section_offset.
16201 (Output_reloc::get_address): Likewise.
16202 (Output_section::is_input_address_mapped): Don't call
16203 is_section_specially_mapped.
16204 (Output_section::output_offset): Likewise.
16205 (Output_section::output_address): Likewise.
16206 (Output_section::starting_output_address): Likewise.
16207 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
16208 parameter to Sized_relobj*.
16209 (Copy_relocs::need_copy_reloc): Likewise.
16210 (Copy_relocs::save): Likewise.
16211 * copy-relocs.h (class Copy_relocs): Update declarations.
16212 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
16213 Sized_relobj*. Change relobj_ field to Sized_relobj*.
16214 * target-reloc.h (relocate_for_relocatable): Change
16215 offset_in_output_section type to Elf_Addr. Change code that uses
16216 it as well.
16217 * layout.cc (Layout::layout): Always set *off.
16218 * mapfile.cc (Mapfile::print_input_section): Use
16219 output_section_offset.
16220 * i386.cc (Target_i386::copy_reloc): Change object parameter to
16221 Sized_relobj*.
16222 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
16223 * sparc.cc (Target_sparc::copy_reloc): Likewise.
16224 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
16225
5cb66f97
ILT
162262008-07-03 Ian Lance Taylor <iant@google.com>
16227
16228 * layout.cc (Layout::include_section): Do not discard unrecognized
16229 SHT_STRTAB sections.
16230
afe47622
CS
162312008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
16232
16233 * script.cc (Lex::can_continue_name): Make '?' allowable in
16234 version-script names.
16235 * testsuite/version_script.map: Change glob pattern to use '?'
16236
5adf9721
ILT
162372008-06-30 Manish Singh <yosh@gimp.org>
16238
16239 PR 6585
16240 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
16241 Correct typo.
16242
e6fde208
ILT
162432008-06-30 Ian Lance Taylor <iant@google.com>
16244
16245 PR 6660
16246 PR 6682
16247 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
16248 versions]: Don't try to read the value in the contents, since we
16249 don't use it. Use the template endianness when writing.
16250
3f2e6a2d
CC
162512008-06-25 Cary Coutant <ccoutant@google.com>
16252
16253 * fileread.cc (File_read::make_view): Assert on zero-length view.
16254 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
16255 symbol table when there are no symbols to read.
16256
c43d3a48
CS
162572008-06-23 Craig Silverstein <csilvers@google.com>
16258
16259 * version.cc (version_string): Bump to 1.7
16260
5f494ea0
CS
162612008-06-18 Craig Silverstein <csilvers@google.com>
16262
16263 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
16264 constant 0xFFFF to type Valtype.
16265 (Powerpc_relocate_functions::rel16_ha): Likewise.
16266
c42e122e
ILT
162672008-06-17 Ian Lance Taylor <iant@google.com>
16268
f34787f8
ILT
16269 * output.h (Output_section::Input_section): Initialize p2align_ to
16270 zero for Output_section_data constructors.
16271 (Output_section::Input_section::addralign): If not an input
16272 section, return the alignment of the Output_section_data.
16273 * testsuite/copy_test.cc: New file.
16274 * testsuite/copy_test_1.cc: New file.
16275 * testsuite/copy_test_2.cc: New file.
16276 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
16277 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
16278 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
16279 (copy_test_1_pic.o, copy_test_1.so): New targets.
16280 (copy_test_2_pic.o, copy_test_2.so): New targets.
16281 * testsuite/Makefile.in: Rebuild.
16282
c42e122e
ILT
16283 * script-sections.cc (Script_sections::place_orphan): Initialize
16284 local variable exact.
16285
ce3ac18a
DE
162862008-06-13 David Edelsohn <edelsohn@gnu.org>
16287
16288 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
16289
42cacb20
DE
162902008-06-12 David Edelsohn <edelsohn@gnu.org>
16291 David S. Miller <davem@davemloft.net>
16292
16293 * powerpc.cc: New file.
16294 * Makefile.am (TARGETSOURCES): Add powerpc.cc
16295 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
16296 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
16297 * Makefile.in: Rebuild.
16298
7b308235
ILT
162992008-06-09 Ian Lance Taylor <iant@google.com>
16300
16301 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
16302 <exception>.
16303 (throwing, orig_terminate): New static variables.
16304 (terminate_handler): New static function.
16305 (t2): Set terminate handler.
16306
f0b886e3
ILT
163072008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
16308
16309 PR 6584
cd536b21 16310 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
16311 alignment.
16312
3e90f135
CC
163132008-05-30 Cary Coutant <ccoutant@google.com>
16314
16315 * archive.cc (Archive::include_all_members) Correct to step
16316 over symbol table and extended name table in thin archives.
16317
e09ad04a
ILT
163182008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
16319
16320 PR 6407
16321 * target-reloc.h (relocate_for_relocatable): Fix new_offset
16322 calculation.
16323
62b01cb5
ILT
163242008-05-28 Caleb Howe <cshowe@google.com>
16325
16326 * reduced_debug_output.cc: New file.
16327 * reduced_debug_output.h: New file.
92de84a6 16328 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
16329 * options.cc (General_options::finalize): Add strip_debug_non_line
16330 to the strip heirarchy.
16331 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
16332 fields.
16333 * layout.cc: Include "reduced_debug_output.h".
16334 (Layout::Layout): Initialize new fields.
16335 (line_only_debug_sections): New static array.
16336 (is_lines_only_debug_sections): New static inline function.
16337 (Layout::include_section): Handle --strip-debug-non-line.
16338 (Layout::make_output_section): If --strip-debug-non-line, build
16339 new output sections for .debug_abbrev and .debug_info.
16340 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
16341 gold. Warn about possible overflow.
16342 (read_signed_LEB_128): Likewise.
16343 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
16344 (read_signed_LEB_128): Declare.
16345 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
16346 (HFILES): Add reduced_debug_output.h.
16347 * Makefile.in: Rebuild.
16348
7d9e3d98
ILT
163492008-05-21 Ian Lance Taylor <iant@google.com>
16350
16351 * mapfile.cc: New file.
16352 * mapfile.h: New file.
16353 * options.h (class General_options): Add -M/--print-map and -Map.
16354 * options.cc (General_options::finalize): Make -M equivalent to
16355 -Map -.
16356 * main.cc: Include <cstdio> and "mapfile.h".
16357 (main): Open mapfile if requested.
16358 * gold.cc (class Middle_runner): Add mapfile_ field. Update
16359 constructor. Change caller.
16360 (queue_initial_tasks): Add mapfile parameter. Change caller.
16361 (queue_middle_tasks): Likewise.
16362 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
16363 declarations.
16364 * archive.cc: Include "mapfile.h".
16365 (Archive::add_symbols): Add mapfile parameter. Change all
16366 callers. Pass mapfile, symbol, and reason to include_member.
16367 (Archive::include_all_members): Add mapfile parameter. Change all
16368 callers.
16369 (Archive::include_member): Add mapfile, sym, and why parameters.
16370 Change all callers. Report inclusion to map file.
16371 * archive.h: Include "fileread.h".
16372 (class Archive): Update declarations.
16373 (Archive::file): New const method.
16374 (class Add_archive_symbols): Add mapfile_ field. Update
16375 constructor. Change all callers.
16376 * readsyms.h (class Read_symbols): Likewise.
16377 (class Finish_group): Likewise.
16378 (class Read_script): Likewise.
16379 * common.cc: Include "mapfile.h".
16380 (Symbol_table::allocate_commons): Add mapfile parameter. Change
16381 all callers.
16382 (Symbol_table::do_allocate_commons): Likewise.
16383 (Symbol_table::do_allocate_commons_list): Likewise. Report common
16384 symbol allocation to mapfile.
16385 * common.h (class Allocate_commons_task): Add mapfile_ field.
16386 Update constructor. Change all callers.
16387 * symtab.h (class Symbol_table): Update declarations.
16388 * layout.cc: Include "mapfile.h".
16389 (Layout_task_runner::run): Print information to mapfile.
16390 (Layout::create_gold_note): Change Output_data_fixed_space to
16391 Output_data_zero_fill.
16392 (Layout::create_build_id): Likewise.
16393 (Layout::print_to_mapfile): New function.
16394 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
16395 constructor. Change caller.
16396 (class Layout): Declare print_to_mapfile.
16397 * output.cc (Output_section::Input_section::print_to_mapfile): New
16398 function.
16399 (Output_section::add_input_section): If producing a map, always
16400 add to input_sections_ list.
16401 (Output_section::do_print_to_mapfile): New function.
16402 (Output_segment::print_sections_to_mapfile): New function.
16403 (Output_segment::print_section_list_to_mapfile): New function.
16404 * output.h: Include "mapfile.h".
16405 (Output_data::print_to_mapfile): New function.
16406 (Output_data::do_print_to_mapfile): New virtual function.
16407 (Output_segment_headers::do_print_to_mapfile): New function.
16408 (Output_file_header::do_print_to_mapfile): New function.
16409 (Output_data_const::do_print_to_mapfile): New function.
16410 (class Output_data_const_buffer): Add map_name_ field. Update
16411 constructor. Change all callers. Add do_print_to_mapfile
16412 function.
16413 (class Output_data_fixed_space): Likewise.
16414 (class Output_data_space): Likewise.
16415 (class Output_data_zero_fill): New class.
16416 (Output_data_strtab::do_print_to_mapfile): New function.
16417 (Output_data_reloc_base::do_print_to_mapfile): New function.
16418 (Output_relocatable_relocs::do_print_to_mapfile): New function.
16419 (Output_data_group::do_print_to_mapfile): New function.
16420 (Output_data_got::do_print_to_mapfile): New function.
16421 (Output_data_dynamic::do_print_to_mapfile): New function.
16422 (Output_symtab_xindex::do_print_to_mapfile): New function.
16423 (class Output_section): Declare do_print_to_mapflie. Declare
16424 print_to_mapfile in Input_section.
16425 (class Output_segment): Declare new functions.
16426 * object.h (Sized_relobj::symbol_count): New function.
16427 * script-sections.cc
16428 (Output_section_element_dot_assignment::set_section_addresses):
16429 Change Output_data_fixed_space to Output_data_zero_fill.
16430 (Output_data_expression::do_print_to_mapfile): New function.
16431 * script.cc (read_input_script): Add mapfile parameter. Change
16432 all callers.
16433 * script.h (read_input_script): Update declaration.
16434 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
16435 (Eh_frame::do_print_to_mapfile): New function.
16436 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
16437 (Output_merge_string::do_print_to_mapfile): New function.
16438 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
16439 function.
16440 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
16441 function.
16442 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
16443 function.
16444 * Makefile.am (CCFILES): Add mapfile.cc.
16445 (HFILES): Add mapfile.h.
16446 * Makefile.in: Rebuild.
16447
9f1d377b
ILT
164482008-05-19 Ian Lance Taylor <iant@google.com>
16449
16450 * options.h (class General_options): Add -z relro.
16451 * layout.cc (Layout::Layout): Initialize relro_segment_.
16452 (Layout::add_output_section_data): Return the output section.
16453 (Layout::make_output_section): Rcognize relro sections and mark
16454 them appropriately.
16455 (Layout::attach_allocated_section_to_segment): Put relro sections
16456 in a PT_GNU_RELRO segment.
16457 (Layout::create_initial_dynamic_sections): Mark the .dynamic
16458 section as relro.
16459 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
16460 PT_TLS segments.
16461 (Layout::linkonce_mapping): Map d.rel.ro.local to
16462 .data.rel.ro.local.
16463 (Layout::output_section_name): Us .data.rel.ro.local for any
16464 section which begins with that.
16465 * layout.h (class Layout): Update add_output_section_data
16466 declaration. Add relro_segment_ field.
16467 * output.cc (Output_section::Output_section): Initialize is_relro_
16468 and is_relro_local_ fields.
16469 (Output_segment::add_output_section): Group relro sections.
16470 (Output_segment::is_first_section_relro): New function.
16471 (Output_segment::maximum_alignment): If there is a relro section,
16472 align the segment to the common page size.
16473 (Output_segment::set_section_addresses): Track whether we are
16474 looking at relro sections. If the last section is a relro
16475 section, align to the common page size.
16476 (Output_segment::set_section_list_addresses): Add in_relro
16477 parameter. Change all callers. Align to the page size when
16478 moving from relro to non-relro section.
16479 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
16480 segment.
16481 * output.h (class Output_section): Add is_relro_ and
16482 is_relro_local_ fields.
16483 (Output_section::is_relro): New function.
16484 (Output_section::set_is_relro): New function.
16485 (Output_section::is_relro_local): New function.
16486 (Output_section::set_is_relro_local): New function.
16487 (class Output_segment): Update declarations.
16488 * i386.cc (Target_i386::got_section): Mark .got section as relro.
16489 * sparc.cc (Target_sparc::got_section): Likewise.
16490 * x86_64.cc (Target_x86_64::got_section): Likewise.
16491 * testsuite/relro_test_main.cc: New file.
16492 * testsuite/relro_test.cc: New file.
16493 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
16494 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
16495 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
16496 (relro_test.so, relro_test_pic.o): New targets.
16497 * testsuite/Makefile.in: Rebuild.
16498
a984ee1d
ILT
164992008-05-16 Ian Lance Taylor <iant@google.com>
16500
01676dcd
ILT
16501 * output.cc (Output_segment::add_output_section): Remove front
16502 parameter.
16503 * output.h (class Output_segment): Remove
16504 add_initial_output_section and overloaded add_output_section.
16505 Update declaration of remaining add_output_section.
16506 * layout.cc (Layout::create_interp): Call add_output_section
16507 rather than add_initial_output_section.
16508 (Layout::finish_dynamic_section): Likewise.
16509
497897f9
ILT
16510 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
16511 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
16512 know the dynamic type.
16513 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
16514 field. Initialize it in constructor.
16515 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
16516 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
16517 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
16518 reloc.
16519
a984ee1d
ILT
16520 * output.cc (Output_reloc::get_address): Change return type to
16521 Elf_Addr.
16522 * output.h (class Output_reloc): Update get_address declaration.
16523 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
16524 for section addresses.
16525
55ba0940
ILT
165262008-05-09 Ian Lance Taylor <iant@google.com>
16527
16528 PR 6493
16529 * gold.cc (gold_nomem): Use return value of write.
16530
75517b77
ILT
165312008-05-08 Ian Lance Taylor <iant@google.com>
16532
16533 * symtab.c (Symbol::init_base_output_data): Add version
16534 parameter. Change all callers.
16535 (Symbol::init_base_output_segment): Likewise.
16536 (Symbol::init_base_constant): Likewise.
16537 (Symbol::init_base_undefined): Likewise.
16538 (Sized_symbol::init_output_data): Likewise.
16539 (Sized_symbol::init_output_segment): Likewise.
16540 (Sized_symbol::init_constant): Likewise.
16541 (Sized_symbol::init_undefined): Likewise.
16542 (Symbol_table::do_define_in_output_data): If the new symbol has a
16543 version, mark it as the default.
16544 (Symbol_table::do_define_in_output_segment): Likewise.
16545 (Symbol_table::do_define_as_constant): Likewise.
16546 * symtab.h (class Symbol): Update declarations.
16547 (class Sized_symbol): Likewise.
16548 * resolve.cc (Symbol::override_version): New function.
c42e122e 16549 (Symbol::override_base): Call override_version.
75517b77
ILT
16550 (Symbol::override_base_with_special): Likewise.
16551 * testsuite/ver_script_8.script: New file.
16552 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
16553 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
16554 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
16555 (ver_test_8_1.so, ver_test_8_2.so): New targets.
16556
f1f70eae
ILT
165572008-05-06 Ian Lance Taylor <iant@google.com>
16558
f3e9c5c5
ILT
16559 PR 6049
16560 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
16561 functions.
16562 (class General_options): Remove existing --undefined, and add
16563 --no-undefined instead. Add new --undefined as synonym for -u.
16564 * archive.cc (Archive::add_symbols): Check whether symbol was
16565 named with -u.
16566 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
16567 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
16568 all uses. Add IS_UNDEFINED. Update declarations to split
16569 different versions of init_base. Declare init_base_undefined.
16570 (Symbol::is_defined): Handle IS_UNDEFINED.
16571 (Symbol::is_undefined): Likewise.
16572 (Symbol::is_weak_undefined): Call is_undefined.
16573 (Symbol::is_absolute): Handle IS_CONSTANT.
16574 (class Sized_symbol): Update declarations to split different
16575 versions of init. Declare init_undefined.
16576 (class Symbol_table): Declare new functions.
16577 * symtab.cc (Symbol::init_base_object): Rename from init_base.
16578 Change all callers.
16579 (Symbol::init_base_output_data): Likewise.
16580 (Symbol::init_base_output_segment): Likewise.
16581 (Symbol::init_base_constant): Likewise.
16582 (Symbol::init_base_undefined): New function.
16583 (Sized_symbol::init_object): Rename from init. Change all
16584 callers.
16585 (Sized_symbol::init_output_data): Likewise.
16586 (Sized_symbol::init_output_segment): Likewise.
16587 (Sized_symbol::init_constant): Likewise.
16588 (Sized_symbol::init_undefined): New function.
16589 (Symbol_table::add_undefined_symbols_from_command_line): New
16590 function.
16591 (Symbol_table::do_add_undefined_symbols_from_command_line): New
16592 function.
16593 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
16594 (Symbol::output_section): Likewise.
16595 (Symbol::set_output_section): Likewise.
16596 (Symbol_table::sized_finalize_symbol): Likewise.
16597 (Symbol_table::sized_write_globals): Likewise.
16598 * resolve.cc (Symbol_table::should_override): Likewise.
16599 (Symbol::override_base_with_special): Likewise.
16600
8bdcdf2c
ILT
16601 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
16602 symbol, change it to have default visibility.
16603 * testsuite/protected_1.cc: New file.
16604 * testsuite/protected_2.cc: New file.
16605 * testsuite/protected_3.cc: New file.
16606 * testsuite/protected_main_1.cc: New file.
16607 * testsuite/protected_main_2.cc: New file.
16608 * testsuite/protected_main_3.cc: New file.
16609 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
16610 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
16611 (protected_1_LDFLAGS, protected_1_LDADD): Define.
16612 (protected_1.so): New target.
16613 (protected_1_pic.o, protected_2_pic.o): New targets.
16614 (protected_3_pic.o): New target.
16615 (check_PROGRAMS): Add protected_2.
16616 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
16617 (protected_2_LDFLAGS, protected_2_LDADD): Define.
16618 * testsuite/Makefile.in: Rebuild.
16619
2b706932
ILT
16620 * options.h (DEFINE_var): Add set_user_set_##varname__.
16621 (DEFINE_bool_alias): New macro.
16622 (class General_options): Define -Bstatic using DEFINE_bool_alias
16623 rather than DEFINE_special. Add --undefined as an alias for -z
16624 defs.
16625 * options.cc (General_options::parse_Bstatic): Remove.
16626
d82a5bcc
ILT
16627 * options.h (class General_options): Add --fatal-warnings.
16628 * main.cc (main): Implement --fatal-warnings.
16629 * errors.h (Errors::warning_count): New function.
16630
f1f70eae
ILT
16631 * options.h (class General_options): Add -Bsymbolic-functions.
16632 * symtab.h (Symbol::is_preemptible): Check for
16633 -Bsymbolic-functions.
16634
8825ac63
ILT
166352008-05-05 Ian Lance Taylor <iant@google.com>
16636
d98bc257
ILT
16637 * options.h (DEFINE_bool): For DASH_Z, create the negative option
16638 as noVARNAME rather than no-VARNAME.
16639 (class General_options): Add option -z combreloc.
16640 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
16641 get_address.
16642 (Output_reloc::sort_before) [SHT_REL]: New function.
16643 (Output_reloc::sort_before) [SHT_RELA]: New function.
16644 (class Output_data_reloc_base): Add sort_relocs_ field. Define
16645 Sort_relocs_comparison.
16646 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
16647 parameter. Change all callers.
16648 (Output_data_reloc::Output_data_reloc) [both versions]: Add
16649 sort_relocs parameter. Change all callers.
16650 * output.cc (Output_reloc::get_address): New function, broken out
16651 of write_rel.
16652 (Output_reloc::write_rel): Call it.
16653 (Output_reloc::compare): New function.
16654 (Output_data_reloc_base::do_write): Optionally sort relocs.
16655
60b2b4e7
ILT
16656 * configure.ac: If targ_extra_obj is set, link it in.
16657 * configure.tgt: Initialize all variables.
16658 (x86_64*): Set targ_extra_obj and targ_extra_size.
16659 * configure: Rebuild.
16660
8825ac63
ILT
16661 * object.cc (Sized_relobj::include_section_group): Adjust section
16662 indexes read from group data. Build vector to pass to
16663 layout_group.
16664 * layout.cc (Layout::layout_group): Add flags and shndxes
16665 parameters. Remove contents parameter. Change caller. Update
16666 explicit instantiations.
16667 * layout.h (class Layout): Update layout_group declaration.
16668 * output.cc (Output_data_group::Output_data_group): Add flags and
16669 input_shndxes parameters. Remove contents parameter. Change
16670 caller.
16671 (Output_data_group::do_write): Change input_sections_ to
16672 input_shndxes_.
16673 * output.h (class Output_data_group): Update constructor
16674 declaration. Rename input_sections_ to input_shndxes_.
16675 * testsuite/many_sections_test.cc: Add template.
16676
e94cf127
CC
166772008-04-30 Cary Coutant <ccoutant@google.com>
16678
4418b2d5
CC
16679 * target-reloc.h (relocate_section): Fix dead-pointer bug.
16680
e94cf127
CC
16681 * layout.cc (Layout::include_section): Refactored check for debug
16682 info section.
16683 (Layout::add_comdat): Add new parameters. Change type
16684 of signature parameter. Add object and shndx to signatures table.
16685 (Layout::find_kept_object): New function.
16686 * layout.h: Include <cstring>.
16687 (Layout::is_debug_info_section): New function.
16688 (Layout::add_comdat): Add new parameters.
16689 (Layout::find_kept_object): New function.
16690 (Layout::Kept_section): New struct.
16691 (Layout::Signatures): Change type of map range.
16692 * object.cc (Relobj::output_section_address): New function.
16693 (Sized_relobj::include_section_group): Add new parameters. Change
16694 calls to Layout::add_comdat. Change to build table of kept comdat
16695 groups and table mapping discarded sections to kept sections.
16696 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
16697 (Sized_relobj::do_layout): Change calls to include_section_group and
16698 include_linkonce_section.
16699 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
16700 value to zero when section is discarded.
16701 (Sized_relobj::map_to_kept_section): New function.
16702 * object.h (Relobj::output_section_address): New function.
16703 (Relobj::Comdat_group): New type.
16704 (Relobj::find_comdat_group): New function.
16705 (Relobj::Comdat_group_table): New type.
16706 (Relobj::Kept_comdat_section): New type.
16707 (Relobj::Kept_comdat_section_table): New type.
16708 (Relobj::add_comdat_group): New function.
16709 (Relobj::set_kept_comdat_section): New function.
16710 (Relobj::get_kept_comdat_section): New function.
16711 (Relobj::comdat_groups_): New field.
16712 (Relobj::kept_comdat_sections_): New field.
16713 (Symbol_value::input_value): Update comment.
16714 (Sized_relobj::map_to_kept_section) New function.
16715 (Sized_relobj::include_linkonce_section): Add new parameter.
16716 * target-reloc.h (Comdat_behavior): New type.
16717 (get_comdat_behavior): New function.
16718 (relocate_section): Add code to map a discarded section to the
16719 corresponding kept section when applying a relocation.
16720
e4e5049b
CS
167212008-04-30 Craig Silverstein <csilvers@google.com>
16722
16723 * dwarf_reader.cc (next_generation_count): New static var.
16724 (Addr2line_cache_entry): New struct.
16725 (addr2line_cache): New static var.
16726 (Dwarf_line_info::one_addr2line): Added caching.
16727 (Dwarf_line_info::clear_addr2line_cache): New function.
16728 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
16729 cache-size parameter.
16730 (Dwarf_line_info::one_addr2line_cache): New function.
16731 * symtab.cc (Symbol_table::detect_odr_violations): Pass
16732 new cache-size argument to one_addr2line(), and clear cache.
16733
d09e9154
CC
167342008-04-28 Cary Coutant <ccoutant@google.com>
16735
16736 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
16737 R_386_PC8 relocations.
16738
7ef73768
ILT
167392008-04-23 Ian Lance Taylor <iant@google.com>
16740
55438702
ILT
16741 * object.cc (Sized_relobj::include_section_group): Check for
16742 invalid section group.
16743
c165fb93
ILT
16744 * object.cc (make_elf_object): Correct test for 64-bit ELF file
16745 header size.
16746
7ef73768
ILT
16747 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
16748 than read for file header.
16749 * archive.cc (Archive::include_member): Likewise.
16750
6194aaab
L
167512008-04-23 Paolo Bonzini <bonzini@gnu.org>
16752
16753 * aclocal.m4: Regenerate.
16754 * configure: Regenerate.
16755
d491d34e
ILT
167562008-04-19 Ian Lance Taylor <iant@google.com>
16757
5ea2bac6
ILT
16758 * version.cc (version_string): Bump to 1.6.
16759
7bc3e21a
ILT
16760 * testsuite/Makefile.am (many_sections_r_test): New target.
16761 (many_sections_r_test_SOURCES): Remove.
16762 (many_sections_r_test_DEPENDENCIES): Remove.
16763 (many_sections_r_test_LDFLAGS): Remove.
16764 (many_sections_r_test_LDADD): Remove.
16765
7fcd3aa9
ILT
16766 * object.cc (Sized_relobj::do_add_symbols): Always pass
16767 local_symbol_count_ to add_from_relobj.
16768
4c94d6ae
ILT
16769 * testsuite/Makefile.am (many_sections_check.h): Only check one in
16770 every thousand variables.
16771 * testsuite/Makefile.in: Rebuild.
16772
d491d34e
ILT
16773 * object.cc (Xindex::initialize_symtab_xindex): New function.
16774 (Xindex::read_symtab_xindex): New function.
16775 (Xindex::sym_xindex_to_shndx): New function.
16776 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
16777 available.
16778 (Sized_relobj::do_initialize_xindex): New function.
16779 (Sized_relobj::do_read_symbols): Adjust section links.
16780 (Sized_relobj::symbol_section_and_value): Add is_ordinary
16781 parameter. Change all callers.
16782 (Sized_relobj::include_section_group): Adjust section links and
16783 symbol section indexes.
16784 (Sized_relobj::do_layout): Adjust section links.
16785 (Sized_relobj::do_count_local_symbols): Adjust section links and
16786 symbol section indexes.
16787 (Sized_relobj::do_finalize_local_symbols): Distinguish between
16788 ordinary and special symbols.
16789 (Sized_relobj::write_local_symbols): Add symtab_xindex and
16790 dynsym_xindex parameters. Change all callers. Adjust section
16791 links. Use SHN_XINDEX when needed.
16792 (Sized_relobj::get_symbol_location_info): Adjust section links.
16793 Don't get fooled by special symbols.
16794 * object.h (class Xindex): Define.
16795 (class Object): Add xindex_ parameter. Declare virtual functoin
16796 do_initialize_xindex.
16797 (Object::adjust_sym_shndx): New function.
16798 (Object::set_xindex): New protected function.
16799 (class Symbol_value): Add is_ordinary_shndx_ field.
16800 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
16801 (Symbol_value::value): Assert ordinary section.
16802 (Symbol_value::initialize_input_to_output_map): Likewise.
16803 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
16804 Change all callers.
16805 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
16806 all callers.
16807 (class Sized_relobj): Update declarations.
16808 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
16809 parameter. Change all callers.
16810 (Sized_relobj::adjust_shndx): New function.
16811 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
16812 field.
16813 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
16814 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
16815 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
16816 (Sized_dynobj::read_dynsym_section): Adjust section links.
16817 (Sized_dynobj::read_dynamic): Likewise.
16818 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
16819 section links.
16820 (Sized_dynobj::do_initialize_xindex): New function.
16821 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
16822 do_initialize_xindex.
16823 (Sized_dynobj::adjust_shndx): New function.
16824 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
16825 dynsym_xindex_ fields.
16826 (Layout::finalize): Add a call to set_section_indexes before
16827 creating the symtab sections.
16828 (Layout::set_section_indexes): Don't do anything if the section
16829 already has a section index.
16830 (Layout::create_symtab_sections): Add shnum parameter. Change
16831 caller. Create .symtab_shndx section if needed.
16832 (Layout::create_shdrs): Add shstrtab_section parameter. Change
16833 caller.
16834 (Layout::allocated_output_section_count): New function.
16835 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
16836 needed.
16837 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
16838 fields. Update declarations.
16839 (Layout::symtab_xindex): New function.
16840 (Layout::dynsym_xindex): New function.
16841 (class Write_symbols_task): Add layout_ field.
16842 (Write_symbols_task::Write_symbols_task): Add layout parameter.
16843 Change caller.
16844 * output.cc (Output_section_headers::Output_section_headers): Add
16845 shstrtab_section parameter. Change all callers.
16846 (Output_section_headers::do_sized_write): Store overflow values
16847 for section count and section string table section index in
16848 section header zero.
16849 (Output_file_header::do_sized_write): Check for overflow of
16850 section count and section string table section index.
16851 (Output_symtab_xindex::do_write): New function.
16852 (Output_symtab_xindex::endian_do_write): New function.
16853 * output.h (class Output_section_headers): Add shstrtab_section_.
16854 Update declarations.
16855 (class Output_symtab_xindex): Define.
16856 (Output_section::has_out_shndx): New function.
16857 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
16858 field.
16859 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
16860 Change all callers.
16861 (Sized_symbol::init): Likewise.
16862 (Symbol::output_section): Check for ordinary symbol.
16863 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
16864 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
16865 callers.
16866 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
16867 Change all callers. Simplify handling of symbols from sections
16868 not included in the link.
16869 (Symbol_table::add_from_dynobj): Handle ordinary symbol
16870 distinction.
16871 (Weak_alias_sorter::operator()): Assert that symbols are
16872 ordinary.
16873 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
16874 distinction.
16875 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
16876 parameters. Change all callers.
16877 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
16878 symbol distinction. Use SHN_XINDEX when needed.
16879 (Symbol_table::write_section_symbol): Add symtab_xindex
16880 parameter. Change all callers.
16881 (Symbol_table::sized_write_section_symbol): Likewise. Use
16882 SHN_XINDEX when needed.
16883 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
16884 declarations.
16885 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
16886 (Symbol::is_defined): Check is_ordinary.
16887 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
16888 (Symbol::is_absolute, Symbol::is_common): Likewise.
16889 (class Sized_symbol): Update declarations.
16890 (class Symbol_table): Update declarations.
16891 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
16892 parameters. Change all callers.
16893 (Sized_symbol::override): Likewise.
16894 (Symbol_table::override): Likewise.
16895 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
16896 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
16897 is_ordinary, and orig_st_shndx parameters. Change all callers.
16898 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
16899 to be in an ordinary section.
16900 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
16901 object and is_ordinary parameters. Change all callers.
16902 (Sized_dwarf_line_info::read_relocs): Add object parameter.
16903 Change all callers. Don't add undefined or non-ordinary symbols
16904 to reloc_map_.
16905 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
16906 Change all callers.
16907 * dwarf_reader.h (class Sized_dwarf_line_info): Update
16908 declarations.
16909 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
16910 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
16911 (Sized_relobj::relocate_sections): Likewise.
16912 * target-reloc.h (scan_relocs): Adjust section symbol index.
16913 (scan_relocatable_relocs): Likewise.
16914 * i386.cc (Scan::local): Check for ordinary symbols.
16915 * sparc.cc (Scan::local): Likewise.
16916 * x86_64.cc (Scan::local): Likewise.
16917 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
16918 to symbol_section_and_value.
16919 * testsuite/many_sections_test.cc: New file.
16920 * testsuite/Makefile.am (BUILT_SOURCES): Define.
16921 (check_PROGRAMS): Add many_sections_test.
16922 (many_sections_test_SOURCES): Define.
16923 (many_sections_test_DEPENDENCIES): Define.
16924 (many_sections_test_LDFLAGS): Define.
16925 (BUILT_SOURCES): Add many_sections_define.h.
16926 (many_sections_define.h): New target.
16927 (BUILT_SOURCES): Add many_sections_check.h.
16928 (many_sections_check.h): New target.
16929 (check_PROGRAMS): Add many_sections_r_test.
16930 (many_sections_r_test_SOURCES): Define.
16931 (many_sections_r_test_DEPENDENCIES): Define.
16932 (many_sections_r_test_LDFLAGS): Define.
16933 (many_sections_r_test_LDADD): Define.
16934 (many_sections_r_test.o): New target.
16935 * testsuite/Makefile.in: Rebuild.
16936
c5818ff1
CC
169372008-04-17 Cary Coutant <ccoutant@google.com>
16938
16939 * errors.cc (Errors::info): New function.
16940 (gold_info): New function.
16941 * errors.h (Errors::info): New function.
16942 * gold.h (gold_info): New function.
16943 * object.cc (Input_objects::add_object): Print trace output.
16944 * options.cc (options::parse_set): New function.
16945 (General_options::parse_wrap): Deleted.
16946 (General_options::General_options): Deleted initializer.
16947 * options.h (options::String_set): New typedef.
16948 (options::parse_set): New function.
16949 (DEFINE_set): New macro.
16950 (General_options::wrap): Changed to use DEFINE_set. Changed
16951 callers of any_wrap_symbols and is_wrap_symbol.
16952 (General_options::trace, General_options::trace_symbol):
16953 New options.
16954 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
16955 (General_options::wrap_symbols_): Deleted.
16956 * symtab.cc (Symbol_table::add_from_object): Print trace output.
16957
b5be4a7c
DM
169582008-04-17 David S. Miller <davem@davemloft.net>
16959
16960 * options.cc (General_options::parse_V): New function.
16961 * options.h: Add entries for -V and -Qy.
16962
155a0dd7
ILT
169632008-04-17 Ian Lance Taylor <iant@google.com>
16964
16965 * common.cc (Symbol_table::allocate_commons): Remove options
16966 parameter. Change caller.
16967 (Symbol_table::do_allocate_commons): Remove options parameter.
16968 Change caller. Just call do_allocate_commons_list twice.
16969 (Symbol_table::do_allocate_commons_list): New function, broken out
16970 of do_allocate_commons.
16971 * common.h (class Allocate_commons_task): Remove options_ field.
16972 Update constructor.
16973 * symtab.cc (Symbol_table::Symbol_table): Initialize
16974 tls_commons_.
16975 (Symbol_table::add_from_object): Put TLS common symbols on
16976 tls_commons_ list.
16977 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
16978 which are IN_OUTPUT_DATA.
16979 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
16980 allocate_commons and do_allocate_commons declarations. Declare
16981 do_allocate_commons_list.
16982 * gold.cc (queue_middle_tasks): Update creation of
16983 Allocate_commons_task to not pass options.
16984 * testsuite/Makefile.am (INCLUDES): Add -I.. .
16985 (TLS_TEST_C_FLAGS): New variable.
16986 (tls_test_c_pic.o): New target.
16987 (tls_test_shared.so): Link in tls_test_c_pic.o.
16988 (tls_test_c_pic_ie.o): New target.
16989 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
16990 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
16991 (tls_test_c.o): New target.
16992 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
16993 (tls_pic_test_LDADD): Likewise.
16994 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
16995 (tls_shared_gd_to_ie_test_LDADD): Likewise.
16996 (tls_test_c_gnu2.o): New target.
16997 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
16998 tls_test_c_gnu2.o.
16999 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
17000 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
17001 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
17002 * testsuite/tls_test.cc: Include "config.h".
17003 (t_last): Call t11_last.
17004 * testsuite/tls_test.h (t11, t11_last): Declare.
17005 * testsuite/tls_test_c.c: New file.
17006 * testsuite/tls_test_main.cc (thread_routine): Call t11.
17007 * configure.ac: Check for OpenMP support.
17008 * configure, config.in, Makefile.in: Rebuild.
17009 * testsuite/Makefile.in: Rebuild.
17010
edfbb029
CC
170112008-04-16 Cary Coutant <ccoutant@google.com>
17012
17013 * i386.cc (Target_i386::define_tls_base_symbol): New function.
17014 (Target_i386::tls_base_symbol_defined_): New field.
17015 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
17016 (Target_i386::Scan::global): Likewise.
17017 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
17018 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
17019 (Target_x86_64::tls_base_symbol_defined_): New field.
17020 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
17021 (Target_x86_64::Scan::global): Likewise.
17022
f3c69fca
CC
170232008-04-16 Cary Coutant <ccoutant@google.com>
17024
17025 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
17026 (Symbol::needs_plt_entry): Allow weak undefined symbols.
17027 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
17028 building shared libraries.
17029 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
17030 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
17031 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
17032 * testsuite/Makefile.in: Rebuild.
17033 * testsuite/weak_undef.h: New file.
17034 * testsuite/weak_undef_file1.cc: Add extra test cases.
17035 * testsuite/weak_undef_file2.cc: Likewise.
17036 * testsuite/weak_undef_test.cc: Likewise.
17037
7c414435
DM
170382008-04-16 David S. Miller <davem@davemloft.net>
17039
32b769e1
DM
17040 * sparc.cc (Target_sparc::Scan): Change from struct to class.
17041 Add issued_non_pic_error_ field. Declare check_non_pic.
17042 (Target_sparc::Scan::check_non_pic): New function.
17043 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
17044 (Target_sparc::Scan::global): Likewise.
17045
11936fb1
DM
17046 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
17047 * configure: Rebuild.
17048
7c414435
DM
17049 * options.h (DEFINE_enable): New macro.
17050 (new_dtags): New enable option.
17051 (initfirst, interpose, loadfltr, nodefaultlib,
17052 nodelete, nodlopen, nodump): New -z options.
17053 * layout.cc (Layout:finish_dynamic_section): If new
17054 dtags enabled, emit DT_RUNPATH. Also, emit a
17055 DT_FLAGS_1 containing any specified -z flags.
17056
85c7bf8b
ILT
170572008-04-16 Ian Lance Taylor <iant@google.com>
17058
12c0daef
ILT
17059 * copy-relocs.cc: New file.
17060 * copy-relocs.h: New file.
17061 * reloc.cc: Remove Copy_relocs code.
17062 * reloc.h: Likewise.
17063 * reloc-types.h (struct Reloc_types) [both versions]: Add
17064 get_reloc_addend_noerror.
17065 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
17066 variants of add_global which take an addend which must be zero.
17067 * i386.cc: Include "copy-relocs.h".
17068 (class Target_i386): Change type of copy_relocs_ to variable,
17069 update initializer.
17070 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
17071 Change all callers.
17072 (Target_i386::do_finalize_sections): Change handling of
17073 copy_relocs_.
17074 * sparc.cc: Include "copy-relocs.h".
17075 (class Target_sparc): Change type of copy_relocs_ to variable,
17076 update initializer.
17077 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
17078 Change all callers.
17079 (Target_sparc::do_finalize_sections): Change handling of
17080 copy_relocs_.
17081 * x86_64.cc: Include "copy-relocs.h".
17082 (class Target_x86_64): Change type of copy_relocs_ to variable,
17083 update initializer.
17084 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
17085 class. Change all callers.
17086 (Target_x86_64::do_finalize_sections): Change handling of
17087 copy_relocs_.
17088 * Makefile.am (CCFILES): Add copy-relocs.cc.
17089 (HFILES): Add copy-relocs.h.
17090
4f4995b6
ILT
17091 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
17092
85c7bf8b
ILT
17093 * testsuite/script_test_4.sh: Permit leading zeroes.
17094
4f2a9edd
ILT
170952008-04-15 Ian Lance Taylor <iant@google.com>
17096
e6188289
ILT
17097 * script-sections.cc (Script_sections::create_segments): Use
17098 header_size_adjustment even when there is enough room for the
17099 headers.
17100 * testsuite/script_test_4.sh: New file.
17101 * testsuite/script_test_4.t: New file.
17102 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
17103 (check_DATA): Add script_test_4.stdout.
17104 (MOSTLYCLEANFILES): Likewise.
17105 (script_test_4): New target.
17106 (script_test_4.stdout): New target.
17107 * testsuite/Makefile.in: Rebuild.
17108
4f2a9edd
ILT
17109 * sparc.cc: Add definitions for Output_data_plt_sparc class
17110 constants.
17111
f5314dd5
DM
171122008-04-14 David S. Miller <davem@davemloft.net>
17113
17114 * sparc.cc: New file.
17115 * Makefile.am (TARGETSOURCES): Add sparc.cc
17116 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
17117 * configure.tgt: Document targ_extra_size and
17118 targ_extra_big_endian. Add entries for sparc-* and
17119 sparc64-*.
17120 * configure.ac: Handle targ_extra_size and
17121 targ_extra_big_endian.
17122 * Makefile.in: Rebuild.
17123 * configure: Likewise.
17124 * po/POTFILES.in: Likewise.
17125 * po/gold.pot: Likewise.
17126
154e0e9a
ILT
171272008-04-14 Ian Lance Taylor <iant@google.com>
17128
17129 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
17130 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
17131 in the name/type/flags to section mapping. Don't call
17132 allocate_output_section.
17133 (Layout::choose_output_section): Change parameter from adjust_name
17134 to is_input_section. Don't permit input sections after sections
17135 are attached to segments. Don't call allocate_output_section.
17136 (Layout::layout_eh_frame): Call update_flags_for_input_section,
17137 not write_enable_output_section.
17138 (Layout::make_output_section): Don't push to
17139 unattached_section_list_ nor call attach_to_segment. Call
17140 attach_section_to_segment if sections are attached.
17141 (Layout::attach_sections_to_segments): New function.
17142 (Layout::attach_section_to_segment): New function.
17143 (Layout::attach_allocated_section_to_segment): Rename from
17144 attach_to_segment. Remove flags parameter.
17145 (Layout::allocate_output_section): Remove function.
17146 (Layout::write_enable_output_section): Remove function.
17147 * layout.h (class Layout): Update for above changes. Add new
17148 field sections_are_attached_.
17149 * output.h (Output_section::update_flags_for_input_section): New
17150 function.
17151 * output.cc (Output_section::add_input_section): Call
17152 update_flags_for_input_section.
17153 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
17154
009a67a2
CC
171552008-04-11 Cary Coutant <ccoutant@google.com>
17156
17157 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
17158 thought unnecessary.
17159 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
17160
759b1a24
ILT
171612008-04-11 Ian Lance Taylor <iant@google.com>
17162
17163 * output.h (class Output_section_data): Remove inline definition
17164 of set_addralign.
17165 * output.cc (Output_section_data::set_addralign): New function.
17166
c2b45e22
CC
171672008-04-11 Cary Coutant <ccoutant@google.com>
17168
17169 Add support for TLS descriptors for i386 and x86_64.
17170 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
17171 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
17172 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
17173 GOT_TYPE_TLS_DESC.
17174 (Target_i386::got_mod_index_entry): Remove unnecessary code.
17175 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
17176 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
17177 relocations.
17178 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
17179 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
17180 Fix problem with initial-exec relocations.
17181 (Target_i386::Relocate::relocate_tls): Likewise.
17182 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
17183 relaxation.
17184 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
17185 support for section-plus-offset dynamic table entries.
17186 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
17187 (Output_data_dynamic::Dynamic_entry): Add support for
17188 section-plus-offset dynamic table entries.
17189 (Output_data_dynamic::Classification): Likewise.
17190 (Output_data_dynamic::classification_): Renamed offset_.
17191 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
17192 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
17193 (Target_x86_64::make_plt_section): New function.
17194 (Target_x86_64::reserve_tlsdesc_entries): New function.
17195 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
17196 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
17197 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
17198 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
17199 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
17200 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
17201 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
17202 add extra PLT entry for TLS descriptors.
17203 (Output_data_plt_x86_64::got_): New field.
17204 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
17205 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
17206 fields.
17207 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
17208 descriptors.
17209 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
17210 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
17211 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
17212 R_386_TLS_DESC_CALL relocations.
17213 (Target_x86_64::Scan::global): Likewise.
17214 (Target_x86_64::do_finalize_sections): Add dynamic table entries
17215 for TLS descriptors.
17216 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
17217 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
17218 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
17219 GD-to-IE relaxation.
17220 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
17221 and TLS_DESCRIPTORS.
17222 * Makefile.in: Rebuild.
17223 * configure: Rebuild.
17224 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
17225 (tls_test_shared2.so): New target.
17226 (tls_shared_gd_to_ie_test_SOURCES): New variable.
17227 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
17228 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
17229 (tls_shared_gd_to_ie_test_LDADD): New variable.
17230 (tls_shared_gnu2_gd_to_ie_test): New target.
17231 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
17232 New targets.
17233 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
17234 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
17235 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
17236 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
17237 (tls_shared_gnu2_test): New target.
17238 (tls_test_gnu2_shared.so): New target.
17239 (tls_shared_gnu2_test_SOURCES): New variable.
17240 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
17241 (tls_shared_gnu2_test_LDFLAGS): New variable.
17242 (tls_shared_gnu2_test_LDADD): New variable.
17243 * testsuite/Makefile.in: Rebuild.
17244 * testsuite/Makefile.
17245
83bfb6b7
ILT
172462008-04-11 Ian Lance Taylor <iant@google.com>
17247
17248 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
17249 justsyms.t.
17250 * testsuite/Makefile.in: Rebuild.
17251
17252 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
17253 long.
17254 * testsuite/script_test_2.cc (main): Adjust test.
17255
706e1f5e
ILT
172562008-04-11 David S. Miller <davem@davemloft.net>
17257 Ian Lance Taylor <iant@google.com>
17258
17259 * options.h (General_options): Add entries for '-Y' and
17260 '-relax'.
17261 * options.cc (General_options:finalize): If -Y was used, add those
17262 entries to the library path instead of the default "/lib" and
17263 "/usr/lib".
17264
7c98e6bb
DM
172652008-04-11 David S. Miller <davem@davemloft.net>
17266
17267 * testsuite/justsyms.t: Start at 0x100.
17268 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
17269 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
17270 long.
17271 * testsuite/script_test_2.cc: Adjust string and section length
17272 checks.
7c98e6bb 17273
99a37bfd
ILT
172742008-04-09 Ian Lance Taylor <iant@google.com>
17275
2cefc357
ILT
17276 PR gold/5996
17277 * script-sections.cc (Sections_element::allocate_to_segment): Add
17278 orphan parameter.
17279 (Output_section_definition::allocate_to_segment): Likewise.
17280 (Orphan_output_section::allocate_to_segment): Likewise.
17281 (Script_sections::attach_sections_using_phdrs_clause): Don't
17282 propagate non-PT_LOAD segments to orphan sections.
17283 * testsuite/Makefile.am (script_test_3.stdout): Generate using
17284 readelf rather than objdump.
17285 * testsuite/script_test_3.sh: Adjust accordingly. Test that
17286 .interp section and PT_INTERP segment are the same size.
17287 * testsuite/Makefile.in: Rebuild.
17288
99a37bfd
ILT
17289 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
17290 aliases for symbols defined in the same object.
17291 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
17292 (weak_alias_test_SOURCES): New variable.
17293 (weak_alias_test_DEPENDENCIES): New variable.
17294 (weak_alias_test_LDFLAGS): New variable.
17295 (weak_alias_test_LDADD): New variable.
17296 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
17297 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
17298 (weak_alias_test_3.o): New target.
17299 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
17300 * testsuite/weak_alias_test_main.cc: New file.
17301 * testsuite/weak_alias_test_1.cc: New file.
17302 * testsuite/weak_alias_test_2.cc: New file.
17303 * testsuite/weak_alias_test_3.cc: New file.
17304
780e49c5
ILT
173052008-04-08 Ian Lance Taylor <iant@google.com>
17306
cdb0b8f5
ILT
17307 * options.h (class General_options): Add --noinhibit-exec option.
17308 * main.cc (main): Check --noinhibit-exec.
17309
0864d551
ILT
17310 * options.h (class General_options): Define --wrap as a special
17311 option. Add wrap_symbols_ field.
17312 (General_options::any_wrap_symbols): New function.
17313 (General_options::is_wrap_symbol): New function.
17314 * options.cc (General_options::parse_wrap): New function.
17315 (General_options::General_options): Initialize wrap_symbols_.
17316 * symtab.cc (Symbol_table::wrap_symbol): New function.
17317 (Symbol_table::add_from_object): Handle --wrap.
17318 * symtab.h (class Symbol_table): Declare wrap_symbol.
17319 * target.h (Target::wrap_char): New function.
17320 (Target::Target_info): Add wrap_char field.
17321 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
17322 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
17323 * testsuite/testfile.cc (Target_test::test_target_info):
17324 Likewise.
17325
789aa6de
ILT
17326 * errors.cc (Errors::undefined_symbol): Mention symbol version if
17327 there is one.
17328
2c38906f
ILT
17329 * layout.h (class Layout): Add added_eh_frame_data_ field.
17330 * layout.cc (Layout::Layout): Initialize new field.
17331 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
17332 output section until we find a section we merged successfully.
17333 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
17334 that the size be non-zero.
17335
780e49c5
ILT
17336 * merge.cc (Object_merge_map::get_output_offset): Remove inline
17337 qualifier.
17338
7fcd0256
ILT
173392008-04-08 Craig Silverstein <csilvers@google.com>
17340
17341 * configure.ac: Export new conditional variable HAVE_ZLIB.
17342 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
17343 on HAVE_ZLIB.
17344 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
17345 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17346
6835af53
ILT
173472008-04-07 Ian Lance Taylor <iant@google.com>
17348
e24f324c
ILT
17349 * version.cc (version_string): Set to "1.5".
17350
a036edd8
ILT
17351 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
17352 Add issued_non_pic_error_ field. Declare check_non_pic.
17353 (Target_x86_64::Scan::check_non_pic): New function.
17354 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
17355 (Target_x86_64::Scan::global): Likewise.
17356
624f8810
ILT
17357 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
17358 addend parameter. Change caller. Handle merge sections.
17359 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
17360 Address to Addend. Don't add in the result of
17361 local_section_offset, pass down the addend and use the returned
17362 value.
17363 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
17364 Update declarations of local_section_offset and symbol_value.
17365 * testsuite/two_file_test_1.cc (t18): New function.
17366 * testsuite/two_file_test_2.cc (f18): New function.
17367 * testsuite/two_file_test_main.cc (main): Call t18.
17368 * testsuite/two_file_test.h (t18, f18): Declare.
17369
6835af53
ILT
17370 * configure.ac: Don't test for objdump, c++filt, or readelf.
17371 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
17372 conditionals.
17373 (TEST_READELF): New variable.
17374 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
17375 (check_PROGRAMS): Add two_file_strip_test.
17376 (two_file_strip_test): New target.
17377 (check_PROGRAMS): Add two_file_same_shared_strip_test.
17378 (two_file_same_shared_strip_test_SOURCES): New variable.
17379 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
17380 (two_file_same_shared_strip_test_LDFLAGS): New variable.
17381 (two_file_same_shared_strip_test_LDADD): New variable.
17382 (two_file_shared_strip.so): New target.
17383 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
17384 (ver_test_5.syms, ver_test_7.syms): Likewise.
17385 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
17386 (strip_test_3.stdout): Use TEST_OBJDUMP.
17387 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17388
86925eef
CC
173892008-04-04 Cary Coutant <ccoutant@google.com>
17390
17391 * symtab.h (Symbol::is_weak_undefined): New function.
17392 (Symbol::is_strong_undefined): New function.
17393 (Symbol::is_absolute): New function.
17394 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
17395 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
17396 absolute symbols.
17397 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
17398 (weak_undef_test): New target.
17399 * testsuite/Makefile.in: Rebuild.
17400 * testsuite/weak_undef_file1.cc: New file.
17401 * testsuite/weak_undef_file2.cc: New file.
17402 * testsuite/weak_undef_test.cc: New file.
17403
126f3ece
ILT
174042008-04-03 Craig Silverstein <csilvers@google.com>
17405
17406 * compressed_output.h (class Output_compressed_section): Use
17407 unsigned buffer.
17408 * compressed_output.cc (zlib_compress): Use unsigned buffers,
17409 add zlib header.
17410 (zlib_compressed_suffix): Removed.
17411 (Output_compressed_section::set_final_data_size): Use unsigned
17412 buffers.
17413 * testsuite/Makefile.am (flagstest_compress_debug_sections):
17414 Fix linker invocation.
17415 (flagstest_o_specialfile_and_compress_debug_sections):
17416 Likewise.
17417 * testsuite/Makefile.in: Regenerated.
17418
deae2a14
DM
174192008-04-02 David S. Miller <davem@davemloft.net>
17420
17421 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
17422 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
17423
70752818
ILT
174242008-04-02 Craig Silverstein <csilvers@google.com>
17425
17426 * TODO: New file.
17427
39d0cb0e
ILT
174282008-04-02 Ian Lance Taylor <iant@google.com>
17429
17430 * fileread.cc (File_read::find_view): Add byteshift and vshifted
17431 parameters. Update for new key type to views_. Change all
17432 callers.
17433 (File_read::read): Adjust for byteshift in returned view.
17434 (File_read::add_view): New function, broken out of
17435 find_and_make_view.
17436 (File_read::make_view): New function, broken out of
17437 find_and_make_view.
17438 (File_read::find_or_make_view): Add offset and aligned
17439 parameters. Rewrite accordingly. Change all callers.
17440 (File_read::get_view): Add offset and aligned parameters. Adjust
17441 for byteshift in return value.
17442 (File_read::get_lasting_view): Likewise.
17443 * fileread.h (class File_read): Update declarations.
17444 (class File_read::View): Add byteshift_ field. Add byteshift to
17445 constructor. Add byteshift method.
17446 * archive.h (Archive::clear_uncached_views): New function.
17447 (Archive::get_view): Add aligned parameter. Change all callers.
17448 * object.h (Object::get_view): Add aligned parameter. Change all
17449 callers.
17450 (Object::get_lasting_view): Likewise.
17451
17452 * fileread.cc (File_read::release): Don't call clear_views if
17453 there are multiple objects.
17454 * fileread.h (File_read::clear_uncached_views): New function.
17455 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
17456 on the archive.
17457
a1207466
CC
174582008-03-31 Cary Coutant <ccoutant@google.com>
17459
17460 Add thin archive support.
17461 * archive.cc (Archive::armagt): New const.
17462 (Archive::setup): Remove task parameter and calls to unlock.
17463 (Archive::unlock_nested_archives): New function.
17464 (Archive::read_header): Add nested_off parameter. Change
17465 all callers.
17466 (Archive::interpret_header): Likewise.
17467 (Archive::include_all_members): Change to handle thin
17468 archives.
17469 (Archive::include_member): Likewise.
17470 * archive.h (Archive::Archive): Add new parameters and
17471 initializers.
17472 (Archive::armagt): New const.
17473 (Archive::setup): Remove task parameter.
17474 (Archive::unlock_nested_archives): New function.
17475 (Archive::read_header): Add nested_off parameter.
17476 (Archive::interpret_header): Likewise.
17477 (Archive::Nested_archive_table): New typedef.
17478 (Archive::is_thin_archive_): New field.
17479 (Archive::nested_archives_): New field.
17480 (Archive::options_): New field.
17481 (Archive::dirpath_): New field.
17482 (Archive::task_): New field.
17483 * readsyms.cc (Read_symbols::do_read_symbols): Add check
17484 for thin archives. Pass additional parameters to
17485 Archive::Archive. Unlock the archive file after calling
17486 Archive::setup.
cd536b21 17487
479f6503
ILT
174882008-03-29 Ian Lance Taylor <iant@google.com>
17489
686c8caf
ILT
17490 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
17491 version symbol to be local.
17492 * testsuite/ver_test_4.sh: New file.
17493 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
17494 (check_DATA): Add ver_test_4.syms.
17495 (ver_test_4.syms): New target.
17496 * testsuite/Makefile.in: Rebuild.
17497
ab794b6b
ILT
17498 * output.cc
17499 (Output_section::Input_section_sort_entry::has_priority): New
17500 function.
17501 (Output_section::Input_section_sort_entry::match_file_name): New
17502 function.
17503 (Output_section::Input_section_sort_entry::match_section_name):
17504 Remove.
17505 (Output_section::Input_section_sort_entry::match_section_name_prefix):
17506 Remove.
17507 (Output_section::Input_section_sort_entry::match_section_file):
17508 Remove.
17509 (Output_section::Input_section_sort_compare::operator()): Rewrite
17510 using new Input_section_sort_entry functions. Sort crtbegin and
17511 crtend first. Sort sections with no priority before sections with
17512 a priority.
17513 * testsuite/initpri1.c (d3): Check j != 4.
17514 (cd5): New constructor/destructor function.
17515 (main): Check j != 2.
17516
479f6503
ILT
17517 * symtab.cc (Symbol_table::add_from_object): If we don't use the
17518 new symbol when resolving, don't call set_is_default.
17519 * testsuite/ver_test_7.cc: New file.
17520 * testsuite/ver_test_7.sh: New file.
17521 * testsuite/Makefile.am (ver_test_7.so): New target.
17522 (ver_test_7.o): New target.
17523 (check_SCRIPTS): Add ver_test_7.sh.
17524 (check_DATA): Add ver_test_7.syms.
17525 (ver_test_7.syms): New target.
17526
2fd32231
ILT
175272008-03-28 Ian Lance Taylor <iant@google.com>
17528
17529 * layout.cc (Layout::layout): If we see an input section with a
17530 name that needs sorting, set the must_sort flag for the output
17531 section.
17532 (Layout::make_output_section): If the name of the output section
17533 indicates that it might require sorting, set the may_sort flag.
17534 * output.h (Output_section::may_sort_attached_input_sections): New
17535 function.
17536 (Output_section::set_may_sort_attached_input_sections): New
17537 function.
17538 (Output_section::must_sort_attached_input_sections): New
17539 function.
17540 (Output_section::set_must_sort_attached_input_sections): New
17541 function.
17542 (class Output_section): Declare Input_section_sort_entry. Define
17543 Input_section_sort_compare. Declare
17544 sort_attached_input_sections. Add new fields:
17545 may_sort_attached_input_sections_,
17546 must_sort_attached_input_sections_,
17547 attached_input_sections_are_sorted_.
17548 * output.cc (Output_section::Output_section): Initialize new
17549 fields.
17550 (Output_section::add_input_section): Add an entry to
17551 input_sections_ if may_sort or must_sort are true.
17552 (Output_section::set_final_data_size): Call
17553 sort_attached_input_sections if necessary.
17554 (Output_section::Input_section_sort_entry): Define new class.
17555 (Output_section::Input_section_sort_compare::operator()): New
17556 function.
17557 (Output_section::sort_attached_input_sections): New function.
17558 * configure.ac: Check whether the compiler supports constructor
17559 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
17560 * testsuite/initpri1.c: New file.
17561 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
17562 CONSTRUCTOR_PRIORITY.
17563 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
17564 (initpri1_LDFLAGS): New variable.
17565 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17566
18e6b24e
ILT
175672008-03-27 Ian Lance Taylor <iant@google.com>
17568
49bdd526
ILT
17569 * common.cc (Sort_commons::operator): Correct sorting algorithm.
17570 * testsuite/common_test_1.c: New file.
17571 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
17572 (common_test_1_SOURCES): New variable.
17573 (common_test_1_DEPENDENCIES): New variable.
17574 (common_test_1_LDFLAGS): New variable.
17575
18e6b24e
ILT
17576 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
17577 and commons_ correctly when NAME/VERSION does not override
17578 NAME/NULL.
17579 * testsuite/ver_test_6.c: New file.
17580 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
17581 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
17582 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
17583
04bf7072
ILT
175842008-03-26 Ian Lance Taylor <iant@google.com>
17585
5871526f
ILT
17586 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
17587 of an undefined symbol from a version script.
17588 * testsuite/Makefile.am (ver_test_5.so): New target.
17589 (ver_test_5.o): New target.
17590 (check_SCRIPTS): Add ver_test_5.sh.
17591 (check_DATA): Add ver_test_5.syms.
17592 (ver_test_5.syms): New target.
17593 * testsuite/ver_test_5.cc: New file.
17594 * testsuite/ver_test_5.script: New file.
17595 * testsuite/ver_test_5.sh: New file.
17596 * Makefile.in, testsuite/Makefile.in: Rebuild.
17597
04bf7072
ILT
17598 PR gold/5986
17599 Fix problems building gold with gcc 4.3.0.
17600 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
17601 (gold_error_at_location, gold_warning_at_location): Use it.
17602 * configure.ac: Check whether we can compile and use a template
17603 function with a printf attribute.
17604 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
17605 when jumping over bytes.
17606 * object.cc: Instantiate Object::read_section_data.
17607 * debug.h: Include <cstring>
17608 * dwarf_reader.cc: Include <algorithm>
17609 * main.cc: Include <cstring>.
17610 * options.cc: Include <cstring>.
17611 * output.cc: Include <cstring>.
17612 * script.cc: Include <cstring>.
17613 * script.h: Include <string>.
17614 * symtab.cc: Include <cstring> and <algorithm>.
17615 * target-select.cc: Include <cstring>.
17616 * version.cc: Include <string>.
17617 * testsuite/testmain.cc: Include <cstdlib>.
17618 * configure, config.in: Rebuild.
17619
874c5b28
ILT
176202008-03-25 Ian Lance Taylor <iant@google.com>
17621
819d6c3a
ILT
17622 * options.cc: Include "../bfd/bfdver.h".
17623 (options::help): Print bug reporting address.
17624
f4b2c6f5
ILT
17625 * version.cc (print_version): Adjust output for current value of
17626 BFD_VERSION_STRING.
17627
17628 * NEWS: New file.
17629
e96caa79
ILT
17630 * options.cc (options::help): Print list of supported targets.
17631 * target-select.h: Include <vector>.
17632 (class Target_selector): Make machine_, size_, and is_big_endian_
17633 fields const. Add bfd_name_ and instantiated_target_ fields.
17634 (Target_selector::Target_selector): Add bfd_name parameter.
17635 (Target_selector::recognize): Make non-virtual, call
17636 do_recognize.
17637 (Target_selector::recognize_by_name): Make non-virtual, call
17638 do_recognize_by_name.
17639 (Target_selector::supported_names): New function.
17640 (Target_selector::bfd_name): New function.
17641 (Target_selector::do_instantiate_target): New pure virtual
17642 function.
17643 (Target_selector::do_recognize): New virtual function.
17644 (Target_selector::do_recognize_by_name): New virtual function.
17645 (Target_selector::instantiate_target): New private function.
17646 (supported_target_names): Declare.
17647 * target-select.cc (Target_selector::Target_selector): Update for
17648 new parameter and fields.
17649 (select_target_by_name): Check that the name matches before
17650 calling recognize_by_name.
17651 (supported_target_names): New function.
17652 * i386.cc (class Target_selector_i386): Update Target_selector
17653 constructor call. Remove recognize and recognize_by_name. Add
17654 do_instantiate_target.
17655 * x86_64.cc (class Target_selector_x86_64): Likewise.
17656 * testsuite/testfile.cc (class Target_selector_test): Update for
17657 changes to Target_selector.
17658
874c5b28
ILT
17659 * README: Rewrite, with some notes on unsupported features.
17660
0a65a3a7
CC
176612008-03-24 Cary Coutant <ccoutant@google.com>
17662
17663 * i386.cc (Target_i386::Got_type): New enum declaration.
17664 (Target_i386::Scan::local): Updated callers of Output_data_got
17665 member functions.
17666 (Target_i386::Scan::global): Likewise.
17667 (Target_i386::Relocate::relocate): Likewise.
17668 (Target_i386::Relocate::relocate_tls): Likewise.
17669 * object.h (Got_offset_list): New class.
17670 (Sized_relobj::local_has_got_offset): Added got_type parameter.
17671 (Sized_relobj::local_got_offset): Likewise.
17672 (Sized_relobj::set_local_got_offset): Likewise.
17673 (Sized_relobj::local_has_tls_got_offset): Removed.
17674 (Sized_relobj::local_tls_got_offset): Removed.
17675 (Sized_relobj::set_local_tls_got_offset): Removed.
17676 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
17677 * output.cc (Output_data_got::add_global): Added got_type parameter.
17678 (Output_data_got::add_global_with_rel): Likewise.
17679 (Output_data_got::add_global_with_rela): Likewise.
17680 (Output_data_got::add_global_pair_with_rel): New function.
17681 (Output_data_got::add_global_pair_with_rela): New function.
17682 (Output_data_got::add_local): Added got_type parameter.
17683 (Output_data_got::add_local_with_rel): Likewise.
17684 (Output_data_got::add_local_with_rela): Likewise.
17685 (Output_data_got::add_local_pair_with_rel): New function.
17686 (Output_data_got::add_local_pair_with_rela): New function.
17687 (Output_data_got::add_global_tls): Removed.
17688 (Output_data_got::add_global_tls_with_rel): Removed.
17689 (Output_data_got::add_global_tls_with_rela): Removed.
17690 (Output_data_got::add_local_tls): Removed.
17691 (Output_data_got::add_local_tls_with_rel): Removed.
17692 (Output_data_got::add_local_tls_with_rela): Removed.
17693 * output.h (Output_data_got::add_global): Added got_type parameter.
17694 (Output_data_got::add_global_with_rel): Likewise.
17695 (Output_data_got::add_global_with_rela): Likewise.
17696 (Output_data_got::add_global_pair_with_rel): New function.
17697 (Output_data_got::add_global_pair_with_rela): New function.
17698 (Output_data_got::add_local): Added got_type parameter.
17699 (Output_data_got::add_local_with_rel): Likewise.
17700 (Output_data_got::add_local_with_rela): Likewise.
17701 (Output_data_got::add_local_pair_with_rel): New function.
17702 (Output_data_got::add_local_pair_with_rela): New function.
17703 (Output_data_got::add_global_tls): Removed.
17704 (Output_data_got::add_global_tls_with_rel): Removed.
17705 (Output_data_got::add_global_tls_with_rela): Removed.
17706 (Output_data_got::add_local_tls): Removed.
17707 (Output_data_got::add_local_tls_with_rel): Removed.
17708 (Output_data_got::add_local_tls_with_rela): Removed.
17709 * resolve.cc (Symbol::override_base_with_special): Removed
17710 reference to has_got_offset_ field.
17711 * symtab.cc (Symbol::init_fields): Replaced initialization
17712 of got_offset_ with got_offsets_. Removed initialization
17713 of has_got_offset_
53fcba31 17714 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
17715 (Symbol::got_offset): Likewise.
17716 (Symbol::set_got_offset): Likewise.
17717 (Symbol::has_tls_got_offset): Removed.
17718 (Symbol::tls_got_offset): Removed.
17719 (Symbol::set_tls_got_offset): Removed.
17720 (Symbol::got_offset_): Removed.
17721 (Symbol::tls_mod_got_offset_): Removed.
17722 (Symbol::tls_pair_got_offset_): Removed.
17723 (Symbol::got_offsets_): New field.
17724 (Symbol::has_got_offset): Removed.
17725 (Symbol::has_tls_mod_got_offset): Removed.
17726 (Symbol::has_tls_pair_got_offset): Removed.
17727 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
17728 (Target_x86_64::Scan::local): Updated callers of Output_data_got
17729 member functions.
17730 (Target_x86_64::Scan::global): Likewise.
17731 (Target_x86_64::Relocate::relocate): Likewise.
17732 (Target_x86_64::Relocate::relocate_tls): Likewise.
17733
bd52eafb
BE
177342008-03-25 Ben Elliston <bje@au.ibm.com>
17735
17736 * yyscript.y: Fix spelling error in comment.
17737
8b105e34
ILT
177382008-03-24 Ian Lance Taylor <iant@google.com>
17739
8ed814a9
ILT
17740 * options.h (class General_options): Define build_id option.
17741 * layout.h (class Layout): Declare write_build_id, create_note,
17742 create_build_id. Add build_id_note_ member.
17743 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
17744 "libiberty.h", "md5.h", "sha1.h".
17745 (Layout::Layout): Initialize eh_frame_data_,
17746 eh_frame_hdr_section_, and build_id_note_.
17747 (Layout::finalize): Call create_build_id.
17748 (Layout::create_note): New function, broken out of
17749 Layout::create_gold_note.
17750 (Layout::create_gold_note): Call create_note.
17751 (Layout::create_build_id): New function.
17752 (Layout::write_build_id): New function.
17753 (Close_task_runner::run): Call write_build_id.
17754
8b105e34
ILT
17755 * x86_64.cc: Correct license to GPLv3.
17756
086a1841
ILT
177572008-03-23 Ian Lance Taylor <iant@google.com>
17758
17759 * options.cc: Include "demangle.h".
17760 (parse_optional_string): New function.
17761 (parse_long_option): Handle takes_optional_argument.
17762 (parse_short_option): Update dash_z initializer. Handle
17763 takes_optional_argument.
17764 (General_options::General_options): Initialize do_demangle_.
17765 (General_options::finalize): Set do_demangle_. Handle demangling
17766 style.
17767 * options.h (parse_optional_string): Declare.
17768 (struct One_option): Add optional_arg field. Update constructor.
17769 Update call constructor calls. Add takes_optional_argument
17770 function.
17771 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
17772 (DEFINE_optional_string): Define.
17773 (General_options::demangle): Change from DEFINE_bool to
17774 DEFINE_optional_string.
17775 (General_options::no_demangle): New function.
17776 (General_options::do_demangle): New function.
17777 (General_options::set_do_demangle): New function.
17778 (General_options::execstack_status_): Move definition to end of
17779 class definition.
17780 (General_options::static_): Likewise.
17781 (General_options::do_demangle_): New field.
17782 * object.cc (big_endian>::get_symbol_location_info): Call
17783 Options::do_demangle, not Options::demangle.
17784 * symtab.cc (demangle): Likewise.
17785
cbb93e63
ILT
177862008-03-22 Ian Lance Taylor <iant@google.com>
17787
17788 * gold.h: Include <cstddef> and <sys/types.h>
17789 * options.h: Include <cstring>.
17790
ec531623
ILT
177912008-03-21 Ian Lance Taylor <iant@google.com>
17792
17793 * Added source code to GNU binutils.
752937aa 17794\f
b90efa5b 17795Copyright (C) 2008-2015 Free Software Foundation, Inc.
752937aa
NC
17796
17797Copying and distribution of this file, with or without modification,
17798are permitted in any medium without royalty provided the copyright
17799notice and this notice are preserved.
17800
17801Local Variables:
17802mode: change-log
17803left-margin: 8
17804fill-column: 74
17805version-control: never
17806End:
This page took 1.210615 seconds and 4 git commands to generate.